]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Partially revert const-ification of context parameters
authorThomas Otto <thomas.otto@pdv-fs.de>
Mon, 17 Feb 2020 20:08:26 +0000 (21:08 +0100)
committerThomas Otto <thomas.otto@pdv-fs.de>
Mon, 17 Feb 2020 20:38:59 +0000 (21:38 +0100)
src/ccache.cpp
src/compress.cpp
src/compress.hpp
src/hashutil.cpp
src/hashutil.hpp
src/result.cpp
src/result.hpp
src/stats.cpp
src/stats.hpp

index 6655cb0eb8fc7dbba78c9b9e2c7dc53aac96fd17..7c85309f867b07409976ef53223c2929b145303d 100644 (file)
@@ -417,7 +417,7 @@ guess_compiler(const char* path)
 }
 
 static bool
-do_remember_include_file(const Context& ctx,
+do_remember_include_file(Context& ctx,
                          std::string path,
                          struct hash* cpp_hash,
                          bool system,
@@ -1035,7 +1035,7 @@ send_cached_stderr(const char* path_stderr)
 
 // Create or update the manifest file.
 static void
-update_manifest_file(const Context& ctx)
+update_manifest_file(Context& ctx)
 {
   if (!ctx.config.direct_mode() || ctx.config.read_only()
       || ctx.config.read_only_direct()) {
@@ -1486,7 +1486,7 @@ get_result_name_from_cpp(Context& ctx, struct args* args, struct hash* hash)
 // Hash mtime or content of a file, or the output of a command, according to
 // the CCACHE_COMPILERCHECK setting.
 static void
-hash_compiler(const Context& ctx,
+hash_compiler(Context& ctx,
               struct hash* hash,
               const Stat& st,
               const char* path,
@@ -1520,7 +1520,7 @@ hash_compiler(const Context& ctx,
 // with -ccbin/--compiler-bindir. If they are NULL, the compilers are looked up
 // in PATH instead.
 static void
-hash_nvcc_host_compiler(const Context& ctx,
+hash_nvcc_host_compiler(Context& ctx,
                         struct hash* hash,
                         const Stat* ccbin_st,
                         const char* ccbin)
@@ -1569,7 +1569,7 @@ hash_nvcc_host_compiler(const Context& ctx,
 
 // Update a hash with information common for the direct and preprocessor modes.
 static void
-hash_common_info(const Context& ctx,
+hash_common_info(Context& ctx,
                  struct args* args,
                  struct hash* hash,
                  const ArgsInfo& args_info)
@@ -2023,7 +2023,7 @@ calculate_result_name(Context& ctx,
 // Try to return the compile result from cache. If we can return from cache
 // then this function exits with the correct status code, otherwise it returns.
 static void
-from_cache(const Context& ctx,
+from_cache(Context& ctx,
            enum fromcache_call_mode mode,
            bool put_result_in_manifest)
 {
@@ -2118,7 +2118,7 @@ from_cache(const Context& ctx,
 // Find the real compiler. We just search the PATH to find an executable of the
 // same name that isn't a link to ourselves.
 static void
-find_compiler(const Context& ctx, char** argv)
+find_compiler(Context& ctx, char** argv)
 {
   // We might be being invoked like "ccache gcc -c foo.c".
   std::string base(Util::base_name(argv[0]));
index bbf691a0fd2bd4c7e0120624dd2fc278a481e786..d127e8610ce2f27eab1bcaaea5a46a0ca827211d 100644 (file)
@@ -85,7 +85,7 @@ create_writer(FILE* stream,
 }
 
 static void
-recompress_file(const Context& ctx,
+recompress_file(Context& ctx,
                 const std::string& stats_file,
                 const CacheFile& cache_file,
                 int8_t level)
@@ -200,7 +200,7 @@ compress_stats(const Config& config,
 }
 
 void
-compress_recompress(const Context& ctx,
+compress_recompress(Context& ctx,
                     int8_t level,
                     const Util::ProgressReceiver& progress_receiver)
 {
index a2a397c4cc6ddcd063a815d9e303f909d3309c8b..118bab51741768774ef37df6bb0fdde99392e0af 100644 (file)
@@ -35,6 +35,6 @@ void compress_stats(const Config& config,
 // - level: Target compression level (positive or negative value), or 0 for no
 //   compression.
 // - progress_receiver: Function that will be called for progress updates.
-void compress_recompress(const Context& ctx,
+void compress_recompress(Context& ctx,
                          int8_t level,
                          const Util::ProgressReceiver& progress_receiver);
index df5026efebceec2392edaee9a4ced820154d449b..1168f4998c360143d96a3b2712537588c40b4045 100644 (file)
@@ -285,7 +285,7 @@ hash_source_code_file(const Config& config, struct hash* hash, const char* path)
 }
 
 bool
-hash_command_output(const Context& ctx,
+hash_command_output(Context& ctx,
                     struct hash* hash,
                     const char* command,
                     const char* compiler)
@@ -431,7 +431,7 @@ hash_command_output(const Context& ctx,
 }
 
 bool
-hash_multicommand_output(const Context& ctx,
+hash_multicommand_output(Context& ctx,
                          struct hash* hash,
                          const char* commands,
                          const char* compiler)
index ffde6a8df31c1e0ec811bc930899dfe20ae34052..560fae20681113e2b9a2918c5a560f6ebfc0af39 100644 (file)
@@ -44,11 +44,11 @@ int hash_source_code_string(const Config& config,
 int hash_source_code_file(const Config& config,
                           struct hash* hash,
                           const char* path);
-bool hash_command_output(const Context& ctx,
+bool hash_command_output(Context& ctx,
                          struct hash* hash,
                          const char* command,
                          const char* compiler);
-bool hash_multicommand_output(const Context& ctx,
+bool hash_multicommand_output(Context& ctx,
                               struct hash* hash,
                               const char* command,
                               const char* compiler);
index 0b6d0f03dc58bdcd3c561d780c7afc79469afde2..59f04530635a7b5df31736a77a9397a5ef4dffd6 100644 (file)
@@ -102,7 +102,7 @@ using ReadEntryFunction = void (*)(const Context& ctx,
                                    FILE* dump_stream);
 
 using WriteEntryFunction =
-  void (*)(const Context& ctx,
+  void (*)(Context& ctx,
            CacheEntryWriter& writer,
            const std::string& result_path_in_cache,
            uint32_t entry_number,
@@ -343,7 +343,7 @@ read_result(const Context& ctx,
 }
 
 static void
-write_embedded_file_entry(const Context&,
+write_embedded_file_entry(Context&,
                           CacheEntryWriter& writer,
                           const std::string& /*result_path_in_cache*/,
                           uint32_t entry_number,
@@ -383,7 +383,7 @@ write_embedded_file_entry(const Context&,
 }
 
 static void
-write_raw_file_entry(const Context& ctx,
+write_raw_file_entry(Context& ctx,
                      CacheEntryWriter& writer,
                      const std::string& result_path_in_cache,
                      uint32_t entry_number,
@@ -444,7 +444,7 @@ should_store_raw_file(const Config& config, FileType type)
 }
 
 static void
-write_result(const Context& ctx,
+write_result(Context& ctx,
              const std::string& path,
              const ResultFileMap& result_file_map)
 {
@@ -506,7 +506,7 @@ result_get(const Context& ctx,
 }
 
 bool
-result_put(const Context& ctx,
+result_put(Context& ctx,
            const std::string& path,
            const ResultFileMap& result_file_map)
 {
index 4015cf6cbe44fd38d0e777b4402ef521ee9912f1..606e41452ca60de5164759fba15904d386611122 100644 (file)
@@ -49,7 +49,7 @@ using ResultFileMap = std::map<FileType, std::string /*path*/>;
 bool result_get(const Context& ctx,
                 const std::string& path,
                 const ResultFileMap& result_file_map);
-bool result_put(const Context& ctx,
+bool result_put(Context& ctx,
                 const std::string& path,
                 const ResultFileMap& result_file_map);
 bool result_dump(const Context& ctx, const std::string& path, FILE* stream);
index a789a1697ce3c1773438514ec2324be9e3121ee5..493b268f5ff063ea872e5f1176b53171b2980ff2 100644 (file)
@@ -299,7 +299,7 @@ stats_collect(const Config& config,
 // Record that a number of bytes and files have been added to the cache. Size
 // is in bytes.
 void
-stats_update_size(const Context& ctx,
+stats_update_size(Context& ctx,
                   const std::string& sfile,
                   int64_t size,
                   int files)
index fb7a2e1745a6b553e845e56d52281c993804b5e9..1a0df5fcba325aed66cbdce148897ed7ee81494a 100644 (file)
@@ -70,7 +70,7 @@ unsigned stats_get_pending(enum stats stat);
 void stats_zero(const Config& config);
 void stats_summary(const Config& config);
 void stats_print(const Config& config);
-void stats_update_size(const Context& ctx,
+void stats_update_size(Context& ctx,
                        const std::string& sfile,
                        int64_t size,
                        int files);