[Piglit] [PATCH 08/18] util/wfl: Replace strcmp() with streq()
Dylan Baker
baker.dylan.c at gmail.com
Fri Jul 11 11:32:28 PDT 2014
From: Chad Versace <chad.versace at linux.intel.com>
Because `strcmp(...) == 0` is crufty.
I generated this patch with the coccinelle patch below:
@@
expression E;
@@
-strcmp(env, E) == 0
+streq(env, E)
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
tests/util/piglit-framework-gl/piglit_wfl_framework.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 818625b..6476aa3 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -69,7 +69,7 @@ piglit_wfl_framework_choose_platform(const struct piglit_gl_test_config *test_co
#endif
}
- else if (strcmp(env, "gbm") == 0) {
+ else if (streq(env, "gbm")) {
#ifdef PIGLIT_HAS_GBM
return WAFFLE_PLATFORM_GBM;
#else
@@ -79,7 +79,7 @@ piglit_wfl_framework_choose_platform(const struct piglit_gl_test_config *test_co
#endif
}
- else if (strcmp(env, "glx") == 0) {
+ else if (streq(env, "glx")) {
#ifdef PIGLIT_HAS_GLX
return WAFFLE_PLATFORM_GLX;
#else
@@ -89,7 +89,7 @@ piglit_wfl_framework_choose_platform(const struct piglit_gl_test_config *test_co
#endif
}
- else if (strcmp(env, "x11_egl") == 0) {
+ else if (streq(env, "x11_egl")) {
#if defined(PIGLIT_HAS_X11) && defined(PIGLIT_HAS_EGL)
return WAFFLE_PLATFORM_X11_EGL;
#else
@@ -99,7 +99,7 @@ piglit_wfl_framework_choose_platform(const struct piglit_gl_test_config *test_co
#endif
}
- else if (strcmp(env, "wayland") == 0) {
+ else if (streq(env, "wayland")) {
#ifdef PIGLIT_HAS_WAYLAND
return WAFFLE_PLATFORM_WAYLAND;
#else
--
2.0.0
More information about the Piglit
mailing list