]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
foo roland/Wshadow
authorRoland McGrath <roland@hack.frob.com>
Mon, 13 Oct 2014 18:12:28 +0000 (11:12 -0700)
committerRoland McGrath <roland@hack.frob.com>
Mon, 13 Oct 2014 18:12:28 +0000 (11:12 -0700)
44 files changed:
ChangeLog
dirent/scandir.c
dirent/scandirat.c
elf/dl-cache.c
elf/dl-deps.c
elf/dl-fini.c
elf/dl-iteratephdr.c
elf/dl-sym.c
elf/dl-version.c
iconv/gconv_int.h
iconv/gconv_simple.c
iconv/iconv_prog.c
inet/rcmd.c
io/ftw.c
locale/loadlocale.c
locale/localeinfo.h
locale/programs/ld-collate.c
locale/programs/ld-ctype.c
locale/programs/locale.c
locale/programs/locarchive.c
locale/programs/locfile.c
malloc/hooks.c
nptl/pthreadP.h
posix/regcomp.c
posix/wordexp.c
resolv/res_hconf.c
resolv/res_init.c
stdio-common/printf-parsemb.c
stdio-common/printf_fphex.c
stdio-common/vfprintf.c
stdio-common/vfscanf.c
stdlib/setenv.c
stdlib/strtod_l.c
sysdeps/posix/getaddrinfo.c
sysdeps/unix/sysv/linux/dl-origin.c
sysdeps/unix/sysv/linux/getsysstats.c
sysdeps/unix/sysv/linux/ifaddrs.c
sysdeps/unix/sysv/linux/x86/elision-conf.c
sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
sysdeps/unix/sysv/linux/x86_64/sysdep.h
sysdeps/x86/elide.h
sysdeps/x86_64/nptl/tls.h
termios/tcgetsid.c
time/strptime_l.c

index e40ba1f346c53cc9859585d30708eb586e19ba2d..ef6f0cfe6d6de5596df7d6844eed4fa44e5c0b47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,138 @@
+2014-10-13  Roland McGrath  <roland@hack.frob.com>
+
+       * locale/programs/ld-ctype.c (charclass_charcode_ellipsis): Remove
+       superfluous block-local variable SEQ.
+       (allocate_arrays): Remove superfluous block-local variables IDX, LEN.
+
+       * locale/programs/ld-collate.c (insert_value): Rename inner-block
+       local variable RESULT to FOUND.
+       (collate_read): Likewise.  Remove superfluous block-local variable PTR.
+       (collate_output): Use C99 mixed declaration for function-local
+       variable RUNP.  Remove superfluous block-local variables I.
+
+       * locale/programs/locarchive.c (show_archive_content): Rename
+       parameter VERBOSE to BE_VERBOSE.
+
+       * locale/programs/locfile.c (write_locale_data): Drop function-local
+       variable CNT.
+
+       * iconv/iconv_prog.c (write_output): Rename parameter OUTPUT_FILE to
+       OUTPUT_FILENAME.
+       (process_block, process_fd, process_file): Likewise.
+
+       * elf/dl-iteratephdr.c (__dl_iterate_phdr): Drop function-local
+       variable L.
+
+       * elf/dl-sym.c (do_sym): Rename block-local variable L to NEXT.
+
+       * elf/dl-cache.c (SEARCH_CACHE): Remove superfluous block-local
+       variable KEY.
+
+       * elf/dl-deps.c (_dl_map_object_deps): Rename block-local variable
+       RUNP to MAP_RUNP.
+
+       * sysdeps/unix/sysv/linux/dl-origin.c (_dl_get_origin): Rename
+       block-local variable LEN to PATH_LEN.
+
+       * elf/dl-fini.c (_dl_sort_fini): Remove superfluous block-local
+       variables RUNP and I.
+
+       * resolv/res_hconf.c (_res_hconf_reorder_addrs): Use C99 for-statement
+       declaration for I and J.
+
+       * resolv/res_init.c (res_setoptions): Rename parameter OPTIONS to OPTS.
+       Remove superfluous block-local variable I.
+
+       * sysdeps/unix/sysv/linux/ifaddrs.c (getifaddrs_internal):
+       Drop shadowing inner-block declaration of local variable IDX.
+
+       * inet/rcmd.c (rcmd_af): Drop shadowing inner-block
+       declaration of local variable NUM.
+
+       * sysdeps/unix/sysv/linux/x86/elision-conf.c
+       (elision_init): Rename parameter ENVIRON to ENVP.
+
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+       (lll_cond_lock, lll_cond_trylock, lll_lock, lll_robust_cond_lock):
+       Prepend _ to local variable names inside statement expression.
+       (lll_robust_lock, lll_robust_timedlock, lll_timedlock, lll_trylock):
+       Likewise.
+       * sysdeps/x86/elide.h (ELIDE_TRYLOCK): Likewise.
+       * nptl/pthreadP.h (CANCELLATION_P): Likewise.
+       * elf/dl-version.c (make_string): Likewise.
+
+       * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Move
+       function-local variable L inside blocks where it's used.
+
+       * termios/tcgetsid.c (tcgetsid): Use C99 mixed declarations for PGRP
+       and PID.
+
+       * io/ftw.c (ftw_startup): Drop function-local variable SAVE_ERR.
+
+       * posix/wordexp.c (parse_param): Rename parameter QUOTED to
+       PARAM_QUOTED.  Rename inner-block locals OFFSET to DOLLARS_OFFSET and
+       TILDE_OFFSET.
+
+       * sysdeps/posix/getaddrinfo.c (gaih_inet): Drop shadowing inner-block
+       declaration of local variable RC.
+
+       * posix/regcomp.c (create_initial_state): Rename inner-block local
+       variable ERR to MERGE_ERR.
+
+       * dirent/scandir.c (SCANDIR): Rename parameter SELECT to SELECTOR.
+       * dirent/scandirat.c (SCANDIRAT): Likewise.
+
+       * time/strptime_l.c (__strptime_internal): Rename inner-block local
+       variables FMT to SUBFMT.
+
+       * malloc/hooks.c (realloc_check): Drop shadowing inner-block
+       declaration of local variable NB.
+
+       * stdio-common/printf-parsemb.c (__parse_one_specwc): Move
+       function-local variable N into inner blocks.
+
+       * stdio-common/vfscanf.c (__va_copy): New macro, define if not already
+       defined.
+       (_IO_vfwscanf: ARG): Always use __va_copy.  Rename local variable ARG
+       inside statement expression to ARGCOPY.
+       (_IO_vfwscanf): Rename parameter S to STREAM.
+       (inchar, ORIENT): Update uses.
+
+       * stdio-common/vfprintf.c (vfprintf): Move block-local variable
+       FUNCTION_DONE in main processing loop into an inside block so it
+       won't be shadowed.
+
+       * stdio-common/printf_fphex.c (__printf_fphex): Remove superfluous
+       block-local variable WIDTH in the SPECIAL case.
+
+       * sysdeps/x86_64/nptl/tls.h (THREAD_SELF): Rename local variable
+       __SELF inside statement expression to __THREAD_SELF.
+
+       * stdlib/strtod_l.c (____STRTOF_INTERNAL): Rename inner-block local
+       variable RETVAL to RESULT.  Move function-level START_OF_DIGITS and
+       STARTP local variables' declarations to their initialization sites.
+       (____STRTOF_INTERNAL: got_limb): Rename block-local variable CNT
+       to ZERO_COUNT.
+       (__mpn_lshift_1): Rename block-local variable I inside statement
+       expression to _I.
+
+       * sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL_NCS):
+       Rename local variable RESULTVAR to NCS_RESULT.
+       (INTERNAL_SYSCALL_NCS_TYPES): Likewise.
+
+       * iconv/gconv_int.h (norm_add_slashes): Use _ prefix on local
+       variables inside the statement expression.
+       * stdlib/setenv.c (KNOWN_VALUE): Likewise.
+
+       * iconv/gconv_simple.c (BODY for internal_utf8_loop): Rename local
+       variable STEP to STEP_SIZE.
+
+       * locale/localeinfo.h (enum value_type): Prefix elements with "vt_".
+       * locale/programs/locale.c (DEFINE_ELEMENT): Prepend the prefix here.
+       * locale/loadlocale.c (DEFINE_ELEMENT): Likewise.
+       (_nl_intern_locale_data): Update user.
+       * locale/programs/locale.c (print_item): Likewise.
+
 2014-10-10  Joseph Myers  <joseph@codesourcery.com>
 
        * CANCEL-FCT-WAIVE: Remove file.
index ae03630d6ec5e1fda4d30a42fb0b6e9eb796ae8a..1311e86c4c86f8af8612821f99e40a2beb84923e 100644 (file)
 
 
 int
-SCANDIR (dir, namelist, select, cmp)
+SCANDIR (dir, namelist, selector, cmp)
      const char *dir;
      DIRENT_TYPE ***namelist;
-     int (*select) (const DIRENT_TYPE *);
+     int (*selector) (const DIRENT_TYPE *);
      int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **);
 {
-  return SCANDIRAT (AT_FDCWD, dir, namelist, select, cmp);
+  return SCANDIRAT (AT_FDCWD, dir, namelist, selector, cmp);
 }
 
 #ifdef _DIRENT_MATCHES_DIRENT64
index 01fc046864e501370a72b909372b243893eb0bb0..bc31e849c56ec37d87929f9e3d3fc6e52aab6970 100644 (file)
@@ -52,11 +52,11 @@ __scandir_cancel_handler (void *arg)
 
 
 int
-SCANDIRAT (dfd, dir, namelist, select, cmp)
+SCANDIRAT (dfd, dir, namelist, selector, cmp)
      int dfd;
      const char *dir;
      DIRENT_TYPE ***namelist;
