[Beignet] [PATCH 2/2] fix warning when egl is not there

Lu Guanqun guanqun.lu at intel.com
Sun Aug 18 23:23:56 PDT 2013


[ 32%] Building CXX object utests/CMakeFiles/utests.dir/utest_helper.cpp.o
/home/q/beignet.git/utests/utest_helper.cpp: In function ‘int cl_ocl_init()’:
/home/q/beignet.git/utests/utest_helper.cpp:314:8: warning: variable ‘hasGLExt’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
---
 utests/utest_helper.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index 9069db2..297c6a3 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -343,8 +343,8 @@ cl_ocl_init(void)
     }
   }
 
-#ifdef HAS_EGL
   if (hasGLExt) {
+#ifdef HAS_EGL
     int i = 0;
     props = new cl_context_properties[7];
     props[i++] = CL_CONTEXT_PLATFORM;
@@ -356,8 +356,8 @@ cl_ocl_init(void)
       props[i++] = (cl_context_properties)eglGetCurrentContext();
     }
     props[i++] = 0;
-  }
 #endif
+  }
   /* Now create a context */
   ctx = clCreateContext(props, 1, &device, NULL, NULL, &status);
   if (status != CL_SUCCESS) {
-- 
1.7.9.5



More information about the Beignet mailing list