]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
strptime: Convert K&R definitions to ANSI C.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 6 Jul 2025 02:34:51 +0000 (19:34 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 6 Jul 2025 02:34:51 +0000 (19:34 -0700)
* lib/strptime.c (LOCALE_PARAM) [_LIBC]: Adjust to match glibc, not
relevant for Gnulib.
(LOCALE_PARAM_PROTO, LOCALE_PARAM_DECL): Remove definitions.
(__strptime_internal, strptime): Convert K&R definition to ANSI C.

ChangeLog
lib/strptime.c

index 692fa95acd5ec2c58101452aa9845b9a24bc12a3..c8d09b3dac138c65190a64c1378486035917b538 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-07-05  Collin Funk  <collin.funk1@gmail.com>
+
+       strptime: Convert K&R definitions to ANSI C.
+       * lib/strptime.c (LOCALE_PARAM) [_LIBC]: Adjust to match glibc, not
+       relevant for Gnulib.
+       (LOCALE_PARAM_PROTO, LOCALE_PARAM_DECL): Remove definitions.
+       (__strptime_internal, strptime): Convert K&R definition to ANSI C.
+
 2025-07-04  Collin Funk  <collin.funk1@gmail.com>
 
        strncasecmp_l: Fix previous change.
index 2b6193a105a96920ce6eaf78d07353b61d8b04ef..89388c11bc72a9ab1f6f000221dc22d6f164a3a0 100644 (file)
@@ -170,17 +170,13 @@ static const unsigned short int __mon_yday[2][13] =
 # undef _NL_CURRENT_WORD
 # define _NL_CURRENT_WORD(category, item) \
   (current->values[_NL_ITEM_INDEX (item)].word)
-# define LOCALE_PARAM , locale
+# define LOCALE_PARAM , __locale_t locale
 # define LOCALE_ARG , locale
-# define LOCALE_PARAM_PROTO , __locale_t locale
-# define LOCALE_PARAM_DECL __locale_t locale;
 # define HELPER_LOCALE_ARG , current
 # define ISSPACE(Ch) __isspace_l (Ch, locale)
 #else
 # define LOCALE_PARAM
 # define LOCALE_ARG
-# define LOCALE_PARAM_DECL
-# define LOCALE_PARAM_PROTO
 # define HELPER_LOCALE_ARG
 # define ISSPACE(Ch) isspace (Ch)
 #endif
@@ -229,13 +225,9 @@ internal_function
 #else
 static char *
 #endif
-__strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
-     const char *rp;
-     const char *fmt;
-     struct tm *tm;
-     enum ptime_locale_status *decided;
-     int era_cnt;
-     LOCALE_PARAM_DECL
+__strptime_internal (const char *rp, const char *fmt, struct tm *tm,
+                     enum ptime_locale_status *decided,
+                     int era_cnt LOCALE_PARAM)
 {
 #ifdef _LIBC
   struct locale_data *const current = locale->__locales[LC_TIME];
@@ -1142,11 +1134,8 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
 
 
 char *
-strptime (buf, format, tm LOCALE_PARAM)
-     const char *restrict buf;
-     const char *restrict format;
-     struct tm *restrict tm;
-     LOCALE_PARAM_DECL
+strptime (const char *restrict buf, const char *restrict format,
+          struct tm *restrict tm LOCALE_PARAM)
 {
   enum ptime_locale_status decided;