[Piglit] [PATCH] glew: Move declaration before code.

Vinson Lee vlee at freedesktop.org
Fri Jan 27 22:04:20 PST 2012


Fixes this GCC warning on Mac OS X.
glew.c: In function ‘NSGLGetProcAddress’:
glew.c:112: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/glew.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tests/util/glew.c b/tests/util/glew.c
index 4130c53..5387940 100644
--- a/tests/util/glew.c
+++ b/tests/util/glew.c
@@ -104,12 +104,13 @@ void* dlGetProcAddress (const GLubyte* name)
 void* NSGLGetProcAddress (const GLubyte *name)
 {
   static void* image = NULL;
+  void* addr;
   if (NULL == image) 
   {
     image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
   }
   if( !image ) return NULL;
-  void* addr = dlsym(image, (const char*)name);
+  addr = dlsym(image, (const char*)name);
   if( addr ) return addr;
 #ifdef GLEW_APPLE_GLX
   return dlGetProcAddress( name ); // try next for glx symbols
-- 
1.7.8.3



More information about the Piglit mailing list