Skip to content
Permalink
Browse files

Patch from Sylvain to fix clang warnings

  • Loading branch information
slouken committed Nov 14, 2016
1 parent c13a077 commit 57d01d7d6774fd352cc7d0a7d6f749c5db28d2b7
Showing with 285 additions and 167 deletions.
  1. +3 −3 include/SDL_test_assert.h
  2. +14 −14 include/SDL_test_fuzzer.h
  3. +11 −11 include/SDL_test_images.h
  4. +1 −4 src/SDL.c
  5. +0 −30 src/audio/SDL_audio.c
  6. +72 −0 src/audio/SDL_sysaudio.h
  7. +4 −4 src/core/linux/SDL_ime.h
  8. +1 −1 src/core/linux/SDL_udev.c
  9. +4 −4 src/events/SDL_gesture.c
  10. +2 −0 src/events/SDL_mouse.c
  11. +1 −1 src/events/SDL_touch.c
  12. +1 −1 src/haptic/SDL_haptic.c
  13. +1 −1 src/haptic/SDL_syshaptic.h
  14. +9 −9 src/joystick/SDL_gamecontroller.c
  15. +2 −2 src/joystick/SDL_sysjoystick.h
  16. +4 −3 src/joystick/linux/SDL_sysjoystick.c
  17. +1 −12 src/power/SDL_power.c
  18. +68 −0 src/power/SDL_syspower.h
  19. +1 −0 src/power/linux/SDL_syspower.c
  20. +1 −1 src/render/opengl/SDL_shaders_gl.h
  21. +1 −1 src/render/opengles/SDL_render_gles.c
  22. +4 −2 src/render/opengles2/SDL_render_gles2.c
  23. +1 −1 src/render/software/SDL_blendfillrect.c
  24. +1 −1 src/render/software/SDL_blendline.c
  25. +3 −5 src/render/software/SDL_blendpoint.c
  26. +1 −1 src/render/software/SDL_rotate.c
  27. +2 −1 src/stdlib/SDL_string.c
  28. +2 −1 src/test/SDL_test_crc32.c
  29. +2 −2 src/test/SDL_test_fuzzer.c
  30. +20 −18 src/test/SDL_test_harness.c
  31. +3 −3 src/test/SDL_test_imageBlit.c
  32. +5 −5 src/test/SDL_test_imageBlitBlend.c
  33. +1 −1 src/test/SDL_test_imageFace.c
  34. +1 −1 src/test/SDL_test_imagePrimitives.c
  35. +1 −1 src/test/SDL_test_imagePrimitivesBlend.c
  36. +1 −1 src/test/SDL_test_log.c
  37. +1 −1 src/thread/SDL_systhread.h
  38. +1 −1 src/thread/SDL_thread_c.h
  39. +1 −1 src/thread/pthread/SDL_syscond.c
  40. +1 −0 src/thread/pthread/SDL_systls.c
  41. +1 −0 src/timer/unix/SDL_systimer.c
  42. +2 −0 src/video/SDL_RLEaccel.c
  43. +8 −6 src/video/SDL_blit_1.c
  44. +2 −2 src/video/SDL_bmp.c
  45. +6 −2 src/video/SDL_video.c
  46. +1 −1 src/video/x11/SDL_x11events.c
  47. +1 −0 src/video/x11/SDL_x11messagebox.c
  48. +6 −6 src/video/x11/SDL_x11modes.c
  49. +3 −0 src/video/x11/SDL_x11opengl.c
  50. +1 −1 src/video/x11/SDL_x11window.c
@@ -80,20 +80,20 @@ void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,
/**
* \brief Resets the assert summary counters to zero.
*/
void SDLTest_ResetAssertSummary();
void SDLTest_ResetAssertSummary(void);

/**
* \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
*/
void SDLTest_LogAssertSummary();
void SDLTest_LogAssertSummary(void);


/**
* \brief Converts the current assert summary state to a test result.
*
* \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
*/
int SDLTest_AssertSummaryToTestResult();
int SDLTest_AssertSummaryToTestResult(void);

#ifdef __cplusplus
}
@@ -68,82 +68,82 @@ void SDLTest_FuzzerInit(Uint64 execKey);
*
* \returns Generated integer
*/
Uint8 SDLTest_RandomUint8();
Uint8 SDLTest_RandomUint8(void);

/**
* Returns a random Sint8
*
* \returns Generated signed integer
*/
Sint8 SDLTest_RandomSint8();
Sint8 SDLTest_RandomSint8(void);


/**
* Returns a random Uint16
*
* \returns Generated integer
*/
Uint16 SDLTest_RandomUint16();
Uint16 SDLTest_RandomUint16(void);

/**
* Returns a random Sint16
*
* \returns Generated signed integer
*/
Sint16 SDLTest_RandomSint16();
Sint16 SDLTest_RandomSint16(void);


/**
* Returns a random integer
*
* \returns Generated integer
*/
Sint32 SDLTest_RandomSint32();
Sint32 SDLTest_RandomSint32(void);


/**
* Returns a random positive integer
*
* \returns Generated integer
*/
Uint32 SDLTest_RandomUint32();
Uint32 SDLTest_RandomUint32(void);

