Fix comparison in if() check.

Submitted by Koop Mast on July 12, 2015, 7:49 p.m.

Details

Message ID 1436730597-79683-1-git-send-email-kwm@rainbow-runner.nl
State New
Headers show

Not browsing as part of any series.

Commit Message

Koop Mast July 12, 2015, 7:49 p.m.
std::strstr() returns a char * or NULL if the substring
isn't found not false.

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

Patch hide | download patch | download mbox

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;
   }

Comments

LGTM, will push it later, thanks.

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Koop Mast

> Sent: Monday, July 13, 2015 03:50

> To: beignet@lists.freedesktop.org

> Cc: Koop Mast

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

> 

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

> 

> Signed-off-by: Koop Mast <kwm@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

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> http://lists.freedesktop.org/mailman/listinfo/beignet