summaryrefslogtreecommitdiff
path: root/utests/utest_helper.cpp
diff options
context:
space:
mode:
authorLv Meng <meng.lv@intel.com>2014-08-15 09:16:33 +0800
committerYang Rong <rong.r.yang@intel.com>2014-08-19 14:06:08 +0800
commit7197ece4b83162b2f1fea84c6fda040febe7c89f (patch)
treeef5eee41fdc85bd25b0e3bdaabf9bec0f26fc1b6 /utests/utest_helper.cpp
parentb9334672bfeab9247ff92d0051d93b98b8e3da39 (diff)
downloadbeignet-7197ece4b83162b2f1fea84c6fda040febe7c89f.tar.gz
Fix compile warnings for CLANG compiler
1.fix data structure redefine warnings. 2.fix 'data' with variable sized type 'union<*>' not at the end of a class warning(in immediate.hpp). 3.fix implicitly conversion warning. 4.fix explicitly assigning a variable type warning. 5.fix comparison of unsigned expression < 0 is always false warning(in cl_api.c). Signed-off-by: Lv Meng <meng.lv@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
Diffstat (limited to 'utests/utest_helper.cpp')
-rw-r--r--utests/utest_helper.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index 90cd11ed..b57b8dc0 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;
+ }
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);