Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed some minor compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 20, 2012
1 parent 524d1ea commit 583d19f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
23 changes: 11 additions & 12 deletions src/file/SDL_rwops.c
Expand Up @@ -438,9 +438,6 @@ SDL_RWops *
SDL_RWFromFile(const char *file, const char *mode)
{
SDL_RWops *rwops = NULL;
#ifdef HAVE_STDIO_H
FILE *fp = NULL;
#endif
if (!file || !*file || !mode || !*mode) {
SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
return NULL;
Expand Down Expand Up @@ -472,15 +469,17 @@ SDL_RWFromFile(const char *file, const char *mode)
rwops->close = windows_file_close;

#elif HAVE_STDIO_H
#ifdef __APPLE__
fp = SDL_OpenFPFromBundleOrFallback(file, mode);
#else
fp = fopen(file, mode);
#endif
if (fp == NULL) {
SDL_SetError("Couldn't open %s", file);
} else {
rwops = SDL_RWFromFP(fp, 1);
{
#ifdef __APPLE__
FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode);
#else
FILE *fp = fopen(file, mode);
#endif
if (fp == NULL) {
SDL_SetError("Couldn't open %s", file);
} else {
rwops = SDL_RWFromFP(fp, 1);
}
}
#else
SDL_SetError("SDL not compiled with stdio support");
Expand Down
3 changes: 2 additions & 1 deletion src/render/software/SDL_rotate.h
Expand Up @@ -3,4 +3,5 @@
#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 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);

2 changes: 2 additions & 0 deletions src/video/x11/SDL_x11opengl.c
Expand Up @@ -95,8 +95,10 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy,

#ifndef 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
#endif
#endif

#ifndef GLX_EXT_swap_control
#define GLX_SWAP_INTERVAL_EXT 0x20F1
Expand Down
17 changes: 14 additions & 3 deletions src/video/x11/SDL_x11xinput2.c
Expand Up @@ -29,16 +29,19 @@

#define MAX_AXIS 16

#if SDL_VIDEO_DRIVER_X11_XINPUT2
static int xinput2_initialized = 0;

#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
static int xinput2_multitouch_supported = 0;
/* Opcode returned XQueryExtension
#endif

/* Opcode returned XQueryExtension
* It will be used in event processing
* to know that the event came from
* this extension */
static int xinput2_opcode;


#if SDL_VIDEO_DRIVER_X11_XINPUT2
static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len,
double *output_values,int output_values_len) {
int i = 0,z = 0;
Expand Down Expand Up @@ -237,12 +240,20 @@ X11_Xinput2SelectTouch(_THIS, SDL_Window *window) {

int
X11_Xinput2IsInitialized() {
#if SDL_VIDEO_DRIVER_X11_XINPUT2
return xinput2_initialized;
#else
return 0;
#endif
}

int
X11_Xinput2IsMutitouchSupported() {
#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
return xinput2_initialized && xinput2_multitouch_supported;
#else
return 0;
#endif
}

#endif /* SDL_VIDEO_DRIVER_X11 */
Expand Down

0 comments on commit 583d19f

Please sign in to comment.