public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] newlib/libc/ctype/jp2uc.c: Declare "cs" variable as "const char *"
@ 2018-10-11 14:42 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2018-10-11 14:42 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4f7a6c326aab3dfff139ad848c45210c3f097317

commit 4f7a6c326aab3dfff139ad848c45210c3f097317
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Fri Oct 5 09:11:05 2018 +0000

    newlib/libc/ctype/jp2uc.c: Declare "cs" variable as "const char *"
    
    Instead of "char *" to avoid compiler warnings.
    This is OK because "cs" is only used as input of strcmp.

Diff:
---
 newlib/libc/ctype/jp2uc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/ctype/jp2uc.c b/newlib/libc/ctype/jp2uc.c
index b89b5ea..5e30f09 100644
--- a/newlib/libc/ctype/jp2uc.c
+++ b/newlib/libc/ctype/jp2uc.c
@@ -166,7 +166,7 @@ __uc2jp (wint_t c, int type)
 wint_t
 _jp2uc_l (wint_t c, struct __locale_t * l)
 {
-  char * cs = l ? __locale_charset(l) : __current_locale_charset();
+  const char * cs = l ? __locale_charset(l) : __current_locale_charset();
   if (0 == strcmp (cs, "JIS"))
     c = __jp2uc (c, JP_JIS);
   else if (0 == strcmp (cs, "SJIS"))
@@ -186,7 +186,7 @@ _jp2uc (wint_t c)
 wint_t
 _uc2jp_l (wint_t c, struct __locale_t * l)
 {
-  char * cs = l ? __locale_charset(l) : __current_locale_charset();
+  const char * cs = l ? __locale_charset(l) : __current_locale_charset();
   if (0 == strcmp (cs, "JIS"))
     c = __uc2jp (c, JP_JIS);
   else if (0 == strcmp (cs, "SJIS"))


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-11 14:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11 14:42 [newlib-cygwin] newlib/libc/ctype/jp2uc.c: Declare "cs" variable as "const char *" Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).