This is the mail archive of the newlib-cvs@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Add/change a few #ifdef comments in locale code for clearness


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]