summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ccache.h2
-rw-r--r--src/cleanup.c19
2 files changed, 10 insertions, 11 deletions
diff --git a/src/ccache.h b/src/ccache.h
index a4fd28ab..973d42dd 100644
--- a/src/ccache.h
+++ b/src/ccache.h
@@ -233,7 +233,7 @@ void exitfn_call(void);
// ----------------------------------------------------------------------------
// cleanup.c
-void clean_up_dir(struct conf *conf, const char *dir, float limit_multiple);
+void clean_up_dir(struct conf *conf, const char *dir, double limit_multiple);
void clean_up_all(struct conf *conf);
void wipe_all(struct conf *conf);
diff --git a/src/cleanup.c b/src/cleanup.c
index dbb65784..969b8d2b 100644
--- a/src/cleanup.c
+++ b/src/cleanup.c
@@ -17,7 +17,6 @@
#include "ccache.h"
-#include <float.h>
#include <math.h>
static struct files {
@@ -158,15 +157,15 @@ sort_and_clean(void)
// Clean up one cache subdirectory.
void
-clean_up_dir(struct conf *conf, const char *dir, float limit_multiple)
+clean_up_dir(struct conf *conf, const char *dir, double limit_multiple)
{
cc_log("Cleaning up cache directory %s", dir);
// When "max files" or "max cache size" is reached, one of the 16 cache
// subdirectories is cleaned up. When doing so, files are deleted (in LRU
// order) until the levels are below limit_multiple.
- cache_size_threshold = roundf(conf->max_size * limit_multiple / 16);
- files_in_cache_threshold = roundf(conf->max_files * limit_multiple / 16);
+ cache_size_threshold = round(conf->max_size * limit_multiple / 16);
+ files_in_cache_threshold = round(conf->max_files * limit_multiple / 16);
num_files = 0;
cache_size = 0;
@@ -176,13 +175,13 @@ clean_up_dir(struct conf *conf, const char *dir, float limit_multiple)
traverse(dir, traverse_fn);
// Clean the cache.
- cc_log("Before cleanup: %lu KiB, %.0f files",
- (unsigned long)cache_size / 1024,
- (float)files_in_cache);
+ cc_log("Before cleanup: %.0f KiB, %.0f files",
+ (double)cache_size / 1024,
+ (double)files_in_cache);
bool cleaned = sort_and_clean();
- cc_log("After cleanup: %lu KiB, %.0f files",
- (unsigned long)cache_size / 1024,
- (float)files_in_cache);
+ cc_log("After cleanup: %.0f KiB, %.0f files",
+ (double)cache_size / 1024,
+ (double)files_in_cache);
if (cleaned) {
cc_log("Cleaned up cache directory %s", dir);