Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()
authorSam Lantinga <slouken@libsdl.org>
Tue, 19 Mar 2013 21:53:33 -0700
changeset 7014 3e0d048e1c14
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
--- a/include/SDL_video.h	Sun Mar 17 09:47:25 2013 -0700
+++ b/include/SDL_video.h	Tue Mar 19 21:53:33 2013 -0700
@@ -694,7 +694,7 @@
  *  \sa SDL_UpdateWindowSurfaceRect()
  */
 extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
-                                                         SDL_Rect * rects,
+                                                         const SDL_Rect * rects,
                                                          int numrects);
 
 /**
--- a/src/video/SDL_rect.c	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/SDL_rect.c	Tue Mar 19 21:53:33 2013 -0700
@@ -412,7 +412,7 @@
 
 SDL_bool
 SDL_GetSpanEnclosingRect(int width, int height,
-                         int numrects, SDL_Rect * rects, SDL_Rect *span)
+                         int numrects, const SDL_Rect * rects, SDL_Rect *span)
 {
     int i;
     int span_y1, span_y2;
--- a/src/video/SDL_rect_c.h	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/SDL_rect_c.h	Tue Mar 19 21:53:33 2013 -0700
@@ -20,6 +20,6 @@
 */
 #include "SDL_config.h"
 
-extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, SDL_Rect * rects, SDL_Rect *span);
+extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span);
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/SDL_sysvideo.h	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/SDL_sysvideo.h	Tue Mar 19 21:53:33 2013 -0700
@@ -199,7 +199,7 @@
     void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed);
     void (*DestroyWindow) (_THIS, SDL_Window * window);
     int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
-    int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, SDL_Rect * rects, int numrects);
+    int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
     void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
 
     /* * * */
--- a/src/video/SDL_video.c	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/SDL_video.c	Tue Mar 19 21:53:33 2013 -0700
@@ -308,7 +308,7 @@
 }
 
 static int
-SDL_UpdateWindowTexture(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects)
+SDL_UpdateWindowTexture(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
 {
     SDL_WindowTextureData *data;
     SDL_Rect rect;
@@ -1841,7 +1841,7 @@
 }
 
 int
-SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects,
+SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects,
                              int numrects)
 {
     CHECK_WINDOW_MAGIC(window, -1);
--- a/src/video/bwindow/SDL_bframebuffer.cc	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/bwindow/SDL_bframebuffer.cc	Tue Mar 19 21:53:33 2013 -0700
@@ -98,7 +98,7 @@
 
 
 int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
-                                      SDL_Rect * rects, int numrects) {
+                                      const SDL_Rect * rects, int numrects) {
 	if(!window)
 		return 0;
 
--- a/src/video/bwindow/SDL_bframebuffer.h	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/bwindow/SDL_bframebuffer.h	Tue Mar 19 21:53:33 2013 -0700
@@ -34,7 +34,7 @@
                                        Uint32 * format,
                                        void ** pixels, int *pitch);
 extern int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
-                                       SDL_Rect * rects, int numrects);
+                                       const SDL_Rect * rects, int numrects);
 extern void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
 extern int32 BE_DrawThread(void *data);
 
--- a/src/video/dummy/SDL_nullframebuffer.c	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/dummy/SDL_nullframebuffer.c	Tue Mar 19 21:53:33 2013 -0700
@@ -58,7 +58,7 @@
     return 0;
 }
 
-int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects)
+int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
 {
     static int frame_number;
     SDL_Surface *surface;
--- a/src/video/dummy/SDL_nullframebuffer_c.h	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/dummy/SDL_nullframebuffer_c.h	Tue Mar 19 21:53:33 2013 -0700
@@ -21,7 +21,7 @@
 #include "SDL_config.h"
 
 extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
-extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects);
+extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
 extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/windows/SDL_windowsframebuffer.c	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/windows/SDL_windowsframebuffer.c	Tue Mar 19 21:53:33 2013 -0700
@@ -93,7 +93,7 @@
     return 0;
 }
 
-int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects)
+int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
 {
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
 
--- a/src/video/windows/SDL_windowsframebuffer.h	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/windows/SDL_windowsframebuffer.h	Tue Mar 19 21:53:33 2013 -0700
@@ -21,7 +21,7 @@
 #include "SDL_config.h"
 
 extern int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
-extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects);
+extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
 extern void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/x11/SDL_x11framebuffer.c	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/x11/SDL_x11framebuffer.c	Tue Mar 19 21:53:33 2013 -0700
@@ -148,7 +148,7 @@
 }
 
 int
-X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects,
+X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects,
                             int numrects)
 {
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
--- a/src/video/x11/SDL_x11framebuffer.h	Sun Mar 17 09:47:25 2013 -0700
+++ b/src/video/x11/SDL_x11framebuffer.h	Tue Mar 19 21:53:33 2013 -0700
@@ -25,7 +25,7 @@
                                        Uint32 * format,
                                        void ** pixels, int *pitch);
 extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
-                                       SDL_Rect * rects, int numrects);
+                                       const SDL_Rect * rects, int numrects);
 extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
 
 /* vi: set ts=4 sw=4 expandtab: */