diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2011-07-14 21:35:28 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2011-07-17 11:57:51 +0200 |
commit | ebae5f7182b30d358eeb915f4edface74fb945ce (patch) | |
tree | d8a0a2e2ce6d439cc9307da9e1ab8301dec52708 /ccache.c | |
parent | 2e0b674ea9e4d23e85f8f85e3f8757aeca1e4830 (diff) | |
download | ccache-ebae5f7182b30d358eeb915f4edface74fb945ce.tar.gz |
config: Use cache_dir_levels from conf struct
Diffstat (limited to 'ccache.c')
-rw-r--r-- | ccache.c | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -169,9 +169,6 @@ static bool enable_direct = true; */ static bool enable_compression = false; -/* number of levels (1 <= nlevels <= 8) */ -static int nlevels = 2; - /* * Whether we should use the optimization of passing the already existing * preprocessed source code to the compiler. @@ -296,18 +293,18 @@ temp_dir() static char * get_path_in_cache(const char *name, const char *suffix) { - int i; + unsigned i; char *path; char *result; path = x_strdup(conf->cache_dir); - for (i = 0; i < nlevels; ++i) { + for (i = 0; i < conf->cache_dir_levels; ++i) { char *p = format("%s/%c", path, name[i]); free(path); path = p; } - result = format("%s/%s%s", path, name + nlevels, suffix); + result = format("%s/%s%s", path, name + conf->cache_dir_levels, suffix); free(path); return result; } @@ -1896,7 +1893,6 @@ cc_reset(void) enable_unify = false; enable_direct = true; enable_compression = false; - nlevels = 2; compile_preprocessed_source_code = false; output_is_precompiled_header = false; @@ -1963,7 +1959,6 @@ ccache(int argc, char *argv[]) bool put_object_in_manifest = false; struct file_hash *object_hash; struct file_hash *object_hash_from_manifest = NULL; - char *env; struct mdfour common_hash; struct mdfour direct_hash; struct mdfour cpp_hash; @@ -2012,12 +2007,6 @@ ccache(int argc, char *argv[]) enable_compression = true; } - if ((env = getenv("CCACHE_NLEVELS"))) { - nlevels = atoi(env); - if (nlevels < 1) nlevels = 1; - if (nlevels > 8) nlevels = 8; - } - if (!cc_process_args(orig_args, &preprocessor_args, &compiler_args)) { failed(); } |