public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Add/change a few #ifdef comments in locale code for clearness
Date: Tue, 23 Aug 2016 10:44:00 -0000	[thread overview]
Message-ID: <20160823104401.53860.qmail@sourceware.org> (raw)

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

commit f4fb06ce1767866594e824c46e60fb7a6780cfc1
Author: Corinna Vinschen <corinna@vinschen.de>
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 <corinna@vinschen.de>

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;
 }


                 reply	other threads:[~2016-08-23 10:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160823104401.53860.qmail@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).