// 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 = round(conf->max_size * limit_multiple / 16);
- files_in_cache_threshold = round(conf->max_files * limit_multiple / 16);
+ cache_size_threshold = (uint64_t)round(conf->max_size * limit_multiple / 16);
+ files_in_cache_threshold = (size_t)round(conf->max_files * limit_multiple / 16);
num_files = 0;
cache_size = 0;
free(conf->prefix_command);
free(conf->prefix_command_cpp);
free(conf->temporary_dir);
- free(conf->item_origins);
+ free((void *)conf->item_origins); /* Workaround for MSVC warning */
free(conf);
}
805306457, 1610612741
};
const unsigned int prime_table_length = sizeof(primes)/sizeof(primes[0]);
-const float max_load_factor = 0.65;
+const float max_load_factor = 0.65f;
/*****************************************************************************/
struct hashtable *
* Factor of ten with the number of digits needed for the fractional
* part. For example, if the precision is 3, the mask will be 1000.
*/
- mask = mypow10(precision);
+ mask = (UINTMAX_T)mypow10(precision);
/*
* We "cheat" by converting the fractional part to integer by
* multiplying by a factor of ten.
if (value >= UINTMAX_MAX)
return UINTMAX_MAX;
- result = value;
+ result = (UINTMAX_T)value;
/*
* At least on NetBSD/sparc64 3.0.2 and 4.99.30, casting long double to
* an integer type converts e.g. 1.9 to 2 instead of 1 (which violates
// Default suffix: G.
x *= 1000 * 1000 * 1000;
}
- *size = x;
+ *size = (uint64_t)x;
return true;
}