diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2016-09-07 14:13:14 +0200 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-10-21 12:36:14 +0800 |
commit | 374c4e103670e0563647a418ed0f8c5d24931d20 (patch) | |
tree | 7801dc8084249090105849284292f7594064d3d3 | |
parent | cd95c07cc06edaa6522775d108c3b010f6d02da4 (diff) |
Fix shift-overflow warning
Wrap toMB constant in UINT64_C to avoid the warning:
src/cl_device_id.c:743:49: warning: result of
‘1152921504606846975l << 20’
requires 81 bits to represent, but ‘long int’ only has 64 bits
[-Wshift-overflow=]
#define toMB(size) (size)&((0xfffffffffffffff)<<20)
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | src/cl_device_id.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cl_device_id.c b/src/cl_device_id.c index 39132234..a4f51329 100644 --- a/src/cl_device_id.c +++ b/src/cl_device_id.c @@ -757,7 +757,7 @@ kbl_gt4_break: /* Apply any driver-dependent updates to the device info */ cl_driver_update_device_info(ret); - #define toMB(size) (size)&(0xfffffffffffffff<<20) + #define toMB(size) (size)&(UINT64_C(0xfffffffffffffff)<<20) /* Get the global_mem_size and max_mem_alloc size from * driver, system ram and hardware*/ struct sysinfo info; |