changeset 3040:62d4992e5a92

indent
author Sam Lantinga <slouken@libsdl.org>
date Wed, 14 Jan 2009 04:25:32 +0000
parents 829043b363d1
children 20d65430e63c
files include/SDL_compat.h src/audio/SDL_audio.c src/audio/SDL_audiocvt.c src/video/SDL_gamma.c src/video/directfb/SDL_DirectFB_WM.c src/video/directfb/SDL_DirectFB_WM.h src/video/directfb/SDL_DirectFB_events.c src/video/directfb/SDL_DirectFB_render.c src/video/directfb/SDL_DirectFB_video.c src/video/directfb/SDL_DirectFB_video.h src/video/directfb/SDL_DirectFB_window.c src/video/x11/SDL_x11events.c test/testresample.c
diffstat 13 files changed, 117 insertions(+), 122 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_compat.h	Tue Jan 13 23:27:08 2009 +0000
+++ b/include/SDL_compat.h	Wed Jan 14 04:25:32 2009 +0000
@@ -228,9 +228,9 @@
 extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width,
                                             int height,
                                             int bpp, Uint32 flags);
-extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags);
-extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width,
-                                                      int height,
+extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(const SDL_PixelFormat *
+                                                 format, Uint32 flags);
+extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width, int height,
                                                       int bpp, Uint32 flags);
 extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface(void);
 extern DECLSPEC void SDLCALL SDL_UpdateRects(SDL_Surface * screen,
--- a/src/audio/SDL_audio.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/audio/SDL_audio.c	Wed Jan 14 04:25:32 2009 +0000
@@ -370,7 +370,7 @@
             silence = 0;
         }
 
-#if 0  /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
+#if 0                           /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
         /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */
         if (device->convert.len_mult != 1 || device->convert.len_div != 1) {
             /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */
--- a/src/audio/SDL_audiocvt.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/audio/SDL_audiocvt.c	Wed Jan 14 04:25:32 2009 +0000
@@ -894,7 +894,7 @@
 
     /* zero means "not a supported multiple" ... we only do 2x and 4x. */
     if ((hi % lo) != 0)
-        return 0;   /* not a multiple. */
+        return 0;               /* not a multiple. */
 
     div = hi / lo;
     retval = ((div == 2) || (div == 4)) ? div : 0;
@@ -915,7 +915,8 @@
         if (filter == NULL) {
             int i;
             const int upsample = (src_rate < dst_rate) ? 1 : 0;
-            const int multiple = SDL_FindFrequencyMultiple(src_rate, dst_rate);
+            const int multiple =
+                SDL_FindFrequencyMultiple(src_rate, dst_rate);
 
             for (i = 0; sdl_audio_rate_filters[i].filter != NULL; i++) {
                 const SDL_AudioRateFilters *filt = &sdl_audio_rate_filters[i];
@@ -980,7 +981,6 @@
     if ((src_rate == 0) || (dst_rate == 0)) {
         return -1;
     }
-
 #ifdef DEBUG_CONVERT
     printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
            src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate);
@@ -1054,7 +1054,8 @@
     }
 
     /* Do rate conversion, if necessary. Updates (cvt). */
-    if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) == -1) {
+    if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) ==
+        -1) {
         return -1;              /* shouldn't happen, but just in case... */
     }
 
--- a/src/video/SDL_gamma.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/SDL_gamma.c	Wed Jan 14 04:25:32 2009 +0000
@@ -50,7 +50,8 @@
         int value;
         gamma = 1.0f / gamma;
         for (i = 0; i < 256; ++i) {
-            value = (int) (SDL_pow((double) i / 256.0, gamma) * 65535.0 + 0.5);
+            value =
+                (int) (SDL_pow((double) i / 256.0, gamma) * 65535.0 + 0.5);
             if (value > 65535) {
                 value = 65535;
             }
@@ -73,7 +74,7 @@
         if ((ramp[i] != 0) && (ramp[i] != 65535)) {
             double B = (double) i / 256.0;
             double A = ramp[i] / 65535.0;
-			sum += (float) (SDL_log(A) / SDL_log(B));
+            sum += (float) (SDL_log(A) / SDL_log(B));
             count++;
         }
     }
