make indent
authorSam Lantinga <slouken@libsdl.org>
Thu, 14 Jun 2007 13:21:29 +0000
changeset 2120 2c835d58faad
parent 2119 9341a884a4d9
child 2121 85ed90a755fa
make indent
include/SDL_video.h
src/joystick/darwin/10.3.9-FIX/IOHIDLib.h
src/joystick/darwin/SDL_sysjoystick.c
src/joystick/linux/SDL_sysjoystick.c
src/loadso/beos/SDL_sysloadso.c
src/stdlib/SDL_string.c
src/timer/mint/SDL_systimer.c
src/video/SDL_blit_A.c
src/video/SDL_pixels.c
src/video/bwindow/SDL_sysvideo.cc
src/video/directfb/SDL_DirectFB_yuv.c
src/video/fbcon/SDL_fbvideo.c
src/video/gem/SDL_gemvideo.c
src/video/x11/SDL_x11dyn.c
src/video/xbios/SDL_xbios.c
src/video/xbios/SDL_xbios.h
src/video/xbios/SDL_xbiosmodes.c
test/testloadso.c
--- a/include/SDL_video.h	Thu Jun 14 06:32:36 2007 +0000
+++ b/include/SDL_video.h	Thu Jun 14 13:21:29 2007 +0000
@@ -1300,9 +1300,9 @@
 /*
  * Maps an RGB triple to an opaque pixel value for a given pixel format
  */
-extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * const format,
-                                          const Uint8 r, const Uint8 g,
-                                          const Uint8 b);
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat *
+                                          const format, const Uint8 r,
+                                          const Uint8 g, const Uint8 b);
 
 /*
  * Maps an RGBA quadruple to a pixel value for a given pixel format
--- a/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h	Thu Jun 14 13:21:29 2007 +0000
@@ -1,3 +1,4 @@
+/* *INDENT-OFF* */
 /*
  *
  * @APPLE_LICENSE_HEADER_START@
--- a/src/joystick/darwin/SDL_sysjoystick.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/joystick/darwin/SDL_sysjoystick.c	Thu Jun 14 13:21:29 2007 +0000
@@ -693,10 +693,10 @@
 */
 
         /* Filter device list to non-keyboard/mouse stuff */
