OSDN Git Service

fixup shadowed warnings
authorMike Frysinger <vapier@gentoo.org>
Mon, 29 Jan 2007 03:18:59 +0000 (03:18 -0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 29 Jan 2007 03:18:59 +0000 (03:18 -0000)
test/misc/tst-seekdir.c
test/pthread/ex7.c
test/signal/sigchld.c
test/string/tester.c
test/time/clocktest.c
test/time/test_time.c

index 5a2810a..7dd5d2e 100644 (file)
@@ -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;
index 93fc34a..9cf30aa 100644 (file)
@@ -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);
     
index d531654..22febac 100644 (file)
@@ -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));
index 71fee0c..bd91c5e 100644 (file)
@@ -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);                                                           \
index f2b3ea7..a5b2c09 100644 (file)
@@ -7,7 +7,7 @@
 volatile int gotit = 0;
 
 static void
-alarm_handler (int signal)
+alarm_handler (int signum)
 {
     gotit = 1;
 }
index 20216ed..2ce819a 100644 (file)
@@ -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;