--- a/src/video/directfb/SDL_DirectFB_WM.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_WM.c	Wed Jan 14 04:25:32 2009 +0000
@@ -199,10 +199,9 @@
     SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
 
     windata->window->GetPosition(windata->window,
-                                     &windata->restore.x,
-                                     &windata->restore.y);
+                                 &windata->restore.x, &windata->restore.y);
     windata->window->GetSize(windata->window, &windata->restore.w,
-                                 &windata->restore.h);
+                             &windata->restore.h);
 
     /* Do this already here */
     window->flags |= SDL_WINDOW_MAXIMIZED;
@@ -210,8 +209,7 @@
 
     windata->window->MoveTo(windata->window, 0, 0);
     windata->window->Resize(windata->window,
-                            display->current_mode.w,
-                            display->current_mode.h);
+                            display->current_mode.w, display->current_mode.h);
     SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
 }
 
@@ -291,7 +289,7 @@
 static int wm_lasty;
 
 int
-DirectFB_WM_ProcessEvent(_THIS, SDL_Window *window, DFBWindowEvent * evt)
+DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt)
 {
     SDL_DFB_WINDOWDATA(window);
 
@@ -306,13 +304,14 @@
             case WM_POS_NONE:
                 return 0;
             case WM_POS_CLOSE:
-                SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0, 0);
+                SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0,
+                                    0);
                 return 1;
             case WM_POS_MAX:
                 if (window->flags & SDL_WINDOW_MAXIMIZED) {
                     DirectFB_WM_RestoreWindow(_this, window);
                 } else {
-                	DirectFB_WM_MaximizeWindow(_this, window);
+                    DirectFB_WM_MaximizeWindow(_this, window);
                 }
                 return 1;
             default:
--- a/src/video/directfb/SDL_DirectFB_WM.h	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_WM.h	Wed Jan 14 04:25:32 2009 +0000
@@ -46,9 +46,11 @@
 extern void DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window);
 extern void DirectFB_WM_RedrawLayout(SDL_Window * window);
 
-extern int DirectFB_WM_ProcessEvent(_THIS, SDL_Window *window, DFBWindowEvent * evt);
+extern int DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window,
+                                    DFBWindowEvent * evt);
 
-extern DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch);
+extern DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window,
+                                           int *cw, int *ch);
 
 
 #endif /* _SDL_directfb_wm_h */
--- a/src/video/directfb/SDL_DirectFB_events.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_events.c	Wed Jan 14 04:25:32 2009 +0000
@@ -177,7 +177,7 @@
             break;
         case DWET_MOTION:
             if (ClientXY(p, &evt->x, &evt->y)) {
-            	SDL_Window *window = SDL_GetWindowFromID(p->sdl_id);
+                SDL_Window *window = SDL_GetWindowFromID(p->sdl_id);
                 if (!devdata->use_linux_input) {
                     if (!(flags & SDL_WINDOW_INPUT_GRABBED))
                         SDL_SendMouseMotion(devdata->mouse_id[0], 0,
@@ -193,7 +193,8 @@
                     }
                 }
                 if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS))
-                    SDL_SendWindowEvent(p->sdl_id, SDL_WINDOWEVENT_ENTER, 0, 0);
+                    SDL_SendWindowEvent(p->sdl_id, SDL_WINDOWEVENT_ENTER, 0,
+                                        0);
             }
             break;
         case DWET_KEYDOWN:
--- a/src/video/directfb/SDL_DirectFB_render.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_render.c	Wed Jan 14 04:25:32 2009 +0000
@@ -182,9 +182,9 @@
 SetBlendMode(DirectFB_RenderData * data, int blendMode,
              DirectFB_TextureData * source)
 {
-	SDL_DFB_WINDOWSURFACE(data->window);
-	
-	//FIXME: check for format change
+    SDL_DFB_WINDOWSURFACE(data->window);
+
+    //FIXME: check for format change
     if (1 || data->lastBlendMode != blendMode) {
         switch (blendMode) {
         case SDL_BLENDMODE_NONE:
@@ -198,15 +198,13 @@
             data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
             data->drawFlags = DSDRAW_BLEND;
             destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
-            destsurf->SetDstBlendFunction(destsurf,
-                                               DSBF_INVSRCALPHA);
+            destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA);
             break;
         case SDL_BLENDMODE_BLEND:
             data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
             data->drawFlags = DSDRAW_BLEND;
             destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
-            destsurf->SetDstBlendFunction(destsurf,
-                                               DSBF_INVSRCALPHA);
+            destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA);
             break;
         case SDL_BLENDMODE_ADD:
             data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
@@ -215,8 +213,7 @@
             // It will be cheaper to copy the surface to
             // a temporay surface and premultiply 
             if (source && TextureHasAlpha(source))
-                destsurf->SetSrcBlendFunction(destsurf,
-                                                   DSBF_SRCALPHA);
+                destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
             else
                 destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE);
             destsurf->SetDstBlendFunction(destsurf, DSBF_ONE);
