Skip to content

Commit

Permalink
dt_mipmap_cache_init(): fix build with clang
Browse files Browse the repository at this point in the history
i386, clang-3.8

[ 16%] Building C object src/CMakeFiles/lib_darktable.dir/common/mipmap_cache.c.o
/home/lebedevri/darktable/src/common/mipmap_cache.c:464:67: error: implicit conversion from 'uint64_t' (aka 'unsigned long long') to 'size_t' (aka 'unsigned int') changes value from 8589934592 to 0 [-Werror,-Wconstant-conversion]
  size_t max_mem = CLAMPS(cache_memory, 100u << 20, ((uint64_t)8) << 30);
         ~~~~~~~                                    ~~~~~~~~~~~~~~^~~~~
/home/lebedevri/darktable/src/common/darktable.h:136:58: note: expanded from macro 'CLAMPS'
#define CLAMPS(A, L, H) ((A) > (L) ? ((A) < (H) ? (A) : (H)) : (L))
  • Loading branch information
LebedevRI committed Apr 8, 2016
1 parent e08d0a0 commit 0800e4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/mipmap_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void dt_mipmap_cache_init(dt_mipmap_cache_t *cache)
// we want at least 100MB, and consider 8G just still reasonable.
int64_t cache_memory = dt_conf_get_int64("cache_memory");
int worker_threads = dt_conf_get_int("worker_threads");
size_t max_mem = CLAMPS(cache_memory, 100u << 20, ((uint64_t)8) << 30);
size_t max_mem = CLAMPS(cache_memory, 100u << 20, ((size_t)8) << 30);
const uint32_t parallel = CLAMP(worker_threads, 1, 8);

// Fixed sizes for the thumbnail mip levels, selected for coverage of most screen sizes
Expand Down

0 comments on commit 0800e4d

Please sign in to comment.