]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use unsigned types for counters in getaddrinfo_a code.
authorRoland McGrath <roland@hack.frob.com>
Thu, 25 Jun 2015 00:58:12 +0000 (17:58 -0700)
committerRoland McGrath <roland@hack.frob.com>
Thu, 25 Jun 2015 00:58:12 +0000 (17:58 -0700)
ChangeLog
resolv/gai_misc.h
resolv/gai_suspend.c
resolv/getaddrinfo_a.c
sysdeps/nptl/gai_misc.h

index 9d06bc14e97e5bf4652e59cbd7b5d9f33e1438d4..e2e2d2ec5a08b2bf72ce54c002149a6da6ed03cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2015-06-24  Roland McGrath  <roland@hack.frob.com>
 
+       * resolv/gai_misc.h (struct waitlist): Change type of field
+       counterp to 'volatile unsigned int *'.
+       * sysdeps/nptl/gai_misc.h (GAI_MISC_WAIT): Use unsigned types for
+       FUTEXADDR and OLDVAL.
+       * resolv/getaddrinfo_a.c (getaddrinfo_a):
+       Give local variable TOTAL type 'volatile unsigned int'.
+       (struct async_waitlist): Change type of field counter to 'unsigned int'.
+       * resolv/gai_suspend.c (gai_suspend):
+       Give local variable CNTR type 'unsigned int'.
+
        * sysdeps/pthread/aio_misc.h (struct waitlist): Change type of field
        counterp to 'volatile unsigned int *'.
        * sysdeps/pthread/aio_suspend.c [DONT_NEED_AIO_MISC_COND]
index 502cad6a8a17a9560d08d72d9d4ca6121b260c04..92f968830cce0285a0699d6e03283f849664d902 100644 (file)
@@ -31,7 +31,7 @@ struct waitlist
 #ifndef DONT_NEED_GAI_MISC_COND
     pthread_cond_t *cond;
 #endif
-    volatile int *counterp;
+    volatile unsigned int *counterp;
     /* The next field is used in asynchronous `lio_listio' operations.  */
     struct sigevent *sigevp;
     /* XXX See requestlist, it's used to work around the broken signal
index 26a2b4e3531ecf8a210ede55e8071d24c230ee5f..c3a128836029e04e13d70a1be61d43fcb2f21b00 100644 (file)
@@ -35,7 +35,7 @@ gai_suspend (const struct gaicb *const list[], int ent,
   pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
 #endif
   int cnt;
-  int cntr = 1;
+  unsigned int cntr = 1;
   int none = 1;
   int result;
 
index b7ae37290baa677811ca26cff6b4e03744fef3c1..e6372228c987531bf3f254654030665c66f29787 100644 (file)
@@ -28,7 +28,7 @@
 /* We need this special structure to handle asynchronous I/O.  */
 struct async_waitlist
   {
-    int counter;
+    unsigned int counter;
     struct sigevent sigev;
     struct waitlist list[0];
   };
@@ -40,7 +40,7 @@ getaddrinfo_a (int mode, struct gaicb *list[], int ent, struct sigevent *sig)
   struct sigevent defsigev;
   struct requestlist *requests[ent];
   int cnt;
-  volatile int total = 0;
+  volatile unsigned int total = 0;
   int result = 0;
 
   /* Check arguments.  */
index bb83dcabb4d9977fb0760ab1134229144694443b..a34dbc0dd9025e10b12a57c7d1654e1eb0c8168f 100644 (file)
@@ -35,8 +35,8 @@
 
 #define GAI_MISC_WAIT(result, futex, timeout, cancel) \
   do {                                                                       \
-    volatile int *futexaddr = &futex;                                        \
-    int oldval = futex;                                                              \
+    volatile unsigned int *futexaddr = &futex;                               \
+    unsigned int oldval = futex;                                             \
                                                                              \
     if (oldval != 0)                                                         \
       {                                                                              \