@@ -324,7 +321,8 @@
     } else
         data->flipflags |= DSFLIP_ONSYNC;
 
-    SDL_DFB_CHECKERR(windata->surface->GetCapabilities(windata->surface, &scaps));
+    SDL_DFB_CHECKERR(windata->surface->
+                     GetCapabilities(windata->surface, &scaps));
     if (scaps & DSCAPS_DOUBLE)
         renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
     else if (scaps & DSCAPS_TRIPLE)
@@ -799,7 +797,7 @@
 {
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
     SDL_DFB_WINDOWSURFACE(data->window);
-    
+
     DFBResult ret;
     Uint8 r, g, b, a;
 
@@ -809,8 +807,7 @@
     a = renderer->a;
 
     SetBlendMode(data, renderer->blendMode, NULL);
-    SDL_DFB_CHECKERR(destsurf->SetDrawingFlags(destsurf,
-                                                    data->drawFlags));
+    SDL_DFB_CHECKERR(destsurf->SetDrawingFlags(destsurf, data->drawFlags));
 
     switch (renderer->blendMode) {
     case SDL_BLENDMODE_NONE:
@@ -856,8 +853,7 @@
     PrepareDraw(renderer);
     /* Use antialiasing when available */
 #if (DFB_VERSION_ATLEAST(1,2,0))
-    SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf,
-                                                     DSRO_ANTIALIAS));
+    SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf, DSRO_ANTIALIAS));
 #endif
     SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, x1, y1, x2, y2));
     return 0;
@@ -874,7 +870,7 @@
 
     PrepareDraw(renderer);
     SDL_DFB_CHECKERR(destsurf->FillRectangle(destsurf, rect->x, rect->y,
-                                            rect->w, rect->h));
+                                             rect->w, rect->h));
 
     return 0;
   error:
@@ -938,48 +934,49 @@
         SDLtoDFBRect(srcrect, &sr);
         SDLtoDFBRect(dstrect, &dr);
 
-        SDL_DFB_CHECKERR(destsurf->SetColor(destsurf, 0xFF, 0xFF, 0xFF, 0xFF));
-        if (texture->modMode &
-            (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA)) {
+        SDL_DFB_CHECKERR(destsurf->
+                         SetColor(destsurf, 0xFF, 0xFF, 0xFF, 0xFF));
+        if (texture->
+            modMode & (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA))
+        {
             if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) {
                 alpha = texture->a;
                 SDL_DFB_CHECKERR(destsurf->SetColor(destsurf, 0xFF, 0xFF,
-                                                   0xFF, alpha));
+                                                    0xFF, alpha));
             }
             if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
 
                 SDL_DFB_CHECKERR(destsurf->SetColor(destsurf,
-                                                         texture->r,
-                                                         texture->g,
-                                                         texture->b, alpha));
+                                                    texture->r,
+                                                    texture->g,
+                                                    texture->b, alpha));
                 flags |= DSBLIT_COLORIZE;
             }
             if (alpha < 0xFF)
                 flags |= DSBLIT_SRC_PREMULTCOLOR;
         } else
             SDL_DFB_CHECKERR(destsurf->SetColor(destsurf, 0xFF, 0xFF,
-                                               0xFF, 0xFF));
+                                                0xFF, 0xFF));
 
         SetBlendMode(data, texture->blendMode, texturedata);
 
         SDL_DFB_CHECKERR(destsurf->SetBlittingFlags(destsurf,
-                                                         data->blitFlags
-                                                         | flags));
+                                                    data->blitFlags | flags));
 
 #if (DFB_VERSION_ATLEAST(1,2,0))
         SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf,
