]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Update comments, remove references to old global variables (#637)
authorThomas Otto <thomas.otto@pdv-fs.de>
Tue, 25 Aug 2020 20:20:04 +0000 (22:20 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Aug 2020 20:20:04 +0000 (22:20 +0200)
src/Logging.cpp
src/ccache.cpp
src/stats.cpp

index 04a6a4b47d4c108293990d26be25ce8bbb494042..e2057b21e991cfbf1787afe13cf5c23a773232f4 100644 (file)
@@ -48,11 +48,9 @@ using nonstd::string_view;
 
 namespace {
 
-// Destination for g_config.log_file.
-File logfile;
-
-// Path to the logfile.
+// Logfile path and file handle, read from Config::log_file().
 std::string logfile_path;
+File logfile;
 
 // Whether to use syslog() instead.
 bool use_syslog;
index 386594d820594ebcfc1cb6ae09671f19a2cb45fd..c59f3fc956b521d0a97a1a841a5f996b2ba06e25 100644 (file)
@@ -373,9 +373,8 @@ do_remember_include_file(Context& ctx,
   return true;
 }
 
-// This function hashes an include file and stores the path and hash in the
-// global g_included_files variable. If the include file is a PCH, cpp_hash is
-// also updated.
+// This function hashes an include file and stores the path and hash in
+// ctx.included_files. If the include file is a PCH, cpp_hash is also updated.
 static void
 remember_include_file(Context& ctx,
                       const std::string& path,
@@ -2140,7 +2139,7 @@ do_cache_compilation(Context& ctx, const char* const* argv)
 
   if (!ctx.config.depend_mode()) {
     // Find the hash using the preprocessed output. Also updates
-    // g_included_files.
+    // ctx.included_files.
     Hash cpp_hash = common_hash;
     init_hash_debug(ctx,
                     cpp_hash,
index f4d431e61b32dd5a89a81df774b8bebf84d3c97a..7fb372ad5b0cf799ab80cea48f4d8033efbf295b 100644 (file)
@@ -235,7 +235,8 @@ stats_write(const std::string& path, const Counters& counters)
     file.commit();
   } catch (const Error& e) {
     // Make failure to write a stats file a soft error since it's not important
-    // enough to fail whole the process.
+    // enough to fail whole the process AND because it is called in the Context
+    // destructor.
     log("Error: {}", e.what());
   }
 }