[Beignet] [PATCH] [PATCH_V3]Fix compile warnings for CLANG compiler
Song, Ruiling
ruiling.song at intel.com
Thu Aug 14 01:56:35 PDT 2014
Two comments below, other part looks good.
-DEF_TEMPLATE(int8_t, CHAR)
-DEF_TEMPLATE(int16_t, SHRT)
-DEF_TEMPLATE(int32_t, INT)
-//DEF_TEMPLATE(int64_t, LONG)
-
+DEF_TYPE(int8_t,CHAR)
+DEF_TYPE(int16_t,CHAR)
+DEF_UTYPE(int8_t,CHAR)
+DEF_UTYPE(int16_t,CHAR)
+DEF_UTYPE(int32_t,CHAR)
There seems a hidden bug in beignet, add_sat is not totally correct for some input value. I will send a patch to fix it. And then the warning will disappear.
template<typename T>
void test(const char *kernel_name)
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index 90cd11e..76df01f 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -537,12 +537,19 @@ int *cl_read_bmp(const char *filename, int *width, int *height)
char magic[2];
int ret;
ret = fread(&magic[0], 1, 2, fp);
- ret = ret;
- assert(2 == ret);
+ if(2 == ret){
+ fclose(fp);
+ free(bmppath);
+ return NULL;
+ }
I am sorry I misleading you. here it should be if (2 != ret), right? Same problem with below code.
assert(magic[0] == 'B' && magic[1] == 'M');
ret = fread(&hdr, sizeof(hdr), 1, fp);
- assert(1 == ret);
+ if(1 == ret){
+ fclose(fp);
+ free(bmppath);
+ return NULL;
+ }
assert(hdr.width > 0 && hdr.height > 0 && hdr.nplanes == 1 && hdr.compression == 0);
--
1.8.3.2
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list