-                                                         texturedata->
-                                                         render_options));
+                                                    texturedata->
+                                                    render_options));
 #endif
 
         if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
             SDL_DFB_CHECKERR(destsurf->Blit(destsurf,
-                                                 texturedata->surface,
-                                                 &sr, dr.x, dr.y));
+                                            texturedata->surface,
+                                            &sr, dr.x, dr.y));
         } else {
             SDL_DFB_CHECKERR(destsurf->StretchBlit(destsurf,
-                                                        texturedata->surface,
-                                                        &sr, &dr));
+                                                   texturedata->surface,
+                                                   &sr, &dr));
         }
     }
     return 0;
@@ -1035,7 +1032,7 @@
 DirectFB_DestroyRenderer(SDL_Renderer * renderer)
 {
     DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    
+
     if (data) {
         SDL_free(data);
     }
--- a/src/video/directfb/SDL_DirectFB_video.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_video.c	Wed Jan 14 04:25:32 2009 +0000
@@ -254,9 +254,9 @@
     /* simple window manager support */
     stemp = SDL_getenv(DFBENV_USE_WM);
     if (stemp)
-    	devdata->has_own_wm = atoi(stemp);
+        devdata->has_own_wm = atoi(stemp);
     else
-    	devdata->has_own_wm = 0;
+        devdata->has_own_wm = 0;
 
     devdata->dfb = dfb;
     devdata->firstwin = NULL;
--- a/src/video/directfb/SDL_DirectFB_video.h	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_video.h	Wed Jan 14 04:25:32 2009 +0000
@@ -44,10 +44,10 @@
 	(DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
 
 #if (DFB_VERSION_ATLEAST(1,0,0))
-	#define SDL_DIRECTFB_OPENGL 1
-	#include <directfbgl.h>
+#define SDL_DIRECTFB_OPENGL 1
+#include <directfbgl.h>
 #else
-	#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
+#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
 #endif
 
 #if SDL_DIRECTFB_OPENGL
@@ -69,7 +69,7 @@
 #define DFBENV_USE_YUV_DIRECT   	"SDL_DIRECTFB_YUV_DIRECT"       /* Default: off */
 #define DFBENV_USE_X11_CHECK		"SDL_DIRECTFB_X11_CHECK"        /* Default: on  */
 #define DFBENV_USE_LINUX_INPUT		"SDL_DIRECTFB_LINUX_INPUT"      /* Default: on  */
-#define DFBENV_USE_WM				"SDL_DIRECTFB_WM"		      	/* Default: off  */
+#define DFBENV_USE_WM				"SDL_DIRECTFB_WM"       /* Default: off  */
 
 #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { x->Release(x); x = NULL; } } while (0)
 #define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0)
--- a/src/video/directfb/SDL_DirectFB_window.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_window.c	Wed Jan 14 04:25:32 2009 +0000
@@ -101,7 +101,8 @@
     windata->window->SetOptions(windata->window, wopts);
 
     /* See what we got */
-    SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
+    SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
+                     (_this, window, &window->w, &window->h));
 
     /* Get the window's surface. */
     SDL_DFB_CHECKERR(windata->window->GetSurface(windata->window,
@@ -115,9 +116,10 @@
 
     /* Create Eventbuffer */
     SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
-                                                        &windata->eventbuffer));
-    SDL_DFB_CHECKERR(windata->
-                     window->EnableEvents(windata->window, DWET_ALL));
+                                                        &windata->
+                                                        eventbuffer));
+    SDL_DFB_CHECKERR(windata->window->
+                     EnableEvents(windata->window, DWET_ALL));
 
     /* Create a font */
     /* FIXME: once during Video_Init */
@@ -279,7 +281,8 @@
         SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window,
                                                        DWET_ALL));
 
-        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
+        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
+                         (_this, window, &window->w, &window->h));
 
         SDL_OnWindowResized(window);
     }
@@ -322,7 +325,7 @@
     SDL_DFB_WINDOWDATA(window);
 
     if (windata->is_managed) {
-    	DirectFB_WM_MaximizeWindow(_this, window);
+        DirectFB_WM_MaximizeWindow(_this, window);
     } else
         SDL_Unsupported();
 }
@@ -341,7 +344,7 @@
     SDL_DFB_WINDOWDATA(window);
 
     if (windata->is_managed) {
-    	DirectFB_WM_RestoreWindow(_this, window);
+        DirectFB_WM_RestoreWindow(_this, window);
     } else
         SDL_Unsupported();
 }
