Fixed compiler warning on some versions of GCC.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 25 Aug 2012 22:21:16 -0400
changeset 6407 93f481657c6d
parent 6406 3a098f2d4dea
child 6408 6fb90a109d83
Fixed compiler warning on some versions of GCC.
src/video/SDL_surface.c
--- a/src/video/SDL_surface.c	Sat Aug 25 16:49:05 2012 -0400
+++ b/src/video/SDL_surface.c	Sat Aug 25 22:21:16 2012 -0400
@@ -912,6 +912,7 @@
     SDL_PixelFormat src_fmt, dst_fmt;
     SDL_BlitMap src_blitmap, dst_blitmap;
     SDL_Rect rect;
+    void *nonconst_src = (void *) src;
 
     /* Fast path for same format copy */
     if (src_format == dst_format) {
@@ -942,7 +943,7 @@
         return 0;
     }
 
-    if (!SDL_CreateSurfaceOnStack(width, height, src_format, (void*)src,
+    if (!SDL_CreateSurfaceOnStack(width, height, src_format, nonconst_src,
                                   src_pitch,
                                   &src_surface, &src_fmt, &src_blitmap)) {
         return -1;