]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Removed locally shadowed global variables
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:45:55 +0000 (18:45 +0200)
committerAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:46:32 +0000 (18:46 +0200)
Rename the local, or remove the parameter

src/ccache.c
src/ccache.h
src/conf.c
src/stats.c

index e5c606384cd34b6f0660b78e16aa67636a212beb..5d893d93ec9704f7b65bce8e67fe07ce4aa17155 100644 (file)
@@ -1619,9 +1619,9 @@ calculate_common_hash(struct args *args, struct mdfour *hash)
        // Also hash the compiler name as some compilers use hard links and behave
        // differently depending on the real name.
        hash_delimiter(hash, "cc_name");
-       char *p = basename(args->argv[0]);
-       hash_string(hash, p);
-       free(p);
+       char *base = basename(args->argv[0]);
+       hash_string(hash, base);
+       free(base);
 
        // Possibly hash the current working directory.
        if (generating_debuginfo && conf->hash_dir) {
@@ -1662,7 +1662,7 @@ calculate_common_hash(struct args *args, struct mdfour *hash)
                }
                if (dir) {
                        char *base_name = basename(output_obj);
-                       p = remove_extension(base_name);
+                       char *p = remove_extension(base_name);
                        free(base_name);
                        char *gcda_path = format("%s/%s.gcda", dir, p);
                        cc_log("Hashing coverage path %s", gcda_path);
@@ -3586,7 +3586,7 @@ ccache_main_options(int argc, char *argv[])
 
                case 's': // --show-stats
                        initialize();
-                       stats_summary(conf);
+                       stats_summary();
                        break;
 
                case 'V': // --version
index ad312f8b7523e178202250aa872688111f11be19..fb9e024577bdf54f63d82f6520343180116b57ff 100644 (file)
@@ -207,7 +207,7 @@ void stats_update(enum stats stat);
 void stats_flush(void);
 unsigned stats_get_pending(enum stats stat);
 void stats_zero(void);
-void stats_summary(struct conf *conf);
+void stats_summary(void);
 void stats_update_size(int64_t size, int files);
 void stats_get_obsolete_limits(const char *dir, unsigned *maxfiles,
                                uint64_t *maxsize);
index dc917092e05ef3dba03256bc8d6a4c4e0064f3a5..a08dbb9211e25889d50df6267f1b0ecfffc2fac7 100644 (file)
@@ -253,8 +253,8 @@ handle_conf_setting(struct conf *conf, const char *key, const char *value,
                        fatal("invalid boolean environment variable value \"%s\"", value);
                }
 
-               bool *value = (bool *)((char *)conf + item->offset);
-               *value = !negate_boolean;
+               bool *boolvalue = (bool *)((char *)conf + item->offset);
+               *boolvalue = !negate_boolean;
                goto out;
        }
 
index 5a150adfcebba8b4ee24b76170785480dd561152..b1b64b3a391b0280de21001d986694b722b23e5d 100644 (file)
@@ -445,7 +445,7 @@ stats_get_pending(enum stats stat)
 
 // Sum and display the total stats for all cache dirs.
 void
-stats_summary(struct conf *conf)
+stats_summary(void)
 {
        struct counters *counters = counters_init(STATS_END);
        time_t updated = 0;