瀏覽代碼

Do not compare a pointer to the integer value "0".

[Coccinelle] Zero-testing a pointer-typed value.
http://coccinelle.lip6.fr/rules/badzero.cocci
Cyril Roelandt 13 年之前
父節點
當前提交
bc650b3ddb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/drivers/opencl/driver_opencl_utils.c

+ 1 - 1
src/drivers/opencl/driver_opencl_utils.c

@@ -137,7 +137,7 @@ char *_starpu_opencl_load_program_source(const char *filename)
         char        c;
 
         fh = fopen(filename, "r");
-        if (fh == 0)
+        if (!fh)
                 return NULL;
 
         stat(filename, &statbuf);