From 0b94a4c53bda3055a2493bfcc9940828d0c521a5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 14 Jun 2007 13:21:29 +0000 Subject: [PATCH] make indent --- include/SDL_video.h | 6 +- src/joystick/darwin/10.3.9-FIX/IOHIDLib.h | 1 + src/joystick/darwin/SDL_sysjoystick.c | 8 +- src/joystick/linux/SDL_sysjoystick.c | 2 +- src/loadso/beos/SDL_sysloadso.c | 4 +- src/stdlib/SDL_string.c | 7 +- src/timer/mint/SDL_systimer.c | 4 +- src/video/SDL_blit_A.c | 2 + src/video/SDL_pixels.c | 4 +- src/video/bwindow/SDL_sysvideo.cc | 5 +- src/video/directfb/SDL_DirectFB_yuv.c | 3 +- src/video/fbcon/SDL_fbvideo.c | 6 +- src/video/gem/SDL_gemvideo.c | 14 +-- src/video/x11/SDL_x11dyn.c | 6 +- src/video/xbios/SDL_xbios.c | 8 +- src/video/xbios/SDL_xbios.h | 10 +- src/video/xbios/SDL_xbiosmodes.c | 65 +++++++------ test/testloadso.c | 109 +++++++++++----------- 18 files changed, 142 insertions(+), 122 deletions(-) diff --git a/include/SDL_video.h b/include/SDL_video.h index 0abe6d16f..0dc0876a4 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -1300,9 +1300,9 @@ extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID); /* * 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 diff --git a/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h b/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h index 9ae269998..836a71ec3 100644 --- a/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h +++ b/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h @@ -1,3 +1,4 @@ +/* *INDENT-OFF* */ /* * * @APPLE_LICENSE_HEADER_START@ diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c index 9d2797d7a..60755d17b 100644 --- a/src/joystick/darwin/SDL_sysjoystick.c +++ b/src/joystick/darwin/SDL_sysjoystick.c @@ -693,10 +693,10 @@ SDL_SYS_JoystickInit(void) */ /* 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); diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index 121778b90..8ae710ee8 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -53,7 +53,7 @@ static struct "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}, { diff --git a/src/loadso/beos/SDL_sysloadso.c b/src/loadso/beos/SDL_sysloadso.c index ba06d933e..832bfe62a 100644 --- a/src/loadso/beos/SDL_sysloadso.c +++ b/src/loadso/beos/SDL_sysloadso.c @@ -49,7 +49,8 @@ SDL_LoadFunction(void *handle, const char *name) { 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 @@ SDL_UnloadObject(void *handle) #endif /* SDL_LOADSO_BEOS */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index ab339cecf..e623e7581 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -298,8 +298,8 @@ SDL_revcpy(void *dst, const void *src, size_t len) { 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 @@ SDL_sscanf(const char *text, const char *fmt, ...) ++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; diff --git a/src/timer/mint/SDL_systimer.c b/src/timer/mint/SDL_systimer.c index d5c29e183..bef184cf0 100644 --- a/src/timer/mint/SDL_systimer.c +++ b/src/timer/mint/SDL_systimer.c @@ -80,8 +80,8 @@ SDL_GetTicks(void) 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); } diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index b144de604..25ecdb3c0 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -387,9 +387,11 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info) 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* */ diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 18cc0bd6a..0cd4a337d 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -551,8 +551,8 @@ SDL_MapRGB(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g, /* 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 diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc index f17e8977d..77970afbc 100644 --- a/src/video/bwindow/SDL_sysvideo.cc +++ b/src/video/bwindow/SDL_sysvideo.cc @@ -372,7 +372,7 @@ extern "C" 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 @@ extern "C" /* 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; diff --git a/src/video/directfb/SDL_DirectFB_yuv.c b/src/video/directfb/SDL_DirectFB_yuv.c index 78a56d071..1f2d5fb49 100644 --- a/src/video/directfb/SDL_DirectFB_yuv.c +++ b/src/video/directfb/SDL_DirectFB_yuv.c @@ -119,7 +119,8 @@ CreateYUVSurface(_THIS, struct private_yuvhwdata *hwdata, /* 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; } diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c index 5b78277da..50b85762d 100644 --- a/src/video/fbcon/SDL_fbvideo.c +++ b/src/video/fbcon/SDL_fbvideo.c @@ -181,7 +181,8 @@ static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo, 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 @@ static int SDL_getpagesize(void) 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 } diff --git a/src/video/gem/SDL_gemvideo.c b/src/video/gem/SDL_gemvideo.c index 2be47b088..73fa099b7 100644 --- a/src/video/gem/SDL_gemvideo.c +++ b/src/video/gem/SDL_gemvideo.c @@ -650,7 +650,7 @@ GEM_SetVideoMode(_THIS, SDL_Surface * current, /*--- 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 @@ GEM_SetVideoMode(_THIS, SDL_Surface * current, /* 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 @@ GEM_SetVideoMode(_THIS, SDL_Surface * current, 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); } } diff --git a/src/video/x11/SDL_x11dyn.c b/src/video/x11/SDL_x11dyn.c index 1ecb7a99f..0bc668813 100644 --- a/src/video/x11/SDL_x11dyn.c +++ b/src/video/x11/SDL_x11dyn.c @@ -167,10 +167,12 @@ SDL_X11_LoadSymbols(void) 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; } } diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index 6d6d01212..eb92ad0fd 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -97,10 +97,10 @@ XBIOS_Available(void) 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; diff --git a/src/video/xbios/SDL_xbios.h b/src/video/xbios/SDL_xbios.h index 71018c1e5..bba9f1629 100644 --- a/src/video/xbios/SDL_xbios.h +++ b/src/video/xbios/SDL_xbios.h @@ -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 */ diff --git a/src/video/xbios/SDL_xbiosmodes.c b/src/video/xbios/SDL_xbiosmodes.c index e856daee3..a2736d3d5 100644 --- a/src/video/xbios/SDL_xbiosmodes.c +++ b/src/video/xbios/SDL_xbiosmodes.c @@ -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 @@ static xbios_mode_t falcon_rgb_modes[]={ {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 @@ SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode, 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 @@ SDL_XBIOS_AddMode(_THIS, int width, int height, int bpp, Uint16 modecode, displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata)); if (!displaydata) { - return; + return; } displaydata->modecode = modecode; displaydata->doubleline = doubleline; @@ -140,7 +141,7 @@ SDL_XBIOS_ModeRestore(_THIS) 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 @@ SDL_XBIOS_PaletteSave(_THIS) 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 @@ SDL_XBIOS_InitModes(_THIS) 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 @@ SDL_XBIOS_InitModes(_THIS) break; case MONITOR_RGB: case MONITOR_TV: - for (i=0; i \n", app); - fprintf(stderr, " %s --hello \n", app); - return 1; - } + if (argc != 3) { + const char *app = argv[0]; + fprintf(stderr, "USAGE: %s \n", app); + fprintf(stderr, " %s --hello \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); } - -