[gtk+] gdk/gdkglcontext.c: Avoid a GCCism



commit 7700243bd49278692c8218fdf8358169672d7a13
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Apr 26 20:29:23 2016 +0800

    gdk/gdkglcontext.c: Avoid a GCCism
    
    Pointer arithmetic on GLvoid* (a void*) is a GCCism, so cast it to an
    unsigned char*, which is the type cairo_image_surface_get_data() returns.

 gdk/gdkglcontext.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 87534c6..44ef88b 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -274,14 +274,14 @@ gdk_gl_context_upload_texture (GdkGLContext    *context,
           glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 
           for (i = 0; i < height; i++)
-            glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, data + (i * 
stride));
+            glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, (unsigned char*) 
data + (i * stride));
         }
       else
         {
           glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 
NULL);
 
           for (i = 0; i < height; i++)
-            glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data + 
(i * stride));
+            glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 
(unsigned char*) data + (i * stride));
         }
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]