From 026a20d0a52fc7922f694171616f0291c9b0514c Mon Sep 17 00:00:00 2001 From: Sylvain Beucler Date: Sat, 21 Apr 2012 19:04:02 +0000 Subject: [PATCH] Fix a few more compiler warnings git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1259 7f0cb862-5218-0410-a997-914c9d46530a --- CMakeLists.txt | 1 + src/egl/fg_state_egl.c | 2 +- src/fg_init.h | 34 ++++++++++++++++++++++++++++++++++ src/x11/fg_state_x11.c | 2 ++ src/x11/fg_state_x11_glx.c | 5 +++-- src/x11/fg_state_x11_glx.h | 35 +++++++++++++++++++++++++++++++++++ src/x11/fg_window_x11_glx.c | 2 +- 7 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/fg_init.h create mode 100644 src/x11/fg_state_x11_glx.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 39febb2..8b3c49b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,6 +145,7 @@ ELSE() src/x11/fg_internal_x11_glx.h src/x11/fg_display_x11_glx.c src/x11/fg_state_x11_glx.c + src/x11/fg_state_x11_glx.h src/x11/fg_window_x11_glx.c src/x11/fg_window_x11_glx.h ) diff --git a/src/egl/fg_state_egl.c b/src/egl/fg_state_egl.c index 2890d00..59fc9c9 100644 --- a/src/egl/fg_state_egl.c +++ b/src/egl/fg_state_egl.c @@ -33,7 +33,7 @@ static int fgPlatformGetConfig( int attribute ) { int returnValue = 0; - int result; /* Not checked */ + int result __fg_unused; /* Not checked */ if( fgStructure.CurrentWindow ) result = eglGetConfigAttrib( fgDisplay.pDisplay.egl.Display, diff --git a/src/fg_init.h b/src/fg_init.h new file mode 100644 index 0000000..a9fdb17 --- /dev/null +++ b/src/fg_init.h @@ -0,0 +1,34 @@ +/* + * fg_init.h + * + * Various freeglut initialization functions. + * + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. + * Written by Pawel W. Olszta, + * Creation date: Thu Dec 2 1999 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __FG_INIT_H__ +#define __FG_INIT_H__ + +extern void fghCloseInputDevices(void); +extern void fgDeinitialize(void); + +#endif diff --git a/src/x11/fg_state_x11.c b/src/x11/fg_state_x11.c index cb55109..3aa19b1 100644 --- a/src/x11/fg_state_x11.c +++ b/src/x11/fg_state_x11.c @@ -29,6 +29,8 @@ #include "fg_internal.h" #ifdef EGL_VERSION_1_0 #include "egl/fg_state_egl.h" +#else +#include "x11/fg_state_x11_glx.h" #endif int fgPlatformGlutDeviceGet ( GLenum eWhat ) diff --git a/src/x11/fg_state_x11_glx.c b/src/x11/fg_state_x11_glx.c index bd2b35e..4688196 100644 --- a/src/x11/fg_state_x11_glx.c +++ b/src/x11/fg_state_x11_glx.c @@ -27,6 +27,7 @@ #include #include "fg_internal.h" +#include "x11/fg_window_x11_glx.h" /* * Queries the GL context about some attributes @@ -34,7 +35,7 @@ int fgPlatformGetConfig( int attribute ) { int returnValue = 0; - int result; /* Not checked */ + int result __fg_unused; /* Not checked */ if( fgStructure.CurrentWindow ) result = glXGetFBConfigAttrib( fgDisplay.pDisplay.Display, @@ -170,7 +171,7 @@ int *fgPlatformGlutGetModeValues(GLenum eWhat, int *size) if (fbconfigArray != NULL) { int * temp_array; - int result; /* Returned by glXGetFBConfigAttrib. Not checked. */ + int result __fg_unused; /* Returned by glXGetFBConfigAttrib. Not checked. */ int previous_value; int i; diff --git a/src/x11/fg_state_x11_glx.h b/src/x11/fg_state_x11_glx.h new file mode 100644 index 0000000..c6349a2 --- /dev/null +++ b/src/x11/fg_state_x11_glx.h @@ -0,0 +1,35 @@ +/* + * fg_state_x11_glx.c + * + * X11-specific freeglut state query methods. + * + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. + * Written by Pawel W. Olszta, + * Copied for Platform code by Evan Felix + * Creation date: Thur Feb 2 2012 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __FG_STATE_X11_GLX_H__ +#define __FG_STATE_X11_GLX_H__ + +int fgPlatformGetConfig(int attribute); +int fghPlatformGlutGetGLX(GLenum eWhat); + +#endif diff --git a/src/x11/fg_window_x11_glx.c b/src/x11/fg_window_x11_glx.c index 2efe7e8..bbabb75 100644 --- a/src/x11/fg_window_x11_glx.c +++ b/src/x11/fg_window_x11_glx.c @@ -115,7 +115,7 @@ int fghChooseConfig(GLXFBConfig* fbconfig) if (fbconfigArray != NULL) { - int result; /* Returned by glXGetFBConfigAttrib, not checked. */ + int result __fg_unused; /* Returned by glXGetFBConfigAttrib, not checked. */ if( wantIndexedMode ) -- 1.7.10.4