Mostly cleaned up warnings with -Wmissing-prototypes
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Jun 2010 08:56:48 -0700
changeset 4472791b3256fb22
parent 4471 11cedc036ca1
child 4473 e8045ba3f79f
Mostly cleaned up warnings with -Wmissing-prototypes
src/SDL.c
src/SDL_assert.c
src/SDL_assert_c.h
src/SDL_compat.c
src/SDL_error.c
src/SDL_error_c.h
src/audio/SDL_audio.c
src/cpuinfo/SDL_cpuinfo.c
src/file/cocoa/SDL_rwopsbundlesupport.m
src/haptic/SDL_haptic.c
src/haptic/SDL_haptic_c.h
src/joystick/SDL_joystick_c.h
src/main/dummy/SDL_dummy_main.c
src/thread/SDL_thread.c
src/video/SDL_blit_slow.c
src/video/SDL_renderer_sw.c
src/video/SDL_stretch.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11render.c
src/video/x11/SDL_x11video.c
src/video/x11/SDL_x11video.h
     1.1 --- a/src/SDL.c	Thu Jun 17 22:23:20 2010 -0700
     1.2 +++ b/src/SDL.c	Sat Jun 26 08:56:48 2010 -0700
     1.3 @@ -25,21 +25,15 @@
     1.4  
     1.5  #include "SDL.h"
     1.6  #include "SDL_fatal.h"
     1.7 -#include "SDL_assert.h"
     1.8 +#include "SDL_assert_c.h"
     1.9 +#include "haptic/SDL_haptic_c.h"
    1.10 +#include "joystick/SDL_joystick_c.h"
    1.11  
    1.12  #if !SDL_VIDEO_DISABLED
    1.13  #include "video/SDL_leaks.h"
    1.14  #endif
    1.15  
    1.16  /* Initialization/Cleanup routines */
    1.17 -#if !SDL_JOYSTICK_DISABLED
    1.18 -extern int SDL_JoystickInit(void);
    1.19 -extern void SDL_JoystickQuit(void);
    1.20 -#endif
    1.21 -#if !SDL_HAPTIC_DISABLED
    1.22 -extern int SDL_HapticInit(void);
    1.23 -extern int SDL_HapticQuit(void);
    1.24 -#endif
    1.25  #if !SDL_TIMERS_DISABLED
    1.26  extern void SDL_StartTicks(void);
    1.27  extern int SDL_TimerInit(void);
    1.28 @@ -50,8 +44,6 @@
    1.29  extern int SDL_HelperWindowDestroy(void);
    1.30  #endif
    1.31  
    1.32 -extern int SDL_AssertionsInit(void);
    1.33 -extern void SDL_AssertionsQuit(void);
    1.34  
    1.35  /* The initialized subsystems */
    1.36  static Uint32 SDL_initialized = 0;
     2.1 --- a/src/SDL_assert.c	Thu Jun 17 22:23:20 2010 -0700
     2.2 +++ b/src/SDL_assert.c	Sat Jun 26 08:56:48 2010 -0700
     2.3 @@ -22,6 +22,7 @@
     2.4  
     2.5  #include "SDL.h"
     2.6  #include "SDL_assert.h"
     2.7 +#include "SDL_assert_c.h"
     2.8  #include "video/SDL_sysvideo.h"
     2.9  
    2.10  #ifdef _WINDOWS
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/SDL_assert_c.h	Sat Jun 26 08:56:48 2010 -0700
     3.3 @@ -0,0 +1,26 @@
     3.4 +/*
     3.5 +    SDL - Simple DirectMedia Layer
     3.6 +    Copyright (C) 1997-2010 Sam Lantinga
     3.7 +
     3.8 +    This library is free software; you can redistribute it and/or
     3.9 +    modify it under the terms of the GNU Lesser General Public
    3.10 +    License as published by the Free Software Foundation; either
    3.11 +    version 2.1 of the License, or (at your option) any later version.
    3.12 +
    3.13 +    This library is distributed in the hope that it will be useful,
    3.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.16 +    Lesser General Public License for more details.
    3.17 +
    3.18 +    You should have received a copy of the GNU Lesser General Public
    3.19 +    License along with this library; if not, write to the Free Software
    3.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3.21 +
    3.22 +    Sam Lantinga
    3.23 +    slouken@libsdl.org
    3.24 +*/
    3.25 +
    3.26 +extern int SDL_AssertionsInit(void);
    3.27 +extern void SDL_AssertionsQuit(void);
    3.28 +
    3.29 +/* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/SDL_compat.c	Thu Jun 17 22:23:20 2010 -0700
     4.2 +++ b/src/SDL_compat.c	Sat Jun 26 08:56:48 2010 -0700
     4.3 @@ -417,7 +417,7 @@
     4.4      }
     4.5  }
     4.6  
     4.7 -int
     4.8 +static int
     4.9  SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags)
    4.10  {
    4.11      int w, h;
     5.1 --- a/src/SDL_error.c	Thu Jun 17 22:23:20 2010 -0700
     5.2 +++ b/src/SDL_error.c	Sat Jun 26 08:56:48 2010 -0700
     5.3 @@ -116,7 +116,7 @@
     5.4  /* This function has a bit more overhead than most error functions
     5.5     so that it supports internationalization and thread-safe errors.
     5.6  */
     5.7 -char *
     5.8 +static char *
     5.9  SDL_GetErrorMsg(char *errstr, unsigned int maxlen)
    5.10  {
    5.11      SDL_error *error;
     6.1 --- a/src/SDL_error_c.h	Thu Jun 17 22:23:20 2010 -0700
     6.2 +++ b/src/SDL_error_c.h	Sat Jun 26 08:56:48 2010 -0700
     6.3 @@ -58,4 +58,5 @@
     6.4  } SDL_error;
     6.5  
     6.6  #endif /* _SDL_error_c_h */
     6.7 +
     6.8  /* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/audio/SDL_audio.c	Thu Jun 17 22:23:20 2010 -0700
     7.2 +++ b/src/audio/SDL_audio.c	Sat Jun 26 08:56:48 2010 -0700
     7.3 @@ -257,7 +257,7 @@
     7.4  
     7.5  /* Streaming functions (for when the input and output buffer sizes are different) */
     7.6  /* Write [length] bytes from buf into the streamer */
     7.7 -void
     7.8 +static void
     7.9  SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length)
    7.10  {
    7.11      int i;
    7.12 @@ -269,7 +269,7 @@
    7.13  }
    7.14  
    7.15  /* Read [length] bytes out of the streamer into buf */
    7.16 -void
    7.17 +static void
    7.18  SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length)
    7.19  {
    7.20      int i;
    7.21 @@ -280,14 +280,14 @@
    7.22      }
    7.23  }
    7.24  
    7.25 -int
    7.26 +static int
    7.27  SDL_StreamLength(SDL_AudioStreamer * stream)
    7.28  {
    7.29      return (stream->write_pos - stream->read_pos) % stream->max_len;
    7.30  }
    7.31  
    7.32  /* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */
    7.33 -int
    7.34 +static int
    7.35  SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence)
    7.36  {
    7.37      /* First try to allocate the buffer */
    7.38 @@ -307,7 +307,7 @@
    7.39  }
    7.40  
    7.41  /* Deinitialize the stream simply by freeing the buffer */
    7.42 -void
    7.43 +static void
    7.44  SDL_StreamDeinit(SDL_AudioStreamer * stream)
    7.45  {
    7.46      if (stream->buffer != NULL) {
     8.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Thu Jun 17 22:23:20 2010 -0700
     8.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Sat Jun 26 08:56:48 2010 -0700
     8.3 @@ -335,7 +335,7 @@
     8.4  }
     8.5  
     8.6  /* Oh, such a sweet sweet trick, just not very useful. :) */
     8.7 -const char *
     8.8 +static const char *
     8.9  SDL_GetCPUType()
    8.10  {
    8.11      static char SDL_CPUType[48];
     9.1 --- a/src/file/cocoa/SDL_rwopsbundlesupport.m	Thu Jun 17 22:23:20 2010 -0700
     9.2 +++ b/src/file/cocoa/SDL_rwopsbundlesupport.m	Sat Jun 26 08:56:48 2010 -0700
     9.3 @@ -1,6 +1,8 @@
     9.4  #ifdef __APPLE__
     9.5  #import <Foundation/Foundation.h>
     9.6  
     9.7 +#include "SDL_rwopsbundlesupport.h"
     9.8 +
     9.9  /* For proper OS X applications, the resources are contained inside the application bundle.
    9.10   So the strategy is to first check the application bundle for the file, then fallback to the current working directory.
    9.11   Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app.
    10.1 --- a/src/haptic/SDL_haptic.c	Thu Jun 17 22:23:20 2010 -0700
    10.2 +++ b/src/haptic/SDL_haptic.c	Sat Jun 26 08:56:48 2010 -0700
    10.3 @@ -22,6 +22,7 @@
    10.4  #include "SDL_config.h"
    10.5  
    10.6  #include "SDL_syshaptic.h"
    10.7 +#include "SDL_haptic_c.h"
    10.8  #include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
    10.9  
   10.10  
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/src/haptic/SDL_haptic_c.h	Sat Jun 26 08:56:48 2010 -0700
    11.3 @@ -0,0 +1,26 @@
    11.4 +/*
    11.5 +    SDL - Simple DirectMedia Layer
    11.6 +    Copyright (C) 1997-2010 Sam Lantinga
    11.7 +
    11.8 +    This library is free software; you can redistribute it and/or
    11.9 +    modify it under the terms of the GNU Lesser General Public
   11.10 +    License as published by the Free Software Foundation; either
   11.11 +    version 2.1 of the License, or (at your option) any later version.
   11.12 +
   11.13 +    This library is distributed in the hope that it will be useful,
   11.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11.16 +    Lesser General Public License for more details.
   11.17 +
   11.18 +    You should have received a copy of the GNU Lesser General Public
   11.19 +    License along with this library; if not, write to the Free Software
   11.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   11.21 +
   11.22 +    Sam Lantinga
   11.23 +    slouken@libsdl.org
   11.24 +*/
   11.25 +
   11.26 +extern int SDL_HapticInit(void);
   11.27 +extern void SDL_HapticQuit(void);
   11.28 +
   11.29 +/* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/joystick/SDL_joystick_c.h	Thu Jun 17 22:23:20 2010 -0700
    12.2 +++ b/src/joystick/SDL_joystick_c.h	Sat Jun 26 08:56:48 2010 -0700
    12.3 @@ -27,6 +27,10 @@
    12.4  /* The number of available joysticks on the system */
    12.5  extern Uint8 SDL_numjoysticks;
    12.6  
    12.7 +/* Initialization and shutdown functions */
    12.8 +extern int SDL_JoystickInit(void);
    12.9 +extern void SDL_JoystickQuit(void);
   12.10 +
   12.11  /* Internal event queueing functions */
   12.12  extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick,
   12.13                                     Uint8 axis, Sint16 value);
    13.1 --- a/src/main/dummy/SDL_dummy_main.c	Thu Jun 17 22:23:20 2010 -0700
    13.2 +++ b/src/main/dummy/SDL_dummy_main.c	Sat Jun 26 08:56:48 2010 -0700
    13.3 @@ -12,7 +12,10 @@
    13.4  #else
    13.5  /* Nothing to do on this platform */
    13.6  int
    13.7 -SDL_main_stub_symbol()
    13.8 +SDL_main_stub_symbol(void);
    13.9 +
   13.10 +int
   13.11 +SDL_main_stub_symbol(void)
   13.12  {
   13.13      return 0;
   13.14  }
    14.1 --- a/src/thread/SDL_thread.c	Thu Jun 17 22:23:20 2010 -0700
    14.2 +++ b/src/thread/SDL_thread.c	Sat Jun 26 08:56:48 2010 -0700
    14.3 @@ -38,7 +38,7 @@
    14.4  static SDL_Thread **SDL_Threads = NULL;
    14.5  static SDL_mutex *thread_lock = NULL;
    14.6  
    14.7 -int
    14.8 +static int
    14.9  SDL_ThreadsInit(void)
   14.10  {
   14.11      int retval;
   14.12 @@ -56,7 +56,7 @@
   14.13     clean up threads here.  If any threads are still running after this call,
   14.14     they will no longer have access to any per-thread data.
   14.15   */
   14.16 -void
   14.17 +static void
   14.18  SDL_ThreadsQuit(void)
   14.19  {
   14.20      SDL_mutex *mutex;
    15.1 --- a/src/video/SDL_blit_slow.c	Thu Jun 17 22:23:20 2010 -0700
    15.2 +++ b/src/video/SDL_blit_slow.c	Sat Jun 26 08:56:48 2010 -0700
    15.3 @@ -23,6 +23,7 @@
    15.4  
    15.5  #include "SDL_video.h"
    15.6  #include "SDL_blit.h"
    15.7 +#include "SDL_blit_slow.h"
    15.8  
    15.9  /* The ONE TRUE BLITTER
   15.10   * This puppy has to handle all the unoptimized cases - yes, it's slow.
    16.1 --- a/src/video/SDL_renderer_sw.c	Thu Jun 17 22:23:20 2010 -0700
    16.2 +++ b/src/video/SDL_renderer_sw.c	Sat Jun 26 08:56:48 2010 -0700
    16.3 @@ -26,6 +26,7 @@
    16.4  #include "SDL_pixels_c.h"
    16.5  #include "SDL_rect_c.h"
    16.6  #include "SDL_yuv_sw_c.h"
    16.7 +#include "SDL_renderer_sw.h"
    16.8  
    16.9  
   16.10  /* SDL surface based renderer implementation */
    17.1 --- a/src/video/SDL_stretch.c	Thu Jun 17 22:23:20 2010 -0700
    17.2 +++ b/src/video/SDL_stretch.c	Sat Jun 26 08:56:48 2010 -0700
    17.3 @@ -151,7 +151,7 @@
    17.4  #endif /* USE_ASM_STRETCH */
    17.5  
    17.6  #define DEFINE_COPY_ROW(name, type)			\
    17.7 -void name(type *src, int src_w, type *dst, int dst_w)	\
    17.8 +static void name(type *src, int src_w, type *dst, int dst_w)	\
    17.9  {							\
   17.10  	int i;						\
   17.11  	int pos, inc;					\
   17.12 @@ -175,7 +175,7 @@
   17.13  /* *INDENT-ON* */
   17.14  
   17.15  /* The ASM code doesn't handle 24-bpp stretch blits */
   17.16 -void
   17.17 +static void
   17.18  copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w)
   17.19  {
   17.20      int i;
    18.1 --- a/src/video/SDL_sysvideo.h	Thu Jun 17 22:23:20 2010 -0700
    18.2 +++ b/src/video/SDL_sysvideo.h	Sat Jun 26 08:56:48 2010 -0700
    18.3 @@ -418,7 +418,7 @@
    18.4  #define SDL_CurrentDisplay	(&_this->displays[_this->current_display])
    18.5  #define SDL_CurrentRenderer	(SDL_CurrentDisplay->current_renderer)
    18.6  
    18.7 -extern SDL_VideoDevice *SDL_GetVideoDevice();
    18.8 +extern SDL_VideoDevice *SDL_GetVideoDevice(void);
    18.9  extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
   18.10  extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
   18.11  extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
    19.1 --- a/src/video/SDL_video.c	Thu Jun 17 22:23:20 2010 -0700
    19.2 +++ b/src/video/SDL_video.c	Sat Jun 26 08:56:48 2010 -0700
    19.3 @@ -304,7 +304,7 @@
    19.4  }
    19.5  
    19.6  SDL_VideoDevice *
    19.7 -SDL_GetVideoDevice()
    19.8 +SDL_GetVideoDevice(void)
    19.9  {
   19.10      return _this;
   19.11  }
   19.12 @@ -718,16 +718,6 @@
   19.13  }
   19.14  
   19.15  int
   19.16 -SDL_SetDisplayMode(const SDL_DisplayMode * mode)
   19.17 -{
   19.18 -    if (!_this) {
   19.19 -        SDL_UninitializedVideo();
   19.20 -        return -1;
   19.21 -    }
   19.22 -    return SDL_SetDisplayModeForDisplay(SDL_CurrentDisplay, mode);
   19.23 -}
   19.24 -
   19.25 -int
   19.26  SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode)
   19.27  {
   19.28      CHECK_WINDOW_MAGIC(window, -1);
    20.1 --- a/src/video/x11/SDL_x11events.c	Thu Jun 17 22:23:20 2010 -0700
    20.2 +++ b/src/video/x11/SDL_x11events.c	Sat Jun 26 08:56:48 2010 -0700
    20.3 @@ -296,7 +296,7 @@
    20.4  }
    20.5  
    20.6  /* Ack!  XPending() actually performs a blocking read if no events available */
    20.7 -int
    20.8 +static int
    20.9  X11_Pending(Display * display)
   20.10  {
   20.11      /* Flush the display connection and look to see if events are queued */
    21.1 --- a/src/video/x11/SDL_x11render.c	Thu Jun 17 22:23:20 2010 -0700
    21.2 +++ b/src/video/x11/SDL_x11render.c	Sat Jun 26 08:56:48 2010 -0700
    21.3 @@ -26,6 +26,7 @@
    21.4  #include <limits.h> /* For INT_MIN and INT_MAX */
    21.5  
    21.6  #include "SDL_x11video.h"
    21.7 +#include "SDL_x11render.h"
    21.8  #include "../SDL_rect_c.h"
    21.9  #include "../SDL_pixels_c.h"
   21.10  #include "../SDL_yuv_sw_c.h"
    22.1 --- a/src/video/x11/SDL_x11video.c	Thu Jun 17 22:23:20 2010 -0700
    22.2 +++ b/src/video/x11/SDL_x11video.c	Sat Jun 26 08:56:48 2010 -0700
    22.3 @@ -292,7 +292,7 @@
    22.4  }
    22.5  
    22.6  SDL_bool
    22.7 -X11_UseDirectColorVisuals()
    22.8 +X11_UseDirectColorVisuals(void)
    22.9  {
   22.10      /* Once we implement DirectColor colormaps and gamma ramp support...
   22.11         return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
    23.1 --- a/src/video/x11/SDL_x11video.h	Thu Jun 17 22:23:20 2010 -0700
    23.2 +++ b/src/video/x11/SDL_x11video.h	Sat Jun 26 08:56:48 2010 -0700
    23.3 @@ -71,7 +71,7 @@
    23.4      SDL_scancode key_layout[256];
    23.5  } SDL_VideoData;
    23.6  
    23.7 -extern SDL_bool X11_UseDirectColorVisuals();
    23.8 +extern SDL_bool X11_UseDirectColorVisuals(void);
    23.9  
   23.10  #endif /* _SDL_x11video_h */
   23.11