diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-01-29 03:18:59 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-01-29 03:18:59 +0000 |
commit | 9a7cfea9e5f6a8289e802dc6d39be521760bc525 (patch) | |
tree | 045af3bf51bab4da2b715f462452afbaebb6de13 | |
parent | df80b74f4b2d282ae9b07e951a798936bb706a48 (diff) |
fixup shadowed warnings
-rw-r--r-- | test/misc/tst-seekdir.c | 9 | ||||
-rw-r--r-- | test/pthread/ex7.c | 8 | ||||
-rw-r--r-- | test/signal/sigchld.c | 6 | ||||
-rw-r--r-- | test/string/tester.c | 1 | ||||
-rw-r--r-- | test/time/clocktest.c | 2 | ||||
-rw-r--r-- | test/time/test_time.c | 8 |
6 files changed, 16 insertions, 18 deletions
diff --git a/test/misc/tst-seekdir.c b/test/misc/tst-seekdir.c index 5a2810abd..7dd5d2e85 100644 --- a/test/misc/tst-seekdir.c +++ b/test/misc/tst-seekdir.c @@ -13,8 +13,7 @@ main (int argc, char *argv[]) int i = 0; int result = 0; struct dirent *dp; - long int save0; - long int rewind; + off_t save0, rewind_ret; dirp = opendir ("."); if (dirp == NULL) @@ -63,13 +62,13 @@ main (int argc, char *argv[]) /* Check rewinddir */ rewinddir (dirp); - rewind = telldir (dirp); - if (rewind == -1) + rewind_ret = telldir (dirp); + if (rewind_ret == -1) { printf ("telldir failed: %s\n", strerror(errno)); result = 1; } - else if (save0 != rewind) + else if (save0 != rewind_ret) { printf ("rewinddir didn't reset directory stream\n"); result = 1; diff --git a/test/pthread/ex7.c b/test/pthread/ex7.c index 93fc34a8c..9cf30aa19 100644 --- a/test/pthread/ex7.c +++ b/test/pthread/ex7.c @@ -27,7 +27,7 @@ test_thread (void *ms_param) { unsigned long status = 0; event_t foo; - struct timespec time; + struct timespec timeout; struct timeval now; long ms = (long) ms_param; @@ -39,13 +39,13 @@ test_thread (void *ms_param) /* set the time out value */ printf("waiting %ld ms ...\n", ms); gettimeofday(&now, NULL); - time.tv_sec = now.tv_sec + ms/1000 + (now.tv_usec + (ms%1000)*1000)/1000000; - time.tv_nsec = ((now.tv_usec + (ms%1000)*1000) % 1000000) * 1000; + timeout.tv_sec = now.tv_sec + ms/1000 + (now.tv_usec + (ms%1000)*1000)/1000000; + timeout.tv_nsec = ((now.tv_usec + (ms%1000)*1000) % 1000000) * 1000; /* Just use this to test the time out. The cond var is never signaled. */ pthread_mutex_lock(&foo.mutex); while (foo.flag == 0 && status != ETIMEDOUT) { - status = pthread_cond_timedwait(&foo.cond, &foo.mutex, &time); + status = pthread_cond_timedwait(&foo.cond, &foo.mutex, &timeout); } pthread_mutex_unlock(&foo.mutex); diff --git a/test/signal/sigchld.c b/test/signal/sigchld.c index d53165419..22febaca7 100644 --- a/test/signal/sigchld.c +++ b/test/signal/sigchld.c @@ -19,12 +19,12 @@ int main(void) { pid_t mypid; struct sigaction siga; - static sigset_t sigset; + static sigset_t set; /* Set up sighandling */ - sigfillset(&sigset); + sigfillset(&set); siga.sa_handler = test_handler; - siga.sa_mask = sigset; + siga.sa_mask = set; siga.sa_flags = 0; if (sigaction(SIGCHLD, &siga, (struct sigaction *)NULL) != 0) { fprintf(stderr, "sigaction choked: %s!", strerror(errno)); diff --git a/test/string/tester.c b/test/string/tester.c index 71fee0c9b..bd91c5e02 100644 --- a/test/string/tester.c +++ b/test/string/tester.c @@ -126,7 +126,6 @@ test_strcmp (void) #define SIMPLE_COPY(fn, n, str, ntest) \ do { \ int __n; \ - char *cp; \ for (__n = 0; __n < (int) sizeof (one); ++__n) \ one[__n] = 'Z'; \ fn (one, str); \ diff --git a/test/time/clocktest.c b/test/time/clocktest.c index f2b3ea73a..a5b2c09e7 100644 --- a/test/time/clocktest.c +++ b/test/time/clocktest.c @@ -7,7 +7,7 @@ volatile int gotit = 0; static void -alarm_handler (int signal) +alarm_handler (int signum) { gotit = 1; } diff --git a/test/time/test_time.c b/test/time/test_time.c index 20216ed9d..2ce819a3f 100644 --- a/test/time/test_time.c +++ b/test/time/test_time.c @@ -37,15 +37,15 @@ main (int argc, char **argv) char buf[BUFSIZ]; if (argc > 0) { - static char buf[BUFSIZ]; - sprintf(buf, "TZ=%s", *argv); - if (putenv(buf)) + static char tzenvbuf[BUFSIZ]; + sprintf(tzenvbuf, "TZ=%s", *argv); + if (putenv(tzenvbuf)) { puts("putenv failed."); lose = 1; } else - puts (buf); + puts (tzenvbuf); } tzset(); tbuf.tm_year = 72; |