diff src/SDL_compat.c @ 1668:4da1ee79c9af SDL-1.3

more tweaking indent options
author Sam Lantinga <slouken@libsdl.org>
date Mon, 29 May 2006 04:04:35 +0000
parents 1fddae038bc8
children 9857d21967bb
line wrap: on
line diff
--- a/src/SDL_compat.c	Mon May 29 03:53:21 2006 +0000
+++ b/src/SDL_compat.c	Mon May 29 04:04:35 2006 +0000
@@ -32,48 +32,48 @@
 static char *wm_title;
 
 char *
-SDL_AudioDriverName (char *namebuf, int maxlen)
+SDL_AudioDriverName(char *namebuf, int maxlen)
 {
-    const char *name = SDL_GetCurrentAudioDriver ();
+    const char *name = SDL_GetCurrentAudioDriver();
     if (name) {
-        SDL_strlcpy (namebuf, name, maxlen);
+        SDL_strlcpy(namebuf, name, maxlen);
         return namebuf;
     }
     return NULL;
 }
 
 char *
-SDL_VideoDriverName (char *namebuf, int maxlen)
+SDL_VideoDriverName(char *namebuf, int maxlen)
 {
-    const char *name = SDL_GetCurrentVideoDriver ();
+    const char *name = SDL_GetCurrentVideoDriver();
     if (name) {
-        SDL_strlcpy (namebuf, name, maxlen);
+        SDL_strlcpy(namebuf, name, maxlen);
         return namebuf;
     }
     return NULL;
 }
 
 int
-SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags)
+SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags)
 {
     int i, actual_bpp = 0;
 
-    if (!SDL_GetVideoDevice ()) {
+    if (!SDL_GetVideoDevice()) {
         return 0;
     }
 
     if (!(flags & SDL_FULLSCREEN)) {
-        return SDL_BITSPERPIXEL (SDL_GetDesktopDisplayMode ()->format);
+        return SDL_BITSPERPIXEL(SDL_GetDesktopDisplayMode()->format);
     }
 
-    for (i = 0; i < SDL_GetNumDisplayModes (); ++i) {
-        const SDL_DisplayMode *mode = SDL_GetDisplayMode (i);
+    for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
+        const SDL_DisplayMode *mode = SDL_GetDisplayMode(i);
         if (!mode->w || !mode->h || (width == mode->w && height == mode->h)) {
             if (!mode->format) {
                 return bpp;
             }
-            if (SDL_BITSPERPIXEL (mode->format) >= bpp) {
-                actual_bpp = SDL_BITSPERPIXEL (mode->format);
+            if (SDL_BITSPERPIXEL(mode->format) >= bpp) {
+                actual_bpp = SDL_BITSPERPIXEL(mode->format);
             }
         }
     }
@@ -81,12 +81,12 @@
 }
 
 SDL_Rect **
-SDL_ListModes (SDL_PixelFormat * format, Uint32 flags)
+SDL_ListModes(SDL_PixelFormat * format, Uint32 flags)
 {
     int i, nmodes;
     SDL_Rect **modes;
 
-    if (!SDL_GetVideoDevice ()) {
+    if (!SDL_GetVideoDevice()) {
         return NULL;
     }
 
@@ -96,12 +96,12 @@
 
     /* Memory leak, but this is a compatibility function, who cares? */
     nmodes = 0;
-    for (i = 0; i < SDL_GetNumDisplayModes (); ++i) {
-        const SDL_DisplayMode *mode = SDL_GetDisplayMode (i);
+    for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
+        const SDL_DisplayMode *mode = SDL_GetDisplayMode(i);
         if (!mode->w || !mode->h) {
             return (SDL_Rect **) (-1);
         }
-        if (SDL_BITSPERPIXEL (mode->format) != format->BitsPerPixel) {
+        if (SDL_BITSPERPIXEL(mode->format) != format->BitsPerPixel) {
             continue;
         }
         if (nmodes > 0 && modes[nmodes - 1]->w == mode->w
@@ -109,11 +109,11 @@
             continue;
         }
 
-        modes = SDL_realloc (modes, (nmodes + 2) * sizeof (*modes));
+        modes = SDL_realloc(modes, (nmodes + 2) * sizeof(*modes));
         if (!modes) {
             return NULL;
         }
-        modes[nmodes] = (SDL_Rect *) SDL_malloc (sizeof (SDL_Rect));
+        modes[nmodes] = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect));
         if (!modes[nmodes]) {
             return NULL;
         }
@@ -130,7 +130,7 @@
 }
 
 SDL_Surface *
-SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
+SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
 {
     SDL_DisplayMode mode;
     int i;
@@ -138,14 +138,14 @@
     Uint32 desktop_format;
     Uint32 desired_format;
 
-    if (!SDL_GetVideoDevice ()) {
-        if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
+    if (!SDL_GetVideoDevice()) {
+        if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
             return NULL;
         }
     }
 
     /* Destroy existing window */
-    SDL_DestroyWindow (window);
+    SDL_DestroyWindow(window);
 
     /* Create a new window */
     window_flags = SDL_WINDOW_SHOWN;
@@ -161,13 +161,13 @@
     if (flags & SDL_NOFRAME) {
         window_flags |= SDL_WINDOW_BORDERLESS;
     }
-    window = SDL_CreateWindow (wm_title, 0, 0, width, height, window_flags);
+    window = SDL_CreateWindow(wm_title, 0, 0, width, height, window_flags);
     if (!window) {
         return NULL;
     }
 
     /* Set up the desired display mode */
-    desktop_format = SDL_GetDesktopDisplayMode ()->format;
+    desktop_format = SDL_GetDesktopDisplayMode()->format;
     if ((bpp == SDL_BITSPERPIXEL(desktop_format)) ||
         (desktop_format && (flags & SDL_ANYFORMAT))) {
         desired_format = desktop_format;
@@ -189,7 +189,7 @@
             desired_format = SDL_PixelFormat_RGB888;
             break;
         default:
-            SDL_SetError ("Unsupported bpp in SDL_SetVideoMode()");
+            SDL_SetError("Unsupported bpp in SDL_SetVideoMode()");
             return NULL;
         }
     }
@@ -200,41 +200,41 @@
 
     /* Set the desired display mode */
     if (flags & SDL_FULLSCREEN) {
-        if (!SDL_GetClosestDisplayMode (&mode, &mode)) {
+        if (!SDL_GetClosestDisplayMode(&mode, &mode)) {
             return NULL;
         }
     } else {
-        mode = *SDL_GetDesktopDisplayMode ();
+        mode = *SDL_GetDesktopDisplayMode();
     }
-    if (SDL_SetDisplayMode (&mode) < 0) {
+    if (SDL_SetDisplayMode(&mode) < 0) {
         return NULL;
     }
 
     /* Create the display surface */
-    return SDL_CreateWindowSurface (window, desired_format, flags);
+    return SDL_CreateWindowSurface(window, desired_format, flags);
 }
 
 SDL_Surface *
-SDL_GetVideoSurface (void)
+SDL_GetVideoSurface(void)
 {
-    SDL_VideoDevice *_this = SDL_GetVideoDevice ();
+    SDL_VideoDevice *_this = SDL_GetVideoDevice();
 
     return SDL_VideoSurface;
 }
 
 void
-SDL_WM_SetCaption (const char *title, const char *icon)
+SDL_WM_SetCaption(const char *title, const char *icon)
 {
     if (wm_title) {
-        SDL_free (wm_title);
+        SDL_free(wm_title);
     } else {
-        wm_title = SDL_strdup (title);
+        wm_title = SDL_strdup(title);
     }
-    SDL_SetWindowTitle (window, wm_title);
+    SDL_SetWindowTitle(window, wm_title);
 }
 
 void
-SDL_WM_GetCaption (char **title, char **icon)
+SDL_WM_GetCaption(char **title, char **icon)
 {
     if (title) {
         *title = wm_title;
@@ -245,39 +245,39 @@
 }
 
 void
-SDL_WM_SetIcon (SDL_Surface * icon, Uint8 * mask)
+SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask)
 {
     /* FIXME */
 }
 
 int
-SDL_WM_IconifyWindow (void)
+SDL_WM_IconifyWindow(void)
 {
-    SDL_MinimizeWindow (window);
+    SDL_MinimizeWindow(window);
 }
 
 int
-SDL_WM_ToggleFullScreen (SDL_Surface * surface)
+SDL_WM_ToggleFullScreen(SDL_Surface * surface)
 {
     return 0;
 }
 
 SDL_GrabMode
-SDL_WM_GrabInput (SDL_GrabMode mode)
+SDL_WM_GrabInput(SDL_GrabMode mode)
 {
     if (mode != SDL_GRAB_QUERY) {
-        SDL_SetWindowGrab (window, mode);
+        SDL_SetWindowGrab(window, mode);
     }
-    return (SDL_GrabMode) SDL_GetWindowGrab (window);
+    return (SDL_GrabMode) SDL_GetWindowGrab(window);
 }
 
 Uint8
-SDL_GetAppState (void)
+SDL_GetAppState(void)
 {
     Uint8 state = 0;
     Uint32 flags = 0;
 
-    flags = SDL_GetWindowFlags (window);
+    flags = SDL_GetWindowFlags(window);
     if ((flags & SDL_WINDOW_SHOWN) && !(flags & SDL_WINDOW_MINIMIZED)) {
         state |= SDL_APPACTIVE;
     }
@@ -291,24 +291,24 @@
 }
 
 const SDL_version *
-SDL_Linked_Version (void)
+SDL_Linked_Version(void)
 {
     static SDL_version version;
-    SDL_VERSION (&version);
+    SDL_VERSION(&version);
     return &version;
 }
 
 int
-SDL_SetPalette (SDL_Surface * surface, int flags, SDL_Color * colors,
-                int firstcolor, int ncolors)
+SDL_SetPalette(SDL_Surface * surface, int flags, SDL_Color * colors,
+               int firstcolor, int ncolors)
 {
-    SDL_SetColors (surface, colors, firstcolor, ncolors);
+    SDL_SetColors(surface, colors, firstcolor, ncolors);
 }
 
 int
-SDL_GetWMInfo (SDL_SysWMinfo * info)
+SDL_GetWMInfo(SDL_SysWMinfo * info)
 {
-    return SDL_GetWindowWMInfo (window, info);
+    return SDL_GetWindowWMInfo(window, info);
 }
 
 /* vi: set ts=4 sw=4 expandtab: */