From 69704974d8fe881815a51dba6cbb93f9247d1f50 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 19 Mar 2013 21:53:33 -0700 Subject: [PATCH] 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 | 2 +- src/video/SDL_rect.c | 2 +- src/video/SDL_rect_c.h | 2 +- src/video/SDL_sysvideo.h | 2 +- src/video/SDL_video.c | 4 ++-- src/video/bwindow/SDL_bframebuffer.cc | 2 +- src/video/bwindow/SDL_bframebuffer.h | 2 +- src/video/dummy/SDL_nullframebuffer.c | 2 +- src/video/dummy/SDL_nullframebuffer_c.h | 2 +- src/video/windows/SDL_windowsframebuffer.c | 2 +- src/video/windows/SDL_windowsframebuffer.h | 2 +- src/video/x11/SDL_x11framebuffer.c | 2 +- src/video/x11/SDL_x11framebuffer.h | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/SDL_video.h b/include/SDL_video.h index d20c7c27c..4873da39b 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -694,7 +694,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); * \sa SDL_UpdateWindowSurfaceRect() */ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, - SDL_Rect * rects, + const SDL_Rect * rects, int numrects); /** diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c index e57381236..23894dc3d 100644 --- a/src/video/SDL_rect.c +++ b/src/video/SDL_rect.c @@ -412,7 +412,7 @@ SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, int *Y1, int *X2, 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; diff --git a/src/video/SDL_rect_c.h b/src/video/SDL_rect_c.h index b360a54c2..a7fd49cf8 100644 --- a/src/video/SDL_rect_c.h +++ b/src/video/SDL_rect_c.h @@ -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: */ diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index b51c5e4cd..4874014d7 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -199,7 +199,7 @@ struct SDL_VideoDevice 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); /* * * */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 1877a5870..f04b13199 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -308,7 +308,7 @@ SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pix } 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 @@ SDL_UpdateWindowSurface(SDL_Window * window) } 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); diff --git a/src/video/bwindow/SDL_bframebuffer.cc b/src/video/bwindow/SDL_bframebuffer.cc index 28bb842a4..11e60bd5f 100644 --- a/src/video/bwindow/SDL_bframebuffer.cc +++ b/src/video/bwindow/SDL_bframebuffer.cc @@ -98,7 +98,7 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window, int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window, - SDL_Rect * rects, int numrects) { + const SDL_Rect * rects, int numrects) { if(!window) return 0; diff --git a/src/video/bwindow/SDL_bframebuffer.h b/src/video/bwindow/SDL_bframebuffer.h index 76d054b70..935f0e95a 100644 --- a/src/video/bwindow/SDL_bframebuffer.h +++ b/src/video/bwindow/SDL_bframebuffer.h @@ -34,7 +34,7 @@ extern int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window, 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); diff --git a/src/video/dummy/SDL_nullframebuffer.c b/src/video/dummy/SDL_nullframebuffer.c index afcdfb807..242fb8209 100644 --- a/src/video/dummy/SDL_nullframebuffer.c +++ b/src/video/dummy/SDL_nullframebuffer.c @@ -58,7 +58,7 @@ int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma 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; diff --git a/src/video/dummy/SDL_nullframebuffer_c.h b/src/video/dummy/SDL_nullframebuffer_c.h index a7a2a1c16..57dd2adbc 100644 --- a/src/video/dummy/SDL_nullframebuffer_c.h +++ b/src/video/dummy/SDL_nullframebuffer_c.h @@ -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: */ diff --git a/src/video/windows/SDL_windowsframebuffer.c b/src/video/windows/SDL_windowsframebuffer.c index 8f2ad057c..5c22ff1f7 100644 --- a/src/video/windows/SDL_windowsframebuffer.c +++ b/src/video/windows/SDL_windowsframebuffer.c @@ -93,7 +93,7 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, voi 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; diff --git a/src/video/windows/SDL_windowsframebuffer.h b/src/video/windows/SDL_windowsframebuffer.h index ebd7d7a9b..4d7a2ba0d 100644 --- a/src/video/windows/SDL_windowsframebuffer.h +++ b/src/video/windows/SDL_windowsframebuffer.h @@ -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: */ diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index f7717416d..7f19ddd29 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -148,7 +148,7 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, } 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; diff --git a/src/video/x11/SDL_x11framebuffer.h b/src/video/x11/SDL_x11framebuffer.h index a538ef956..8e4c21ae7 100644 --- a/src/video/x11/SDL_x11framebuffer.h +++ b/src/video/x11/SDL_x11framebuffer.h @@ -25,7 +25,7 @@ extern int X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, 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: */