From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53889 invoked by alias); 23 Aug 2016 10:44:02 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 53862 invoked by uid 9078); 23 Aug 2016 10:44:01 -0000 Date: Tue, 23 Aug 2016 10:44:00 -0000 Message-ID: <20160823104401.53860.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Add/change a few #ifdef comments in locale code for clearness X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 3eace743b2e9bc34a6ee3e51aa241a45c91159b2 X-Git-Newrev: f4fb06ce1767866594e824c46e60fb7a6780cfc1 X-SW-Source: 2016-q3/txt/msg00061.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f4fb06ce1767866594e824c46e60fb7a6780cfc1 commit f4fb06ce1767866594e824c46e60fb7a6780cfc1 Author: Corinna Vinschen Date: Tue Aug 23 12:43:40 2016 +0200 Add/change a few #ifdef comments in locale code for clearness Signed-off-by: Corinna Vinschen Diff: --- newlib/libc/locale/duplocale.c | 4 ++-- newlib/libc/locale/freelocale.c | 2 +- newlib/libc/locale/locale.c | 12 ++++++------ newlib/libc/locale/newlocale.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/newlib/libc/locale/duplocale.c b/newlib/libc/locale/duplocale.c index 7bd89ea..263a2b5 100644 --- a/newlib/libc/locale/duplocale.c +++ b/newlib/libc/locale/duplocale.c @@ -64,7 +64,7 @@ _duplocale_r (struct _reent *p, struct __locale_t *locobj) if (!__loadlocale (&tmp_locale, i, tmp_locale.categories[i])) goto error; } -#endif +#endif /* __HAVE_LOCALE_INFO__ */ /* Allocate new locale_t. */ new_locale = (struct __locale_t *) _calloc_r (p, 1, sizeof *new_locale); if (!new_locale) @@ -83,7 +83,7 @@ error: _free_r (p, (void *) tmp_locale.lc_cat[i].ptr); _free_r (p, tmp_locale.lc_cat[i].buf); } -#endif +#endif /* __HAVE_LOCALE_INFO__ */ return NULL; } diff --git a/newlib/libc/locale/freelocale.c b/newlib/libc/locale/freelocale.c index e18b453..eba439e 100644 --- a/newlib/libc/locale/freelocale.c +++ b/newlib/libc/locale/freelocale.c @@ -50,7 +50,7 @@ _freelocale_r (struct _reent *p, struct __locale_t *locobj) _free_r (p, (void *) locobj->lc_cat[i].ptr); _free_r (p, locobj->lc_cat[i].buf); } -#endif +#endif /* __HAVE_LOCALE_INFO__ */ _free_r (p, locobj); } diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c index 58c2849..9808022 100644 --- a/newlib/libc/locale/locale.c +++ b/newlib/libc/locale/locale.c @@ -234,7 +234,7 @@ const struct __locale_t __C_locale = "\1", "ASCII", "ASCII", -#else +#else /* __HAVE_LOCALE_INFO__ */ { { NULL, NULL }, /* LC_ALL */ #ifdef __CYGWIN__ @@ -248,7 +248,7 @@ const struct __locale_t __C_locale = { &_C_time_locale, NULL }, /* LC_TIME */ { &_C_messages_locale, NULL }, /* LC_MESSAGES */ }, -#endif +#endif /* __HAVE_LOCALE_INFO__ */ }; struct __locale_t __global_locale = @@ -274,7 +274,7 @@ struct __locale_t __global_locale = "\1", "ASCII", "ASCII", -#else +#else /* __HAVE_LOCALE_INFO__ */ { { NULL, NULL }, /* LC_ALL */ #ifdef __CYGWIN__ @@ -288,7 +288,7 @@ struct __locale_t __global_locale = { &_C_time_locale, NULL }, /* LC_TIME */ { &_C_messages_locale, NULL }, /* LC_MESSAGES */ }, -#endif +#endif /* __HAVE_LOCALE_INFO__ */ }; /* Renamed from current_locale_string to make clear this is only the @@ -313,7 +313,7 @@ _DEFUN(_setlocale_r, (p, category, locale), return NULL; } return "C"; -#else /* !_MB_CAPABLE */ +#else /* _MB_CAPABLE */ static char new_categories[_LC_LAST][ENCODING_LEN + 1]; static char saved_categories[_LC_LAST][ENCODING_LEN + 1]; int i, j, len, saverr; @@ -445,7 +445,7 @@ _DEFUN(_setlocale_r, (p, category, locale), } } return currentlocale (); -#endif /* !_MB_CAPABLE */ +#endif /* _MB_CAPABLE */ } #ifdef _MB_CAPABLE diff --git a/newlib/libc/locale/newlocale.c b/newlib/libc/locale/newlocale.c index 239173b..b4a4778 100644 --- a/newlib/libc/locale/newlocale.c +++ b/newlib/libc/locale/newlocale.c @@ -149,12 +149,12 @@ _newlocale_r (struct _reent *p, int category_mask, const char *locale, subsequent error. */ tmp_locale.lc_cat[i].ptr = base->lc_cat[i].ptr; tmp_locale.lc_cat[i].buf = (void *) -1; -#else +#else /* !__HAVE_LOCALE_INFO__ */ if (i == LC_CTYPE) strcpy (tmp_locale.ctype_codeset, base->ctype_codeset); else if (i == LC_MESSAGES) strcpy (tmp_locale.message_codeset, base->message_codeset); -#endif +#endif /* !__HAVE_LOCALE_INFO__ */ } /* Otherwise, if the category is in category_mask, create entry. */ else if (((1 << i) & category_mask) != 0) @@ -184,7 +184,7 @@ _newlocale_r (struct _reent *p, int category_mask, const char *locale, tmp_locale.lc_cat[i].buf = base->lc_cat[i].buf; base->lc_cat[i].ptr = base->lc_cat[i].buf = NULL; } -#endif +#endif /* __HAVE_LOCALE_INFO__ */ _freelocale_r (p, base); } @@ -203,7 +203,7 @@ error: _free_r (p, (void *) tmp_locale.lc_cat[i].ptr); _free_r (p, tmp_locale.lc_cat[i].buf); } -#endif +#endif /* __HAVE_LOCALE_INFO__ */ return NULL; }