]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Context: move manifest_stats_file and convert to std::string
authorThomas Otto <thomas.otto@pdv-fs.de>
Sun, 26 Jan 2020 20:03:55 +0000 (21:03 +0100)
committerThomas Otto <thomas.otto@pdv-fs.de>
Mon, 17 Feb 2020 21:06:17 +0000 (22:06 +0100)
src/Context.hpp
src/ccache.cpp
src/legacy_globals.cpp
src/legacy_globals.hpp

index b6e7e85dee222342e776895a8931079668a10b18..7af2ec4e45b9ef070b0b24de733cc338649f37d2 100644 (file)
@@ -78,4 +78,7 @@ struct Context : NonCopyable
 
   // The name of the cpp stderr file.
   std::string cpp_stderr;
+
+  // The stats file to use for the manifest.
+  std::string manifest_stats_file;
 };
index 3388d01e2df887fc4472ffe81ab2e3b5e7b4470f..6b1631eceb99ad7f2c869f358c43bda535561ac8 100644 (file)
@@ -1061,7 +1061,7 @@ update_manifest_file(Context& ctx)
   } else {
     auto st = Stat::stat(ctx.manifest_path, Stat::OnError::log);
     stats_update_size(ctx,
-                      from_cstr(manifest_stats_file),
+                      ctx.manifest_stats_file,
                       st.size_on_disk() - old_st.size_on_disk(),
                       !old_st && st ? 1 : 0);
   }
@@ -1981,8 +1981,8 @@ calculate_result_name(Context& ctx,
                                                 ctx.config.cache_dir_levels(),
                                                 manifest_name_string,
                                                 ".manifest");
-    manifest_stats_file = format(
-      "%s/%c/stats", ctx.config.cache_dir().c_str(), manifest_name_string[0]);
+    ctx.manifest_stats_file = fmt::format(
+      "{}/{}/stats", ctx.config.cache_dir(), manifest_name_string[0]);
 
     cc_log("Looking for result name in %s", ctx.manifest_path.c_str());
     MTR_BEGIN("manifest", "manifest_get");
index c5ac740287cd7dee19821bc6e5138ea5739743e8..57ce0f351afc87616c3b7464757585ac93655635 100644 (file)
@@ -24,9 +24,6 @@ char** ignore_headers;
 // Size of headers to ignore list.
 size_t ignore_headers_len;
 
-// The stats file to use for the manifest.
-char* manifest_stats_file;
-
 // Compiler guessing is currently only based on the compiler name, so nothing
 // should hard-depend on it if possible.
 enum guessed_compiler guessed_compiler = GUESSED_UNKNOWN;
index acfce56be451f70a4b7b5d9fe348c9793df3c9d4..b4996cf6ec51a8a6715614512045bb5090657662 100644 (file)
@@ -34,8 +34,6 @@ extern char** ignore_headers;
 
 extern size_t ignore_headers_len;
 
-extern char* manifest_stats_file;
-
 extern enum guessed_compiler guessed_compiler;
 
 extern char* included_pch_file;