-        if ( (device->usagePage != kHIDPage_GenericDesktop) ||
-             ((device->usage != kHIDUsage_GD_Joystick &&
-               device->usage != kHIDUsage_GD_GamePad &&
-               device->usage != kHIDUsage_GD_MultiAxisController)) ) {
+        if ((device->usagePage != kHIDPage_GenericDesktop) ||
+            ((device->usage != kHIDUsage_GD_Joystick &&
+              device->usage != kHIDUsage_GD_GamePad &&
+              device->usage != kHIDUsage_GD_MultiAxisController))) {
 
             /* release memory for the device */
             HIDDisposeDevice(&device);
--- a/src/joystick/linux/SDL_sysjoystick.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/joystick/linux/SDL_sysjoystick.c	Thu Jun 14 13:21:29 2007 +0000
@@ -53,7 +53,7 @@
     "SideWinder Precision Pro", 4, 1, 0}, {
     "SideWinder 3D Pro", 4, 1, 0}, {
     "Microsoft SideWinder 3D Pro", 4, 1, 0}, {
-    "Microsoft SideWinder Precision Pro", 4, 1, 0 }, {
+    "Microsoft SideWinder Precision Pro", 4, 1, 0}, {
     "Microsoft SideWinder Dual Strike USB version 1.0", 2, 1, 0}, {
     "WingMan Interceptor", 3, 3, 0}, {
     "WingMan Extreme Digital 3D", 4, 1, 0}, {
--- a/src/loadso/beos/SDL_sysloadso.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/loadso/beos/SDL_sysloadso.c	Thu Jun 14 13:21:29 2007 +0000
@@ -49,7 +49,8 @@
 {
     void *sym = NULL;
     image_id library_id = (image_id) handle;
-    status_t rc = get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
+    status_t rc =
+        get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
     if (rc != B_NO_ERROR) {
         SDL_SetError(strerror(rc));
     }
@@ -69,4 +70,3 @@
 #endif /* SDL_LOADSO_BEOS */
 
 /* vi: set ts=4 sw=4 expandtab: */
-
--- a/src/stdlib/SDL_string.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/stdlib/SDL_string.c	Thu Jun 14 13:21:29 2007 +0000
@@ -298,8 +298,8 @@
 {
     char *srcp = (char *) src;
     char *dstp = (char *) dst;
-    srcp += len-1;
-    dstp += len-1;
+    srcp += len - 1;
+    dstp += len - 1;
     while (len--) {
         *dstp-- = *srcp--;
     }
@@ -872,7 +872,8 @@
                             ++index;
                         }
                         if (text[index] == '0') {
-                            if (SDL_tolower((unsigned char) text[index + 1]) == 'x') {
+                            if (SDL_tolower((unsigned char) text[index + 1])
+                                == 'x') {
                                 radix = 16;
                             } else {
                                 radix = 8;
--- a/src/timer/mint/SDL_systimer.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/timer/mint/SDL_systimer.c	Thu Jun 14 13:21:29 2007 +0000
@@ -80,8 +80,8 @@
     if (read_hz200_from_vbl) {
         now = SDL_Atari_hz200;
     } else {
-        void *old_stack = (void *)Super(0);
-        now = *((volatile long *)_hz_200);
+        void *old_stack = (void *) Super(0);
+        now = *((volatile long *) _hz_200);
         Super(old_stack);
     }
 
--- a/src/video/SDL_blit_A.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/SDL_blit_A.c	Thu Jun 14 13:21:29 2007 +0000
@@ -387,9 +387,11 @@
     packsswb_r2r(mm6, mm3);     /* 0000FFFF -> mm3 */
     pxor_r2r(mm0, mm3);         /* 0000F000 -> mm3 (~channel mask) */
     /* get alpha channel shift */
+    /* *INDENT-OFF* */
     __asm__ __volatile__ (
         "movd %0, %%mm5"
         : : "rm" ((Uint32) sf->Ashift) ); /* Ashift -> mm5 */
+    /* *INDENT-ON* */
 
     while (height--) {
 	    /* *INDENT-OFF* */
--- a/src/video/SDL_pixels.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/SDL_pixels.c	Thu Jun 14 13:21:29 2007 +0000
@@ -551,8 +551,8 @@
 
 /* Find the pixel value corresponding to an RGBA quadruple */
 Uint32
-SDL_MapRGBA(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g,
-            const Uint8 b, const Uint8 a)
+SDL_MapRGBA(const SDL_PixelFormat * const format, const Uint8 r,
+            const Uint8 g, const Uint8 b, const Uint8 a)
 {
     if (format->palette == NULL) {
         return (r >> format->Rloss) << format->Rshift
--- a/src/video/bwindow/SDL_sysvideo.cc	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/bwindow/SDL_sysvideo.cc	Thu Jun 14 13:21:29 2007 +0000
@@ -372,7 +372,7 @@
         modes = SDL_modelist[((bpp + 7) / 8) - 1];
 
         bool exactmatch = false;
-        for ( uint32 x = 0; modes[x]; x++ ) {
+        for (uint32 x = 0; modes[x]; x++) {
             if (modes[x]->w == width && modes[x]->h == height) {
                 exactmatch = true;
                 i = x;
@@ -385,7 +385,8 @@
                 /* still looking */
             }
             if (!modes[i] || (modes[i]->w < width) || (modes[i]->h < height)) {
-                --i;                /* We went too far */
+                /* We went too far */
+                --i;
             }
         }
         width = modes[i]->w;
--- a/src/video/directfb/SDL_DirectFB_yuv.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/directfb/SDL_DirectFB_yuv.c	Thu Jun 14 13:21:29 2007 +0000
@@ -119,7 +119,8 @@
     /* Need to set coop level or newer DirectFB versions will fail here. */
     ret = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
     if (ret) {
-        SetDirectFBError("IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret);
+        SetDirectFBError
+            ("IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret);
         layer->Release(layer);
         return ret;
     }
--- a/src/video/fbcon/SDL_fbvideo.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/fbcon/SDL_fbvideo.c	Thu Jun 14 13:21:29 2007 +0000
@@ -181,7 +181,8 @@
                            struct fb_var_screeninfo *vinfo);
 static void FB_RestorePalette(_THIS);
 
-static int SDL_getpagesize(void)
+static int
+SDL_getpagesize(void)
 {
 #ifdef HAVE_GETPAGESIZE
     return getpagesize();
@@ -189,7 +190,8 @@
     return PAGE_SIZE;
 #else
 #error Can not determine system page size.
-    return 4096;  /* this is what it USED to be in Linux... */
+    /* this is what it USED to be in Linux... */
+    return 4096;
 #endif
 }
 
--- a/src/video/gem/SDL_gemvideo.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/gem/SDL_gemvideo.c	Thu Jun 14 13:21:29 2007 +0000
@@ -650,7 +650,7 @@
         /*--- Verify if asked mode can be used ---*/
     if (VDI_bpp != bpp) {
         SDL_SetError("%d bpp mode not supported", bpp);
-        return(NULL);
+        return (NULL);
     }
 
     if (flags & SDL_FULLSCREEN) {
@@ -774,10 +774,10 @@
             /* Center window */
             x2 = (GEM_desk_w - w2) >> 1;
             y2 = (GEM_desk_h - h2) >> 1;
-            if (x2<0) {
+            if (x2 < 0) {
                 x2 = 0;
             }
-            if (y2<0) {
+            if (y2 < 0) {
                 y2 = 0;
             }
             x2 += GEM_desk_x;
@@ -811,9 +811,11 @@
             wind_open(GEM_handle, x2, y2, w2, h2);
         } else {
             /* Resize window to fit asked video mode */
-            wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
-            if (wind_calc(WC_BORDER, GEM_win_type, x2,y2,width,height, &x2,&y2,&w2,&h2)) {
-                wind_set (GEM_handle, WF_CURRXYWH, x2,y2,w2,h2);
+            wind_get(GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
+            if (wind_calc
+                (WC_BORDER, GEM_win_type, x2, y2, width, height, &x2, &y2,
+                 &w2, &h2)) {
+                wind_set(GEM_handle, WF_CURRXYWH, x2, y2, w2, h2);
             }
         }
 
--- a/src/video/x11/SDL_x11dyn.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/x11/SDL_x11dyn.c	Thu Jun 14 13:21:29 2007 +0000
@@ -167,10 +167,12 @@
         X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8, (void **) &pXCreateIC);
 #endif
 
-        if (SDL_X11_HAVE_BASEXLIB) {  /* all required symbols loaded. */
+        if (SDL_X11_HAVE_BASEXLIB) {
+            /* all required symbols loaded. */
             SDL_ClearError();
         } else {
-            SDL_X11_UnloadSymbols();  /* in case something got loaded... */
+            /* in case something got loaded... */
+            SDL_X11_UnloadSymbols();
             rc = 0;
         }
     }
--- a/src/video/xbios/SDL_xbios.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/xbios/SDL_xbios.c	Thu Jun 14 13:21:29 2007 +0000
@@ -97,10 +97,10 @@
         if (VgetMonitor() == MONITOR_MONO)
             return 0;
         /*if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
-            if (!SDL_XBIOS_SB3Usable((scpn_cookie_t *) cookie_scpn)) {
-                return 0;
-            }
-        }*/
+           if (!SDL_XBIOS_SB3Usable((scpn_cookie_t *) cookie_scpn)) {
+           return 0;
+           }
+           } */
         break;
     default:
         return 0;
--- a/src/video/xbios/SDL_xbios.h	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/xbios/SDL_xbios.h	Thu Jun 14 13:21:29 2007 +0000
@@ -29,12 +29,12 @@
 
 typedef struct SDL_VideoData
 {
-    long cookie_vdo;		/* _VDO cookie */
+    long cookie_vdo;            /* _VDO cookie */
 
-    Uint16 old_modecode;	/* Current video mode */
-    void *old_vbase;		/* Current pointer to video RAM */
-    int old_numcol;		/* Number of colors in saved palette */
-    Uint32 old_palette[256];	/* Buffer to save current palette */
+    Uint16 old_modecode;        /* Current video mode */
+    void *old_vbase;            /* Current pointer to video RAM */
+    int old_numcol;             /* Number of colors in saved palette */
+    Uint32 old_palette[256];    /* Buffer to save current palette */
 
 #if 0
     int old_video_mode;         /* Old video mode before entering SDL */
--- a/src/video/xbios/SDL_xbiosmodes.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/src/video/xbios/SDL_xbiosmodes.c	Thu Jun 14 13:21:29 2007 +0000
@@ -28,13 +28,14 @@
 #include "SDL_xbiosmodes.h"
 
 
-typedef struct {
-    int width,height,bpp;
+typedef struct
+{
+    int width, height, bpp;
     int modecode;
     int doubleline;
 } xbios_mode_t;
 
-static xbios_mode_t falcon_rgb_modes[]={
+static xbios_mode_t falcon_rgb_modes[] = {
     {768, 480, 16, BPS16 | COL80 | OVERSCAN | VERTFLAG},
     {768, 240, 16, BPS16 | COL80 | OVERSCAN},
     {640, 400, 16, BPS16 | COL80 | VERTFLAG},
@@ -52,19 +53,19 @@
     {320, 400, 8, BPS8 | VERTFLAG},
     {320, 200, 8, BPS8}
 };
- 
-static xbios_mode_t falcon_vga_modes[]={
-    {320, 480, 16, BPS16 },
+
+static xbios_mode_t falcon_vga_modes[] = {
+    {320, 480, 16, BPS16},
     {320, 240, 16, BPS16 | VERTFLAG},
     {640, 480, 8, BPS8 | COL80},
     {640, 240, 8, BPS8 | COL80 | VERTFLAG},
-    {320, 480, 8, BPS8 },
+    {320, 480, 8, BPS8},
     {320, 240, 8, BPS8 | VERTFLAG}
 };
 
 static void
 SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode,
-    SDL_bool doubleline)
+                  SDL_bool doubleline)
 {
     SDL_VideoDisplay display;
     SDL_DisplayData *displaydata;
@@ -74,9 +75,9 @@
 
     Rmask = Gmask = Bmask = Amask = 0;
     if (bpp == 16) {
-        Rmask = 31<<11;
-	Gmask = 63<<5;
-	Bmask = 31;
+        Rmask = 31 << 11;
+        Gmask = 63 << 5;
+        Bmask = 31;
     }
     /* Memorize for c2p4 operation */
     orig_bpp = bpp;
@@ -92,7 +93,7 @@
 
     displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
     if (!displaydata) {
-       return;
+        return;
     }
     displaydata->modecode = modecode;
     displaydata->doubleline = doubleline;
@@ -140,7 +141,7 @@
         break;
     case VDO_TT:
         Setscreen(-1, data->old_vbase, -1);
-	EsetShift(data->old_modecode);
+        EsetShift(data->old_modecode);
         break;
     case VDO_F30:
         Setscreen(-1, data->old_vbase, -1);
@@ -204,8 +205,8 @@
     case VDO_F30:
         data->old_numcol = 1 << (1 << (data->old_modecode & NUMCOLS));
         if (data->old_numcol > 256) {
-	    data->old_numcol = 0;
-	} else {
+            data->old_numcol = 0;
+        } else {
             VgetRGB(0, data->old_numcol, data->old_palette);
         }
         break;
@@ -261,7 +262,7 @@
         break;
     case VDO_F30:
         {
-	    Uint16 modecodemask = data->old_modecode & (VGA | PAL);
+            Uint16 modecodemask = data->old_modecode & (VGA | PAL);
             int i;
 
             switch (VgetMonitor()) {
@@ -270,19 +271,27 @@
                 break;
             case MONITOR_RGB:
             case MONITOR_TV:
-               for (i=0; i<sizeof(falcon_rgb_modes)/sizeof(xbios_mode_t); i++) {
-                   SDL_XBIOS_AddMode(_this, falcon_rgb_modes[i].width,
-		       falcon_rgb_modes[i].height, falcon_rgb_modes[i].bpp,
-		       falcon_rgb_modes[i].modecode & modecodemask, SDL_FALSE);
-	       }
-               break;
+                for (i = 0;
+                     i < sizeof(falcon_rgb_modes) / sizeof(xbios_mode_t);
+                     i++) {
+                    SDL_XBIOS_AddMode(_this, falcon_rgb_modes[i].width,
+                                      falcon_rgb_modes[i].height,
+                                      falcon_rgb_modes[i].bpp,
+                                      falcon_rgb_modes[i].
+                                      modecode & modecodemask, SDL_FALSE);
+                }
+                break;
             case MONITOR_VGA:
-               for (i=0; i<sizeof(falcon_vga_modes)/sizeof(xbios_mode_t); i++) {
-                   SDL_XBIOS_AddMode(_this, falcon_vga_modes[i].width,
-		       falcon_vga_modes[i].height, falcon_vga_modes[i].bpp,
-		       falcon_vga_modes[i].modecode & modecodemask, SDL_FALSE);
-	       }
-               break;
+                for (i = 0;
+                     i < sizeof(falcon_vga_modes) / sizeof(xbios_mode_t);
+                     i++) {
+                    SDL_XBIOS_AddMode(_this, falcon_vga_modes[i].width,
+                                      falcon_vga_modes[i].height,
+                                      falcon_vga_modes[i].bpp,
+                                      falcon_vga_modes[i].
+                                      modecode & modecodemask, SDL_FALSE);
+                }
+                break;
             }
         }
         break;
--- a/test/testloadso.c	Thu Jun 14 06:32:36 2007 +0000
+++ b/test/testloadso.c	Thu Jun 14 13:21:29 2007 +0000
@@ -7,65 +7,64 @@
 
 #include "SDL.h"
 
-typedef int (*fntype)(const char *);
+typedef int (*fntype) (const char *);
 
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
 {
-	int retval = 0;
-	int hello = 0;
-	const char *libname = NULL;
-	const char *symname = NULL;
-	void *lib = NULL;
-	fntype fn = NULL;
+    int retval = 0;
+    int hello = 0;
+    const char *libname = NULL;
+    const char *symname = NULL;
+    void *lib = NULL;
+    fntype fn = NULL;
 
-	if (argc != 3) {
-		const char *app = argv[0];
-		fprintf(stderr, "USAGE: %s <library> <functionname>\n", app);
-		fprintf(stderr, "       %s --hello <lib with puts()>\n", app);
-		return 1;
-	}
+    if (argc != 3) {
+        const char *app = argv[0];
+        fprintf(stderr, "USAGE: %s <library> <functionname>\n", app);
+        fprintf(stderr, "       %s --hello <lib with puts()>\n", app);
+        return 1;
+    }
 
-	/* Initialize SDL */
-	if ( SDL_Init(0) < 0 ) {
-		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
-		return 2;
-	}
+    /* Initialize SDL */
+    if (SDL_Init(0) < 0) {
+        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
+        return 2;
+    }
 
-	if (strcmp(argv[1], "--hello") == 0) {
-		hello = 1;
-		libname = argv[2];
-		symname = "puts";
-	} else {
-		libname = argv[1];
-		symname = argv[2];
-	}
+    if (strcmp(argv[1], "--hello") == 0) {
+        hello = 1;
+        libname = argv[2];
+        symname = "puts";
+    } else {
+        libname = argv[1];
+        symname = argv[2];
+    }
 
-	lib = SDL_LoadObject(libname);
-        if (lib == NULL) {
-		fprintf(stderr, "SDL_LoadObject('%s') failed: %s\n",
-		        libname, SDL_GetError());
-		retval = 3;
-	} else {
-		fn = (fntype) SDL_LoadFunction(lib, symname);
-		if (fn == NULL) {
-			fprintf(stderr, "SDL_LoadFunction('%s') failed: %s\n",
-			        symname, SDL_GetError());
-			retval = 4;
-		} else {
-			printf("Found %s in %s at %p\n", symname, libname, fn);
-			if (hello) {
-				printf("Calling function...\n");
-				fflush(stdout);
-				fn("     HELLO, WORLD!\n");
-				printf("...apparently, we survived.  :)\n");
-				printf("Unloading library...\n");
-				fflush(stdout);
-			}
-		}
-		SDL_UnloadObject(lib);
-	}
-	SDL_Quit();
-	return(0);
+    lib = SDL_LoadObject(libname);
+    if (lib == NULL) {
+        fprintf(stderr, "SDL_LoadObject('%s') failed: %s\n",
+                libname, SDL_GetError());
+        retval = 3;
+    } else {
+        fn = (fntype) SDL_LoadFunction(lib, symname);
+        if (fn == NULL) {
+            fprintf(stderr, "SDL_LoadFunction('%s') failed: %s\n",
+                    symname, SDL_GetError());
+            retval = 4;
+        } else {
+            printf("Found %s in %s at %p\n", symname, libname, fn);
+            if (hello) {
+                printf("Calling function...\n");
+                fflush(stdout);
+                fn("     HELLO, WORLD!\n");
+                printf("...apparently, we survived.  :)\n");
+                printf("Unloading library...\n");
+                fflush(stdout);
+            }
+        }
+        SDL_UnloadObject(lib);
+    }
+    SDL_Quit();
+    return (0);
 }
-
-