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 *" ?
This commit is contained in:
Sam Lantinga 2013-03-19 21:53:33 -07:00
parent 63b082da83
commit fecccf1718
13 changed files with 14 additions and 14 deletions

View file

@ -694,7 +694,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
* \sa SDL_UpdateWindowSurfaceRect() * \sa SDL_UpdateWindowSurfaceRect()
*/ */
extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
SDL_Rect * rects, const SDL_Rect * rects,
int numrects); int numrects);
/** /**

View file

@ -412,7 +412,7 @@ SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, int *Y1, int *X2,
SDL_bool SDL_bool
SDL_GetSpanEnclosingRect(int width, int height, 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 i;
int span_y1, span_y2; int span_y1, span_y2;

View file

@ -20,6 +20,6 @@
*/ */
#include "SDL_config.h" #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: */ /* vi: set ts=4 sw=4 expandtab: */

View file

@ -199,7 +199,7 @@ struct SDL_VideoDevice
void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed); void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed);
void (*DestroyWindow) (_THIS, SDL_Window * window); void (*DestroyWindow) (_THIS, SDL_Window * window);
int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); 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); void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
/* * * */ /* * * */

View file

@ -308,7 +308,7 @@ SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pix
} }
static int 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_WindowTextureData *data;
SDL_Rect rect; SDL_Rect rect;
@ -1841,7 +1841,7 @@ SDL_UpdateWindowSurface(SDL_Window * window)
} }
int int
SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects, SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects,
int numrects) int numrects)
{ {
CHECK_WINDOW_MAGIC(window, -1); CHECK_WINDOW_MAGIC(window, -1);

View file

@ -98,7 +98,7 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window, int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
SDL_Rect * rects, int numrects) { const SDL_Rect * rects, int numrects) {
if(!window) if(!window)
return 0; return 0;

View file

@ -34,7 +34,7 @@ extern int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
Uint32 * format, Uint32 * format,
void ** pixels, int *pitch); void ** pixels, int *pitch);
extern int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window, 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 void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
extern int32 BE_DrawThread(void *data); extern int32 BE_DrawThread(void *data);

View file

@ -58,7 +58,7 @@ int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma
return 0; 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; static int frame_number;
SDL_Surface *surface; SDL_Surface *surface;

View file

@ -21,7 +21,7 @@
#include "SDL_config.h" #include "SDL_config.h"
extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); 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); extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View file

@ -93,7 +93,7 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, voi
return 0; 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; SDL_WindowData *data = (SDL_WindowData *) window->driverdata;

View file

@ -21,7 +21,7 @@
#include "SDL_config.h" #include "SDL_config.h"
extern int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); 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); extern void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View file

@ -148,7 +148,7 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format,
} }
int int
X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects,
int numrects) int numrects)
{ {
SDL_WindowData *data = (SDL_WindowData *) window->driverdata; SDL_WindowData *data = (SDL_WindowData *) window->driverdata;

View file

@ -25,7 +25,7 @@ extern int X11_CreateWindowFramebuffer(_THIS, SDL_Window * window,
Uint32 * format, Uint32 * format,
void ** pixels, int *pitch); void ** pixels, int *pitch);
extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, 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); extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */