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

Commit

Permalink
indent
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 1, 2009
1 parent 53a99f3 commit a127203
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 62 deletions.
4 changes: 2 additions & 2 deletions src/audio/SDL_audio.c
Expand Up @@ -617,10 +617,10 @@ SDL_AudioInit(const char *driver_name)
current_audio.name = backend->name;
current_audio.desc = backend->desc;
rc = backend->init(&current_audio.impl);
if (rc == 2) { /* init'd, and devices available. Take it! */
if (rc == 2) { /* init'd, and devices available. Take it! */
initialized = 1;
best_choice = i;
} else if (rc == 1) { /* init'd, but can't see any devices. */
} else if (rc == 1) { /* init'd, but can't see any devices. */
current_audio.impl.Deinitialize();
if (best_choice == -1) {
best_choice = i;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/alsa/SDL_alsa_audio.c
Expand Up @@ -607,7 +607,7 @@ ALSA_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = ALSA_Deinitialize;
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: Add device enum! */

return 1; /* !!! FIXME: return 2 once device enum is implemented. */
return 1; /* !!! FIXME: return 2 once device enum is implemented. */
}


Expand Down
2 changes: 1 addition & 1 deletion src/audio/esd/SDL_esdaudio.c
Expand Up @@ -341,7 +341,7 @@ ESD_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = ESD_Deinitialize;
impl->OnlyHasDefaultOutputDevice = 1;

return 2; /* return 2 (definitely have a "device"). */
return 2; /* return 2 (definitely have a "device"). */
}


Expand Down
2 changes: 1 addition & 1 deletion src/audio/iphoneos/SDL_coreaudio_iphone.c
Expand Up @@ -329,7 +329,7 @@ COREAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1;
impl->HasCaptureSupport = 0; /* still needs to be written */

return 2; /* defitely have an audio device. */
return 2; /* defitely have an audio device. */
}

AudioBootStrap COREAUDIOIPHONE_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/mint/SDL_mintaudio_dma8.c
Expand Up @@ -338,7 +338,7 @@ MINTDMA8_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_DMA8_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/mint/SDL_mintaudio_gsxb.c
Expand Up @@ -433,7 +433,7 @@ MINTGSXB_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_GSXB_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/mint/SDL_mintaudio_mcsn.c
Expand Up @@ -390,7 +390,7 @@ MINTMCSN_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_MCSN_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/mint/SDL_mintaudio_stfa.c
Expand Up @@ -297,7 +297,7 @@ MINTSTFA_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_STFA_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/mint/SDL_mintaudio_xbios.c
Expand Up @@ -490,7 +490,7 @@ MINTXBIOS_Init(SDL_AudioDriverImpl * impl)
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap MINTAUDIO_XBIOS_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/nas/SDL_nasaudio.c
Expand Up @@ -398,7 +398,7 @@ NAS_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = NAS_Deinitialize;
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: is this true? */

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap NAS_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/nds/SDL_ndsaudio.c
Expand Up @@ -120,7 +120,7 @@ NDSAUD_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1;
impl->OnlyHasDefaultInputDevice = 1;

return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap NDSAUD_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/nto/SDL_nto_audio.c
Expand Up @@ -457,7 +457,7 @@ NTO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */

/* !!! FIXME: device enum might make this 1. */
return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap QNXNTOAUDIO_bootstrap = {
Expand Down
2 changes: 1 addition & 1 deletion src/audio/paudio/SDL_paudio.c
Expand Up @@ -545,7 +545,7 @@ PAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */

/* !!! FIXME: device enum might make this 1. */
return 2; /* 2 == definitely has an audio device. */
return 2; /* 2 == definitely has an audio device. */
}

