changeset 2942:1e431c2631ee

indent
author Sam Lantinga <slouken@libsdl.org>
date Thu, 01 Jan 2009 08:21:19 +0000
parents 1d2bc7259f30
children 6429dfe45d82
files src/audio/SDL_audio.c src/audio/alsa/SDL_alsa_audio.c src/audio/esd/SDL_esdaudio.c src/audio/iphoneos/SDL_coreaudio_iphone.c src/audio/mint/SDL_mintaudio_dma8.c src/audio/mint/SDL_mintaudio_gsxb.c src/audio/mint/SDL_mintaudio_mcsn.c src/audio/mint/SDL_mintaudio_stfa.c src/audio/mint/SDL_mintaudio_xbios.c src/audio/nas/SDL_nasaudio.c src/audio/nds/SDL_ndsaudio.c src/audio/nto/SDL_nto_audio.c src/audio/paudio/SDL_paudio.c src/video/x11/SDL_x11events.c src/video/x11/SDL_x11mouse.c src/video/x11/SDL_x11window.c
diffstat 16 files changed, 67 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/src/audio/SDL_audio.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/SDL_audio.c	Thu Jan 01 08:21:19 2009 +0000
@@ -617,10 +617,10 @@
         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;
--- a/src/audio/alsa/SDL_alsa_audio.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/alsa/SDL_alsa_audio.c	Thu Jan 01 08:21:19 2009 +0000
@@ -607,7 +607,7 @@
     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. */
 }
 
 
--- a/src/audio/esd/SDL_esdaudio.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/esd/SDL_esdaudio.c	Thu Jan 01 08:21:19 2009 +0000
@@ -341,7 +341,7 @@
     impl->Deinitialize = ESD_Deinitialize;
     impl->OnlyHasDefaultOutputDevice = 1;
 
-    return 2;  /* return 2 (definitely have a "device"). */
+    return 2;                   /* return 2 (definitely have a "device"). */
 }
 
 
--- a/src/audio/iphoneos/SDL_coreaudio_iphone.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/iphoneos/SDL_coreaudio_iphone.c	Thu Jan 01 08:21:19 2009 +0000
@@ -329,7 +329,7 @@
     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 = {
--- a/src/audio/mint/SDL_mintaudio_dma8.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/mint/SDL_mintaudio_dma8.c	Thu Jan 01 08:21:19 2009 +0000
@@ -338,7 +338,7 @@
     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 = {
--- a/src/audio/mint/SDL_mintaudio_gsxb.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/mint/SDL_mintaudio_gsxb.c	Thu Jan 01 08:21:19 2009 +0000
@@ -433,7 +433,7 @@
     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 = {
--- a/src/audio/mint/SDL_mintaudio_mcsn.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/mint/SDL_mintaudio_mcsn.c	Thu Jan 01 08:21:19 2009 +0000
@@ -390,7 +390,7 @@
     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 = {
--- a/src/audio/mint/SDL_mintaudio_stfa.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/mint/SDL_mintaudio_stfa.c	Thu Jan 01 08:21:19 2009 +0000
@@ -297,7 +297,7 @@
     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 = {
--- a/src/audio/mint/SDL_mintaudio_xbios.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/mint/SDL_mintaudio_xbios.c	Thu Jan 01 08:21:19 2009 +0000
@@ -490,7 +490,7 @@
     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 = {
--- a/src/audio/nas/SDL_nasaudio.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/nas/SDL_nasaudio.c	Thu Jan 01 08:21:19 2009 +0000
@@ -398,7 +398,7 @@
     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 = {
--- a/src/audio/nds/SDL_ndsaudio.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/nds/SDL_ndsaudio.c	Thu Jan 01 08:21:19 2009 +0000
@@ -120,7 +120,7 @@
     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 = {
--- a/src/audio/nto/SDL_nto_audio.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/nto/SDL_nto_audio.c	Thu Jan 01 08:21:19 2009 +0000
@@ -457,7 +457,7 @@
     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 = {
--- a/src/audio/paudio/SDL_paudio.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/audio/paudio/SDL_paudio.c	Thu Jan 01 08:21:19 2009 +0000
@@ -545,7 +545,7 @@
     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 = {
--- a/src/video/x11/SDL_x11events.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/video/x11/SDL_x11events.c	Thu Jan 01 08:21:19 2009 +0000
@@ -297,49 +297,55 @@
 
     default:{
 #if SDL_VIDEO_DRIVER_X11_XINPUT
-        for (i = 0; i < SDL_GetNumMice(); ++i) {
-            SDL_Mouse *mouse;
-            X11_MouseData *data;
+            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;
+                }
 
-            mouse = SDL_GetMouse(i);
-            data = (X11_MouseData *)mouse->driverdata;
-            if (!data) {
-                continue;
-            }
-                    
-            if (xevent.type == data->motion) {          /* MotionNotify */
-                XDeviceMotionEvent *move = (XDeviceMotionEvent *) & xevent;
+                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;
+                    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->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;
-            }
-        }
 #endif
 #ifdef DEBUG_XEVENTS
             printf("Unhandled event %d\n", xevent.type);
--- a/src/video/x11/SDL_x11mouse.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/video/x11/SDL_x11mouse.c	Thu Jan 01 08:21:19 2009 +0000
@@ -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 @@
                 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 @@
                     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;
                 }
--- a/src/video/x11/SDL_x11window.c	Thu Jan 01 08:19:56 2009 +0000
+++ b/src/video/x11/SDL_x11window.c	Thu Jan 01 08:21:19 2009 +0000
@@ -534,7 +534,7 @@
             X11_MouseData *data;
 
             mouse = SDL_GetMouse(i);
-            data = (X11_MouseData *)mouse->driverdata;
+            data = (X11_MouseData *) mouse->driverdata;
             if (!data) {
                 continue;
             }