From d554cb9ab1d8dcc200a5f263631834c5e15b8fe5 Mon Sep 17 00:00:00 2001 From: beuc Date: Sat, 21 Apr 2012 19:04:02 +0000 Subject: [PATCH] Fix a few more compiler warnings git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1259 7f0cb862-5218-0410-a997-914c9d46530a --- .gitattributes | 2 ++ freeglut/freeglut/CMakeLists.txt | 1 + freeglut/freeglut/src/egl/fg_state_egl.c | 2 +- freeglut/freeglut/src/fg_init.h | 34 ++++++++++++++++++ freeglut/freeglut/src/x11/fg_state_x11.c | 2 ++ freeglut/freeglut/src/x11/fg_state_x11_glx.c | 5 +-- freeglut/freeglut/src/x11/fg_state_x11_glx.h | 35 +++++++++++++++++++ freeglut/freeglut/src/x11/fg_window_x11_glx.c | 2 +- 8 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 freeglut/freeglut/src/fg_init.h create mode 100644 freeglut/freeglut/src/x11/fg_state_x11_glx.h diff --git a/.gitattributes b/.gitattributes index 5726937..477f6f5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -99,6 +99,7 @@ freeglut/freeglut/src/fg_geometry.c svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/fg_gl2.c -text freeglut/freeglut/src/fg_gl2.h -text freeglut/freeglut/src/fg_init.c svn_keywords=Author+Date+Id+Revision +freeglut/freeglut/src/fg_init.h -text freeglut/freeglut/src/fg_input_devices.c svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/fg_internal.h svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/fg_joystick.c svn_keywords=Author+Date+Id+Revision @@ -150,6 +151,7 @@ freeglut/freeglut/src/x11/fg_menu_x11.c svnc_svn_005fkeywords=Author+Date+Id+Rev freeglut/freeglut/src/x11/fg_spaceball_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision freeglut/freeglut/src/x11/fg_state_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision freeglut/freeglut/src/x11/fg_state_x11_glx.c -text +freeglut/freeglut/src/x11/fg_state_x11_glx.h -text freeglut/freeglut/src/x11/fg_structure_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision freeglut/freeglut/src/x11/fg_window_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision freeglut/freeglut/src/x11/fg_window_x11_glx.c -text diff --git a/freeglut/freeglut/CMakeLists.txt b/freeglut/freeglut/CMakeLists.txt index 39febb2..8b3c49b 100644 --- a/freeglut/freeglut/CMakeLists.txt +++ b/freeglut/freeglut/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/freeglut/freeglut/src/egl/fg_state_egl.c b/freeglut/freeglut/src/egl/fg_state_egl.c index 2890d00..59fc9c9 100644 --- a/freeglut/freeglut/src/egl/fg_state_egl.c +++ b/freeglut/freeglut/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/freeglut/freeglut/src/fg_init.h b/freeglut/freeglut/src/fg_init.h new file mode 100644 index 0000000..a9fdb17 --- /dev/null +++ b/freeglut/freeglut/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/freeglut/freeglut/src/x11/fg_state_x11.c b/freeglut/freeglut/src/x11/fg_state_x11.c index cb55109..3aa19b1 100644 --- a/freeglut/freeglut/src/x11/fg_state_x11.c +++ b/freeglut/freeglut/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/freeglut/freeglut/src/x11/fg_state_x11_glx.c b/freeglut/freeglut/src/x11/fg_state_x11_glx.c index bd2b35e..4688196 100644 --- a/freeglut/freeglut/src/x11/fg_state_x11_glx.c +++ b/freeglut/freeglut/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/freeglut/freeglut/src/x11/fg_state_x11_glx.h b/freeglut/freeglut/src/x11/fg_state_x11_glx.h new file mode 100644 index 0000000..c6349a2 --- /dev/null +++ b/freeglut/freeglut/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/freeglut/freeglut/src/x11/fg_window_x11_glx.c b/freeglut/freeglut/src/x11/fg_window_x11_glx.c index 2efe7e8..bbabb75 100644 --- a/freeglut/freeglut/src/x11/fg_window_x11_glx.c +++ b/freeglut/freeglut/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 )