Fix warnings from compiler option '-Wshadow'
authorThomas Zimmermann <tdz@users.sourceforge.net>
Sun, 21 Aug 2016 19:30:49 +0000 (21:30 +0200)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 10 Oct 2016 17:04:09 +0000 (18:04 +0100)
Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98192

dbus/dbus-address.c
dbus/dbus-address.h
dbus/dbus-list.c
dbus/dbus-marshal-recursive-util.c
dbus/dbus-message-factory.c
dbus/dbus-timeout.c
dbus/dbus-watch.c
test/dbus-daemon.c
tools/dbus-launch-x11.c
tools/dbus-send.c

index 8e397e5..66b26d5 100644 (file)
@@ -354,14 +354,14 @@ append_unescaped_value (DBusString       *unescaped,
  * in the semicolon-separated list should be tried first.
  * 
  * @param address the address.
- * @param entry return location to an array of entries.
+ * @param entry_result return location to an array of entries.
  * @param array_len return location for array length.
  * @param error address where an error can be returned.
  * @returns #TRUE on success, #FALSE otherwise.
  */
 dbus_bool_t
 dbus_parse_address (const char         *address,
-                   DBusAddressEntry ***entry,
+                   DBusAddressEntry ***entry_result,
                    int                *array_len,
                     DBusError          *error)
 {
@@ -553,7 +553,7 @@ dbus_parse_address (const char         *address,
     }
 
   _dbus_list_clear (&entries);
-  *entry = entry_array;
+  *entry_result = entry_array;
 
   return TRUE;
 
index e51ef0a..4d14fdf 100644 (file)
@@ -42,7 +42,7 @@ typedef struct DBusAddressEntry DBusAddressEntry;
 
 DBUS_EXPORT
 dbus_bool_t dbus_parse_address            (const char         *address,
-                                          DBusAddressEntry ***entry,
+                                          DBusAddressEntry ***entry_result,
                                           int                *array_len,
                                           DBusError          *error);
 DBUS_EXPORT
index c4c1856..df7c72f 100644 (file)
@@ -1044,8 +1044,6 @@ _dbus_list_test (void)
     {
       DBusList *got_link1;
       DBusList *got_link2;
-
-      DBusList *link2;
       
       void *data1_indirect;
       void *data1;
index e00ac5c..1f57ed8 100644 (file)
@@ -3068,10 +3068,10 @@ array_write_value (TestTypeNode   *node,
           link = _dbus_list_get_first_link (&container->children);
           while (link != NULL)
             {
-              TestTypeNode *child = link->data;
+              TestTypeNode *child2 = link->data;
               DBusList *next = _dbus_list_get_next_link (&container->children, link);
 
-              if (!node_write_value (child, block, &sub, seed + i))
+              if (!node_write_value (child2, block, &sub, seed + i))
                 goto oom;
 
               link = next;
@@ -3132,20 +3132,20 @@ array_read_or_set_value (TestTypeNode   *node,
               link = _dbus_list_get_first_link (&container->children);
               while (link != NULL)
                 {
-                  TestTypeNode *child = link->data;
+                  TestTypeNode *child2 = link->data;
                   DBusList *next = _dbus_list_get_next_link (&container->children, link);
 
-                  _dbus_assert (child->klass->typecode ==
+                  _dbus_assert (child2->klass->typecode ==
                                 _dbus_type_reader_get_element_type (reader));
 
                   if (realign_root == NULL)
                     {
-                      if (!node_read_value (child, &sub, seed + i))
+                      if (!node_read_value (child2, &sub, seed + i))
                         return FALSE;
                     }
                   else
                     {
-                      if (!node_set_value (child, &sub, realign_root, seed + i))
+                      if (!node_set_value (child2, &sub, realign_root, seed + i))
                         return FALSE;
                     }
 
index b742e4c..a3e2b6a 100644 (file)
@@ -139,11 +139,11 @@ generate_trivial_inner (DBusMessageDataIter *iter,
         _dbus_assert_not_reached ("oom");
       
       {
-        DBusMessageIter iter;
+        DBusMessageIter iter2;
         const char *v_STRING = "This is an error";
         
-        dbus_message_iter_init_append (message, &iter);
-        if (!dbus_message_iter_append_basic (&iter,
+        dbus_message_iter_init_append (message, &iter2);
+        if (!dbus_message_iter_append_basic (&iter2,
                                              DBUS_TYPE_STRING,
                                              &v_STRING))
           _dbus_assert_not_reached ("oom");
index a1d6ce5..413178d 100644 (file)
@@ -262,12 +262,12 @@ _dbus_timeout_list_set_functions (DBusTimeoutList           *timeout_list,
               link2 = _dbus_list_get_first_link (&timeout_list->timeouts);
               while (link2 != link)
                 {
-                  DBusList *next = _dbus_list_get_next_link (&timeout_list->timeouts,
-                                                             link2);
+                  DBusList *next2 = _dbus_list_get_next_link (&timeout_list->timeouts,
+                                                              link2);
 
                   (* remove_function) (link2->data, data);
                   
-                  link2 = next;
+                  link2 = next2;
                 }
 
               return FALSE;
index 3257f0e..9842296 100644 (file)
@@ -326,8 +326,8 @@ _dbus_watch_list_set_functions (DBusWatchList           *watch_list,
               link2 = _dbus_list_get_first_link (&watch_list->watches);
               while (link2 != link)
                 {
-                  DBusList *next = _dbus_list_get_next_link (&watch_list->watches,
-                                                             link2);
+                  DBusList *next2 = _dbus_list_get_next_link (&watch_list->watches,
+                                                              link2);
 #ifdef DBUS_ENABLE_VERBOSE_MODE
                   DBusWatch *watch2 = link2->data;
                   
@@ -337,7 +337,7 @@ _dbus_watch_list_set_functions (DBusWatchList           *watch_list,
                   
                   (* remove_function) (link2->data, data);
                   
-                  link2 = next;
+                  link2 = next2;
                 }
 
               return FALSE;
index 5d121ca..44b3dfb 100644 (file)
@@ -951,14 +951,14 @@ static const guchar partial_message[] =
 
 static void
 send_all_with_fd (GSocket *socket,
-                  const guchar *partial_message,
+                  const guchar *local_partial_message,
                   gsize len,
                   int fd)
 {
   GSocketControlMessage *fdm = g_unix_fd_message_new ();
   GError *error = NULL;
   gssize sent;
-  GOutputVector vector = { partial_message, len };
+  GOutputVector vector = { local_partial_message, len };
 
   g_unix_fd_message_append_fd (G_UNIX_FD_MESSAGE (fdm), fd, &error);
   g_assert_no_error (error);
index a09444b..1988848 100644 (file)
@@ -43,7 +43,7 @@ static Atom address_atom;
 static Atom pid_atom;
 
 static int
-x_io_error_handler (Display *xdisplay)
+x_io_error_handler (Display *local_xdisplay)
 {
   verbose ("X IO error\n");
   kill_bus_and_exit (0);
index 0dc1f5b..e77e809 100644 (file)
@@ -457,13 +457,13 @@ main (int argc, char *argv[])
     {
       char *arg;
       char *c;
-      int type;
+      int type2;
       int secondary_type;
       int container_type;
       DBusMessageIter *target_iter;
       DBusMessageIter container_iter;
 
-      type = DBUS_TYPE_INVALID;
+      type2 = DBUS_TYPE_INVALID;
       arg = argv[i++];
       c = strchr (arg, ':');
 
@@ -497,9 +497,9 @@ main (int argc, char *argv[])
        }
 
       if (arg[0] == 0)
-       type = DBUS_TYPE_STRING;
+       type2 = DBUS_TYPE_STRING;
       else
-       type = type_from_name (arg);
+       type2 = type_from_name (arg);
 
       if (container_type == DBUS_TYPE_DICT_ENTRY)
        {
@@ -514,7 +514,7 @@ main (int argc, char *argv[])
          *(c++) = 0;
          secondary_type = type_from_name (arg);
          sig[0] = DBUS_DICT_ENTRY_BEGIN_CHAR;
-         sig[1] = type;
+         sig[1] = type2;
          sig[2] = secondary_type;
          sig[3] = DBUS_DICT_ENTRY_END_CHAR;
          sig[4] = '\0';
@@ -527,7 +527,7 @@ main (int argc, char *argv[])
       else if (container_type != DBUS_TYPE_INVALID)
        {
          char sig[2];
-         sig[0] = type;
+         sig[0] = type2;
          sig[1] = '\0';
          dbus_message_iter_open_container (&iter,
                                            container_type,
@@ -540,14 +540,14 @@ main (int argc, char *argv[])
 
       if (container_type == DBUS_TYPE_ARRAY)
        {
-         append_array (target_iter, type, c);
+         append_array (target_iter, type2, c);
        }
       else if (container_type == DBUS_TYPE_DICT_ENTRY)
        {
-         append_dict (target_iter, type, secondary_type, c);
+         append_dict (target_iter, type2, secondary_type, c);
        }
       else
-       append_arg (target_iter, type, c);
+       append_arg (target_iter, type2, c);
 
       if (container_type != DBUS_TYPE_INVALID)
        {