Browse Source

fixup shadowed warnings

Mike Frysinger 18 years ago
parent
commit
9a7cfea9e5
6 changed files with 16 additions and 18 deletions
  1. 4 5
      test/misc/tst-seekdir.c
  2. 4 4
      test/pthread/ex7.c
  3. 3 3
      test/signal/sigchld.c
  4. 0 1
      test/string/tester.c
  5. 1 1
      test/time/clocktest.c
  6. 4 4
      test/time/test_time.c

+ 4 - 5
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;

+ 4 - 4
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);
     

+ 3 - 3
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));

+ 0 - 1
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);							      \

+ 1 - 1
test/time/clocktest.c

@@ -7,7 +7,7 @@
 volatile int gotit = 0;
 
 static void
-alarm_handler (int signal)
+alarm_handler (int signum)
 {
     gotit = 1;
 }

+ 4 - 4
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;