@@ -421,31 +424,30 @@
 
     if (adjust) {
 #if DFB_VERSION_ATLEAST(1,2,1)
-       SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
+        SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
                                                         windata->size.w,
                                                         windata->size.h));
-       SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
+        SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
                                                           windata->
                                                           window_surface,
                                                           &windata->client));
 #else
- 	   DFBWindowOptions opts;
+        DFBWindowOptions opts;
+
+        SDL_DFB_CHECKERR(windata->window->GetOptions(windata->window, &opts));
+        /* recreate subsurface */
+        SDL_DFB_RELEASE(windata->surface);
 
-	   SDL_DFB_CHECKERR(windata->window->GetOptions(windata->window, &opts));
-       /* recreate subsurface */
-       SDL_DFB_RELEASE(windata->surface);
-       
-       if (opts & DWOP_SCALE)
-          SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
-                                                          windata->size.w,
-                                                          windata->size.h));
-       SDL_DFB_CHECKERR(windata->window_surface->
-                      GetSubSurface(windata->window_surface, &windata->client,
-                                  &windata->surface));
+        if (opts & DWOP_SCALE)
+            SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
+                                                            windata->size.w,
+                                                            windata->size.h));
+        SDL_DFB_CHECKERR(windata->window_surface->
+                         GetSubSurface(windata->window_surface,
+                                       &windata->client, &windata->surface));
 #endif
-       DirectFB_WM_RedrawLayout(window);
+        DirectFB_WM_RedrawLayout(window);
     }
   error:
     return;
 }
-
--- a/src/video/x11/SDL_x11events.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/src/video/x11/SDL_x11events.c	Wed Jan 14 04:25:32 2009 +0000
@@ -310,7 +310,6 @@
                     }
                     continue;
                 }
-
 #if SDL_VIDEO_DRIVER_X11_XINPUT
                 data = (X11_MouseData *) mouse->driverdata;
                 if (xevent.type == data->motion) {
@@ -398,7 +397,7 @@
     if (_this->suspend_screensaver) {
         Uint32 now = SDL_GetTicks();
         if (!data->screensaver_activity ||
-            (int)(now-data->screensaver_activity) >= 30000) {
+            (int) (now - data->screensaver_activity) >= 30000) {
             XResetScreenSaver(data->display);
             data->screensaver_activity = now;
         }
@@ -415,7 +414,8 @@
 #ifdef GNOME_SCREENSAVER_HACK
 #include <unistd.h>
 static pid_t screensaver_inhibit_pid;
-static void gnome_screensaver_disable()
+static void
+gnome_screensaver_disable()
 {
     screensaver_inhibit_pid = fork();
     if (screensaver_inhibit_pid == 0) {
@@ -426,12 +426,12 @@
               "gnome-screensaver-command",
               "--inhibit",
               "--reason",
-              "GNOME screensaver doesn't respect MIT-SCREEN-SAVER",
-              NULL);
+              "GNOME screensaver doesn't respect MIT-SCREEN-SAVER", NULL);
         exit(2);
     }
 }
-static void gnome_screensaver_enable()
+static void
+gnome_screensaver_enable()
 {
     kill(screensaver_inhibit_pid, 15);
 }
