Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()
Browse files Browse the repository at this point in the history
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 *" ?
  • Loading branch information
slouken committed Mar 20, 2013
1 parent 07f0946 commit 6970497
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/SDL_video.h
Expand Up @@ -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);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_rect.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_rect_c.h
Expand Up @@ -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: */
2 changes: 1 addition & 1 deletion src/video/SDL_sysvideo.h
Expand Up @@ -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);

/* * * */
Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/video/bwindow/SDL_bframebuffer.cc
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/video/bwindow/SDL_bframebuffer.h
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/video/dummy/SDL_nullframebuffer.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/video/dummy/SDL_nullframebuffer_c.h
Expand Up @@ -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: */
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsframebuffer.c
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsframebuffer.h
Expand Up @@ -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: */
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11framebuffer.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11framebuffer.h
Expand Up @@ -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: */

0 comments on commit 6970497

Please sign in to comment.