]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdio-common/vfscanf-internal.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / stdio-common / vfscanf-internal.c
index 5d002078d8fb922abe4164c31d8ab8b61819644a..3fd466fd761b425a84bb00888662b8a66681c111 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal functions for the *scanf* implementation.
-   Copyright (C) 1991-2018 Free Software Foundation, Inc.
+   Copyright (C) 1991-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <assert.h>
 #include <errno.h>
@@ -385,32 +385,32 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
         For a %N$... spec, this is the Nth argument from the beginning;
         otherwise it is the next argument after the state now in ARG.  */
 #ifdef __va_copy
-# define ARG(type)     (argpos == 0 ? va_arg (arg, type) :                   \
-                        ({ unsigned int pos = argpos;                        \
-                           va_list arg;                                      \
-                           __va_copy (arg, argptr);                          \
-                           while (--pos > 0)                                 \
-                             (void) va_arg (arg, void *);                    \
-                           va_arg (arg, type);                               \
-                         }))
+# define ARG(type)     (argpos == 0 ? va_arg (arg, type)                     \
+                        : ({ unsigned int pos = argpos;                      \
+                             va_list arg;                                    \
+                             __va_copy (arg, argptr);                        \
+                             while (--pos > 0)                               \
+                               (void) va_arg (arg, void *);                  \
+                             va_arg (arg, type);                             \
+                           }))
 #else
 # if 0
       /* XXX Possible optimization.  */
-#  define ARG(type)    (argpos == 0 ? va_arg (arg, type) :                   \
-                        ({ va_list arg = (va_list) argptr;                   \
-                           arg = (va_list) ((char *) arg                     \
-                                            + (argpos - 1)                   \
-                                            * __va_rounded_size (void *));   \
-                           va_arg (arg, type);                               \
-                        }))
+#  define ARG(type)    (argpos == 0 ? va_arg (arg, type)                     \
+                        : ({ va_list arg = (va_list) argptr;                 \
+                             arg = (va_list) ((char *) arg                   \
+                                              + (argpos - 1)                 \
+                                              * __va_rounded_size (void *)); \
+                             va_arg (arg, type);                             \
+                          }))
 # else
-#  define ARG(type)    (argpos == 0 ? va_arg (arg, type) :                   \
-                        ({ unsigned int pos = argpos;                        \
-                           va_list arg = (va_list) argptr;                   \
-                           while (--pos > 0)                                 \
-                             (void) va_arg (arg, void *);                    \
-                           va_arg (arg, type);                               \
-                         }))
+#  define ARG(type)    (argpos == 0 ? va_arg (arg, type)                     \
+                        : ({ unsigned int pos = argpos;                      \
+                             va_list arg = (va_list) argptr;                 \
+                             while (--pos > 0)                               \
+                               (void) va_arg (arg, void *);                  \
+                             va_arg (arg, type);                             \
+                           }))
 # endif
 #endif
 
@@ -1360,7 +1360,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
                    wchar_t *cp = (wchar_t *) realloc (*strptr,
                                                       ((wstr
                                                         - (wchar_t *) *strptr)
-                                                       * sizeof(wchar_t)));
+                                                       * sizeof (wchar_t)));
                    if (cp != NULL)
                      *strptr = (char *) cp;
                  }
@@ -2756,7 +2756,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
                    {
                      wchar_t *cp = (wchar_t *)
                        realloc (*strptr, ((wstr - (wchar_t *) *strptr)
-                                          * sizeof(wchar_t)));
+                                          * sizeof (wchar_t)));
                      if (cp != NULL)
                        *strptr = (char *) cp;
                    }