Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()
authorSam Lantinga <slouken@libsdl.org>
Tue, 19 Mar 2013 21:53:33 -0700
changeset 70143e0d048e1c14
parent 7013 fe82d15464d1
child 7015 e3cba60c0f0a
Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()

Ryan C. Gordon

With this function...
SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects, int numrects);
...is there any reason rects isn't "const SDL_Rect *" ?
include/SDL_video.h
src/video/SDL_rect.c
src/video/SDL_rect_c.h
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/bwindow/SDL_bframebuffer.cc
src/video/bwindow/SDL_bframebuffer.h
src/video/dummy/SDL_nullframebuffer.c
src/video/dummy/SDL_nullframebuffer_c.h
src/video/windows/SDL_windowsframebuffer.c
src/video/windows/SDL_windowsframebuffer.h
src/video/x11/SDL_x11framebuffer.c
src/video/x11/SDL_x11framebuffer.h
     1.1 --- a/include/SDL_video.h	Sun Mar 17 09:47:25 2013 -0700
     1.2 +++ b/include/SDL_video.h	Tue Mar 19 21:53:33 2013 -0700
     1.3 @@ -694,7 +694,7 @@
     1.4   *  \sa SDL_UpdateWindowSurfaceRect()
     1.5   */
     1.6  extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
     1.7 -                                                         SDL_Rect * rects,
     1.8 +                                                         const SDL_Rect * rects,
     1.9                                                           int numrects);
    1.10  
    1.11  /**
     2.1 --- a/src/video/SDL_rect.c	Sun Mar 17 09:47:25 2013 -0700
     2.2 +++ b/src/video/SDL_rect.c	Tue Mar 19 21:53:33 2013 -0700
     2.3 @@ -412,7 +412,7 @@
     2.4  
     2.5  SDL_bool
     2.6  SDL_GetSpanEnclosingRect(int width, int height,
     2.7 -                         int numrects, SDL_Rect * rects, SDL_Rect *span)
     2.8 +                         int numrects, const SDL_Rect * rects, SDL_Rect *span)
     2.9  {
    2.10      int i;
    2.11      int span_y1, span_y2;
     3.1 --- a/src/video/SDL_rect_c.h	Sun Mar 17 09:47:25 2013 -0700
     3.2 +++ b/src/video/SDL_rect_c.h	Tue Mar 19 21:53:33 2013 -0700
     3.3 @@ -20,6 +20,6 @@
     3.4  */
     3.5  #include "SDL_config.h"
     3.6  
     3.7 -extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, SDL_Rect * rects, SDL_Rect *span);
     3.8 +extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span);
     3.9  
    3.10  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/video/SDL_sysvideo.h	Sun Mar 17 09:47:25 2013 -0700
     4.2 +++ b/src/video/SDL_sysvideo.h	Tue Mar 19 21:53:33 2013 -0700
     4.3 @@ -199,7 +199,7 @@
     4.4      void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed);
     4.5      void (*DestroyWindow) (_THIS, SDL_Window * window);
     4.6      int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
     4.7 -    int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, SDL_Rect * rects, int numrects);
     4.8 +    int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
     4.9      void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
    4.10  
    4.11      /* * * */
     5.1 --- a/src/video/SDL_video.c	Sun Mar 17 09:47:25 2013 -0700
     5.2 +++ b/src/video/SDL_video.c	Tue Mar 19 21:53:33 2013 -0700
     5.3 @@ -308,7 +308,7 @@
     5.4  }
     5.5  
     5.6  static int
     5.7 -SDL_UpdateWindowTexture(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects)
     5.8 +SDL_UpdateWindowTexture(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
     5.9  {
    5.10      SDL_WindowTextureData *data;
    5.11      SDL_Rect rect;
    5.12 @@ -1841,7 +1841,7 @@
    5.13  }
    5.14  
    5.15  int
    5.16 -SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects,
    5.17 +SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects,
    5.18                               int numrects)
    5.19  {
    5.20      CHECK_WINDOW_MAGIC(window, -1);
     6.1 --- a/src/video/bwindow/SDL_bframebuffer.cc	Sun Mar 17 09:47:25 2013 -0700
     6.2 +++ b/src/video/bwindow/SDL_bframebuffer.cc	Tue Mar 19 21:53:33 2013 -0700
     6.3 @@ -98,7 +98,7 @@
     6.4  
     6.5  
     6.6  int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
     6.7 -                                      SDL_Rect * rects, int numrects) {
     6.8 +                                      const SDL_Rect * rects, int numrects) {
     6.9  	if(!window)
    6.10  		return 0;
    6.11  
     7.1 --- a/src/video/bwindow/SDL_bframebuffer.h	Sun Mar 17 09:47:25 2013 -0700
     7.2 +++ b/src/video/bwindow/SDL_bframebuffer.h	Tue Mar 19 21:53:33 2013 -0700
     7.3 @@ -34,7 +34,7 @@
     7.4                                         Uint32 * format,
     7.5                                         void ** pixels, int *pitch);
     7.6  extern int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
     7.7 -                                       SDL_Rect * rects, int numrects);
     7.8 +                                       const SDL_Rect * rects, int numrects);
     7.9  extern void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
    7.10  extern int32 BE_DrawThread(void *data);
    7.11  
     8.1 --- a/src/video/dummy/SDL_nullframebuffer.c	Sun Mar 17 09:47:25 2013 -0700
     8.2 +++ b/src/video/dummy/SDL_nullframebuffer.c	Tue Mar 19 21:53:33 2013 -0700
     8.3 @@ -58,7 +58,7 @@
     8.4      return 0;
     8.5  }
     8.6  
     8.7 -int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects)
     8.8 +int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
     8.9  {
    8.10      static int frame_number;
    8.11      SDL_Surface *surface;
     9.1 --- a/src/video/dummy/SDL_nullframebuffer_c.h	Sun Mar 17 09:47:25 2013 -0700
     9.2 +++ b/src/video/dummy/SDL_nullframebuffer_c.h	Tue Mar 19 21:53:33 2013 -0700
     9.3 @@ -21,7 +21,7 @@
     9.4  #include "SDL_config.h"
     9.5  
     9.6  extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
     9.7 -extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects);
     9.8 +extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
     9.9  extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
    9.10  
    9.11  /* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/video/windows/SDL_windowsframebuffer.c	Sun Mar 17 09:47:25 2013 -0700
    10.2 +++ b/src/video/windows/SDL_windowsframebuffer.c	Tue Mar 19 21:53:33 2013 -0700
    10.3 @@ -93,7 +93,7 @@
    10.4      return 0;
    10.5  }
    10.6  
    10.7 -int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects)
    10.8 +int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
    10.9  {
   10.10      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
   10.11  
    11.1 --- a/src/video/windows/SDL_windowsframebuffer.h	Sun Mar 17 09:47:25 2013 -0700
    11.2 +++ b/src/video/windows/SDL_windowsframebuffer.h	Tue Mar 19 21:53:33 2013 -0700
    11.3 @@ -21,7 +21,7 @@
    11.4  #include "SDL_config.h"
    11.5  
    11.6  extern int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
    11.7 -extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects);
    11.8 +extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
    11.9  extern void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
   11.10  
   11.11  /* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/video/x11/SDL_x11framebuffer.c	Sun Mar 17 09:47:25 2013 -0700
    12.2 +++ b/src/video/x11/SDL_x11framebuffer.c	Tue Mar 19 21:53:33 2013 -0700
    12.3 @@ -148,7 +148,7 @@
    12.4  }
    12.5  
    12.6  int
    12.7 -X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects,
    12.8 +X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects,
    12.9                              int numrects)
   12.10  {
   12.11      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    13.1 --- a/src/video/x11/SDL_x11framebuffer.h	Sun Mar 17 09:47:25 2013 -0700
    13.2 +++ b/src/video/x11/SDL_x11framebuffer.h	Tue Mar 19 21:53:33 2013 -0700
    13.3 @@ -25,7 +25,7 @@
    13.4                                         Uint32 * format,
    13.5                                         void ** pixels, int *pitch);
    13.6  extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
    13.7 -                                       SDL_Rect * rects, int numrects);
    13.8 +                                       const SDL_Rect * rects, int numrects);
    13.9  extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
   13.10  
   13.11  /* vi: set ts=4 sw=4 expandtab: */