Mostly cleaned up warnings with -Wmissing-prototypes
This commit is contained in:
parent
b46edfbdc6
commit
95fbd50b15
23 changed files with 88 additions and 39 deletions
14
src/SDL.c
14
src/SDL.c
|
@ -25,21 +25,15 @@
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_fatal.h"
|
#include "SDL_fatal.h"
|
||||||
#include "SDL_assert.h"
|
#include "SDL_assert_c.h"
|
||||||
|
#include "haptic/SDL_haptic_c.h"
|
||||||
|
#include "joystick/SDL_joystick_c.h"
|
||||||
|
|
||||||
#if !SDL_VIDEO_DISABLED
|
#if !SDL_VIDEO_DISABLED
|
||||||
#include "video/SDL_leaks.h"
|
#include "video/SDL_leaks.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialization/Cleanup routines */
|
/* Initialization/Cleanup routines */
|
||||||
#if !SDL_JOYSTICK_DISABLED
|
|
||||||
extern int SDL_JoystickInit(void);
|
|
||||||
extern void SDL_JoystickQuit(void);
|
|
||||||
#endif
|
|
||||||
#if !SDL_HAPTIC_DISABLED
|
|
||||||
extern int SDL_HapticInit(void);
|
|
||||||
extern int SDL_HapticQuit(void);
|
|
||||||
#endif
|
|
||||||
#if !SDL_TIMERS_DISABLED
|
#if !SDL_TIMERS_DISABLED
|
||||||
extern void SDL_StartTicks(void);
|
extern void SDL_StartTicks(void);
|
||||||
extern int SDL_TimerInit(void);
|
extern int SDL_TimerInit(void);
|
||||||
|
@ -50,8 +44,6 @@ extern int SDL_HelperWindowCreate(void);
|
||||||
extern int SDL_HelperWindowDestroy(void);
|
extern int SDL_HelperWindowDestroy(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int SDL_AssertionsInit(void);
|
|
||||||
extern void SDL_AssertionsQuit(void);
|
|
||||||
|
|
||||||
/* The initialized subsystems */
|
/* The initialized subsystems */
|
||||||
static Uint32 SDL_initialized = 0;
|
static Uint32 SDL_initialized = 0;
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_assert.h"
|
#include "SDL_assert.h"
|
||||||
|
#include "SDL_assert_c.h"
|
||||||
#include "video/SDL_sysvideo.h"
|
#include "video/SDL_sysvideo.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
|
|
26
src/SDL_assert_c.h
Normal file
26
src/SDL_assert_c.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
SDL - Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2010 Sam Lantinga
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Sam Lantinga
|
||||||
|
slouken@libsdl.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern int SDL_AssertionsInit(void);
|
||||||
|
extern void SDL_AssertionsQuit(void);
|
||||||
|
|
||||||
|
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -417,7 +417,7 @@ SetupScreenSaver(int flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags)
|
SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags)
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
|
@ -116,7 +116,7 @@ SDL_SetError(const char *fmt, ...)
|
||||||
/* This function has a bit more overhead than most error functions
|
/* This function has a bit more overhead than most error functions
|
||||||
so that it supports internationalization and thread-safe errors.
|
so that it supports internationalization and thread-safe errors.
|
||||||
*/
|
*/
|
||||||
char *
|
static char *
|
||||||
SDL_GetErrorMsg(char *errstr, unsigned int maxlen)
|
SDL_GetErrorMsg(char *errstr, unsigned int maxlen)
|
||||||
{
|
{
|
||||||
SDL_error *error;
|
SDL_error *error;
|
||||||
|
|
|
@ -58,4 +58,5 @@ typedef struct SDL_error
|
||||||
} SDL_error;
|
} SDL_error;
|
||||||
|
|
||||||
#endif /* _SDL_error_c_h */
|
#endif /* _SDL_error_c_h */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|
|
@ -257,7 +257,7 @@ finalize_audio_entry_points(void)
|
||||||
|
|
||||||
/* Streaming functions (for when the input and output buffer sizes are different) */
|
/* Streaming functions (for when the input and output buffer sizes are different) */
|
||||||
/* Write [length] bytes from buf into the streamer */
|
/* Write [length] bytes from buf into the streamer */
|
||||||
void
|
static void
|
||||||
SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length)
|
SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -269,7 +269,7 @@ SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read [length] bytes out of the streamer into buf */
|
/* Read [length] bytes out of the streamer into buf */
|
||||||
void
|
static void
|
||||||
SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length)
|
SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -280,14 +280,14 @@ SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
SDL_StreamLength(SDL_AudioStreamer * stream)
|
SDL_StreamLength(SDL_AudioStreamer * stream)
|
||||||
{
|
{
|
||||||
return (stream->write_pos - stream->read_pos) % stream->max_len;
|
return (stream->write_pos - stream->read_pos) % stream->max_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */
|
/* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */
|
||||||
int
|
static int
|
||||||
SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence)
|
SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence)
|
||||||
{
|
{
|
||||||
/* First try to allocate the buffer */
|
/* First try to allocate the buffer */
|
||||||
|
@ -307,7 +307,7 @@ SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deinitialize the stream simply by freeing the buffer */
|
/* Deinitialize the stream simply by freeing the buffer */
|
||||||
void
|
static void
|
||||||
SDL_StreamDeinit(SDL_AudioStreamer * stream)
|
SDL_StreamDeinit(SDL_AudioStreamer * stream)
|
||||||
{
|
{
|
||||||
if (stream->buffer != NULL) {
|
if (stream->buffer != NULL) {
|
||||||
|
|
|
@ -335,7 +335,7 @@ SDL_GetCPUCount()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Oh, such a sweet sweet trick, just not very useful. :) */
|
/* Oh, such a sweet sweet trick, just not very useful. :) */
|
||||||
const char *
|
static const char *
|
||||||
SDL_GetCPUType()
|
SDL_GetCPUType()
|
||||||
{
|
{
|
||||||
static char SDL_CPUType[48];
|
static char SDL_CPUType[48];
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
#include "SDL_rwopsbundlesupport.h"
|
||||||
|
|
||||||
/* For proper OS X applications, the resources are contained inside the application bundle.
|
/* For proper OS X applications, the resources are contained inside the application bundle.
|
||||||
So the strategy is to first check the application bundle for the file, then fallback to the current working directory.
|
So the strategy is to first check the application bundle for the file, then fallback to the current working directory.
|
||||||
Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app.
|
Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app.
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
|
|
||||||
#include "SDL_syshaptic.h"
|
#include "SDL_syshaptic.h"
|
||||||
|
#include "SDL_haptic_c.h"
|
||||||
#include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
|
#include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
|
||||||
|
|
||||||
|
|
||||||
|
|
26
src/haptic/SDL_haptic_c.h
Normal file
26
src/haptic/SDL_haptic_c.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
SDL - Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2010 Sam Lantinga
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Sam Lantinga
|
||||||
|
slouken@libsdl.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern int SDL_HapticInit(void);
|
||||||
|
extern void SDL_HapticQuit(void);
|
||||||
|
|
||||||
|
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -27,6 +27,10 @@
|
||||||
/* The number of available joysticks on the system */
|
/* The number of available joysticks on the system */
|
||||||
extern Uint8 SDL_numjoysticks;
|
extern Uint8 SDL_numjoysticks;
|
||||||
|
|
||||||
|
/* Initialization and shutdown functions */
|
||||||
|
extern int SDL_JoystickInit(void);
|
||||||
|
extern void SDL_JoystickQuit(void);
|
||||||
|
|
||||||
/* Internal event queueing functions */
|
/* Internal event queueing functions */
|
||||||
extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick,
|
extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick,
|
||||||
Uint8 axis, Sint16 value);
|
Uint8 axis, Sint16 value);
|
||||||
|
|
|
@ -12,7 +12,10 @@ main(int argc, char *argv[])
|
||||||
#else
|
#else
|
||||||
/* Nothing to do on this platform */
|
/* Nothing to do on this platform */
|
||||||
int
|
int
|
||||||
SDL_main_stub_symbol()
|
SDL_main_stub_symbol(void);
|
||||||
|
|
||||||
|
int
|
||||||
|
SDL_main_stub_symbol(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ static int SDL_numthreads = 0;
|
||||||
static SDL_Thread **SDL_Threads = NULL;
|
static SDL_Thread **SDL_Threads = NULL;
|
||||||
static SDL_mutex *thread_lock = NULL;
|
static SDL_mutex *thread_lock = NULL;
|
||||||
|
|
||||||
int
|
static int
|
||||||
SDL_ThreadsInit(void)
|
SDL_ThreadsInit(void)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
@ -56,7 +56,7 @@ SDL_ThreadsInit(void)
|
||||||
clean up threads here. If any threads are still running after this call,
|
clean up threads here. If any threads are still running after this call,
|
||||||
they will no longer have access to any per-thread data.
|
they will no longer have access to any per-thread data.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
SDL_ThreadsQuit(void)
|
SDL_ThreadsQuit(void)
|
||||||
{
|
{
|
||||||
SDL_mutex *mutex;
|
SDL_mutex *mutex;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include "SDL_video.h"
|
#include "SDL_video.h"
|
||||||
#include "SDL_blit.h"
|
#include "SDL_blit.h"
|
||||||
|
#include "SDL_blit_slow.h"
|
||||||
|
|
||||||
/* The ONE TRUE BLITTER
|
/* The ONE TRUE BLITTER
|
||||||
* This puppy has to handle all the unoptimized cases - yes, it's slow.
|
* This puppy has to handle all the unoptimized cases - yes, it's slow.
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "SDL_pixels_c.h"
|
#include "SDL_pixels_c.h"
|
||||||
#include "SDL_rect_c.h"
|
#include "SDL_rect_c.h"
|
||||||
#include "SDL_yuv_sw_c.h"
|
#include "SDL_yuv_sw_c.h"
|
||||||
|
#include "SDL_renderer_sw.h"
|
||||||
|
|
||||||
|
|
||||||
/* SDL surface based renderer implementation */
|
/* SDL surface based renderer implementation */
|
||||||
|
|
|
@ -151,7 +151,7 @@ generate_rowbytes(int src_w, int dst_w, int bpp)
|
||||||
#endif /* USE_ASM_STRETCH */
|
#endif /* USE_ASM_STRETCH */
|
||||||
|
|
||||||
#define DEFINE_COPY_ROW(name, type) \
|
#define DEFINE_COPY_ROW(name, type) \
|
||||||
void name(type *src, int src_w, type *dst, int dst_w) \
|
static void name(type *src, int src_w, type *dst, int dst_w) \
|
||||||
{ \
|
{ \
|
||||||
int i; \
|
int i; \
|
||||||
int pos, inc; \
|
int pos, inc; \
|
||||||
|
@ -175,7 +175,7 @@ DEFINE_COPY_ROW(copy_row4, Uint32)
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* The ASM code doesn't handle 24-bpp stretch blits */
|
/* The ASM code doesn't handle 24-bpp stretch blits */
|
||||||
void
|
static void
|
||||||
copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w)
|
copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -418,7 +418,7 @@ extern VideoBootStrap PND_bootstrap;
|
||||||
#define SDL_CurrentDisplay (&_this->displays[_this->current_display])
|
#define SDL_CurrentDisplay (&_this->displays[_this->current_display])
|
||||||
#define SDL_CurrentRenderer (SDL_CurrentDisplay->current_renderer)
|
#define SDL_CurrentRenderer (SDL_CurrentDisplay->current_renderer)
|
||||||
|
|
||||||
extern SDL_VideoDevice *SDL_GetVideoDevice();
|
extern SDL_VideoDevice *SDL_GetVideoDevice(void);
|
||||||
extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
|
extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
|
||||||
extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
|
extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
|
||||||
extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
|
extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
|
||||||
|
|
|
@ -304,7 +304,7 @@ SDL_GetCurrentVideoDriver()
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_VideoDevice *
|
SDL_VideoDevice *
|
||||||
SDL_GetVideoDevice()
|
SDL_GetVideoDevice(void)
|
||||||
{
|
{
|
||||||
return _this;
|
return _this;
|
||||||
}
|
}
|
||||||
|
@ -717,16 +717,6 @@ SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
SDL_SetDisplayMode(const SDL_DisplayMode * mode)
|
|
||||||
{
|
|
||||||
if (!_this) {
|
|
||||||
SDL_UninitializedVideo();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return SDL_SetDisplayModeForDisplay(SDL_CurrentDisplay, mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode)
|
SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -296,7 +296,7 @@ X11_DispatchEvent(_THIS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ack! XPending() actually performs a blocking read if no events available */
|
/* Ack! XPending() actually performs a blocking read if no events available */
|
||||||
int
|
static int
|
||||||
X11_Pending(Display * display)
|
X11_Pending(Display * display)
|
||||||
{
|
{
|
||||||
/* Flush the display connection and look to see if events are queued */
|
/* Flush the display connection and look to see if events are queued */
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <limits.h> /* For INT_MIN and INT_MAX */
|
#include <limits.h> /* For INT_MIN and INT_MAX */
|
||||||
|
|
||||||
#include "SDL_x11video.h"
|
#include "SDL_x11video.h"
|
||||||
|
#include "SDL_x11render.h"
|
||||||
#include "../SDL_rect_c.h"
|
#include "../SDL_rect_c.h"
|
||||||
#include "../SDL_pixels_c.h"
|
#include "../SDL_pixels_c.h"
|
||||||
#include "../SDL_yuv_sw_c.h"
|
#include "../SDL_yuv_sw_c.h"
|
||||||
|
|
|
@ -292,7 +292,7 @@ X11_VideoQuit(_THIS)
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_bool
|
SDL_bool
|
||||||
X11_UseDirectColorVisuals()
|
X11_UseDirectColorVisuals(void)
|
||||||
{
|
{
|
||||||
/* Once we implement DirectColor colormaps and gamma ramp support...
|
/* Once we implement DirectColor colormaps and gamma ramp support...
|
||||||
return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
|
return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
|
||||||
|
|
|
@ -71,7 +71,7 @@ typedef struct SDL_VideoData
|
||||||
SDL_scancode key_layout[256];
|
SDL_scancode key_layout[256];
|
||||||
} SDL_VideoData;
|
} SDL_VideoData;
|
||||||
|
|
||||||
extern SDL_bool X11_UseDirectColorVisuals();
|
extern SDL_bool X11_UseDirectColorVisuals(void);
|
||||||
|
|
||||||
#endif /* _SDL_x11video_h */
|
#endif /* _SDL_x11video_h */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue