Use unsigned types for counters in getaddrinfo_a code.

This commit is contained in:
Roland McGrath 2015-06-24 17:58:12 -07:00
parent 86edd44f04
commit e185d57e99
5 changed files with 16 additions and 6 deletions

View File

@ -1,5 +1,15 @@
2015-06-24 Roland McGrath <roland@hack.frob.com> 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 * sysdeps/pthread/aio_misc.h (struct waitlist): Change type of field
counterp to 'volatile unsigned int *'. counterp to 'volatile unsigned int *'.
* sysdeps/pthread/aio_suspend.c [DONT_NEED_AIO_MISC_COND] * sysdeps/pthread/aio_suspend.c [DONT_NEED_AIO_MISC_COND]

View File

@ -31,7 +31,7 @@ struct waitlist
#ifndef DONT_NEED_GAI_MISC_COND #ifndef DONT_NEED_GAI_MISC_COND
pthread_cond_t *cond; pthread_cond_t *cond;
#endif #endif
volatile int *counterp; volatile unsigned int *counterp;
/* The next field is used in asynchronous `lio_listio' operations. */ /* The next field is used in asynchronous `lio_listio' operations. */
struct sigevent *sigevp; struct sigevent *sigevp;
/* XXX See requestlist, it's used to work around the broken signal /* XXX See requestlist, it's used to work around the broken signal

View File

@ -35,7 +35,7 @@ gai_suspend (const struct gaicb *const list[], int ent,
pthread_cond_t cond = PTHREAD_COND_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
#endif #endif
int cnt; int cnt;
int cntr = 1; unsigned int cntr = 1;
int none = 1; int none = 1;
int result; int result;

View File

@ -28,7 +28,7 @@
/* We need this special structure to handle asynchronous I/O. */ /* We need this special structure to handle asynchronous I/O. */
struct async_waitlist struct async_waitlist
{ {
int counter; unsigned int counter;
struct sigevent sigev; struct sigevent sigev;
struct waitlist list[0]; struct waitlist list[0];
}; };
@ -40,7 +40,7 @@ getaddrinfo_a (int mode, struct gaicb *list[], int ent, struct sigevent *sig)
struct sigevent defsigev; struct sigevent defsigev;
struct requestlist *requests[ent]; struct requestlist *requests[ent];
int cnt; int cnt;
volatile int total = 0; volatile unsigned int total = 0;
int result = 0; int result = 0;
/* Check arguments. */ /* Check arguments. */

View File

@ -35,8 +35,8 @@
#define GAI_MISC_WAIT(result, futex, timeout, cancel) \ #define GAI_MISC_WAIT(result, futex, timeout, cancel) \
do { \ do { \
volatile int *futexaddr = &futex; \ volatile unsigned int *futexaddr = &futex; \
int oldval = futex; \ unsigned int oldval = futex; \
\ \
if (oldval != 0) \ if (oldval != 0) \
{ \ { \