fix left shift warning
authorLu Guanqun <guanqun.lu@intel.com>
Mon, 19 Aug 2013 06:23:55 +0000 (14:23 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Mon, 19 Aug 2013 07:52:07 +0000 (15:52 +0800)
/home/q/beignet.git/utests/compiler_long.cpp: In function ‘void compiler_long()’:
/home/q/beignet.git/utests/compiler_long.cpp:33:32: warning: left shift count >= width of type [enabled by default]
/home/q/beignet.git/utests/compiler_long.cpp:34:32: warning: left shift count >= width of type [enabled by default]

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
utests/compiler_long.cpp

index fad2744..d7e1517 100644 (file)
@@ -30,8 +30,8 @@ void compiler_long(void)
   src1[7] = -2L,                  src2[7] = -1L;
   src1[8] = 0,                    src2[8] = 0x8000000000000000UL;
   for (int32_t i = 9; i < (int32_t) n; ++i) {
-    src1[i] = ((long)rand() << 32) + rand();
-    src2[i] = ((long)rand() << 32) + rand();
+    src1[i] = ((int64_t)rand() << 32) + rand();
+    src2[i] = ((int64_t)rand() << 32) + rand();
   }
   OCL_MAP_BUFFER(0);
   OCL_MAP_BUFFER(1);