# HG changeset patch # User Akim Demaille # Date 1548291262 -3600 # Node ID 33ac33ab575cd545b477db5de899162b76b977d7 # Parent 6240a6971ae170169ddd1c57f0cbdf8727e01ebd relocatable: avoid compiler warnings (-Wshadow) * lib/relocatable.c (compute_curr_prefix): Rename local variables to avoid name collisions with global variables. diff -r 6240a6971ae1 -r 33ac33ab575c ChangeLog --- a/ChangeLog Wed Jan 23 01:17:07 2019 +0100 +++ b/ChangeLog Thu Jan 24 01:54:22 2019 +0100 @@ -1,3 +1,10 @@ +2019-01-23 Akim Demaille + Bruno Haible + + relocatable: avoid compiler warnings (-Wshadow) + * lib/relocatable.c (compute_curr_prefix): Rename local variables + to avoid name collisions with global variables. + 2019-01-22 Bruno Haible vasnprintf: Don't use %n on Android. diff -r 6240a6971ae1 -r 33ac33ab575c lib/relocatable.c --- a/lib/relocatable.c Wed Jan 23 01:17:07 2019 +0100 +++ b/lib/relocatable.c Thu Jan 24 01:54:22 2019 +0100 @@ -268,7 +268,7 @@ } if (!same) break; - /* The last pathname component was the same. opi and cpi now point + /* The last pathname component was the same. rpi and cpi now point to the slash before it. */ rp = rpi; cp = cpi; @@ -282,23 +282,23 @@ } { - size_t curr_prefix_len = cp - curr_installdir; - char *curr_prefix; + size_t computed_curr_prefix_len = cp - curr_installdir; + char *computed_curr_prefix; - curr_prefix = (char *) xmalloc (curr_prefix_len + 1); + computed_curr_prefix = (char *) xmalloc (computed_curr_prefix_len + 1); #ifdef NO_XMALLOC - if (curr_prefix == NULL) + if (computed_curr_prefix == NULL) { free (curr_installdir); return NULL; } #endif - memcpy (curr_prefix, curr_installdir, curr_prefix_len); - curr_prefix[curr_prefix_len] = '\0'; + memcpy (computed_curr_prefix, curr_installdir, computed_curr_prefix_len); + computed_curr_prefix[computed_curr_prefix_len] = '\0'; free (curr_installdir); - return curr_prefix; + return computed_curr_prefix; } } }