-     int (*select) (const DIRENT_TYPE *);
+     int (*selector) (const DIRENT_TYPE *);
      int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **);
 {
   DIR *dp = __opendirat (dfd, dir);
@@ -79,12 +79,12 @@ SCANDIRAT (dfd, dir, namelist, select, cmp)
 
   while ((d = READDIR (dp)) != NULL)
     {
-      int use_it = select == NULL;
+      int use_it = selector == NULL;
 
       if (! use_it)
        {
-         use_it = select (d);
-         /* The select function might have changed errno.  It was
+         use_it = (*selector) (d);
+         /* The SELECTOR function might have changed errno.  It was
             zero before and it need to be again to make the latter
             tests work.  */
          __set_errno (0);
@@ -95,7 +95,7 @@ SCANDIRAT (dfd, dir, namelist, select, cmp)
          DIRENT_TYPE *vnew;
          size_t dsize;
 
-         /* Ignore errors from select or readdir */
+         /* Ignore errors from SELECTOR or readdir.  */
          __set_errno (0);
 
          if (__glibc_unlikely (c.cnt == vsize))
index 91fef9578e1e509693aad0d31ebc5bdcf0cb9a24..699d9474fe76213a9ac99afa4836f2043b2dea6d 100644 (file)
@@ -75,8 +75,6 @@ do                                                                          \
               found.  So we have to find the beginning.  */                  \
            while (middle > 0)                                                \
              {                                                               \
-               __typeof__ (cache->libs[0].key) key;                          \
-                                                                             \
                key = cache->libs[middle - 1].key;                            \
                /* Make sure string table indices are not bogus before        \
                   using them.  */                                            \
index b34039c4dafde185862d6ec1022f7d34022b5b0d..00b184c891b5dfed1fd6e928ee34885753feb381 100644 (file)
@@ -629,11 +629,11 @@ Filters not supported with LD_TRACE_PRELINKING"));
          unsigned int k = nlist - 1;
          while (k > i)
            {
-             struct link_map **runp = l_initfini[k]->l_initfini;
-             if (runp != NULL)
+             struct link_map **map_runp = l_initfini[k]->l_initfini;
+             if (map_runp != NULL)
                /* Look through the dependencies of the object.  */
-               while (*runp != NULL)
-                 if (__glibc_unlikely (*runp++ == thisp))
+               while (*map_runp != NULL)
+                 if (__glibc_unlikely (*map_runp++ == thisp))
                    {
                      /* Move the current object to the back past the last
                         object with it as the dependency.  */
index c35577565eb66ac241365c05efe7c7fb791e0df2..aa0f82783c7c87782c381339e30b982dcf70f326 100644 (file)
@@ -101,7 +101,7 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
                  {
                    /* If a cycle exists with a link time dependency,
                       preserve the latter.  */
-                   struct link_map **runp = thisp->l_initfini;
+                   runp = thisp->l_initfini;
                    if (runp != NULL)
                      while (*runp != NULL)
                        if (__glibc_unlikely (*runp++ == maps[k]))
@@ -246,8 +246,8 @@ _dl_fini (void)
                      ElfW(Addr) *array =
                        (ElfW(Addr) *) (l->l_addr
                                        + l->l_info[DT_FINI_ARRAY]->d_un.d_ptr);
-                     unsigned int i = (l->l_info[DT_FINI_ARRAYSZ]->d_un.d_val
-                                       / sizeof (ElfW(Addr)));
+                     i = (l->l_info[DT_FINI_ARRAYSZ]->d_un.d_val
+                           / sizeof (ElfW(Addr)));
                      while (i-- > 0)
                        ((fini_t) array[i]) ();
                    }
index 6572ec3a33dff5512a3b4913fc86c6e01efbfa98..21e8760f06446b4b99438793a44dc3f47b151bdf 100644 (file)
@@ -33,7 +33,6 @@ int
 __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
                                    size_t size, void *data), void *data)
 {
-  struct link_map *l;
   struct dl_phdr_info info;
   int ret = 0;
 
@@ -61,7 +60,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
       }
 #endif
 
-  for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
+  for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
     {
       info.dlpi_addr = l->l_real->l_addr;
       info.dlpi_name = l->l_real->l_name;
index 69671c172fd3d04ac02c76184e0a92cdca907405..205de4a950be50a9a201faf69bec36c0b3eecf51 100644 (file)
@@ -154,11 +154,11 @@ do_sym (void *handle, const char *name, void *who,
 RTLD_NEXT used in code not dynamically loaded"));
        }
 
-      struct link_map *l = match;
-      while (l->l_loader != NULL)
-       l = l->l_loader;
+      struct link_map *next = match;
+      while (next->l_loader != NULL)
+       next = next->l_loader;
 
-      result = GLRO(dl_lookup_symbol_x) (name, match, &ref, l->l_local_scope,
+      result = GLRO(dl_lookup_symbol_x) (name, match, &ref, next->l_local_scope,
                                         vers, 0, 0, match);
     }
   else
index 525e9d52e541d223cb0a94ef06f8e258d107c517..735746c6a2d13f506a31896b2f2e177eb1730073 100644 (file)
 
 #define make_string(string, rest...) \
   ({                                                                         \
-    const char *all[] = { string, ## rest };                                 \
-    size_t len, cnt;                                                         \
-    char *result, *cp;                                                       \
+    const char *_all[] = { string, ## rest };                                \
+    size_t _len, _cnt;                                                       \
+    char *_result, *_cp;                                                     \
                                                                              \
-    len = 1;                                                                 \
-    for (cnt = 0; cnt < sizeof (all) / sizeof (all[0]); ++cnt)               \
-      len += strlen (all[cnt]);                                                      \
+    _len = 1;                                                                \
+    for (_cnt = 0; _cnt < sizeof (_all) / sizeof (_all[0]); ++_cnt)          \
+      _len += strlen (_all[_cnt]);                                           \
                                                                              \
-    cp = result = alloca (len);                                                      \
-    for (cnt = 0; cnt < sizeof (all) / sizeof (all[0]); ++cnt)               \
-      cp = __stpcpy (cp, all[cnt]);                                          \
+    _cp = _result = alloca (_len);                                           \
+    for (_cnt = 0; _cnt < sizeof (_all) / sizeof (_all[0]); ++_cnt)          \
+      _cp = __stpcpy (_cp, _all[_cnt]);                                              \
                                                                              \
-    result;                                                                  \
+    _result;                                                                 \
   })
 
 
index 13b0e99915e9afd56d7dddf7b01117dfef767c90..9c56a2d67f4ab1cbc6347413cd4239977118a3d8 100644 (file)
@@ -123,34 +123,34 @@ __libc_lock_define (extern, __gconv_lock attribute_hidden)
 
 /* The gconv functions expects the name to be in upper case and complete,
    including the trailing slashes if necessary.  */
-#define norm_add_slashes(str,suffix) \
+#define norm_add_slashes(str, suffix) \
   ({                                                                         \
-    const char *cp = (str);                                                  \
-    char *result;                                                            \
-    char *tmp;                                                               \
-    size_t cnt = 0;                                                          \
-    const size_t suffix_len = strlen (suffix);                               \
+    const char *_cp = (str);                                                 \
+    char *_result;                                                           \
+    char *_tmp;                                                                      \
+    size_t _cnt = 0;                                                         \
+    const size_t _suffix_len = strlen (suffix);                                      \
                                                                              \
-    while (*cp != '\0')                                                              \
-      if (*cp++ == '/')                                                              \
-       ++cnt;                                                                \
+    while (*_cp != '\0')                                                     \
+      if (*_cp++ == '/')                                                     \
+       ++_cnt;                                                               \
                                                                              \
-    tmp = result = __alloca (cp - (str) + 3 + suffix_len);                   \
-    cp = (str);                                                                      \
-    while (*cp != '\0')                                                              \
-      *tmp++ = __toupper_l (*cp++, _nl_C_locobj_ptr);                        \
-    if (cnt < 2)                                                             \
+    _tmp = _result = __alloca (_cp - (str) + 3 + _suffix_len);               \
+    _cp = (str);                                                             \
+    while (*_cp != '\0')                                                     \
+      *_tmp++ = __toupper_l (*_cp++, _nl_C_locobj_ptr);                              \
+    if (_cnt < 2)                                                            \
       {                                                                              \
-       *tmp++ = '/';                                                         \
-       if (cnt < 1)                                                          \
+       *_tmp++ = '/';                                                        \
+       if (_cnt < 1)                                                         \
          {                                                                   \
-           *tmp++ = '/';                                                     \
-           if (suffix_len != 0)                                              \
-             tmp = __mempcpy (tmp, suffix, suffix_len);                      \
+           *_tmp++ = '/';                                                    \
+           if (_suffix_len != 0)                                             \
+             _tmp = __mempcpy (_tmp, suffix, _suffix_len);                   \
          }                                                                   \
       }                                                                              \
-    *tmp = '\0';                                                             \
-    result;                                                                  \
+    *_tmp = '\0';                                                            \
+    _result;                                                                 \
   })
 
 
index 4ed45052e4d2d100a1e83e522578ca2475553049..9bc2453b65cc0eaf425442f3a82f66877997c728 100644 (file)
@@ -892,14 +892,14 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
       *outptr++ = (unsigned char) wc;                                        \
     else if (__glibc_likely (wc <= 0x7fffffff))                                      \
       {                                                                              \
-       size_t step;                                                          \
+       size_t step_size;                                                     \
        unsigned char *start;                                                 \
                                                                              \
-       for (step = 2; step < 6; ++step)                                      \
-         if ((wc & (~(uint32_t)0 << (5 * step + 1))) == 0)                   \
+       for (step_size = 2; step_size < 6; ++step_size)                       \
+         if ((wc & (~(uint32_t)0 << (5 * step_size + 1))) == 0)              \
            break;                                                            \
                                                                              \
-       if (__glibc_unlikely (outptr + step > outend))                        \
+       if (__glibc_unlikely (outptr + step_size > outend))                   \
          {                                                                   \
            /* Too long.  */                                                  \
            result = __GCONV_FULL_OUTPUT;                                     \
@@ -907,14 +907,14 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
          }                                                                   \
                                                                              \
        start = outptr;                                                       \
-       *outptr = (unsigned char) (~0xff >> step);                            \
-       outptr += step;                                                       \
+       *outptr = (unsigned char) (~0xff >> step_size);                       \
+       outptr += step_size;                                                  \
        do                                                                    \
          {                                                                   \
-           start[--step] = 0x80 | (wc & 0x3f);                               \
+           start[--step_size] = 0x80 | (wc & 0x3f);                          \
            wc >>= 6;                                                         \
          }                                                                   \
-       while (step > 1);                                                     \
+       while (step_size > 1);                                                \
        start[0] |= wc;                                                       \
       }                                                                              \
     else                                                                     \
index 563d4ea0eb6fd00ac6c94853112bd455f7c469c9..5005a0806ef68d7a1b8cbd956a367e7137addd4d 100644 (file)
@@ -433,7 +433,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 
 static int
 write_output (const char *outbuf, const char *outptr, FILE **output,
-             const char *output_file)
+             const char *output_filename)
 {
   /* We have something to write out.  */
   int errno_save = errno;
@@ -441,9 +441,9 @@ write_output (const char *outbuf, const char *outptr, FILE **output,
   if (*output == NULL)
     {
       /* Determine output file.  */
-      if (output_file != NULL && strcmp (output_file, "-") != 0)
+      if (output_filename != NULL && strcmp (output_filename, "-") != 0)
        {
-         *output = fopen (output_file, "w");
+         *output = fopen (output_filename, "w");
          if (*output == NULL)
            error (EXIT_FAILURE, errno, _("cannot open output file"));
        }
@@ -468,7 +468,7 @@ conversion stopped due to problem in writing the output"));
 
 static int
 process_block (iconv_t cd, char *addr, size_t len, FILE **output,
-              const char *output_file)
+              const char *output_filename)
 {
 #define OUTBUF_SIZE    32768
   const char *start = addr;
@@ -495,7 +495,7 @@ process_block (iconv_t cd, char *addr, size_t len, FILE **output,
 
       if (outptr != outbuf)
        {
-         ret = write_output (outbuf, outptr, output, output_file);
+         ret = write_output (outbuf, outptr, output, output_filename);
          if (ret != 0)
            break;
        }
@@ -510,7 +510,7 @@ process_block (iconv_t cd, char *addr, size_t len, FILE **output,
 
          if (outptr != outbuf)
            {
-             ret = write_output (outbuf, outptr, output, output_file);
+             ret = write_output (outbuf, outptr, output, output_filename);
              if (ret != 0)
                break;
            }
@@ -556,7 +556,7 @@ incomplete character or shift sequence at end of buffer"));
 
 
 static int
-process_fd (iconv_t cd, int fd, FILE **output, const char *output_file)
+process_fd (iconv_t cd, int fd, FILE **output, const char *output_filename)
 {
   /* we have a problem with reading from a desriptor since we must not
      provide the iconv() function an incomplete character or shift
@@ -630,16 +630,17 @@ process_fd (iconv_t cd, int fd, FILE **output, const char *output_file)
       }
 
   /* Now we have all the input in the buffer.  Process it in one run.  */
-  return process_block (cd, inbuf, actlen, output, output_file);
+  return process_block (cd, inbuf, actlen, output, output_filename);
 }
 
 
 static int
-process_file (iconv_t cd, FILE *input, FILE **output, const char *output_file)
+process_file (iconv_t cd, FILE *input, FILE **output,
+              const char *output_filename)
 {
   /* This should be safe since we use this function only for `stdin' and
      we haven't read anything so far.  */
-  return process_fd (cd, fileno (input), output, output_file);
+  return process_fd (cd, fileno (input), output, output_filename);
 }
 
 
index acacaa0d8a78cd256589f3eed24690e2e8f1c03b..29a097a90c5e2107d7155b0001500ed013488af1 100644 (file)
@@ -241,7 +241,6 @@ rcmd: socket: All ports in use\n"));
                __write(s, "", 1);
                lport = 0;
        } else {
-               char num[8];
                int s2 = rresvport_af(&lport, ai->ai_family), s3;
                socklen_t len = ai->ai_addrlen;
 
index bf749b1e79efb1e5d017588d39fc0a089ba5cd42..d95eb85bd670ab33872db33f1cff14488ad68ac5 100644 (file)
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -635,7 +635,6 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
   struct ftw_data data;
   struct STAT st;
   int result = 0;
-  int save_err;
   int cwdfd = -1;
   char *cwd = NULL;
   char *cp;
@@ -803,8 +802,8 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
     }
 
   /* Free all memory.  */
- out_fail:
-  save_err = errno;
+ out_fail:;
+  int save_err = errno;
   __tdestroy (data.known_objects, free);
   free (data.dirbuf);
   __set_errno (save_err);
index 13eecea4e50b7834e96388c5ca41393caec36327..3530a1aef40573c24edfe4e247bac54a5aa86aea 100644 (file)
@@ -47,7 +47,7 @@ static const size_t _nl_category_num_items[] =
 #define DEFINE_CATEGORY(category, category_name, items, a) \
 static const enum value_type _nl_value_type_##category[] = { NO_PAREN items };
 #define DEFINE_ELEMENT(element, element_name, optstd, type, rest...) \
-  [_NL_ITEM_INDEX (element)] = type,
+  [_NL_ITEM_INDEX (element)] = vt_##type,
 #include "categories.def"
 #undef DEFINE_CATEGORY
 
@@ -144,7 +144,7 @@ _nl_intern_locale_data (int category, const void *data, size_t datasize)
       if ((category == LC_CTYPE
           && cnt >= (sizeof (_nl_value_type_LC_CTYPE)
                      / sizeof (_nl_value_type_LC_CTYPE[0])))
-         || __builtin_expect (_nl_value_types[category][cnt] != word, 1))
+         || __builtin_expect (_nl_value_types[category][cnt] != vt_word, 1))
        newdata->values[cnt].string = newdata->filedata + idx;
       else
        {
index 070914dd51723a1629925a712ab9d0aea548fc82..f9dcdb670cde8e11c058c9711c7661e4cd482584 100644 (file)
@@ -113,17 +113,17 @@ enum coll_sort_rule
 /* We can map the types of the entries into a few categories.  */
 enum value_type
 {
-  none,
-  string,
-  stringarray,
-  byte,
-  bytearray,
-  word,
-  stringlist,
-  wordarray,
-  wstring,
-  wstringarray,
-  wstringlist
+  vt_none,
+  vt_string,
+  vt_stringarray,
+  vt_byte,
+  vt_bytearray,
+  vt_word,
+  vt_stringlist,
+  vt_wordarray,
+  vt_wstring,
+  vt_wstringarray,
+  vt_wstringlist
 };
 
 
index 037fd2fcc5a9f1cf6d43b7b599eab704b94de69f..c66df44fc9b1cc95cfaf4200970a08d7e7557fce 100644 (file)
@@ -977,17 +977,17 @@ insert_value (struct linereader *ldfile, const char *symstr, size_t symlen,
       void *ptr = elem;
       if (find_entry (&collate->elem_table, symstr, symlen, &ptr) != 0)
        {
-         void *result;
+         void *found;
          struct symbol_t *sym = NULL;
 
          /* It's also collation element.  Therefore it's either a
             collating symbol or it's a character which is not
             supported by the character set.  In the later case we
             simply create a dummy entry.  */
-         if (find_entry (&collate->sym_table, symstr, symlen, &result) == 0)
+         if (find_entry (&collate->sym_table, symstr, symlen, &found) == 0)
            {
              /* It's a collation symbol.  */
-             sym = (struct symbol_t *) result;
+             sym = found;
 
              elem = sym->order;
            }
@@ -2116,7 +2116,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
   uint32_t elem_size;
   uint32_t *elem_table;
   int i;
-  struct element_t *runp;
 
   init_locale_data (&file, nelems);
   add_locale_uint32 (&file, nrules);
@@ -2230,7 +2229,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
                && (runp->mbs[runp->nmbs - 1]
                    == runp->mbnext->mbs[runp->nmbs - 1] + 1))
              {
-               int i;
                struct element_t *series_startp = runp;
                struct element_t *curp;
 
@@ -2289,8 +2287,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
                /* A single entry.  Simply add the index and the length and
                   string (except for the first character which is already
                   tested for).  */
-               int i;
-
                /* Output the weight info.  */
                weightidx = output_weight (&weightpool, collate, runp);
 
@@ -2402,7 +2398,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
      larger to avoid extremely long search times.  We can achieve
      good results with a 40% larger table than there are entries.  */
   elem_size = 0;
-  runp = collate->start;
+  struct element_t *runp = collate->start;
   while (runp != NULL)
     {
       if (runp->mbs != NULL && runp->weights != NULL && !runp->is_character)
@@ -3313,7 +3309,6 @@ error while adding equivalent collating symbol"));
              else
                {
                  struct symbol_t *symbp;
-                 void *ptr;
 
                  if (find_entry (&collate->sym_table, startmb, lenmb,
                                  &ptr) == 0)
@@ -3535,10 +3530,10 @@ error while adding equivalent collating symbol"));
                }
              else
                {
-                 void *result;
+                 void *found;
 
                  if (find_entry (&collate->sym_table, symstr, symlen,
-                                 &result) != 0)
+                                 &found) != 0)
                    /* No collating symbol, it's an error.  */
                    goto err_label;
 
index 67846b398ac6ad89cc41c4e0069ee6bb9b713579..48542ebeae123a8723367079b5ad4b10a2215077 100644 (file)
@@ -1700,7 +1700,6 @@ to-value character sequence is smaller than from-value sequence"));
            }
          else if (handle_digits == 2)
            {
-             struct charseq *seq;
              /* We must store the digit values.  */
              if (ctype->outdigits_act >= 10)
                {
@@ -3994,9 +3993,9 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
        {
          /* Search for the place where to insert this string.
             XXX Better use a real sorting algorithm later.  */
-         size_t idx = 0;
          int replace = 0;
 
+          idx = 0;
          while (idx < number)
            {
              int res = wcscmp ((const wchar_t *) sorted[idx]->from,
@@ -4059,7 +4058,6 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
       to_len = 0;
       for (size_t cnt = 0; cnt < number; ++cnt)
        {
-         size_t len;
          struct translit_to_t *srunp;
 
          ctype->translit_from_idx[cnt] = from_len;
index c9660e94c490e9da7c18453020c5971e716ed0ff..213ef5897d70570cd0753b675eedd213e1ac9a3c 100644 (file)
@@ -138,7 +138,8 @@ struct category
 
 /* We have all categories defined in `categories.def'.  Now construct
    the description and data structure used for all categories.  */
-#define DEFINE_ELEMENT(Item, More...) { Item, ## More },
+#define DEFINE_ELEMENT(item, name, std, type, rest...) \
+  { item, name, std, vt_##type ,##rest },
 #define DEFINE_CATEGORY(category, name, items, postload) \
     static struct cat_item category##_desc[] =                               \
       {                                                                              \
@@ -826,7 +827,7 @@ print_item (struct cat_item *item)
 {
   switch (item->value_type)
     {
-    case string:
+    case vt_string:
       if (show_keyword_name)
        printf ("%s=\"", item->name);
       fputs (nl_langinfo (item->item_id) ? : "", stdout);
@@ -834,7 +835,7 @@ print_item (struct cat_item *item)
        putchar ('"');
       putchar ('\n');
       break;
-    case stringarray:
+    case vt_stringarray:
       {
        const char *val;
        int cnt;
@@ -859,7 +860,7 @@ print_item (struct cat_item *item)
        putchar ('\n');
       }
       break;
-    case stringlist:
+    case vt_stringlist:
       {
        int first = 1;
        const char *val = nl_langinfo (item->item_id) ? : "";
@@ -878,7 +879,7 @@ print_item (struct cat_item *item)
        putchar ('\n');
       }
       break;
-    case byte:
+    case vt_byte:
       {
        const char *val = nl_langinfo (item->item_id);
 
@@ -890,7 +891,7 @@ print_item (struct cat_item *item)
        putchar ('\n');
       }
       break;
-    case bytearray:
+    case vt_bytearray:
       {
        const char *val = nl_langinfo (item->item_id);
        int cnt = val ? strlen (val) : 0;
@@ -908,7 +909,7 @@ print_item (struct cat_item *item)
        printf ("%d\n", cnt == 0 || *val == '\177' ? -1 : *val);
       }
       break;
-    case word:
+    case vt_word:
       {
        union { unsigned int word; char *string; } val;
        val.string = nl_langinfo (item->item_id);
@@ -918,7 +919,7 @@ print_item (struct cat_item *item)
        printf ("%d\n", val.word);
       }
       break;
-    case wordarray:
+    case vt_wordarray:
       {
        int first = 1;
        union { unsigned int *wordarray; char *string; } val;
@@ -935,9 +936,9 @@ print_item (struct cat_item *item)
        putchar ('\n');
       }
       break;
-    case wstring:
-    case wstringarray:
-    case wstringlist:
+    case vt_wstring:
+    case vt_wstringarray:
+    case vt_wstringlist:
       /* We don't print wide character information since the same
         information is available in a multibyte string.  */
     default:
index cdd99602c2e1dea4dea37cdd1da9cc329a36902f..452017aef73e42242dce08aaad87d51634499864 100644 (file)
@@ -1629,7 +1629,7 @@ dataentcmp (const void *a, const void *b)
 
 
 void
-show_archive_content (const char *fname, int verbose)
+show_archive_content (const char *fname, int be_verbose)
 {
   struct locarhandle ah;
   struct locarhead *head;
@@ -1660,7 +1660,7 @@ show_archive_content (const char *fname, int verbose)
   /* Sort the names.  */
   qsort (names, used, sizeof (struct nameent), nameentcmp);
 
-  if (verbose)
+  if (be_verbose)
     {
       struct dataent *files;
       struct sumhashent *sumhashtab;
index 1c4fe854e08b8040ec99ca9ac259f4900be0f995..7e7f736d9f8dd6b6bbe5974421c3d0dba90ddef8 100644 (file)
@@ -699,7 +699,7 @@ void
 write_locale_data (const char *output_path, int catidx, const char *category,
                   struct locale_file *file)
 {
-  size_t cnt, step, maxiov;
+  size_t step, maxiov;
   int fd;
   char *fname;
   const char **other_paths;
@@ -724,7 +724,7 @@ write_locale_data (const char *output_path, int catidx, const char *category,
       /* The data will be added to the archive.  For now we simply
         generate the image which will be written.  First determine
         the size.  */
-      int cnt;
+      size_t cnt;
       void *endp;
 
       to_archive[catidx].size = 0;
@@ -812,7 +812,7 @@ cannot open output file `%s' for category `%s'"), fname, category));
 
   /* Write the data using writev.  But we must take care for the
      limitation of the implementation.  */
-  for (cnt = 0; cnt < n_elem; cnt += step)
+  for (size_t cnt = 0; cnt < n_elem; cnt += step)
     {
       step = n_elem - cnt;
       if (maxiov > 0)
index 00ee6bec8c4c28bc6eda7c55811308c96861a667..337e806ea3e06cf083fd85eead230721bafda319 100644 (file)
@@ -370,7 +370,6 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
     {
       if (top_check () >= 0)
         {
-          INTERNAL_SIZE_T nb;
           checked_request2size (bytes + 1, nb);
           newmem = _int_realloc (&main_arena, oldp, oldsize, nb);
         }
index d4415ba933cc6b92c7e3f015c849dd76095b8b9c..2f489cb91305cfcc9edaa7066dfa2f475b5a7277 100644 (file)
@@ -227,8 +227,8 @@ extern int __pthread_debug attribute_hidden;
 /* Cancellation test.  */
 #define CANCELLATION_P(self) \
   do {                                                                       \
-    int cancelhandling = THREAD_GETMEM (self, cancelhandling);               \
-    if (CANCEL_ENABLED_AND_CANCELED (cancelhandling))                        \
+    int _cancelhandling = THREAD_GETMEM (self, cancelhandling);                      \
+    if (CANCEL_ENABLED_AND_CANCELED (_cancelhandling))                       \
       {                                                                              \
        THREAD_SETMEM (self, result, PTHREAD_CANCELED);                       \
        __do_cancel ();                                                       \
index 897fe276a3fab89bcf3c72546fab15709f4149b8..695b082057c4260f07806a694b4142e4c6159f7d 100644 (file)
@@ -1036,11 +1036,11 @@ create_initial_state (re_dfa_t *dfa)
            int dest_idx = dfa->edests[node_idx].elems[0];
            if (!re_node_set_contains (&init_nodes, dest_idx))
              {
-               reg_errcode_t err = re_node_set_merge (&init_nodes,
-                                                      dfa->eclosures
-                                                      + dest_idx);
-               if (err != REG_NOERROR)
-                 return err;
+               reg_errcode_t merge_err = re_node_set_merge (&init_nodes,
+                                                             dfa->eclosures
+                                                             + dest_idx);
+               if (merge_err != REG_NOERROR)
+                 return merge_err;
                i = 0;
              }
          }
index b6b65dd993ec7e2ee5e3e88f8800c2e254cb9d5f..7daa918a4b5b49d38e9fef38c4db73963b3a0107 100644 (file)
@@ -1218,7 +1218,7 @@ static int
 internal_function
 parse_param (char **word, size_t *word_length, size_t *max_length,
             const char *words, size_t *offset, int flags, wordexp_t *pwordexp,
-            const char *ifs, const char *ifs_white, int quoted)
+            const char *ifs, const char *ifs_white, int param_quoted)
 {
   /* We are poised just after "$" */
   enum action
@@ -1474,7 +1474,7 @@ envsubst:
          return *word ? 0 : WRDE_NOSPACE;
        }
       /* Is it `$*' or `$@' (unquoted) ? */
-      else if (*env == '*' || (*env == '@' && !quoted))
+      else if (*env == '*' || (*env == '@' && !param_quoted))
        {
          size_t plist_len = 0;
          int p;
@@ -1500,7 +1500,7 @@ envsubst:
       else
        {
          /* Must be a quoted `$@' */
-         assert (*env == '@' && quoted);
+         assert (*env == '@' && param_quoted);
 
          /* Each parameter is a separate word ("$@") */
          if (__libc_argc == 2)
@@ -1599,8 +1599,6 @@ envsubst:
          expanded = w_newword (&exp_len, &exp_maxl);
          for (p = pattern; p && *p; p++)
            {
-             size_t offset;
-
              switch (*p)
                {
                case '"':
@@ -1634,10 +1632,11 @@ envsubst:
                    }
                  break;
 
-               case '$':
-                 offset = 0;
+               case '$':;
+                  size_t dollars_offset = 0;
                  error = parse_dollars (&expanded, &exp_len, &exp_maxl, p,
-                                        &offset, flags, NULL, NULL, NULL, 1);
+                                        &dollars_offset, flags,
+                                         NULL, NULL, NULL, 1);
                  if (error)
                    {
                      if (free_value)
@@ -1648,16 +1647,16 @@ envsubst:
                      goto do_error;
                    }
 
-                 p += offset;
+                 p += dollars_offset;
                  continue;
 
                case '~':
                  if (quoted || exp_len)
                    break;
 
-                 offset = 0;
+                 size_t tilde_offset = 0;
                  error = parse_tilde (&expanded, &exp_len, &exp_maxl, p,
-                                      &offset, 0);
+                                      &tilde_offset, 0);
                  if (error)
                    {
                      if (free_value)
@@ -1668,7 +1667,7 @@ envsubst:
                      goto do_error;
                    }
 
-                 p += offset;
+                 p += tilde_offset;
                  continue;
 
                case '\\':
@@ -1940,7 +1939,7 @@ envsubst:
   if (value == NULL)
     return 0;
 
-  if (quoted || !pwordexp)
+  if (param_quoted || !pwordexp)
     {
       /* Quoted - no field split */
       *word = w_addstr (*word, word_length, max_length, value);
index b4c86227f8ad461083d4f93135413ce87959d954..fc9cba4d7bb665ef1cf46740cf16029de3c948d0 100644 (file)
@@ -386,7 +386,6 @@ void
 _res_hconf_reorder_addrs (struct hostent *hp)
 {
 #if defined SIOCGIFCONF && defined SIOCGIFNETMASK
-  int i, j;
   /* Number of interfaces.  */
   static int num_ifs = -1;
   /* We need to protect the dynamic buffer handling.  */
@@ -474,11 +473,11 @@ _res_hconf_reorder_addrs (struct hostent *hp)
     return;
 
   /* Find an address for which we have a direct connection.  */
-  for (i = 0; hp->h_addr_list[i]; ++i)
+  for (int i = 0; hp->h_addr_list[i]; ++i)
     {
       struct in_addr *haddr = (struct in_addr *) hp->h_addr_list[i];
 
-      for (j = 0; j < num_ifs; ++j)
+      for (int j = 0; j < num_ifs; ++j)
        {
          u_int32_t if_addr    = ifaddrs[j].u.ipv4.addr;
          u_int32_t if_netmask = ifaddrs[j].u.ipv4.mask;
index ea133f8d8212c76eaee9c12ef4bd980c1fff6549..c80d2826962c9f7eb1322116a2c85384e6db52e9 100644 (file)
@@ -477,14 +477,14 @@ __res_vinit(res_state statp, int preinit) {
 
 static void
 internal_function
-res_setoptions(res_state statp, const char *options, const char *source) {
-       const char *cp = options;
+res_setoptions(res_state statp, const char *opts, const char *source) {
+       const char *cp = opts;
        int i;
 
 #ifdef DEBUG
        if (statp->options & RES_DEBUG)
                printf(";; res_setoptions(\"%s\", \"%s\")...\n",
-                      options, source);
+                      opts, source);
 #endif
        while (*cp) {
                /* skip leading and inner runs of spaces */
@@ -545,7 +545,6 @@ res_setoptions(res_state statp, const char *options, const char *source) {
                    { STRnLEN ("use-vc"), 0, RES_USEVC }
                  };
 #define noptions (sizeof (options) / sizeof (options[0]))
-                 int i;
                  for (i = 0; i < noptions; ++i)
                    if (strncmp (cp, options[i].str, options[i].len) == 0)
                      {
index 24909b2b0474651296508fc5356d743d96284bf5..ac281b60fa862377c2147dee8a7b3ce11b0d4501 100644 (file)
@@ -62,7 +62,6 @@ __parse_one_specmb (const UCHAR_T *format, size_t posn,
                    struct printf_spec *spec, size_t *max_ref_arg)
 #endif
 {
-  unsigned int n;
   size_t nargs = 0;
 
   /* Skip the '%'.  */
@@ -85,7 +84,7 @@ __parse_one_specmb (const UCHAR_T *format, size_t posn,
     {
       const UCHAR_T *begin = format;
 
-      n = read_int (&format);
+      int n = read_int (&format);
 
       if (n != 0 && *format == L_('$'))
        /* Is positional parameter.  */
@@ -161,7 +160,7 @@ __parse_one_specmb (const UCHAR_T *format, size_t posn,
       if (ISDIGIT (*format))
        {
          /* The width argument might be found in a positional parameter.  */
-         n = read_int (&format);
+         int n = read_int (&format);
 
          if (n != 0 && *format == L_('$'))
            {
@@ -204,7 +203,7 @@ __parse_one_specmb (const UCHAR_T *format, size_t posn,
 
          if (ISDIGIT (*format))
            {
-             n = read_int (&format);
+             int n = read_int (&format);
 
              if (n != 0 && *format == L_('$'))
                {
index 4599867b3fbdf374b0f7bc67be56f16855dc9e55..78733a7778ab996d80e81c344c6b0200b7883286 100644 (file)
@@ -240,8 +240,6 @@ __printf_fphex (FILE *fp,
 
   if (special)
     {
-      int width = info->width;
-
       if (negative || info->showsign || info->space)
        --width;
       width -= 3;
index c4ff8334b206fdeb3ae1e97ebec203552ca6a1ff..469c75616b975d1a8eefb08e993bc2489b5e7e6b 100644 (file)
@@ -1965,7 +1965,6 @@ do_positional:
        while (1)
          {
            extern printf_function **__printf_function_table;
-           int function_done;
 
            if (spec <= UCHAR_MAX
                && __printf_function_table != NULL
@@ -1980,7 +1979,7 @@ do_positional:
                  ptr[i] = &args_value[specs[nspecs_done].data_arg + i];
 
                /* Call the function.  */
-               function_done = __printf_function_table[(size_t) spec]
+               int function_done = __printf_function_table[(size_t) spec]
                  (s, &specs[nspecs_done].info, ptr);
 
                if (function_done != -2)
@@ -2017,8 +2016,8 @@ do_positional:
                ptr[i] = &args_value[specs[nspecs_done].data_arg + i];
 
              /* Call the function.  */
-             function_done = printf_unknown (s, &specs[nspecs_done].info,
-                                             ptr);
+             int function_done = printf_unknown (s, &specs[nspecs_done].info,
+                                                  ptr);
 
              /* If an error occurred we don't have information about #
                 of chars.  */
index e0d224530cc67498c3fa5b37838d5bdcdf08eb28..20b9aa8ace5c8d07551d8e58359afc39c12ac587 100644 (file)
@@ -82,7 +82,7 @@
 # define ungetc_not_eof(c, s)  ((void) (--read_in,                           \
                                         _IO_sputbackwc (s, c)))
 # define inchar()      (c == WEOF ? ((errno = inchar_errno), WEOF)           \
-                        : ((c = _IO_getwc_unlocked (s)),                     \
+                        : ((c = _IO_getwc_unlocked (stream)),                \
                            (void) (c != WEOF                                 \
                                    ? ++read_in                               \
                                    : (size_t) (inchar_errno = errno)), c))
@@ -92,7 +92,7 @@
 # define ISDIGIT(Ch)     iswdigit (Ch)
 # define ISXDIGIT(Ch)    iswxdigit (Ch)
 # define TOLOWER(Ch)     towlower (Ch)
-# define ORIENT          if (_IO_fwide (s, 1) != 1) return WEOF
+# define ORIENT          if (_IO_fwide (stream, 1) != 1) return WEOF
 # define __strtoll_internal    __wcstoll_internal
 # define __strtoull_internal   __wcstoull_internal
 # define __strtol_internal     __wcstol_internal
 # define ungetc_not_eof(c, s)  ((void) (--read_in,                           \
                                         _IO_sputbackc (s, (unsigned char) c)))
 # define inchar()      (c == EOF ? ((errno = inchar_errno), EOF)             \
-                        : ((c = _IO_getc_unlocked (s)),                      \
+                        : ((c = _IO_getc_unlocked (stream)),                 \
                            (void) (c != EOF                                  \
                                    ? ++read_in                               \
                                    : (size_t) (inchar_errno = errno)), c))
 # define ISDIGIT(Ch)     __isdigit_l (Ch, loc)
 # define ISXDIGIT(Ch)    __isxdigit_l (Ch, loc)
 # define TOLOWER(Ch)     __tolower_l ((unsigned char) (Ch), loc)
-# define ORIENT          if (_IO_vtable_offset (s) == 0                              \
-                             && _IO_fwide (s, -1) != -1)                     \
-                           return EOF
+# define ORIENT          if (_IO_vtable_offset (stream) == 0                         \
+                      && _IO_fwide (stream, -1) != -1)                       \
+                   return EOF
 
 # define L_(Str)       Str
 # define CHAR_T                char
@@ -192,16 +192,20 @@ struct ptrs_to_free
   char **ptrs[32];
 };
 
+#ifndef __va_copy
+# define __va_copy(dst, src)   (dst) = (va_list) (src)
+#endif
+
 /* Read formatted input from S according to the format string
    FORMAT, using the argument list in ARG.
    Return the number of assignments made, or -1 for an input error.  */
 #ifdef COMPILE_WSCANF
 int
-_IO_vfwscanf (_IO_FILE *s, const wchar_t *format, _IO_va_list argptr,
+_IO_vfwscanf (_IO_FILE *stream, const wchar_t *format, _IO_va_list argptr,
              int *errp)
 #else
 int
-_IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+_IO_vfscanf_internal (_IO_FILE *stream, const char *format, _IO_va_list argptr,
                      int *errp)
 #endif
 {
@@ -303,17 +307,13 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
     }                                                                      \
   while (0)
 
-#ifdef __va_copy
   __va_copy (arg, argptr);
-#else
-  arg = (va_list) argptr;
-#endif
 
 #ifdef ORIENT
   ORIENT;
 #endif
 
-  ARGCHECK (s, format);
+  ARGCHECK (stream, format);
 
  {
 #ifndef COMPILE_WSCANF
@@ -337,7 +337,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
  }
 
   /* Lock the stream.  */
-  LOCK_STREAM (s);
+  LOCK_STREAM (stream);
 
 
 #ifndef COMPILE_WSCANF
@@ -352,35 +352,14 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
       /* Extract the next argument, which is of type TYPE.
         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) :                   \
+#define ARG(type)      (argpos == 0 ? va_arg (arg, type) :                   \
                         ({ unsigned int pos = argpos;                        \
-                           va_list arg;                                      \
-                           __va_copy (arg, argptr);                          \
+                           va_list argcopy;                                  \
+                           __va_copy (argcopy, argptr);                      \
                            while (--pos > 0)                                 \
-                             (void) va_arg (arg, void *);                    \
-                           va_arg (arg, type);                               \
+                             (void) va_arg (argcopy, void *);                \
+                           va_arg (argcopy, 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);                               \
-                        }))
-# 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);                               \
-                         }))
-# endif
-#endif
 
 #ifndef COMPILE_WSCANF
       if (!isascii ((unsigned char) *f))
@@ -396,7 +375,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                    input_error ();
                  else if (c != (unsigned char) *f++)
                    {
-                     ungetc_not_eof (c, s);
+                     ungetc_not_eof (c, stream);
                      conv_error ();
                    }
                }
@@ -435,7 +414,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 
          if (__glibc_unlikely (c != fc))
            {
-             ungetc (c, s);
+             ungetc (c, stream);
              conv_error ();
            }
 
@@ -539,7 +518,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
            }
          /* In __isoc99_*scanf %as, %aS and %a[ extension is not
             supported at all.  */
-         if (s->_flags2 & _IO_FLAGS2_SCANF_STD)
+         if (stream->_flags2 & _IO_FLAGS2_SCANF_STD)
            {
              --f;
              break;
@@ -602,7 +581,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              input_error ();
          while (ISSPACE (c));
          __set_errno (save_errno);
-         ungetc (c, s);
+         ungetc (c, stream);
          skip_space = 0;
        }
 
@@ -614,7 +593,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
            input_error ();
          if (__glibc_unlikely (c != fc))
            {
-             ungetc_not_eof (c, s);
+             ungetc_not_eof (c, stream);
              conv_error ();
            }
          break;
@@ -1002,7 +981,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                {
                  if (ISSPACE (c))
                    {
-                     ungetc_not_eof (c, s);
+                     ungetc_not_eof (c, stream);
                      break;
                    }
 
@@ -1192,7 +1171,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              {
                if (ISSPACE (c))
                  {
-                   ungetc_not_eof (c, s);
+                   ungetc_not_eof (c, stream);
                    break;
                  }
 
@@ -1459,12 +1438,12 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                      wint_t extra_wcdigit = __towctrans (L'0' + n, map);
 
                      /*  Convert it to multibyte representation.  */
-                     mbstate_t state;
-                     memset (&state, '\0', sizeof (state));
+                     mbstate_t dstate;
+                     memset (&dstate, '\0', sizeof (dstate));
 
                      char extra_mbdigit[MB_LEN_MAX];
                      size_t mblen
-                       = __wcrtomb (extra_mbdigit, extra_wcdigit, &state);
+                       = __wcrtomb (extra_mbdigit, extra_wcdigit, &dstate);
 
                      if (mblen == (size_t) -1)
                        {
@@ -1554,9 +1533,9 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                      /* We are pushing all read characters back.  */
                      if (cmpp > mbdigits[n])
                        {
-                         ungetc (c, s);
+                         ungetc (c, stream);
                          while (--cmpp > mbdigits[n])
-                           ungetc_not_eof ((unsigned char) *cmpp, s);
+                           ungetc_not_eof ((unsigned char) *cmpp, stream);
                          c = (unsigned char) *cmpp;
                        }
 
@@ -1606,9 +1585,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                              /* We are pushing all read characters back.  */
                              if (cmpp > mbdigits[n])
                                {
-                                 ungetc (c, s);
+                                 ungetc (c, stream);
                                  while (--cmpp > mbdigits[n])
-                                   ungetc_not_eof ((unsigned char) *cmpp, s);
+                                   ungetc_not_eof ((unsigned char) *cmpp,
+                                                    stream);
                                  c = (unsigned char) *cmpp;
                                }
 
@@ -1658,9 +1638,9 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                          if (cmpp > thousands)
                            {
                              wpsize -= cmpp - thousands;
-                             ungetc (c, s);
+                             ungetc (c, stream);
                              while (--cmpp > thousands)
-                               ungetc_not_eof ((unsigned char) *cmpp, s);
+                               ungetc_not_eof ((unsigned char) *cmpp, stream);
                              c = (unsigned char) *cmpp;
                            }
                          break;
@@ -1724,9 +1704,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                            if (cmpp > thousands)
                              {
                                wpsize -= cmpp - thousands;
-                               ungetc (c, s);
+                               ungetc (c, stream);
                                while (--cmpp > thousands)
-                                 ungetc_not_eof ((unsigned char) *cmpp, s);
+                                 ungetc_not_eof ((unsigned char) *cmpp,
+                                                  stream);
                                c = (unsigned char) *cmpp;
                              }
                            break;
@@ -1770,14 +1751,14 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                {
                  /* The last read character is not part of the number
                     anymore.  */
-                 ungetc (c, s);
+                 ungetc (c, stream);
 
                  conv_error ();
                }
            }
          else
            /* The just read character is not part of the number anymore.  */
-           ungetc (c, s);
+           ungetc (c, stream);
 
          /* Convert the number.  */
          ADDW (L_('\0'));
@@ -1940,7 +1921,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                    }
                  else
                    /* Never mind.  */
-                   ungetc (c, s);
+                   ungetc (c, stream);
                }
              goto scan_float;
            }
@@ -2005,7 +1986,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                    {
                      /* The last read character is not part of the number
                         anymore.  */
-                     ungetc (c, s);
+                     ungetc (c, stream);
                      break;
                    }
 #else
@@ -2074,7 +2055,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                        {
                          /* The last read character is not part of the number
                             anymore.  */
-                         ungetc (c, s);
+                         ungetc (c, stream);
                          break;
                        }
                    }
@@ -2117,11 +2098,11 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 #else
              char mbdigits[12][MB_LEN_MAX + 1];
 
-             mbstate_t state;
-             memset (&state, '\0', sizeof (state));
+             mbstate_t dstate;
+             memset (&dstate, '\0', sizeof (dstate));
 
              bool match_so_far = wpsize == 0;
-             size_t mblen = __wcrtomb (mbdigits[11], wcdigits[11], &state);
+             size_t mblen = __wcrtomb (mbdigits[11], wcdigits[11], &dstate);
              if (mblen != (size_t) -1)
                {
                  mbdigits[11][mblen] = '\0';
@@ -2161,8 +2142,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 #ifndef COMPILE_WSCANF
                      memset (&state, '\0', sizeof (state));
 
-                     size_t mblen = __wcrtomb (mbdigits[n], wcdigits[n],
-                                               &state);
+                      mblen = __wcrtomb (mbdigits[n], wcdigits[n], &state);
                      if (mblen == (size_t) -1)
                        {
                          if (n == 10)
@@ -2274,9 +2254,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                              /* We are pushing all read characters back.  */
                              if (cmpp > mbdigits[n])
                                {
-                                 ungetc (c, s);
+                                 ungetc (c, stream);
                                  while (--cmpp > mbdigits[n])
-                                   ungetc_not_eof ((unsigned char) *cmpp, s);
+                                   ungetc_not_eof ((unsigned char) *cmpp,
+                                                    stream);
                                  c = (unsigned char) *cmpp;
                                }
 #endif
@@ -2286,7 +2267,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                            {
                              /* The last read character is not part
                                 of the number anymore.  */
-                             ungetc (c, s);
+                             ungetc (c, stream);
                              break;
                            }
                        }
@@ -2448,7 +2429,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                            {
                              /* The current character is not in the
                                 scanset.  */
-                             ungetc (c, s);
+                             ungetc (c, stream);
                              goto out;
                            }
 
@@ -2460,7 +2441,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                            break;
                          if ((wint_t) *runp == c && not_in)
                            {
-                             ungetc (c, s);
+                             ungetc (c, stream);
                              goto out;
                            }
 
@@ -2470,7 +2451,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 
                  if (runp == twend && !not_in)
                    {
-                     ungetc (c, s);
+                     ungetc (c, stream);
                      goto out;
                    }
 
@@ -2539,7 +2520,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                {
                  if (wp[c] == not_in)
                    {
-                     ungetc_not_eof (c, s);
+                     ungetc_not_eof (c, stream);
                      break;
                    }
 
@@ -2680,7 +2661,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                            {
                              /* The current character is not in the
                                 scanset.  */
-                             ungetc (c, s);
+                             ungetc (c, stream);
                              goto out2;
                            }
 
@@ -2692,7 +2673,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                            break;
                          if ((wint_t) *runp == c && not_in)
                            {
-                             ungetc (c, s);
+                             ungetc (c, stream);
                              goto out2;
                            }
 
@@ -2702,7 +2683,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 
                  if (runp == twend && !not_in)
                    {
-                     ungetc (c, s);
+                     ungetc (c, stream);
                      goto out2;
                    }
 
@@ -2767,7 +2748,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                {
                  if (wp[c] == not_in)
                    {
-                     ungetc_not_eof (c, s);
+                     ungetc_not_eof (c, stream);
                      break;
                    }
 
@@ -2898,12 +2879,12 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
       do
        c = inchar ();
       while (ISSPACE (c));
-      ungetc (c, s);
+      ungetc (c, stream);
     }
 
  errout:
   /* Unlock stream.  */
-  UNLOCK_STREAM (s);
+  UNLOCK_STREAM (stream);
 
   if (use_malloc)
     free (wp);
index 8de5328b06ff4aeefca346be27af9fc7650ae548..666f5ad0e1d12dd6bf8a082b4b77d308686aad46 100644 (file)
@@ -79,8 +79,8 @@ static void *known_values;
 
 # define KNOWN_VALUE(Str) \
   ({                                                                         \
-    void *value = tfind (Str, &known_values, (__compar_fn_t) strcmp);        \
-    value != NULL ? *(char **) value : NULL;                                 \
+    void *_value = tfind (Str, &known_values, (__compar_fn_t) strcmp);       \
+    _value != NULL ? *(char **) _value : NULL;                               \
   })
 # define STORE_VALUE(Str) \
   tsearch (Str, &known_values, (__compar_fn_t) strcmp)
index 3c449c7d54d97d647b73758743f62afda75e0cc4..41578e3e4c83f8ffc067fa315b8b95b29a1776a7 100644 (file)
@@ -458,9 +458,9 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
       mp_limb_t *__ptr = (ptr);                                                \
       if (__builtin_constant_p (count) && count == BITS_PER_MP_LIMB)   \
        {                                                               \
-         mp_size_t i;                                                  \
-         for (i = (size) - 1; i > 0; --i)                              \
-           __ptr[i] = __ptr[i - 1];                                    \
+         mp_size_t _i;                                                 \
+         for (_i = (size) - 1; _i > 0; --_i)                           \
+           __ptr[_i] = __ptr[_i - 1];                                  \
          __ptr[0] = (limb);                                            \
        }                                                               \
       else                                                             \
@@ -515,8 +515,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 
   /* Running pointer after the last character processed in the string.  */
   const STRING_TYPE *cp, *tp;
-  /* Start of significant part of the number.  */
-  const STRING_TYPE *startp, *start_of_digits;
   /* Points at the character following the integer and fractional digits.  */
   const STRING_TYPE *expp;
   /* Total number of digit and number of digits in integer part.  */
@@ -647,7 +645,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
       if (lowc == L_('n') && STRNCASECMP (cp, L_("nan"), 3) == 0)
        {
          /* Return NaN.  */
-         FLOAT retval = NAN;
+         FLOAT result = NAN;
 
          cp += 3;
 
@@ -677,7 +675,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 
                  mant = STRTOULL (startp + 1, &endp, 0);
                  if (endp == cp)
-                   SET_MANTISSA (retval, mant);
+                   SET_MANTISSA (result, mant);
 
                  /* Consume the closing brace.  */
                  ++cp;
@@ -687,7 +685,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
          if (endptr != NULL)
            *endptr = (STRING_TYPE *) cp;
 
-         return retval;
+         return result;
        }
 
       /* It is really a text we do not recognize.  */
@@ -707,7 +705,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
     }
 
   /* Record the start of the digits, in case we will check their grouping.  */
-  start_of_digits = startp = cp;
+  const STRING_TYPE *start_of_digits = cp;
 
   /* Ignore leading zeroes.  This helps us to avoid useless computations.  */
 #ifdef USE_WIDE_CHAR
@@ -777,7 +775,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 
   /* Remember first significant digit and read following characters until the
      decimal point, exponent character or any non-FP number character.  */
-  startp = cp;
+  const STRING_TYPE *startp = cp;
   dig_no = 0;
   while (1)
     {
@@ -1349,7 +1347,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
     int neg_exp;
     int more_bits;
     int need_frac_digits;
-    mp_limb_t cy;
     mp_limb_t *psrc = den;
     mp_limb_t *pdest = num;
     const struct mp_power *ttab = &_fpioconst_pow10[0];
@@ -1470,7 +1467,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
        /* Don't call `mpn_shift' with a count of zero since the specification
           does not allow this.  */
        (void) __mpn_lshift (den, den, densize, cnt);
-       cy = __mpn_lshift (num, num, numsize, cnt);
+       mp_limb_t cy = __mpn_lshift (num, num, numsize, cnt);
        if (cy != 0)
          num[numsize++] = cy;
       }
@@ -1502,15 +1499,15 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 #define got_limb                                                             \
              if (bits == 0)                                                  \
                {                                                             \
-                 int cnt;                                                    \
+                 int zero_count;                                             \
                  if (quot == 0)                                              \
-                   cnt = BITS_PER_MP_LIMB;                                   \
+                   zero_count = BITS_PER_MP_LIMB;                            \
                  else                                                        \
-                   count_leading_zeros (cnt, quot);                          \
-                 exponent -= cnt;                                            \
-                 if (BITS_PER_MP_LIMB - cnt > MANT_DIG)                      \
+                   count_leading_zeros (zero_count, quot);                   \
+                 exponent -= zero_count;                                     \
+                 if (BITS_PER_MP_LIMB - zero_count > MANT_DIG)               \
                    {                                                         \
-                     used = MANT_DIG + cnt;                                  \
+                     used = MANT_DIG + zero_count;                           \
                      retval[0] = quot >> (BITS_PER_MP_LIMB - used);          \
                      bits = MANT_DIG + 1;                                    \
                    }                                                         \
@@ -1521,7 +1518,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
                      if (RETURN_LIMB_SIZE > 1)                               \
                        retval[1] = 0;                                        \
                      retval[0] = quot;                                       \
-                     bits = -cnt;                                            \
+                     bits = -zero_count;                                     \
                    }                                                         \
                }                                                             \
              else if (bits + BITS_PER_MP_LIMB <= MANT_DIG)                   \
@@ -1654,7 +1651,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
          if (numsize < densize)
            {
              mp_size_t empty = densize - numsize;
-             int i;
 
              if (bits <= 0)
                exponent -= empty * BITS_PER_MP_LIMB;
@@ -1682,7 +1678,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
                      used = MANT_DIG - bits;
                      if (used >= BITS_PER_MP_LIMB)
                        {
-                         int i;
                          (void) __mpn_lshift (&retval[used
                                                       / BITS_PER_MP_LIMB],
                                               retval,
@@ -1703,7 +1698,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
            }
          else
            {
-             int i;
              assert (numsize == densize);
              for (i = numsize; i > 0; --i)
                num[i] = num[i - 1];
index 8f392b9678c1da2947196af2bd21964c6b4fdafe..68697250ffbb723d3cf9c967c1b87c33bc5d0e82 100644 (file)
@@ -576,7 +576,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
                                  + 16 * sizeof(char));
              assert (tmpbuf == NULL);
              tmpbuf = alloca_account (tmpbuflen, alloca_used);
-             int rc;
              struct hostent th;
              struct hostent *h;
              int herrno;
@@ -1154,7 +1153,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
                  idn_flags |= IDNA_USE_STD3_ASCII_RULES;
 
                char *out;
-               int rc = __idna_to_unicode_lzlz (canon, &out, idn_flags);
+                rc = __idna_to_unicode_lzlz (canon, &out, idn_flags);
                if (rc != IDNA_SUCCESS)
                  {
                    if (rc == IDNA_MALLOC_ERROR)
index 052b9ed1103a4b865fb072b96b8cac06d602de7e..139022b02c58ddc32a6e2854bb38ceb56c58464a 100644 (file)
@@ -62,13 +62,13 @@ _dl_get_origin (void)
         a copy and strip out trailing slashes.  */
       if (GLRO(dl_origin_path) != NULL)
        {
-         size_t len = strlen (GLRO(dl_origin_path));
-         result = (char *) malloc (len + 1);
+         size_t path_len = strlen (GLRO(dl_origin_path));
+         result = (char *) malloc (path_len + 1);
          if (result == NULL)
            result = (char *) -1;
          else
            {
-             char *cp = __mempcpy (result, GLRO(dl_origin_path), len);
+             char *cp = __mempcpy (result, GLRO(dl_origin_path), path_len);
              while (cp > result + 1 && cp[-1] == '/')
                --cp;
              *cp = '\0';
index 1746827e9eb865b71cc34630a703d360fa316c79..22600f02265c9ae55693e172b2ede4e3119f11c9 100644 (file)
@@ -144,11 +144,10 @@ __get_nprocs (void)
 
   const int flags = O_RDONLY | O_CLOEXEC;
   int fd = open_not_cancel_2 ("/sys/devices/system/cpu/online", flags);
-  char *l;
   int result = 0;
   if (fd != -1)
     {
-      l = next_line (fd, buffer, &cp, &re, buffer_end);
+      char *l = next_line (fd, buffer, &cp, &re, buffer_end);
       if (l != NULL)
        do
          {
@@ -196,6 +195,7 @@ __get_nprocs (void)
     {
       result = 0;
 
+      char *l;
       while ((l = next_line (fd, buffer, &cp, &re, buffer_end)) != NULL)
        /* The current format of /proc/stat has all the cpu* entries
           at the front.  We assume here that stays this way.  */
index a47b2edcad437b96c74952367dd7bb611b424b17..a952172cfa75e273ea7379d1198643308e40f8f7 100644 (file)
@@ -734,8 +734,8 @@ getifaddrs_internal (struct ifaddrs **ifap)
                 address, use the name from the interface entry.  */
              if (ifas[ifa_index].ifa.ifa_name == NULL)
                {
-                 int idx = map_newlink (ifam->ifa_index - 1, ifas,
-                                        map_newlink_data, newlink);
+                  idx = map_newlink (ifam->ifa_index - 1, ifas,
+                                     map_newlink_data, newlink);
                  if (__glibc_unlikely (idx == -1))
                    goto try_again;
                  ifas[ifa_index].ifa.ifa_name = ifas[idx].ifa.ifa_name;
index 28e48d9e922417a3ceb3fc3c8b5d22e459485d4d..77757c66c5b9530350de15255ed9f1d1eec0b921 100644 (file)
@@ -60,7 +60,7 @@ int __pthread_force_elision attribute_hidden;
 static void
 elision_init (int argc __attribute__ ((unused)),
              char **argv  __attribute__ ((unused)),
-             char **environ)
+             char **envp)
 {
   __elision_available = HAS_RTM;
 #ifdef ENABLE_LOCK_ELISION
index 55b4e16144bd16fb203d5a6569f1ffbe7a0e0be8..6f4e4495b1bf1a3b57c8a0e05af77b7a4ff8bcd0 100644 (file)
 #endif
 
 #define lll_trylock(futex) \
-  ({ int ret;                                                                \
+  ({ int _ret;                                                               \
      __asm __volatile (__lll_trylock_asm                                     \
-                      : "=a" (ret), "=m" (futex)                             \
+                      : "=a" (_ret), "=m" (futex)                            \
                       : "r" (LLL_LOCK_INITIALIZER_LOCKED), "m" (futex),      \
                         "0" (LLL_LOCK_INITIALIZER)                           \
                       : "memory");                                           \
-     ret; })
+     _ret; })
 
 #define lll_cond_trylock(futex) \
-  ({ int ret;                                                                \
+  ({ int _ret;                                                               \
      __asm __volatile (LOCK_INSTR "cmpxchgl %2, %1"                          \
-                      : "=a" (ret), "=m" (futex)                             \
+                      : "=a" (_ret), "=m" (futex)                            \
                       : "r" (LLL_LOCK_INITIALIZER_WAITERS),                  \
                         "m" (futex), "0" (LLL_LOCK_INITIALIZER)              \
                       : "memory");                                           \
-     ret; })
+     _ret; })
 
 #if defined NOT_IN_libc || defined UP
 # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %4, %2\n\t"               \
 
 #define lll_lock(futex, private) \
   (void)                                                                     \
-    ({ int ignore1, ignore2, ignore3;                                        \
+    ({ int _ignore1, _ignore2, _ignore3;                                     \
        if (__builtin_constant_p (private) && (private) == LLL_PRIVATE)       \
         __asm __volatile (__lll_lock_asm_start                               \
                           "1:\tlea %2, %%" RDI_LP "\n"                       \
                           "4:\tadd $128, %%" RSP_LP "\n"                     \
                           ".cfi_adjust_cfa_offset -128\n"                    \
                           "24:"                                              \
-                          : "=S" (ignore1), "=&D" (ignore2), "=m" (futex),   \
-                            "=a" (ignore3)                                   \
+                          : "=S" (_ignore1), "=&D" (_ignore2), "=m" (futex), \
+                            "=a" (_ignore3)                                  \
                           : "0" (1), "m" (futex), "3" (0)                    \
                           : "cx", "r11", "cc", "memory");                    \
        else                                                                  \
                           "4:\tadd $128, %%" RSP_LP "\n"                     \
                           ".cfi_adjust_cfa_offset -128\n"                    \
                           "24:"                                              \
-                          : "=S" (ignore1), "=D" (ignore2), "=m" (futex),    \
-                            "=a" (ignore3)                                   \
+                          : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),  \
+                            "=a" (_ignore3)                                  \
                           : "1" (1), "m" (futex), "3" (0), "0" (private)     \
                           : "cx", "r11", "cc", "memory");                    \
     })                                                                       \
 
 #define lll_robust_lock(futex, id, private) \
-  ({ int result, ignore1, ignore2;                                           \
+  ({ int _result, _ignore1, _ignore2;                                        \
     __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"                       \
                      "jz 24f\n"                                              \
                      "1:\tlea %2, %%" RDI_LP "\n"                            \
                      "4:\tadd $128, %%" RSP_LP "\n"                          \
                      ".cfi_adjust_cfa_offset -128\n"                         \
                      "24:"                                                   \
-                     : "=S" (ignore1), "=D" (ignore2), "=m" (futex),         \
-                       "=a" (result)                                         \
+                     : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),       \
+                       "=a" (_result)                                        \
                      : "1" (id), "m" (futex), "3" (0), "0" (private)         \
                      : "cx", "r11", "cc", "memory");                         \
-    result; })
+    _result; })
 
 #define lll_cond_lock(futex, private) \
   (void)                                                                     \
-    ({ int ignore1, ignore2, ignore3;                                        \
+    ({ int _ignore1, _ignore2, _ignore3;                                     \
        __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"                    \
                         "jz 24f\n"                                           \
                         "1:\tlea %2, %%" RDI_LP "\n"                         \
                         "4:\tadd $128, %%" RSP_LP "\n"                       \
                         ".cfi_adjust_cfa_offset -128\n"                      \
                         "24:"                                                \
-                        : "=S" (ignore1), "=D" (ignore2), "=m" (futex),      \
-                          "=a" (ignore3)                                     \
+                        : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),    \
+                          "=a" (_ignore3)                                    \
                         : "1" (2), "m" (futex), "3" (0), "0" (private)       \
                         : "cx", "r11", "cc", "memory");                      \
     })
 
 #define lll_robust_cond_lock(futex, id, private) \
-  ({ int result, ignore1, ignore2;                                           \
+  ({ int _result, _ignore1, _ignore2;                                        \
     __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"                       \
                      "jz 24f\n"                                              \
                      "1:\tlea %2, %%" RDI_LP "\n"                            \
                      "4:\tadd $128, %%" RSP_LP "\n"                          \
                      ".cfi_adjust_cfa_offset -128\n"                         \
                      "24:"                                                   \
-                     : "=S" (ignore1), "=D" (ignore2), "=m" (futex),         \
-                       "=a" (result)                                         \
+                     : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),       \
+                       "=a" (_result)                                        \
                      : "1" (id | FUTEX_WAITERS), "m" (futex), "3" (0),       \
                        "0" (private)                                         \
                      : "cx", "r11", "cc", "memory");                         \
-    result; })
+    _result; })
 
 #define lll_timedlock(futex, timeout, private) \
-  ({ int result, ignore1, ignore2, ignore3;                                  \
+  ({ int _result, _ignore1, _ignore2, _ignore3;                                      \
      __asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t"                              \
                       "jz 24f\n"                                             \
                       "1:\tlea %4, %%" RDI_LP "\n"                           \
                       "4:\tadd $128, %%" RSP_LP "\n"                         \
                       ".cfi_adjust_cfa_offset -128\n"                        \
                       "24:"                                                  \
-                      : "=a" (result), "=D" (ignore1), "=S" (ignore2),       \
-                        "=&d" (ignore3), "=m" (futex)                        \
+                      : "=a" (_result), "=D" (_ignore1), "=S" (_ignore2),    \
+                        "=&d" (_ignore3), "=m" (futex)                       \
                       : "0" (0), "1" (1), "m" (futex), "m" (timeout),        \
                         "2" (private)                                        \
                       : "memory", "cx", "cc", "r10", "r11");                 \
-     result; })
+     _result; })
 
 extern int __lll_timedlock_elision (int *futex, short *adapt_count,
                                         const struct timespec *timeout,
@@ -298,7 +298,7 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
   __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
 
 #define lll_robust_timedlock(futex, timeout, id, private) \
-  ({ int result, ignore1, ignore2, ignore3;                                  \
+  ({ int _result, _ignore1, _ignore2, _ignore3;                                      \
      __asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t"                              \
                       "jz 24f\n\t"                                           \
                       "1:\tlea %4, %%" RDI_LP "\n"                           \
@@ -309,12 +309,12 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
                       "4:\tadd $128, %%" RSP_LP "\n"                         \
                       ".cfi_adjust_cfa_offset -128\n"                        \
                       "24:"                                                  \
-                      : "=a" (result), "=D" (ignore1), "=S" (ignore2),       \
-                        "=&d" (ignore3), "=m" (futex)                        \
+                      : "=a" (_result), "=D" (_ignore1), "=S" (_ignore2),    \
+                        "=&d" (_ignore3), "=m" (futex)                       \
                       : "0" (0), "1" (id), "m" (futex), "m" (timeout),       \
                         "2" (private)                                        \
                       : "memory", "cx", "cc", "r10", "r11");                 \
-     result; })
+     _result; })
 
 #if defined NOT_IN_libc || defined UP
 # define __lll_unlock_asm_start LOCK_INSTR "decl %0\n\t"                     \
index 4a619dafebd180426bf32ab6b6cb0e5e560b718a..f062bdadb6dc7b515517b43d292afcc2469304de 100644 (file)
 # undef INTERNAL_SYSCALL_DECL
 # define INTERNAL_SYSCALL_DECL(err) do { } while (0)
 
-# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+# define INTERNAL_SYSCALL_NCS(name, err, nr, args...)                        \
   ({                                                                         \
-    unsigned long int resultvar;                                             \
+    unsigned long int ncs_result;                                            \
     LOAD_ARGS_##nr (args)                                                    \
     LOAD_REGS_##nr                                                           \
-    asm volatile (                                                           \
-    "syscall\n\t"                                                            \
-    : "=a" (resultvar)                                                       \
-    : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");               \
-    (long int) resultvar; })
+    asm volatile ("syscall"                                                  \
+                 : "=a" (ncs_result)                                         \
+                 : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");  \
+    (long int) ncs_result; })
 # undef INTERNAL_SYSCALL
 # define INTERNAL_SYSCALL(name, err, nr, args...) \
   INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
 
-# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...) \
+# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...)                  \
   ({                                                                         \
-    unsigned long int resultvar;                                             \
+    unsigned long int ncs_result;                                            \
     LOAD_ARGS_TYPES_##nr (args)                                                      \
     LOAD_REGS_TYPES_##nr (args)                                                      \
-    asm volatile (                                                           \
-    "syscall\n\t"                                                            \
-    : "=a" (resultvar)                                                       \
-    : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");               \
-    (long int) resultvar; })
+    asm volatile ("syscall"                                                  \
+                 : "=a" (ncs_result)                                         \
+                 : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");  \
+    (long int) ncs_result; })
 # undef INTERNAL_SYSCALL_TYPES
 # define INTERNAL_SYSCALL_TYPES(name, err, nr, args...) \
   INTERNAL_SYSCALL_NCS_TYPES (__NR_##name, err, nr, ##args)
index 5befa53f30ad224b9261fc0ae14306df1182a6e7..acf92e394a3a4e46fda6d9b66536842b3a71a729 100644 (file)
@@ -83,14 +83,14 @@ elision_adapt(signed char *adapt_count, unsigned int status)
    ADAPT_COUNT is a pointer to per-lock state variable.  */
 
 #define ELIDE_TRYLOCK(adapt_count, is_lock_free, write) ({     \
-  int ret = 0;                                         \
+  int _ret = 0;                                                \
   if (__elision_aconf.retry_try_xbegin > 0)            \
     {                                                          \
       if (write)                                       \
         _xabort (_ABORT_NESTED_TRYLOCK);               \
-      ret = ELIDE_LOCK (adapt_count, is_lock_free);     \
+      _ret = ELIDE_LOCK (adapt_count, is_lock_free);     \
     }                                                  \
-    ret;                                               \
+    _ret;                                              \
     })
 
 /* Returns true if lock defined by IS_LOCK_FREE was elided.  */
index 3e811b6aeadb2369839eaa56026b1884e434089b..63a3992a9dd269c209990706f183fdab7ea72799 100644 (file)
@@ -177,13 +177,13 @@ typedef struct
 
    The contained asm must *not* be marked volatile since otherwise
    assignments like
-       pthread_descr self = thread_self();
+       pthread_descr self = THREAD_SELF;
    do not get optimized away.  */
 # define THREAD_SELF \
-  ({ struct pthread *__self;                                                 \
-     asm ("mov %%fs:%c1,%0" : "=r" (__self)                                  \
+  ({ struct pthread *__thread_self;                                          \
+     asm ("mov %%fs:%c1,%0" : "=r" (__thread_self)                           \
          : "i" (offsetof (struct pthread, header.self)));                    \
-     __self;})
+     __thread_self;})
 
 /* Magic for libthread_db to know how to do THREAD_SELF.  */
 # define DB_THREAD_SELF_INCLUDE  <sys/reg.h> /* For the FS constant.  */
index 7eb96f4e13406ed30a11da4ab74e1a3e920ed558..f7e9c87b4ce568b40204b57aa5b4b0bd4f8da8cb 100644 (file)
@@ -26,8 +26,6 @@ pid_t
 tcgetsid (fd)
      int fd;
 {
-  pid_t pgrp;
-  pid_t sid;
 #ifdef TIOCGSID
   static int tiocgsid_does_not_work;
 
@@ -51,11 +49,11 @@ tcgetsid (fd)
     }
 #endif
 
-  pgrp = tcgetpgrp (fd);
+  pid_t pgrp = tcgetpgrp (fd);
   if (pgrp == -1)
     return (pid_t) -1;
 
-  sid = getsid (pgrp);
+  pid_t sid = getsid (pgrp);
   if (sid == -1 && errno == ESRCH)
     __set_errno (ENOTTY);
 
index b3a612e03c02f0f8137cd7a6333750af9ad00f55..94ca22129e2bab0c1e9b4c0c5ff0483e7659a0bd 100644 (file)
@@ -792,12 +792,12 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
              /* Match locale's alternate date and time format.  */
              if (s.decided != raw)
                {
-                 const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT);
+                 const char *subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT);
 
-                 if (*fmt == '\0')
-                   fmt = _NL_CURRENT (LC_TIME, D_T_FMT);
+                 if (*subfmt == '\0')
+                   subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
 
-                 if (!recursive (fmt))
+                 if (!recursive (subfmt))
                    {
                      if (s.decided == loc)
                        return NULL;
@@ -806,7 +806,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
                    }
                  else
                    {
-                     if (strcmp (fmt, HERE_D_T_FMT))
+                     if (strcmp (subfmt, HERE_D_T_FMT))
                        s.decided = loc;
                      s.want_xday = 1;
                      break;
@@ -956,12 +956,12 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
            case 'x':
              if (s.decided != raw)
                {
-                 const char *fmt = _NL_CURRENT (LC_TIME, ERA_D_FMT);
+                 const char *subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT);
 
-                 if (*fmt == '\0')
-                   fmt = _NL_CURRENT (LC_TIME, D_FMT);
+                 if (*subfmt == '\0')
+                   subfmt = _NL_CURRENT (LC_TIME, D_FMT);
 
-                 if (!recursive (fmt))
+                 if (!recursive (subfmt))
                    {
                      if (s.decided == loc)
                        return NULL;
@@ -970,7 +970,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
                    }
                  else
                    {
-                     if (strcmp (fmt, HERE_D_FMT))
+                     if (strcmp (subfmt, HERE_D_FMT))
                        s.decided = loc;
                      break;
                    }
@@ -982,12 +982,12 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
            case 'X':
              if (s.decided != raw)
                {
-                 const char *fmt = _NL_CURRENT (LC_TIME, ERA_T_FMT);
+                 const char *subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT);
 
-                 if (*fmt == '\0')
-                   fmt = _NL_CURRENT (LC_TIME, T_FMT);
+                 if (*subfmt == '\0')
+                   subfmt = _NL_CURRENT (LC_TIME, T_FMT);
 
-                 if (!recursive (fmt))
+                 if (!recursive (subfmt))
                    {
                      if (s.decided == loc)
                        return NULL;
@@ -996,7 +996,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
                    }
                  else
                    {
-                     if (strcmp (fmt, HERE_T_FMT))
+                     if (strcmp (subfmt, HERE_T_FMT))
                        s.decided = loc;
                      break;
                    }