]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Pass std::string instead of .c_str()
authorErik Johansson <erik@ejohansson.se>
Sun, 23 Feb 2020 20:54:42 +0000 (21:54 +0100)
committerErik Johansson <erik@ejohansson.se>
Sun, 23 Feb 2020 21:07:08 +0000 (22:07 +0100)
to function taking std::string.

src/ccache.cpp
src/compress.cpp
src/result.cpp

index 70707c00a87fa1cc3670bfba59685700d2d1fc3b..a1fa6a42d6c7f00c08a1cf91378e8990580c0b7d 100644 (file)
@@ -1325,7 +1325,7 @@ to_cache(Context& ctx,
     failed(STATS_ERROR);
   }
   stats_update_size(ctx,
-                    ctx.stats_file.c_str(),
+                    ctx.stats_file,
                     new_dest_stat.size_on_disk()
                       - orig_dest_stat.size_on_disk(),
                     orig_dest_stat ? 0 : 1);
index d127e8610ce2f27eab1bcaaea5a46a0ca827211d..055aaa73528f4eccd65820aa72833cf8cf4fd1b1 100644 (file)
@@ -127,7 +127,7 @@ recompress_file(Context& ctx,
   uint64_t new_size =
     Stat::stat(cache_file.path(), Stat::OnError::log).size_on_disk();
 
-  stats_update_size(ctx, stats_file.c_str(), new_size - old_size, 0);
+  stats_update_size(ctx, stats_file, new_size - old_size, 0);
   cc_log("Recompression of %s done", cache_file.path().c_str());
 }
 
index 59f04530635a7b5df31736a77a9397a5ef4dffd6..306bf3e3edfc01a350c4109142fdc34ff1623ad4 100644 (file)
@@ -414,7 +414,7 @@ write_raw_file_entry(Context& ctx,
   auto new_stat = Stat::stat(raw_file);
 
   stats_update_size(ctx,
-                    ctx.stats_file.c_str(),
+                    ctx.stats_file,
                     new_stat.size_on_disk() - old_stat.size_on_disk(),
                     (new_stat ? 1 : 0) - (old_stat ? 1 : 0));
 }