/**
* Returns random Uint64.
*
* \returns Generated integer
*/
Uint64 SDLTest_RandomUint64();
Uint64 SDLTest_RandomUint64(void);


/**
* Returns random Sint64.
*
* \returns Generated signed integer
*/
Sint64 SDLTest_RandomSint64();
Sint64 SDLTest_RandomSint64(void);

/**
* \returns random float in range [0.0 - 1.0[
*/
float SDLTest_RandomUnitFloat();
float SDLTest_RandomUnitFloat(void);

/**
* \returns random double in range [0.0 - 1.0[
*/
double SDLTest_RandomUnitDouble();
double SDLTest_RandomUnitDouble(void);

/**
* \returns random float.
*
*/
float SDLTest_RandomFloat();
float SDLTest_RandomFloat(void);

/**
* \returns random double.
*
*/
double SDLTest_RandomDouble();
double SDLTest_RandomDouble(void);

/**
* Returns a random boundary value for Uint8 within the given boundaries.
@@ -338,7 +338,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
*
* \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
*/
char * SDLTest_RandomAsciiString();
char * SDLTest_RandomAsciiString(void);


/**
@@ -371,7 +371,7 @@ char * SDLTest_RandomAsciiStringOfSize(int size);
/**
* Returns the invocation count for the fuzzer since last ...FuzzerInit.
*/
int SDLTest_GetFuzzerInvocationCount();
int SDLTest_GetFuzzerInvocationCount(void);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
@@ -55,17 +55,17 @@ typedef struct SDLTest_SurfaceImage_s {
} SDLTest_SurfaceImage_t;

/* Test images */
SDL_Surface *SDLTest_ImageBlit();
SDL_Surface *SDLTest_ImageBlitColor();
SDL_Surface *SDLTest_ImageBlitAlpha();
SDL_Surface *SDLTest_ImageBlitBlendAdd();
SDL_Surface *SDLTest_ImageBlitBlend();
SDL_Surface *SDLTest_ImageBlitBlendMod();
SDL_Surface *SDLTest_ImageBlitBlendNone();
SDL_Surface *SDLTest_ImageBlitBlendAll();
SDL_Surface *SDLTest_ImageFace();
SDL_Surface *SDLTest_ImagePrimitives();
SDL_Surface *SDLTest_ImagePrimitivesBlend();
SDL_Surface *SDLTest_ImageBlit(void);
SDL_Surface *SDLTest_ImageBlitColor(void);
SDL_Surface *SDLTest_ImageBlitAlpha(void);
SDL_Surface *SDLTest_ImageBlitBlendAdd(void);
SDL_Surface *SDLTest_ImageBlitBlend(void);
SDL_Surface *SDLTest_ImageBlitBlendMod(void);
SDL_Surface *SDLTest_ImageBlitBlendNone(void);
SDL_Surface *SDLTest_ImageBlitBlendAll(void);
SDL_Surface *SDLTest_ImageFace(void);
SDL_Surface *SDLTest_ImagePrimitives(void);
SDL_Surface *SDLTest_ImagePrimitivesBlend(void);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
@@ -36,10 +36,7 @@

/* Initialization/Cleanup routines */
#if !SDL_TIMERS_DISABLED
extern int SDL_TimerInit(void);
extern void SDL_TimerQuit(void);
extern void SDL_TicksInit(void);
extern void SDL_TicksQuit(void);
# include "timer/SDL_timer_c.h"
#endif
#if SDL_VIDEO_DRIVER_WINDOWS
extern int SDL_HelperWindowCreate(void);
@@ -33,36 +33,6 @@
static SDL_AudioDriver current_audio;
static SDL_AudioDevice *open_devices[16];

/*
* Not all of these will be compiled and linked in, but it's convenient
* to have a complete list here and saves yet-another block of #ifdefs...
* Please see bootstrap[], below, for the actual #ifdef mess.
*/
extern AudioBootStrap PULSEAUDIO_bootstrap;
extern AudioBootStrap ALSA_bootstrap;
extern AudioBootStrap SNDIO_bootstrap;
extern AudioBootStrap BSD_AUDIO_bootstrap;
extern AudioBootStrap DSP_bootstrap;
extern AudioBootStrap QSAAUDIO_bootstrap;
extern AudioBootStrap SUNAUDIO_bootstrap;
extern AudioBootStrap ARTS_bootstrap;
extern AudioBootStrap ESD_bootstrap;
extern AudioBootStrap NACLAUDIO_bootstrap;
extern AudioBootStrap NAS_bootstrap;
extern AudioBootStrap XAUDIO2_bootstrap;
extern AudioBootStrap DSOUND_bootstrap;
extern AudioBootStrap WINMM_bootstrap;
extern AudioBootStrap PAUDIO_bootstrap;
extern AudioBootStrap HAIKUAUDIO_bootstrap;
extern AudioBootStrap COREAUDIO_bootstrap;
extern AudioBootStrap DISKAUDIO_bootstrap;
extern AudioBootStrap DUMMYAUDIO_bootstrap;
extern AudioBootStrap FUSIONSOUND_bootstrap;
extern AudioBootStrap ANDROIDAUDIO_bootstrap;
extern AudioBootStrap PSPAUDIO_bootstrap;
extern AudioBootStrap SNDIO_bootstrap;
extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap;

