[Beignet] [PATCH] Fix comparison in if() check.

Koop Mast kwm at rainbow-runner.nl
Sun Jul 12 12:49:57 PDT 2015


std::strstr() returns a char * or NULL if the substring
isn't found not false.

Signed-off-by: Koop Mast <kwm at rainbow-runner.nl>
---
 utests/compiler_half.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utests/compiler_half.cpp b/utests/compiler_half.cpp
index ce0f7da..e8ed286 100644
--- a/utests/compiler_half.cpp
+++ b/utests/compiler_half.cpp
@@ -115,7 +115,7 @@ static int check_half_device(void)
   if (!param_value.empty())
     extStr = std::string(&param_value.front(), param_value_size-1);
 
-  if (std::strstr(extStr.c_str(), "cl_khr_fp16") == false) {
+  if (std::strstr(extStr.c_str(), "cl_khr_fp16") == NULL) {
     printf("No cl_khr_fp16, Skip!");
     return 0;
   }
-- 
2.4.5



More information about the Beignet mailing list