Avoid a name conflict in a local variable
authorBen Kaduk <kaduk@mit.edu>
Mon, 21 Jul 2014 15:01:04 +0000 (11:01 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 13 Aug 2014 15:26:01 +0000 (11:26 -0400)
Modern compilers will warn when a variable in a nested scope hiding
a variable of the same name in an outer scope.  One of the arguments
to afs_lhash_remove() is already named 'data'; don't reuse that name
for a local variable.

Change-Id: Icbb5010d298110cd4dab395fc5eec45e01ec9ba3
Reviewed-on: http://gerrit.openafs.org/11371
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/util/afs_lhash.c

index 18d7a1a..176fd24 100644 (file)
@@ -406,7 +406,7 @@ afs_lhash_remove(afs_lhash * lh, unsigned key, const void *data)
         pprev = &cur->next, cur = cur->next) {
        lh->remove_tests++;
        if (lh->equal(data, cur->data)) {
-           void *data = cur->data;
+           void *ptr = cur->data;
 
            if (pprev) {
                *pprev = cur->next;
@@ -418,7 +418,7 @@ afs_lhash_remove(afs_lhash * lh, unsigned key, const void *data)
 
            lh->ndata--;
 
-           return data;
+           return ptr;
        }
     }