indent
authorSam Lantinga <slouken@libsdl.org>
Wed, 14 Jan 2009 04:25:32 +0000
changeset 304062d4992e5a92
parent 3039 829043b363d1
child 3041 20d65430e63c
indent
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
     1.1 --- a/include/SDL_compat.h	Tue Jan 13 23:27:08 2009 +0000
     1.2 +++ b/include/SDL_compat.h	Wed Jan 14 04:25:32 2009 +0000
     1.3 @@ -228,9 +228,9 @@
     1.4  extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width,
     1.5                                              int height,
     1.6                                              int bpp, Uint32 flags);
     1.7 -extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags);
     1.8 -extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width,
     1.9 -                                                      int height,
    1.10 +extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(const SDL_PixelFormat *
    1.11 +                                                 format, Uint32 flags);
    1.12 +extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width, int height,
    1.13                                                        int bpp, Uint32 flags);
    1.14  extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface(void);
    1.15  extern DECLSPEC void SDLCALL SDL_UpdateRects(SDL_Surface * screen,
     2.1 --- a/src/audio/SDL_audio.c	Tue Jan 13 23:27:08 2009 +0000
     2.2 +++ b/src/audio/SDL_audio.c	Wed Jan 14 04:25:32 2009 +0000
     2.3 @@ -370,7 +370,7 @@
     2.4              silence = 0;
     2.5          }
     2.6  
     2.7 -#if 0  /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
     2.8 +#if 0                           /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
     2.9          /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */
    2.10          if (device->convert.len_mult != 1 || device->convert.len_div != 1) {
    2.11              /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */
     3.1 --- a/src/audio/SDL_audiocvt.c	Tue Jan 13 23:27:08 2009 +0000
     3.2 +++ b/src/audio/SDL_audiocvt.c	Wed Jan 14 04:25:32 2009 +0000
     3.3 @@ -894,7 +894,7 @@
     3.4  
     3.5      /* zero means "not a supported multiple" ... we only do 2x and 4x. */
     3.6      if ((hi % lo) != 0)
     3.7 -        return 0;   /* not a multiple. */
     3.8 +        return 0;               /* not a multiple. */
     3.9  
    3.10      div = hi / lo;
    3.11      retval = ((div == 2) || (div == 4)) ? div : 0;
    3.12 @@ -915,7 +915,8 @@
    3.13          if (filter == NULL) {
    3.14              int i;
    3.15              const int upsample = (src_rate < dst_rate) ? 1 : 0;
    3.16 -            const int multiple = SDL_FindFrequencyMultiple(src_rate, dst_rate);
    3.17 +            const int multiple =
    3.18 +                SDL_FindFrequencyMultiple(src_rate, dst_rate);
    3.19  
    3.20              for (i = 0; sdl_audio_rate_filters[i].filter != NULL; i++) {
    3.21                  const SDL_AudioRateFilters *filt = &sdl_audio_rate_filters[i];
    3.22 @@ -980,7 +981,6 @@
    3.23      if ((src_rate == 0) || (dst_rate == 0)) {
    3.24          return -1;
    3.25      }
    3.26 -
    3.27  #ifdef DEBUG_CONVERT
    3.28      printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
    3.29             src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate);
    3.30 @@ -1054,7 +1054,8 @@
    3.31      }
    3.32  
    3.33      /* Do rate conversion, if necessary. Updates (cvt). */
    3.34 -    if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) == -1) {
    3.35 +    if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) ==
    3.36 +        -1) {
    3.37          return -1;              /* shouldn't happen, but just in case... */
    3.38      }
    3.39  
     4.1 --- a/src/video/SDL_gamma.c	Tue Jan 13 23:27:08 2009 +0000
     4.2 +++ b/src/video/SDL_gamma.c	Wed Jan 14 04:25:32 2009 +0000
     4.3 @@ -50,7 +50,8 @@
     4.4          int value;
     4.5          gamma = 1.0f / gamma;
     4.6          for (i = 0; i < 256; ++i) {
     4.7 -            value = (int) (SDL_pow((double) i / 256.0, gamma) * 65535.0 + 0.5);
     4.8 +            value =
     4.9 +                (int) (SDL_pow((double) i / 256.0, gamma) * 65535.0 + 0.5);
    4.10              if (value > 65535) {
    4.11                  value = 65535;
    4.12              }
    4.13 @@ -73,7 +74,7 @@
    4.14          if ((ramp[i] != 0) && (ramp[i] != 65535)) {
    4.15              double B = (double) i / 256.0;
    4.16              double A = ramp[i] / 65535.0;
    4.17 -			sum += (float) (SDL_log(A) / SDL_log(B));
    4.18 +            sum += (float) (SDL_log(A) / SDL_log(B));
    4.19              count++;
    4.20          }
    4.21      }
     5.1 --- a/src/video/directfb/SDL_DirectFB_WM.c	Tue Jan 13 23:27:08 2009 +0000
     5.2 +++ b/src/video/directfb/SDL_DirectFB_WM.c	Wed Jan 14 04:25:32 2009 +0000
     5.3 @@ -199,10 +199,9 @@
     5.4      SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
     5.5  
     5.6      windata->window->GetPosition(windata->window,
     5.7 -                                     &windata->restore.x,
     5.8 -                                     &windata->restore.y);
     5.9 +                                 &windata->restore.x, &windata->restore.y);
    5.10      windata->window->GetSize(windata->window, &windata->restore.w,
    5.11 -                                 &windata->restore.h);
    5.12 +                             &windata->restore.h);
    5.13  
    5.14      /* Do this already here */
    5.15      window->flags |= SDL_WINDOW_MAXIMIZED;
    5.16 @@ -210,8 +209,7 @@
    5.17  
    5.18      windata->window->MoveTo(windata->window, 0, 0);
    5.19      windata->window->Resize(windata->window,
    5.20 -                            display->current_mode.w,
    5.21 -                            display->current_mode.h);
    5.22 +                            display->current_mode.w, display->current_mode.h);
    5.23      SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
    5.24  }
    5.25  
    5.26 @@ -291,7 +289,7 @@
    5.27  static int wm_lasty;
    5.28  
    5.29  int
    5.30 -DirectFB_WM_ProcessEvent(_THIS, SDL_Window *window, DFBWindowEvent * evt)
    5.31 +DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt)
    5.32  {
    5.33      SDL_DFB_WINDOWDATA(window);
    5.34  
    5.35 @@ -306,13 +304,14 @@
    5.36              case WM_POS_NONE:
    5.37                  return 0;
    5.38              case WM_POS_CLOSE:
    5.39 -                SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0, 0);
    5.40 +                SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0,
    5.41 +                                    0);
    5.42                  return 1;
    5.43              case WM_POS_MAX:
    5.44                  if (window->flags & SDL_WINDOW_MAXIMIZED) {
    5.45                      DirectFB_WM_RestoreWindow(_this, window);
    5.46                  } else {
    5.47 -                	DirectFB_WM_MaximizeWindow(_this, window);
    5.48 +                    DirectFB_WM_MaximizeWindow(_this, window);
    5.49                  }
    5.50                  return 1;
    5.51              default:
     6.1 --- a/src/video/directfb/SDL_DirectFB_WM.h	Tue Jan 13 23:27:08 2009 +0000
     6.2 +++ b/src/video/directfb/SDL_DirectFB_WM.h	Wed Jan 14 04:25:32 2009 +0000
     6.3 @@ -46,9 +46,11 @@
     6.4  extern void DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window);
     6.5  extern void DirectFB_WM_RedrawLayout(SDL_Window * window);
     6.6  
     6.7 -extern int DirectFB_WM_ProcessEvent(_THIS, SDL_Window *window, DFBWindowEvent * evt);
     6.8 +extern int DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window,
     6.9 +                                    DFBWindowEvent * evt);
    6.10  
    6.11 -extern DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch);
    6.12 +extern DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window,
    6.13 +                                           int *cw, int *ch);
    6.14  
    6.15  
    6.16  #endif /* _SDL_directfb_wm_h */
     7.1 --- a/src/video/directfb/SDL_DirectFB_events.c	Tue Jan 13 23:27:08 2009 +0000
     7.2 +++ b/src/video/directfb/SDL_DirectFB_events.c	Wed Jan 14 04:25:32 2009 +0000
     7.3 @@ -177,7 +177,7 @@
     7.4              break;
     7.5          case DWET_MOTION:
     7.6              if (ClientXY(p, &evt->x, &evt->y)) {
     7.7 -            	SDL_Window *window = SDL_GetWindowFromID(p->sdl_id);
     7.8 +                SDL_Window *window = SDL_GetWindowFromID(p->sdl_id);
     7.9                  if (!devdata->use_linux_input) {
    7.10                      if (!(flags & SDL_WINDOW_INPUT_GRABBED))
    7.11                          SDL_SendMouseMotion(devdata->mouse_id[0], 0,
    7.12 @@ -193,7 +193,8 @@
    7.13                      }
    7.14                  }
    7.15                  if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS))
    7.16 -                    SDL_SendWindowEvent(p->sdl_id, SDL_WINDOWEVENT_ENTER, 0, 0);
    7.17 +                    SDL_SendWindowEvent(p->sdl_id, SDL_WINDOWEVENT_ENTER, 0,
    7.18 +                                        0);
    7.19              }
    7.20              break;
    7.21          case DWET_KEYDOWN:
     8.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Tue Jan 13 23:27:08 2009 +0000
     8.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Wed Jan 14 04:25:32 2009 +0000
     8.3 @@ -182,9 +182,9 @@
     8.4  SetBlendMode(DirectFB_RenderData * data, int blendMode,
     8.5               DirectFB_TextureData * source)
     8.6  {
     8.7 -	SDL_DFB_WINDOWSURFACE(data->window);
     8.8 -	
     8.9 -	//FIXME: check for format change
    8.10 +    SDL_DFB_WINDOWSURFACE(data->window);
    8.11 +
    8.12 +    //FIXME: check for format change
    8.13      if (1 || data->lastBlendMode != blendMode) {
    8.14          switch (blendMode) {
    8.15          case SDL_BLENDMODE_NONE:
    8.16 @@ -198,15 +198,13 @@
    8.17              data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
    8.18              data->drawFlags = DSDRAW_BLEND;
    8.19              destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
    8.20 -            destsurf->SetDstBlendFunction(destsurf,
    8.21 -                                               DSBF_INVSRCALPHA);
    8.22 +            destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA);
    8.23              break;
    8.24          case SDL_BLENDMODE_BLEND:
    8.25              data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
    8.26              data->drawFlags = DSDRAW_BLEND;
    8.27              destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
    8.28 -            destsurf->SetDstBlendFunction(destsurf,
    8.29 -                                               DSBF_INVSRCALPHA);
    8.30 +            destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA);
    8.31              break;
    8.32          case SDL_BLENDMODE_ADD:
    8.33              data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
    8.34 @@ -215,8 +213,7 @@
    8.35              // It will be cheaper to copy the surface to
    8.36              // a temporay surface and premultiply 
    8.37              if (source && TextureHasAlpha(source))
    8.38 -                destsurf->SetSrcBlendFunction(destsurf,
    8.39 -                                                   DSBF_SRCALPHA);
    8.40 +                destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA);
    8.41              else
    8.42                  destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE);
    8.43              destsurf->SetDstBlendFunction(destsurf, DSBF_ONE);
    8.44 @@ -324,7 +321,8 @@
    8.45      } else
    8.46          data->flipflags |= DSFLIP_ONSYNC;
    8.47  
    8.48 -    SDL_DFB_CHECKERR(windata->surface->GetCapabilities(windata->surface, &scaps));
    8.49 +    SDL_DFB_CHECKERR(windata->surface->
    8.50 +                     GetCapabilities(windata->surface, &scaps));
    8.51      if (scaps & DSCAPS_DOUBLE)
    8.52          renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
    8.53      else if (scaps & DSCAPS_TRIPLE)
    8.54 @@ -799,7 +797,7 @@
    8.55  {
    8.56      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
    8.57      SDL_DFB_WINDOWSURFACE(data->window);
    8.58 -    
    8.59 +
    8.60      DFBResult ret;
    8.61      Uint8 r, g, b, a;
    8.62  
    8.63 @@ -809,8 +807,7 @@
    8.64      a = renderer->a;
    8.65  
    8.66      SetBlendMode(data, renderer->blendMode, NULL);
    8.67 -    SDL_DFB_CHECKERR(destsurf->SetDrawingFlags(destsurf,
    8.68 -                                                    data->drawFlags));
    8.69 +    SDL_DFB_CHECKERR(destsurf->SetDrawingFlags(destsurf, data->drawFlags));
    8.70  
    8.71      switch (renderer->blendMode) {
    8.72      case SDL_BLENDMODE_NONE:
    8.73 @@ -856,8 +853,7 @@
    8.74      PrepareDraw(renderer);
    8.75      /* Use antialiasing when available */
    8.76  #if (DFB_VERSION_ATLEAST(1,2,0))
    8.77 -    SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf,
    8.78 -                                                     DSRO_ANTIALIAS));
    8.79 +    SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf, DSRO_ANTIALIAS));
    8.80  #endif
    8.81      SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, x1, y1, x2, y2));
    8.82      return 0;
    8.83 @@ -874,7 +870,7 @@
    8.84  
    8.85      PrepareDraw(renderer);
    8.86      SDL_DFB_CHECKERR(destsurf->FillRectangle(destsurf, rect->x, rect->y,
    8.87 -                                            rect->w, rect->h));
    8.88 +                                             rect->w, rect->h));
    8.89  
    8.90      return 0;
    8.91    error:
    8.92 @@ -938,48 +934,49 @@
    8.93          SDLtoDFBRect(srcrect, &sr);
    8.94          SDLtoDFBRect(dstrect, &dr);
    8.95  
    8.96 -        SDL_DFB_CHECKERR(destsurf->SetColor(destsurf, 0xFF, 0xFF, 0xFF, 0xFF));
    8.97 -        if (texture->modMode &
    8.98 -            (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA)) {
    8.99 +        SDL_DFB_CHECKERR(destsurf->
   8.100 +                         SetColor(destsurf, 0xFF, 0xFF, 0xFF, 0xFF));
   8.101 +        if (texture->
   8.102 +            modMode & (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA))
   8.103 +        {
   8.104              if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) {
   8.105                  alpha = texture->a;
   8.106                  SDL_DFB_CHECKERR(destsurf->SetColor(destsurf, 0xFF, 0xFF,
   8.107 -                                                   0xFF, alpha));
   8.108 +                                                    0xFF, alpha));
   8.109              }
   8.110              if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
   8.111  
   8.112                  SDL_DFB_CHECKERR(destsurf->SetColor(destsurf,
   8.113 -                                                         texture->r,
   8.114 -                                                         texture->g,
   8.115 -                                                         texture->b, alpha));
   8.116 +                                                    texture->r,
   8.117 +                                                    texture->g,
   8.118 +                                                    texture->b, alpha));
   8.119                  flags |= DSBLIT_COLORIZE;
   8.120              }
   8.121              if (alpha < 0xFF)
   8.122                  flags |= DSBLIT_SRC_PREMULTCOLOR;
   8.123          } else
   8.124              SDL_DFB_CHECKERR(destsurf->SetColor(destsurf, 0xFF, 0xFF,
   8.125 -                                               0xFF, 0xFF));
   8.126 +                                                0xFF, 0xFF));
   8.127  
   8.128          SetBlendMode(data, texture->blendMode, texturedata);
   8.129  
   8.130          SDL_DFB_CHECKERR(destsurf->SetBlittingFlags(destsurf,
   8.131 -                                                         data->blitFlags
   8.132 -                                                         | flags));
   8.133 +                                                    data->blitFlags | flags));
   8.134  
   8.135  #if (DFB_VERSION_ATLEAST(1,2,0))
   8.136          SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf,
   8.137 -                                                         texturedata->
   8.138 -                                                         render_options));
   8.139 +                                                    texturedata->
   8.140 +                                                    render_options));
   8.141  #endif
   8.142  
   8.143          if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
   8.144              SDL_DFB_CHECKERR(destsurf->Blit(destsurf,
   8.145 -                                                 texturedata->surface,
   8.146 -                                                 &sr, dr.x, dr.y));
   8.147 +                                            texturedata->surface,
   8.148 +                                            &sr, dr.x, dr.y));
   8.149          } else {
   8.150              SDL_DFB_CHECKERR(destsurf->StretchBlit(destsurf,
   8.151 -                                                        texturedata->surface,
   8.152 -                                                        &sr, &dr));
   8.153 +                                                   texturedata->surface,
   8.154 +                                                   &sr, &dr));
   8.155          }
   8.156      }
   8.157      return 0;
   8.158 @@ -1035,7 +1032,7 @@
   8.159  DirectFB_DestroyRenderer(SDL_Renderer * renderer)
   8.160  {
   8.161      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
   8.162 -    
   8.163 +
   8.164      if (data) {
   8.165          SDL_free(data);
   8.166      }
     9.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Tue Jan 13 23:27:08 2009 +0000
     9.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Wed Jan 14 04:25:32 2009 +0000
     9.3 @@ -254,9 +254,9 @@
     9.4      /* simple window manager support */
     9.5      stemp = SDL_getenv(DFBENV_USE_WM);
     9.6      if (stemp)
     9.7 -    	devdata->has_own_wm = atoi(stemp);
     9.8 +        devdata->has_own_wm = atoi(stemp);
     9.9      else
    9.10 -    	devdata->has_own_wm = 0;
    9.11 +        devdata->has_own_wm = 0;
    9.12  
    9.13      devdata->dfb = dfb;
    9.14      devdata->firstwin = NULL;
    10.1 --- a/src/video/directfb/SDL_DirectFB_video.h	Tue Jan 13 23:27:08 2009 +0000
    10.2 +++ b/src/video/directfb/SDL_DirectFB_video.h	Wed Jan 14 04:25:32 2009 +0000
    10.3 @@ -44,10 +44,10 @@
    10.4  	(DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
    10.5  
    10.6  #if (DFB_VERSION_ATLEAST(1,0,0))
    10.7 -	#define SDL_DIRECTFB_OPENGL 1
    10.8 -	#include <directfbgl.h>
    10.9 +#define SDL_DIRECTFB_OPENGL 1
   10.10 +#include <directfbgl.h>
   10.11  #else
   10.12 -	#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
   10.13 +#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
   10.14  #endif
   10.15  
   10.16  #if SDL_DIRECTFB_OPENGL
   10.17 @@ -69,7 +69,7 @@
   10.18  #define DFBENV_USE_YUV_DIRECT   	"SDL_DIRECTFB_YUV_DIRECT"       /* Default: off */
   10.19  #define DFBENV_USE_X11_CHECK		"SDL_DIRECTFB_X11_CHECK"        /* Default: on  */
   10.20  #define DFBENV_USE_LINUX_INPUT		"SDL_DIRECTFB_LINUX_INPUT"      /* Default: on  */
   10.21 -#define DFBENV_USE_WM				"SDL_DIRECTFB_WM"		      	/* Default: off  */
   10.22 +#define DFBENV_USE_WM				"SDL_DIRECTFB_WM"       /* Default: off  */
   10.23  
   10.24  #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { x->Release(x); x = NULL; } } while (0)
   10.25  #define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0)
    11.1 --- a/src/video/directfb/SDL_DirectFB_window.c	Tue Jan 13 23:27:08 2009 +0000
    11.2 +++ b/src/video/directfb/SDL_DirectFB_window.c	Wed Jan 14 04:25:32 2009 +0000
    11.3 @@ -101,7 +101,8 @@
    11.4      windata->window->SetOptions(windata->window, wopts);
    11.5  
    11.6      /* See what we got */
    11.7 -    SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
    11.8 +    SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
    11.9 +                     (_this, window, &window->w, &window->h));
   11.10  
   11.11      /* Get the window's surface. */
   11.12      SDL_DFB_CHECKERR(windata->window->GetSurface(windata->window,
   11.13 @@ -115,9 +116,10 @@
   11.14  
   11.15      /* Create Eventbuffer */
   11.16      SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
   11.17 -                                                        &windata->eventbuffer));
   11.18 -    SDL_DFB_CHECKERR(windata->
   11.19 -                     window->EnableEvents(windata->window, DWET_ALL));
   11.20 +                                                        &windata->
   11.21 +                                                        eventbuffer));
   11.22 +    SDL_DFB_CHECKERR(windata->window->
   11.23 +                     EnableEvents(windata->window, DWET_ALL));
   11.24  
   11.25      /* Create a font */
   11.26      /* FIXME: once during Video_Init */
   11.27 @@ -279,7 +281,8 @@
   11.28          SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window,
   11.29                                                         DWET_ALL));
   11.30  
   11.31 -        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
   11.32 +        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
   11.33 +                         (_this, window, &window->w, &window->h));
   11.34  
   11.35          SDL_OnWindowResized(window);
   11.36      }
   11.37 @@ -322,7 +325,7 @@
   11.38      SDL_DFB_WINDOWDATA(window);
   11.39  
   11.40      if (windata->is_managed) {
   11.41 -    	DirectFB_WM_MaximizeWindow(_this, window);
   11.42 +        DirectFB_WM_MaximizeWindow(_this, window);
   11.43      } else
   11.44          SDL_Unsupported();
   11.45  }
   11.46 @@ -341,7 +344,7 @@
   11.47      SDL_DFB_WINDOWDATA(window);
   11.48  
   11.49      if (windata->is_managed) {
   11.50 -    	DirectFB_WM_RestoreWindow(_this, window);
   11.51 +        DirectFB_WM_RestoreWindow(_this, window);
   11.52      } else
   11.53          SDL_Unsupported();
   11.54  }
   11.55 @@ -421,31 +424,30 @@
   11.56  
   11.57      if (adjust) {
   11.58  #if DFB_VERSION_ATLEAST(1,2,1)
   11.59 -       SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   11.60 +        SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   11.61                                                          windata->size.w,
   11.62                                                          windata->size.h));
   11.63 -       SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
   11.64 +        SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
   11.65                                                            windata->
   11.66                                                            window_surface,
   11.67                                                            &windata->client));
   11.68  #else
   11.69 - 	   DFBWindowOptions opts;
   11.70 +        DFBWindowOptions opts;
   11.71  
   11.72 -	   SDL_DFB_CHECKERR(windata->window->GetOptions(windata->window, &opts));
   11.73 -       /* recreate subsurface */
   11.74 -       SDL_DFB_RELEASE(windata->surface);
   11.75 -       
   11.76 -       if (opts & DWOP_SCALE)
   11.77 -          SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   11.78 -                                                          windata->size.w,
   11.79 -                                                          windata->size.h));
   11.80 -       SDL_DFB_CHECKERR(windata->window_surface->
   11.81 -                      GetSubSurface(windata->window_surface, &windata->client,
   11.82 -                                  &windata->surface));
   11.83 +        SDL_DFB_CHECKERR(windata->window->GetOptions(windata->window, &opts));
   11.84 +        /* recreate subsurface */
   11.85 +        SDL_DFB_RELEASE(windata->surface);
   11.86 +
   11.87 +        if (opts & DWOP_SCALE)
   11.88 +            SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
   11.89 +                                                            windata->size.w,
   11.90 +                                                            windata->size.h));
   11.91 +        SDL_DFB_CHECKERR(windata->window_surface->
   11.92 +                         GetSubSurface(windata->window_surface,
   11.93 +                                       &windata->client, &windata->surface));
   11.94  #endif
   11.95 -       DirectFB_WM_RedrawLayout(window);
   11.96 +        DirectFB_WM_RedrawLayout(window);
   11.97      }
   11.98    error:
   11.99      return;
  11.100  }
  11.101 -
    12.1 --- a/src/video/x11/SDL_x11events.c	Tue Jan 13 23:27:08 2009 +0000
    12.2 +++ b/src/video/x11/SDL_x11events.c	Wed Jan 14 04:25:32 2009 +0000
    12.3 @@ -310,7 +310,6 @@
    12.4                      }
    12.5                      continue;
    12.6                  }
    12.7 -
    12.8  #if SDL_VIDEO_DRIVER_X11_XINPUT
    12.9                  data = (X11_MouseData *) mouse->driverdata;
   12.10                  if (xevent.type == data->motion) {
   12.11 @@ -398,7 +397,7 @@
   12.12      if (_this->suspend_screensaver) {
   12.13          Uint32 now = SDL_GetTicks();
   12.14          if (!data->screensaver_activity ||
   12.15 -            (int)(now-data->screensaver_activity) >= 30000) {
   12.16 +            (int) (now - data->screensaver_activity) >= 30000) {
   12.17              XResetScreenSaver(data->display);
   12.18              data->screensaver_activity = now;
   12.19          }
   12.20 @@ -415,7 +414,8 @@
   12.21  #ifdef GNOME_SCREENSAVER_HACK
   12.22  #include <unistd.h>
   12.23  static pid_t screensaver_inhibit_pid;
   12.24 -static void gnome_screensaver_disable()
   12.25 +static void
   12.26 +gnome_screensaver_disable()
   12.27  {
   12.28      screensaver_inhibit_pid = fork();
   12.29      if (screensaver_inhibit_pid == 0) {
   12.30 @@ -426,12 +426,12 @@
   12.31                "gnome-screensaver-command",
   12.32                "--inhibit",
   12.33                "--reason",
   12.34 -              "GNOME screensaver doesn't respect MIT-SCREEN-SAVER",
   12.35 -              NULL);
   12.36 +              "GNOME screensaver doesn't respect MIT-SCREEN-SAVER", NULL);
   12.37          exit(2);
   12.38      }
   12.39  }
   12.40 -static void gnome_screensaver_enable()
   12.41 +static void
   12.42 +gnome_screensaver_enable()
   12.43  {
   12.44      kill(screensaver_inhibit_pid, 15);
   12.45  }
    13.1 --- a/test/testresample.c	Tue Jan 13 23:27:08 2009 +0000
    13.2 +++ b/test/testresample.c	Wed Jan 14 04:25:32 2009 +0000
    13.3 @@ -1,7 +1,8 @@
    13.4  #include <stdio.h>
    13.5  #include "SDL.h"
    13.6  
    13.7 -int main(int argc, char **argv)
    13.8 +int
    13.9 +main(int argc, char **argv)
   13.10  {
   13.11      SDL_AudioSpec spec;
   13.12      SDL_AudioCVT cvt;
   13.13 @@ -13,30 +14,26 @@
   13.14      int avgbytes = 0;
   13.15      SDL_RWops *io = NULL;
   13.16  
   13.17 -    if (argc != 4)
   13.18 -    {
   13.19 +    if (argc != 4) {
   13.20          fprintf(stderr, "USAGE: %s in.wav out.wav newfreq\n", argv[0]);
   13.21          return 1;
   13.22      }
   13.23  
   13.24      cvtfreq = atoi(argv[3]);
   13.25  
   13.26 -    if (SDL_Init(SDL_INIT_AUDIO) == -1)
   13.27 -    {
   13.28 +    if (SDL_Init(SDL_INIT_AUDIO) == -1) {
   13.29          fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError());
   13.30          return 2;
   13.31      }
   13.32  
   13.33 -    if (SDL_LoadWAV(argv[1], &spec, &data, &len) == NULL)
   13.34 -    {
   13.35 +    if (SDL_LoadWAV(argv[1], &spec, &data, &len) == NULL) {
   13.36          fprintf(stderr, "failed to load %s: %s\n", argv[1], SDL_GetError());
   13.37          SDL_Quit();
   13.38          return 3;
   13.39      }
   13.40  
   13.41      if (SDL_BuildAudioCVT(&cvt, spec.format, spec.channels, spec.freq,
   13.42 -                          spec.format, spec.channels, cvtfreq) == -1)
   13.43 -    {
   13.44 +                          spec.format, spec.channels, cvtfreq) == -1) {
   13.45          fprintf(stderr, "failed to build CVT: %s\n", SDL_GetError());
   13.46          SDL_FreeWAV(data);
   13.47          SDL_Quit();
   13.48 @@ -45,8 +42,7 @@
   13.49  
   13.50      cvt.len = len;
   13.51      cvt.buf = (Uint8 *) malloc(len * cvt.len_mult);
   13.52 -    if (cvt.buf == NULL)
   13.53 -    {
   13.54 +    if (cvt.buf == NULL) {
   13.55          fprintf(stderr, "Out of memory.\n");
   13.56          SDL_FreeWAV(data);
   13.57          SDL_Quit();
   13.58 @@ -54,8 +50,7 @@
   13.59      }
   13.60      memcpy(cvt.buf, data, len);
   13.61  
   13.62 -    if (SDL_ConvertAudio(&cvt) == -1)
   13.63 -    {
   13.64 +    if (SDL_ConvertAudio(&cvt) == -1) {
   13.65          fprintf(stderr, "Conversion failed: %s\n", SDL_GetError());
   13.66          free(cvt.buf);
   13.67          SDL_FreeWAV(data);
   13.68 @@ -65,8 +60,7 @@
   13.69  
   13.70      /* write out a WAV header... */
   13.71      io = SDL_RWFromFile(argv[2], "wb");
   13.72 -    if (io == NULL)
   13.73 -    {
   13.74 +    if (io == NULL) {
   13.75          fprintf(stderr, "fopen('%s') failed: %s\n", argv[2], SDL_GetError());
   13.76          free(cvt.buf);
   13.77          SDL_FreeWAV(data);
   13.78 @@ -78,35 +72,33 @@
   13.79      blockalign = (bitsize / 8) * spec.channels;
   13.80      avgbytes = cvtfreq * blockalign;
   13.81  
   13.82 -    SDL_WriteLE32(io, 0x46464952);  /* RIFF */
   13.83 +    SDL_WriteLE32(io, 0x46464952);      /* RIFF */
   13.84      SDL_WriteLE32(io, len * cvt.len_mult + 36);
   13.85 -    SDL_WriteLE32(io, 0x45564157);  /* WAVE */
   13.86 -    SDL_WriteLE32(io, 0x20746D66);  /* fmt */
   13.87 -    SDL_WriteLE32(io, 16);          /* chunk size */
   13.88 -    SDL_WriteLE16(io, 1);           /* uncompressed */
   13.89 -    SDL_WriteLE16(io, spec.channels);  /* channels */
   13.90 -    SDL_WriteLE32(io, cvtfreq);  /* sample rate */
   13.91 -    SDL_WriteLE32(io, avgbytes);  /* average bytes per second */
   13.92 -    SDL_WriteLE16(io, blockalign);  /* block align */
   13.93 -    SDL_WriteLE16(io, bitsize);  /* significant bits per sample */
   13.94 -    SDL_WriteLE32(io, 0x61746164);  /* data */
   13.95 -    SDL_WriteLE32(io, cvt.len_cvt);  /* size */
   13.96 +    SDL_WriteLE32(io, 0x45564157);      /* WAVE */
   13.97 +    SDL_WriteLE32(io, 0x20746D66);      /* fmt */
   13.98 +    SDL_WriteLE32(io, 16);      /* chunk size */
   13.99 +    SDL_WriteLE16(io, 1);       /* uncompressed */
  13.100 +    SDL_WriteLE16(io, spec.channels);   /* channels */
  13.101 +    SDL_WriteLE32(io, cvtfreq); /* sample rate */
  13.102 +    SDL_WriteLE32(io, avgbytes);        /* average bytes per second */
  13.103 +    SDL_WriteLE16(io, blockalign);      /* block align */
  13.104 +    SDL_WriteLE16(io, bitsize); /* significant bits per sample */
  13.105 +    SDL_WriteLE32(io, 0x61746164);      /* data */
  13.106 +    SDL_WriteLE32(io, cvt.len_cvt);     /* size */
  13.107      SDL_RWwrite(io, cvt.buf, cvt.len_cvt, 1);
  13.108  
  13.109 -    if (SDL_RWclose(io) == -1)
  13.110 -    {
  13.111 +    if (SDL_RWclose(io) == -1) {
  13.112          fprintf(stderr, "fclose('%s') failed: %s\n", argv[2], SDL_GetError());
  13.113          free(cvt.buf);
  13.114          SDL_FreeWAV(data);
  13.115          SDL_Quit();
  13.116          return 8;
  13.117 -    } // if
  13.118 +    }                           // if
  13.119  
  13.120      free(cvt.buf);
  13.121      SDL_FreeWAV(data);
  13.122      SDL_Quit();
  13.123      return 0;
  13.124 -} // main
  13.125 +}                               // main
  13.126  
  13.127  // end of resample_test.c ...
  13.128 -