From: Bruno Haible Date: Fri, 19 Jul 2024 16:45:28 +0000 (+0200) Subject: xstrtol: Improve documentation. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=099046189e78eaa90d0646622be26c21bdfc79e4;p=gnulib.git xstrtol: Improve documentation. * lib/xstrtol.h: Don't test _STRTOL_ERROR, left-over from 2007-08-08. (_DECLARE_XSTRTOL): Add the parameter names, referenced by the comments. --- diff --git a/ChangeLog b/ChangeLog index fb6b7eba58..31ed29ac61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-07-19 Bruno Haible + + xstrtol: Improve documentation. + * lib/xstrtol.h: Don't test _STRTOL_ERROR, left-over from 2007-08-08. + (_DECLARE_XSTRTOL): Add the parameter names, referenced by the comments. + 2024-07-18 Paul Eggert xstrtol: document and stray less from strtol diff --git a/lib/xstrtol.h b/lib/xstrtol.h index cedff6393e..10b48cac4e 100644 --- a/lib/xstrtol.h +++ b/lib/xstrtol.h @@ -27,7 +27,6 @@ extern "C" { #endif -#ifndef _STRTOL_ERROR enum strtol_error { LONGINT_OK = 0, @@ -42,7 +41,6 @@ enum strtol_error LONGINT_INVALID = 4 }; typedef enum strtol_error strtol_error; -#endif /* Act like the system's strtol (NPTR, ENDPTR, BASE) except: - The TYPE of the result might be something other than long int. @@ -59,8 +57,11 @@ typedef enum strtol_error strtol_error; 'c' for 1, and 'w' for 2. */ #define _DECLARE_XSTRTOL(name, type) \ - strtol_error name (char const *restrict, char **restrict, int, \ - type *restrict, char const *restrict); + strtol_error name (char const *restrict /*nptr*/, \ + char **restrict /*endptr*/, \ + int /*base*/, \ + type *restrict /*val*/, \ + char const *restrict /*valid_suffixes*/); _DECLARE_XSTRTOL (xstrtol, long int) _DECLARE_XSTRTOL (xstrtoul, unsigned long int) _DECLARE_XSTRTOL (xstrtoll, long long int)