--- a/test/testresample.c	Tue Jan 13 23:27:08 2009 +0000
+++ b/test/testresample.c	Wed Jan 14 04:25:32 2009 +0000
@@ -1,7 +1,8 @@
 #include <stdio.h>
 #include "SDL.h"
 
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
 {
     SDL_AudioSpec spec;
     SDL_AudioCVT cvt;
@@ -13,30 +14,26 @@
     int avgbytes = 0;
     SDL_RWops *io = NULL;
 
-    if (argc != 4)
-    {
+    if (argc != 4) {
         fprintf(stderr, "USAGE: %s in.wav out.wav newfreq\n", argv[0]);
         return 1;
     }
 
     cvtfreq = atoi(argv[3]);
 
-    if (SDL_Init(SDL_INIT_AUDIO) == -1)
-    {
+    if (SDL_Init(SDL_INIT_AUDIO) == -1) {
         fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError());
         return 2;
     }
 
-    if (SDL_LoadWAV(argv[1], &spec, &data, &len) == NULL)
-    {
+    if (SDL_LoadWAV(argv[1], &spec, &data, &len) == NULL) {
         fprintf(stderr, "failed to load %s: %s\n", argv[1], SDL_GetError());
         SDL_Quit();
         return 3;
     }
 
     if (SDL_BuildAudioCVT(&cvt, spec.format, spec.channels, spec.freq,
-                          spec.format, spec.channels, cvtfreq) == -1)
-    {
+                          spec.format, spec.channels, cvtfreq) == -1) {
         fprintf(stderr, "failed to build CVT: %s\n", SDL_GetError());
         SDL_FreeWAV(data);
         SDL_Quit();
@@ -45,8 +42,7 @@
 
     cvt.len = len;
     cvt.buf = (Uint8 *) malloc(len * cvt.len_mult);
-    if (cvt.buf == NULL)
-    {
+    if (cvt.buf == NULL) {
         fprintf(stderr, "Out of memory.\n");
         SDL_FreeWAV(data);
         SDL_Quit();
@@ -54,8 +50,7 @@
     }
     memcpy(cvt.buf, data, len);
 
-    if (SDL_ConvertAudio(&cvt) == -1)
-    {
+    if (SDL_ConvertAudio(&cvt) == -1) {
         fprintf(stderr, "Conversion failed: %s\n", SDL_GetError());
         free(cvt.buf);
         SDL_FreeWAV(data);
@@ -65,8 +60,7 @@
 
     /* write out a WAV header... */
     io = SDL_RWFromFile(argv[2], "wb");
-    if (io == NULL)
-    {
+    if (io == NULL) {
         fprintf(stderr, "fopen('%s') failed: %s\n", argv[2], SDL_GetError());
         free(cvt.buf);
         SDL_FreeWAV(data);
@@ -78,35 +72,33 @@
     blockalign = (bitsize / 8) * spec.channels;
     avgbytes = cvtfreq * blockalign;
 
-    SDL_WriteLE32(io, 0x46464952);  /* RIFF */
+    SDL_WriteLE32(io, 0x46464952);      /* RIFF */
     SDL_WriteLE32(io, len * cvt.len_mult + 36);
-    SDL_WriteLE32(io, 0x45564157);  /* WAVE */
-    SDL_WriteLE32(io, 0x20746D66);  /* fmt */
-    SDL_WriteLE32(io, 16);          /* chunk size */
-    SDL_WriteLE16(io, 1);           /* uncompressed */
-    SDL_WriteLE16(io, spec.channels);  /* channels */
-    SDL_WriteLE32(io, cvtfreq);  /* sample rate */
-    SDL_WriteLE32(io, avgbytes);  /* average bytes per second */
-    SDL_WriteLE16(io, blockalign);  /* block align */
-    SDL_WriteLE16(io, bitsize);  /* significant bits per sample */
-    SDL_WriteLE32(io, 0x61746164);  /* data */
-    SDL_WriteLE32(io, cvt.len_cvt);  /* size */
+    SDL_WriteLE32(io, 0x45564157);      /* WAVE */
+    SDL_WriteLE32(io, 0x20746D66);      /* fmt */
+    SDL_WriteLE32(io, 16);      /* chunk size */
+    SDL_WriteLE16(io, 1);       /* uncompressed */
+    SDL_WriteLE16(io, spec.channels);   /* channels */
+    SDL_WriteLE32(io, cvtfreq); /* sample rate */
+    SDL_WriteLE32(io, avgbytes);        /* average bytes per second */
+    SDL_WriteLE16(io, blockalign);      /* block align */
+    SDL_WriteLE16(io, bitsize); /* significant bits per sample */
+    SDL_WriteLE32(io, 0x61746164);      /* data */
+    SDL_WriteLE32(io, cvt.len_cvt);     /* size */
     SDL_RWwrite(io, cvt.buf, cvt.len_cvt, 1);
 
-    if (SDL_RWclose(io) == -1)
-    {
+    if (SDL_RWclose(io) == -1) {
         fprintf(stderr, "fclose('%s') failed: %s\n", argv[2], SDL_GetError());
         free(cvt.buf);
         SDL_FreeWAV(data);
         SDL_Quit();
         return 8;
-    } // if
+    }                           // if
 
     free(cvt.buf);
     SDL_FreeWAV(data);
     SDL_Quit();
     return 0;
-} // main
+}                               // main
 
 // end of resample_test.c ...
-