Fixed some minor compiler warnings.

--HG--
extra : rebase_source : 9466732b4e5ab87e92e8eb9e2377aa5405bdc23b
This commit is contained in:
Ryan C. Gordon 2012-07-20 13:33:15 -04:00
parent abaa69bf81
commit 82ebf2d4ff
4 changed files with 29 additions and 16 deletions

View file

@ -438,9 +438,6 @@ SDL_RWops *
SDL_RWFromFile(const char *file, const char *mode) SDL_RWFromFile(const char *file, const char *mode)
{ {
SDL_RWops *rwops = NULL; SDL_RWops *rwops = NULL;
#ifdef HAVE_STDIO_H
FILE *fp = NULL;
#endif
if (!file || !*file || !mode || !*mode) { if (!file || !*file || !mode || !*mode) {
SDL_SetError("SDL_RWFromFile(): No file or no mode specified"); SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
return NULL; return NULL;
@ -472,15 +469,17 @@ SDL_RWFromFile(const char *file, const char *mode)
rwops->close = windows_file_close; rwops->close = windows_file_close;
#elif HAVE_STDIO_H #elif HAVE_STDIO_H
#ifdef __APPLE__ {
fp = SDL_OpenFPFromBundleOrFallback(file, mode); #ifdef __APPLE__
#else FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode);
fp = fopen(file, mode); #else
#endif FILE *fp = fopen(file, mode);
if (fp == NULL) { #endif
SDL_SetError("Couldn't open %s", file); if (fp == NULL) {
} else { SDL_SetError("Couldn't open %s", file);
rwops = SDL_RWFromFP(fp, 1); } else {
rwops = SDL_RWFromFP(fp, 1);
}
} }
#else #else
SDL_SetError("SDL not compiled with stdio support"); SDL_SetError("SDL not compiled with stdio support");

View file

@ -3,4 +3,5 @@
#endif #endif
extern SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle); extern SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle);
extern void _rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle); extern void _rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle);

View file

@ -95,8 +95,10 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy,
#ifndef GLX_EXT_create_context_es2_profile #ifndef GLX_EXT_create_context_es2_profile
#define GLX_EXT_create_context_es2_profile #define GLX_EXT_create_context_es2_profile
#ifndef GLX_CONTEXT_ES2_PROFILE_BIT_EXT
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000002 #define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000002
#endif #endif
#endif
#ifndef GLX_EXT_swap_control #ifndef GLX_EXT_swap_control
#define GLX_SWAP_INTERVAL_EXT 0x20F1 #define GLX_SWAP_INTERVAL_EXT 0x20F1

View file

@ -29,16 +29,19 @@
#define MAX_AXIS 16 #define MAX_AXIS 16
#if SDL_VIDEO_DRIVER_X11_XINPUT2
static int xinput2_initialized = 0; static int xinput2_initialized = 0;
#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
static int xinput2_multitouch_supported = 0; static int xinput2_multitouch_supported = 0;
/* Opcode returned XQueryExtension #endif
/* Opcode returned XQueryExtension
* It will be used in event processing * It will be used in event processing
* to know that the event came from * to know that the event came from
* this extension */ * this extension */
static int xinput2_opcode; static int xinput2_opcode;
#if SDL_VIDEO_DRIVER_X11_XINPUT2
static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len, static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len,
double *output_values,int output_values_len) { double *output_values,int output_values_len) {
int i = 0,z = 0; int i = 0,z = 0;
@ -237,12 +240,20 @@ X11_Xinput2SelectTouch(_THIS, SDL_Window *window) {
int int
X11_Xinput2IsInitialized() { X11_Xinput2IsInitialized() {
#if SDL_VIDEO_DRIVER_X11_XINPUT2
return xinput2_initialized; return xinput2_initialized;
#else
return 0;
#endif
} }
int int
X11_Xinput2IsMutitouchSupported() { X11_Xinput2IsMutitouchSupported() {
#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
return xinput2_initialized && xinput2_multitouch_supported; return xinput2_initialized && xinput2_multitouch_supported;
#else
return 0;
#endif
} }
#endif /* SDL_VIDEO_DRIVER_X11 */ #endif /* SDL_VIDEO_DRIVER_X11 */