[Beignet] [PATCH 1/2] fix left shift warning

Zhigang Gong zhigang.gong at linux.intel.com
Mon Aug 19 00:50:52 PDT 2013


LGTM, pushed, thanks for the patch.

On Mon, Aug 19, 2013 at 02:23:55PM +0800, Lu Guanqun wrote:
> /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 at intel.com>
> ---
>  utests/compiler_long.cpp |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utests/compiler_long.cpp b/utests/compiler_long.cpp
> index fad2744..d7e1517 100644
> --- a/utests/compiler_long.cpp
> +++ b/utests/compiler_long.cpp
> @@ -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);
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list