mirror of
https://github.com/transmission/transmission.git
synced 2026-04-27 20:24:17 +01:00
Make some utility functions return std::string to simplify code (#2368)
* tr_formatter_speed_KBps returns std::string * tr_formatter_mem_B returns std::string * tr_formatter_size_B returns std::string * tr_strpercent/tr_strratio returns std::string
This commit is contained in:
@@ -248,13 +248,14 @@ static int getMaxBlocks(int64_t max_bytes)
|
||||
|
||||
int tr_cacheSetLimit(tr_cache* cache, int64_t max_bytes)
|
||||
{
|
||||
char buf[128];
|
||||
|
||||
cache->max_bytes = max_bytes;
|
||||
cache->max_blocks = getMaxBlocks(max_bytes);
|
||||
|
||||
tr_formatter_mem_B(buf, cache->max_bytes, sizeof(buf));
|
||||
tr_logAddNamedDbg(MY_NAME, "Maximum cache size set to %s (%d blocks)", buf, cache->max_blocks);
|
||||
tr_logAddNamedDbg(
|
||||
MY_NAME,
|
||||
"Maximum cache size set to %s (%d blocks)",
|
||||
tr_formatter_mem_B(cache->max_bytes).c_str(),
|
||||
cache->max_blocks);
|
||||
|
||||
return cacheTrim(cache);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user