Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
make indent
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 14, 2007
1 parent 403efff commit 0b94a4c
Show file tree
Hide file tree
Showing 18 changed files with 142 additions and 122 deletions.
6 changes: 3 additions & 3 deletions include/SDL_video.h
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/joystick/darwin/10.3.9-FIX/IOHIDLib.h
@@ -1,3 +1,4 @@
/* *INDENT-OFF* */
/*
*
* @APPLE_LICENSE_HEADER_START@
Expand Down
8 changes: 4 additions & 4 deletions src/joystick/darwin/SDL_sysjoystick.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -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}, {
Expand Down
4 changes: 2 additions & 2 deletions src/loadso/beos/SDL_sysloadso.c
Expand Up @@ -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));
}
Expand All @@ -69,4 +70,3 @@ SDL_UnloadObject(void *handle)
#endif /* SDL_LOADSO_BEOS */

/* vi: set ts=4 sw=4 expandtab: */

7 changes: 4 additions & 3 deletions src/stdlib/SDL_string.c
Expand Up @@ -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--;
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/timer/mint/SDL_systimer.c
Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions src/video/SDL_blit_A.c
Expand Up @@ -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* */
Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_pixels.c
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/video/bwindow/SDL_sysvideo.cc
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/video/directfb/SDL_DirectFB_yuv.c
Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions src/video/fbcon/SDL_fbvideo.c
Expand Up @@ -181,15 +181,17 @@ 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();
#elif defined(PAGE_SIZE)
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
}

Expand Down
14 changes: 8 additions & 6 deletions src/video/gem/SDL_gemvideo.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/video/x11/SDL_x11dyn.c
Expand Up @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/video/xbios/SDL_xbios.c
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/video/xbios/SDL_xbios.h
Expand Up @@ -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 */
Expand Down
65 changes: 37 additions & 28 deletions src/video/xbios/SDL_xbiosmodes.c
Expand Up @@ -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},
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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()) {
Expand All @@ -270,19 +271,27 @@ SDL_XBIOS_InitModes(_THIS)
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;
Expand Down

0 comments on commit 0b94a4c

Please sign in to comment.