Put the braces on the next line so vi can find the beginning of the function. SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 10 Oct 2009 14:59:32 +0000
branchSDL-1.2
changeset 4317719faf118c38
parent 4316 7b27a7fc4fdf
child 4318 34a0a589b9c4
Put the braces on the next line so vi can find the beginning of the function.
src/video/quartz/SDL_QuartzVideo.m
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.m	Sat Oct 10 10:28:05 2009 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.m	Sat Oct 10 14:59:32 2009 +0000
     1.3 @@ -111,12 +111,13 @@
     1.4  
     1.5  
     1.6  /* Bootstrap functions */
     1.7 -static int QZ_Available () {
     1.8 +static int QZ_Available ()
     1.9 +{
    1.10      return 1;
    1.11  }
    1.12  
    1.13 -static SDL_VideoDevice* QZ_CreateDevice (int device_index) {
    1.14 -
    1.15 +static SDL_VideoDevice* QZ_CreateDevice (int device_index)
    1.16 +{
    1.17  #pragma unused (device_index)
    1.18  
    1.19      SDL_VideoDevice *device;
    1.20 @@ -188,19 +189,20 @@
    1.21      return device;
    1.22  }
    1.23  
    1.24 -static void QZ_DeleteDevice (SDL_VideoDevice *device) {
    1.25 -
    1.26 +static void QZ_DeleteDevice (SDL_VideoDevice *device)
    1.27 +{
    1.28      SDL_free (device->hidden);
    1.29      SDL_free (device);
    1.30  }
    1.31  
    1.32 -static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format) {
    1.33 -
    1.34 +static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format)
    1.35 +{
    1.36      NSRect r = NSMakeRect(0.0, 0.0, 0.0, 0.0);
    1.37      const char *env = NULL;
    1.38 -
    1.39 +	
    1.40      /* Initialize the video settings; this data persists between mode switches */
    1.41      display_id = kCGDirectMainDisplay;
    1.42 +
    1.43      save_mode  = CGDisplayCurrentMode    (display_id);
    1.44      mode_list  = CGDisplayAvailableModes (display_id);
    1.45      palette    = CGPaletteCreateDefaultColorPalette ();
    1.46 @@ -253,8 +255,8 @@
    1.47      return 0;
    1.48  }
    1.49  
    1.50 -static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags) {
    1.51 -
    1.52 +static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags)
    1.53 +{
    1.54      CFIndex num_modes;
    1.55      CFIndex i;
    1.56  
    1.57 @@ -379,8 +381,8 @@
    1.58      return SDL_FALSE;
    1.59  }
    1.60  
    1.61 -static void QZ_UnsetVideoMode (_THIS, BOOL to_desktop) {
    1.62 -
    1.63 +static void QZ_UnsetVideoMode (_THIS, BOOL to_desktop)
    1.64 +{
    1.65      /* Reset values that may change between switches */
    1.66      this->info.blit_fill  = 0;
    1.67      this->FillHWRect      = NULL;
    1.68 @@ -456,7 +458,8 @@
    1.69  }
    1.70  
    1.71  static SDL_Surface* QZ_SetVideoFullScreen (_THIS, SDL_Surface *current, int width,
    1.72 -                                           int height, int bpp, Uint32 flags) {
    1.73 +                                           int height, int bpp, Uint32 flags)
    1.74 +{
    1.75      boolean_t exact_match = 0;
    1.76      NSRect screen_rect;
    1.77      CGError error;
    1.78 @@ -654,7 +657,8 @@
    1.79  }
    1.80  
    1.81  static SDL_Surface* QZ_SetVideoWindowed (_THIS, SDL_Surface *current, int width,
    1.82 -                                         int height, int *bpp, Uint32 flags) {
    1.83 +                                         int height, int *bpp, Uint32 flags)
    1.84 +{
    1.85      unsigned int style;
    1.86      NSRect contentRect;
    1.87      int center_window = 1;
    1.88 @@ -821,8 +825,8 @@
    1.89  }
    1.90  
    1.91  static SDL_Surface* QZ_SetVideoMode (_THIS, SDL_Surface *current, int width,
    1.92 -                                     int height, int bpp, Uint32 flags) {
    1.93 -
    1.94 +                                     int height, int bpp, Uint32 flags)
    1.95 +{
    1.96      current->flags = 0;
    1.97      current->pixels = NULL;
    1.98  
    1.99 @@ -894,13 +898,14 @@
   1.100      return current;
   1.101  }
   1.102  
   1.103 -static int QZ_ToggleFullScreen (_THIS, int on) {
   1.104 +static int QZ_ToggleFullScreen (_THIS, int on)
   1.105 +{
   1.106      return 0;
   1.107  }
   1.108  
   1.109  static int QZ_SetColors (_THIS, int first_color, int num_colors,
   1.110 -                         SDL_Color *colors) {
   1.111 -
   1.112 +                         SDL_Color *colors)
   1.113 +{
   1.114      CGTableCount  index;
   1.115      CGDeviceColor color;
   1.116  
   1.117 @@ -922,18 +927,18 @@
   1.118      return 1;
   1.119  }
   1.120  
   1.121 -static int QZ_LockDoubleBuffer (_THIS, SDL_Surface *surface) {
   1.122 -
   1.123 +static int QZ_LockDoubleBuffer (_THIS, SDL_Surface *surface)
   1.124 +{
   1.125      return 1;
   1.126  }
   1.127  
   1.128 -static void QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface) {
   1.129 -
   1.130 +static void QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface)
   1.131 +{
   1.132  }
   1.133  
   1.134 - /* The VBL delay is based on code by Ian R Ollmann's RezLib <iano@cco.caltech.edu> */
   1.135 - static AbsoluteTime QZ_SecondsToAbsolute ( double seconds ) {
   1.136 -    
   1.137 +/* The VBL delay is based on code by Ian R Ollmann's RezLib <iano@cco.caltech.edu> */
   1.138 +static AbsoluteTime QZ_SecondsToAbsolute ( double seconds )
   1.139 +{
   1.140      union
   1.141      {
   1.142          UInt64 i;
   1.143 @@ -945,8 +950,8 @@
   1.144      return NanosecondsToAbsolute ( temp.ns );
   1.145  }
   1.146  
   1.147 -static int QZ_ThreadFlip (_THIS) {
   1.148 -
   1.149 +static int QZ_ThreadFlip (_THIS)
   1.150 +{
   1.151      Uint8 *src, *dst;
   1.152      int skip, len, h;
   1.153      
   1.154 @@ -1051,8 +1056,8 @@
   1.155      return 0;
   1.156  }
   1.157          
   1.158 -static int QZ_FlipDoubleBuffer (_THIS, SDL_Surface *surface) {
   1.159 -
   1.160 +static int QZ_FlipDoubleBuffer (_THIS, SDL_Surface *surface)
   1.161 +{
   1.162      /* wait for previous flip to complete */
   1.163      SDL_SemWait (sem2);
   1.164      
   1.165 @@ -1069,14 +1074,14 @@
   1.166      return 0;
   1.167  }
   1.168  
   1.169 -
   1.170 -static void QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects) {
   1.171 -
   1.172 +static void QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects)
   1.173 +{
   1.174      /* perform a flip if someone calls updaterects on a doublebuferred surface */
   1.175      this->FlipHWSurface (this, SDL_VideoSurface);
   1.176  }
   1.177  
   1.178 -static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects) {
   1.179 +static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects)
   1.180 +{
   1.181  #pragma unused(this,num_rects,rects)
   1.182  }
   1.183  
   1.184 @@ -1121,8 +1126,8 @@
   1.185      0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0b
   1.186  };
   1.187  
   1.188 -static void QZ_DrawResizeIcon (_THIS) {
   1.189 -
   1.190 +static void QZ_DrawResizeIcon (_THIS)
   1.191 +{
   1.192      /* Check if we should draw the resize icon */
   1.193      if (SDL_VideoSurface->flags & SDL_RESIZABLE) {
   1.194      
   1.195 @@ -1152,8 +1157,8 @@
   1.196      }
   1.197  }
   1.198  
   1.199 -static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects) {
   1.200 -
   1.201 +static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects)
   1.202 +{
   1.203      if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {
   1.204          QZ_GL_SwapBuffers (this);
   1.205      }
   1.206 @@ -1178,8 +1183,8 @@
   1.207      }
   1.208  }
   1.209  
   1.210 -static void QZ_VideoQuit (_THIS) {
   1.211 -
   1.212 +static void QZ_VideoQuit (_THIS)
   1.213 +{
   1.214      CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
   1.215  
   1.216      /* Restore gamma settings */
   1.217 @@ -1219,28 +1224,30 @@
   1.218  }
   1.219  
   1.220  #if 0 /* Not used (apparently, it's really slow) */
   1.221 -static int  QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color) {
   1.222 -
   1.223 +static int  QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
   1.224 +{
   1.225      CGSDisplayHWFill (display_id, rect->x, rect->y, rect->w, rect->h, color);
   1.226  
   1.227      return 0;
   1.228  }
   1.229  #endif
   1.230  
   1.231 -static int  QZ_LockHWSurface(_THIS, SDL_Surface *surface) {
   1.232 -
   1.233 +static int  QZ_LockHWSurface(_THIS, SDL_Surface *surface)
   1.234 +{
   1.235      return 1;
   1.236  }
   1.237  
   1.238 -static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface) {
   1.239 -
   1.240 +static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface)
   1.241 +{
   1.242  }
   1.243  
   1.244 -static int QZ_AllocHWSurface(_THIS, SDL_Surface *surface) {
   1.245 +static int QZ_AllocHWSurface(_THIS, SDL_Surface *surface)
   1.246 +{
   1.247      return(-1); /* unallowed (no HWSURFACE support here). */
   1.248  }
   1.249  
   1.250 -static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface) {
   1.251 +static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface)
   1.252 +{
   1.253  }
   1.254  
   1.255  /*
   1.256 @@ -1250,8 +1257,8 @@
   1.257   */
   1.258  
   1.259  /* Gamma functions */
   1.260 -int QZ_SetGamma (_THIS, float red, float green, float blue) {
   1.261 -
   1.262 +int QZ_SetGamma (_THIS, float red, float green, float blue)
   1.263 +{
   1.264      const CGGammaValue min = 0.0, max = 1.0;
   1.265  
   1.266      if (red == 0.0)
   1.267 @@ -1280,8 +1287,8 @@
   1.268      }
   1.269  }
   1.270  
   1.271 -int QZ_GetGamma (_THIS, float *red, float *green, float *blue) {
   1.272 -
   1.273 +int QZ_GetGamma (_THIS, float *red, float *green, float *blue)
   1.274 +{
   1.275      CGGammaValue dummy;
   1.276      if ( CGDisplayNoErr == CGGetDisplayTransferByFormula
   1.277           (display_id, &dummy, &dummy, red,
   1.278 @@ -1292,8 +1299,8 @@
   1.279          return -1;
   1.280  }
   1.281  
   1.282 -int QZ_SetGammaRamp (_THIS, Uint16 *ramp) {
   1.283 -
   1.284 +int QZ_SetGammaRamp (_THIS, Uint16 *ramp)
   1.285 +{
   1.286      const CGTableCount tableSize = 255;
   1.287      CGGammaValue redTable[tableSize];
   1.288      CGGammaValue greenTable[tableSize];
   1.289 @@ -1318,8 +1325,8 @@
   1.290          return -1;
   1.291  }
   1.292  
   1.293 -int QZ_GetGammaRamp (_THIS, Uint16 *ramp) {
   1.294 -
   1.295 +int QZ_GetGammaRamp (_THIS, Uint16 *ramp)
   1.296 +{
   1.297      const CGTableCount tableSize = 255;
   1.298      CGGammaValue redTable[tableSize];
   1.299      CGGammaValue greenTable[tableSize];