[Beignet] [PATCH] fix left shift warnings in utests

Lu Guanqun guanqun.lu at intel.com
Sun Aug 18 21:29:17 PDT 2013


We should use the explicit 64 bit types. Otherwise we would have warnings.

Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
---
 utests/compiler_long_2.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utests/compiler_long_2.cpp b/utests/compiler_long_2.cpp
index e3c6640..6c5da4b 100644
--- a/utests/compiler_long_2.cpp
+++ b/utests/compiler_long_2.cpp
@@ -21,8 +21,8 @@ void compiler_long_2(void)
 
   // Run random tests
   for (int32_t i = 0; 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();
   }
   src1[4] = 1;
   OCL_MAP_BUFFER(0);
-- 
1.7.9.5



More information about the Beignet mailing list