AudioBootStrap PAUDIO_bootstrap = {
Expand Down
86 changes: 46 additions & 40 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -297,49 +297,55 @@ X11_DispatchEvent(_THIS)

default:{
#if SDL_VIDEO_DRIVER_X11_XINPUT
for (i = 0; i < SDL_GetNumMice(); ++i) {
SDL_Mouse *mouse;
X11_MouseData *data;

mouse = SDL_GetMouse(i);
data = (X11_MouseData *)mouse->driverdata;
if (!data) {
continue;
}

if (xevent.type == data->motion) { /* MotionNotify */
XDeviceMotionEvent *move = (XDeviceMotionEvent *) & xevent;
for (i = 0; i < SDL_GetNumMice(); ++i) {
SDL_Mouse *mouse;
X11_MouseData *data;

mouse = SDL_GetMouse(i);
data = (X11_MouseData *) mouse->driverdata;
if (!data) {
continue;
}

if (xevent.type == data->motion) { /* MotionNotify */
XDeviceMotionEvent *move =
(XDeviceMotionEvent *) & xevent;
#ifdef DEBUG_MOTION
printf("X11 motion: %d,%d\n", move->x, move->y);
printf("X11 motion: %d,%d\n", move->x, move->y);
#endif
SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y, move->axis_data[2]);
return;
}
if (xevent.type == data->button_pressed) { /* ButtonPress */
XDeviceButtonPressedEvent *pressed =
(XDeviceButtonPressedEvent *) & xevent;
SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED, pressed->button);
return;
}
if (xevent.type == data->button_released) { /* ButtonRelease */
XDeviceButtonReleasedEvent *released =
(XDeviceButtonReleasedEvent *) & xevent;
SDL_SendMouseButton(released->deviceid, SDL_RELEASED, released->button);
return;
SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y,
move->axis_data[2]);
return;
}
if (xevent.type == data->button_pressed) { /* ButtonPress */
XDeviceButtonPressedEvent *pressed =
(XDeviceButtonPressedEvent *) & xevent;
SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED,
pressed->button);
return;
}
if (xevent.type == data->button_released) { /* ButtonRelease */
XDeviceButtonReleasedEvent *released =
(XDeviceButtonReleasedEvent *) & xevent;
SDL_SendMouseButton(released->deviceid, SDL_RELEASED,
released->button);
return;
}
if (xevent.type == data->proximity_in) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x,
proximity->y, SDL_PROXIMITYIN);
return;
}
if (xevent.type == data->proximity_out) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x,
proximity->y, SDL_PROXIMITYOUT);
return;
}
}
if (xevent.type == data->proximity_in) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x, proximity->y, SDL_PROXIMITYIN);
return;
}
if (xevent.type == data->proximity_out) {
XProximityNotifyEvent *proximity =
(XProximityNotifyEvent *) & xevent;
SDL_SendProximity(proximity->deviceid, proximity->x, proximity->y, SDL_PROXIMITYOUT);
return;
}
}
#endif
#ifdef DEBUG_XEVENTS
printf("Unhandled event %d\n", xevent.type);
Expand Down
14 changes: 7 additions & 7 deletions src/video/x11/SDL_x11mouse.c
Expand Up @@ -26,9 +26,9 @@

#if SDL_VIDEO_DRIVER_X11_XINPUT
static void
X11_FreeMouse(SDL_Mouse *mouse)
X11_FreeMouse(SDL_Mouse * mouse)
{
X11_MouseData *data = (X11_MouseData *)mouse->driverdata;
X11_MouseData *data = (X11_MouseData *) mouse->driverdata;

if (data) {
XCloseDevice(data->display, mouse->id);
Expand Down Expand Up @@ -73,7 +73,7 @@ X11_InitMouse(_THIS)
if (deviceClass->class == ValuatorClass) { /* bingo ;) */
XValuatorInfo *valInfo;

data = (X11_MouseData *)SDL_calloc(1, sizeof(*data));
data = (X11_MouseData *) SDL_calloc(1, sizeof(*data));
if (!data) {
continue;
}
Expand Down Expand Up @@ -120,11 +120,11 @@ X11_InitMouse(_THIS)
valInfo = (XValuatorInfo *) deviceClass;
/* if the device reports pressure, lets check it parameteres */
if (valInfo->num_axes > 2) {
SDL_AddMouse(&mouse, DevList[i].name,
valInfo->axes[2].max_value,
valInfo->axes[2].min_value, 1);
SDL_AddMouse(&mouse, DevList[i].name,
valInfo->axes[2].max_value,
valInfo->axes[2].min_value, 1);
} else {
SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1);
SDL_AddMouse(&mouse, DevList[i].name, 0, 0, 1);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11window.c
Expand Up @@ -534,7 +534,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
X11_MouseData *data;

mouse = SDL_GetMouse(i);
data = (X11_MouseData *)mouse->driverdata;
data = (X11_MouseData *) mouse->driverdata;
if (!data) {
continue;
}
Expand Down

0 comments on commit a127203

Please sign in to comment.