From a1272037ba19c5dfb24466a3c0a103e7ef38997b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 1 Jan 2009 08:21:19 +0000 Subject: [PATCH] indent --- src/audio/SDL_audio.c | 4 +- src/audio/alsa/SDL_alsa_audio.c | 2 +- src/audio/esd/SDL_esdaudio.c | 2 +- src/audio/iphoneos/SDL_coreaudio_iphone.c | 2 +- src/audio/mint/SDL_mintaudio_dma8.c | 2 +- src/audio/mint/SDL_mintaudio_gsxb.c | 2 +- src/audio/mint/SDL_mintaudio_mcsn.c | 2 +- src/audio/mint/SDL_mintaudio_stfa.c | 2 +- src/audio/mint/SDL_mintaudio_xbios.c | 2 +- src/audio/nas/SDL_nasaudio.c | 2 +- src/audio/nds/SDL_ndsaudio.c | 2 +- src/audio/nto/SDL_nto_audio.c | 2 +- src/audio/paudio/SDL_paudio.c | 2 +- src/video/x11/SDL_x11events.c | 86 ++++++++++++----------- src/video/x11/SDL_x11mouse.c | 14 ++-- src/video/x11/SDL_x11window.c | 2 +- 16 files changed, 68 insertions(+), 62 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 80460f5ae..51ca00f1e 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -617,10 +617,10 @@ SDL_AudioInit(const char *driver_name) current_audio.name = backend->name; current_audio.desc = backend->desc; rc = backend->init(¤t_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; diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index daa08357f..4854fb115 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -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. */ } diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index 201a41568..0a9078ee2 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -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"). */ } diff --git a/src/audio/iphoneos/SDL_coreaudio_iphone.c b/src/audio/iphoneos/SDL_coreaudio_iphone.c index 3e50ea9f9..2e0982b90 100644 --- a/src/audio/iphoneos/SDL_coreaudio_iphone.c +++ b/src/audio/iphoneos/SDL_coreaudio_iphone.c @@ -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 = { diff --git a/src/audio/mint/SDL_mintaudio_dma8.c b/src/audio/mint/SDL_mintaudio_dma8.c index 223d4495a..d2723d862 100644 --- a/src/audio/mint/SDL_mintaudio_dma8.c +++ b/src/audio/mint/SDL_mintaudio_dma8.c @@ -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 = { diff --git a/src/audio/mint/SDL_mintaudio_gsxb.c b/src/audio/mint/SDL_mintaudio_gsxb.c index ab9d7632e..ab84e7710 100644 --- a/src/audio/mint/SDL_mintaudio_gsxb.c +++ b/src/audio/mint/SDL_mintaudio_gsxb.c @@ -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 = { diff --git a/src/audio/mint/SDL_mintaudio_mcsn.c b/src/audio/mint/SDL_mintaudio_mcsn.c index 8dc8fcfaa..1625f8d31 100644 --- a/src/audio/mint/SDL_mintaudio_mcsn.c +++ b/src/audio/mint/SDL_mintaudio_mcsn.c @@ -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 = { diff --git a/src/audio/mint/SDL_mintaudio_stfa.c b/src/audio/mint/SDL_mintaudio_stfa.c index 3ba08972f..f7ba3f9b0 100644 --- a/src/audio/mint/SDL_mintaudio_stfa.c +++ b/src/audio/mint/SDL_mintaudio_stfa.c @@ -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 = { diff --git a/src/audio/mint/SDL_mintaudio_xbios.c b/src/audio/mint/SDL_mintaudio_xbios.c index 799a4cbe4..115e1cdcb 100644 --- a/src/audio/mint/SDL_mintaudio_xbios.c +++ b/src/audio/mint/SDL_mintaudio_xbios.c @@ -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 = { diff --git a/src/audio/nas/SDL_nasaudio.c b/src/audio/nas/SDL_nasaudio.c index dc72b537b..359748fd4 100644 --- a/src/audio/nas/SDL_nasaudio.c +++ b/src/audio/nas/SDL_nasaudio.c @@ -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 = { diff --git a/src/audio/nds/SDL_ndsaudio.c b/src/audio/nds/SDL_ndsaudio.c index e92aeb410..aec17f05f 100644 --- a/src/audio/nds/SDL_ndsaudio.c +++ b/src/audio/nds/SDL_ndsaudio.c @@ -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 = { diff --git a/src/audio/nto/SDL_nto_audio.c b/src/audio/nto/SDL_nto_audio.c index d85f94e69..2622b4331 100644 --- a/src/audio/nto/SDL_nto_audio.c +++ b/src/audio/nto/SDL_nto_audio.c @@ -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 = { diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c index 79cff19ce..83b845f9d 100644 --- a/src/audio/paudio/SDL_paudio.c +++ b/src/audio/paudio/SDL_paudio.c @@ -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 = { diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 1469ceacb..096e8705b 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -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); diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 85e23968d..5de687ca8 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -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); @@ -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; } @@ -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; } diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index abf3c173a..e1f05d6f0 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -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; }