/* Available audio drivers */
static const AudioBootStrap *const bootstrap[] = {
#if SDL_AUDIO_DRIVER_PULSEAUDIO
@@ -200,6 +200,78 @@ typedef struct AudioBootStrap
int demand_only; /* 1==request explicitly, or it won't be available. */
} AudioBootStrap;

#if SDL_AUDIO_DRIVER_PULSEAUDIO
extern AudioBootStrap PULSEAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_ALSA
extern AudioBootStrap ALSA_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_SNDIO
extern AudioBootStrap SNDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_BSD
extern AudioBootStrap BSD_AUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_OSS
extern AudioBootStrap DSP_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_QSA
extern AudioBootStrap QSAAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_SUNAUDIO
extern AudioBootStrap SUNAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_ARTS
extern AudioBootStrap ARTS_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_ESD
extern AudioBootStrap ESD_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_NACL
extern AudioBootStrap NACLAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_NAS
extern AudioBootStrap NAS_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_XAUDIO2
extern AudioBootStrap XAUDIO2_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_DSOUND
extern AudioBootStrap DSOUND_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_WINMM
extern AudioBootStrap WINMM_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_PAUDIO
extern AudioBootStrap PAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_HAIKU
extern AudioBootStrap HAIKUAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_COREAUDIO
extern AudioBootStrap COREAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_DISK
extern AudioBootStrap DISKAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_DUMMY
extern AudioBootStrap DUMMYAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_FUSIONSOUND
extern AudioBootStrap FUSIONSOUND_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_ANDROID
extern AudioBootStrap ANDROIDAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_PSP
extern AudioBootStrap PSPAUDIO_bootstrap;
#endif
#if SDL_AUDIO_DRIVER_EMSCRIPTEN
extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap;
#endif



#endif /* _SDL_sysaudio_h */

/* vi: set ts=4 sw=4 expandtab: */
@@ -27,12 +27,12 @@
#include "SDL_stdinc.h"
#include "SDL_rect.h"

extern SDL_bool SDL_IME_Init();
extern void SDL_IME_Quit();
extern SDL_bool SDL_IME_Init(void);
extern void SDL_IME_Quit(void);
extern void SDL_IME_SetFocus(SDL_bool focused);
extern void SDL_IME_Reset();
extern void SDL_IME_Reset(void);
extern SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode);
extern void SDL_IME_UpdateTextRect(SDL_Rect *rect);
extern void SDL_IME_PumpEvents();
extern void SDL_IME_PumpEvents(void);

#endif /* _SDL_ime_h */
@@ -280,7 +280,7 @@ SDL_UDEV_LoadLibrary(void)
#define BITS_PER_LONG (sizeof(unsigned long) * 8)
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define OFF(x) ((x)%BITS_PER_LONG)
#define BIT(x) (1UL<<OFF(x))
/* #define BIT(x) (1UL<<OFF(x)) */
#define LONG(x) ((x)/BITS_PER_LONG)
#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)

@@ -71,9 +71,9 @@ typedef struct {
SDL_bool recording;
} SDL_GestureTouch;

SDL_GestureTouch *SDL_gestureTouch;
int SDL_numGestureTouches = 0;
SDL_bool recordAll;
static SDL_GestureTouch *SDL_gestureTouch;
static int SDL_numGestureTouches = 0;
static SDL_bool recordAll;

#if 0
static void PrintPath(SDL_FloatPoint *path)
@@ -468,7 +468,7 @@ static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id)
return NULL;
}

int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist)
static int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist)
{
SDL_Event event;
event.mgesture.type = SDL_MULTIGESTURE;
@@ -82,6 +82,7 @@ SDL_GetMouseFocus(void)
return mouse->focus;
}

#if 0
void
SDL_ResetMouse(void)
{
@@ -98,6 +99,7 @@ SDL_ResetMouse(void)
}
SDL_assert(mouse->buttonstate == 0);
}
#endif

void
SDL_SetMouseFocus(SDL_Window * window)
@@ -92,7 +92,7 @@ SDL_GetFingerIndex(const SDL_Touch * touch, SDL_FingerID fingerid)
return -1;
}

SDL_Finger *
static SDL_Finger *
SDL_GetFinger(const SDL_Touch * touch, SDL_FingerID id)
{
int index = SDL_GetFingerIndex(touch, id);
@@ -25,7 +25,7 @@
#include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
#include "SDL_assert.h"

SDL_Haptic *SDL_haptics = NULL;
static SDL_Haptic *SDL_haptics = NULL;


/*
@@ -62,7 +62,7 @@ struct _SDL_Haptic
extern int SDL_SYS_HapticInit(void);

/* Function to return the number of haptic devices plugged in right now */
extern int SDL_SYS_NumHaptics();
extern int SDL_SYS_NumHaptics(void);

/*
* Gets the device dependent name of the haptic device

0 comments on commit 57d01d7

Please sign in to comment.