From 2bcf38d1263cda3c2a7489c17df66c579b729ebe Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 26 Sep 2012 17:05:01 +0100 Subject: [PATCH] Fix a warning in the vtable for texture_2d_get_data The function pointer for texture_2d_get_data in the driver vtable was expecting an unsigned int for the rowstride but the definition in cogl-texture-2d-gl.c took a size_t so it was giving an annoying warning. This normalizes them both to just take an int. This seems to better match the pattern used for cogl_bitmap_new_from_data and cogl_texture_2d_new_from_data. Reviewed-by: Robert Bragg (cherry picked from commit 003f080531d5368835081568779b031ef4f09a77) --- cogl/cogl-driver.h | 2 +- cogl/cogl-texture-2d.c | 2 +- cogl/cogl-texture-3d.c | 2 +- cogl/cogl-texture-private.h | 2 +- cogl/cogl-texture-rectangle.c | 2 +- cogl/driver/gl/cogl-texture-2d-gl-private.h | 2 +- cogl/driver/gl/cogl-texture-2d-gl.c | 2 +- cogl/winsys/cogl-texture-pixmap-x11.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cogl/cogl-driver.h b/cogl/cogl-driver.h index 7560ba08a..f92211100 100644 --- a/cogl/cogl-driver.h +++ b/cogl/cogl-driver.h @@ -209,7 +209,7 @@ struct _CoglDriverVtable void (* texture_2d_get_data) (CoglTexture2D *tex_2d, CoglPixelFormat format, - unsigned int rowstride, + int rowstride, uint8_t *data); /* Prepares for drawing by flushing the journal, framebuffer state, diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c index 6b902fb11..950cccef8 100644 --- a/cogl/cogl-texture-2d.c +++ b/cogl/cogl-texture-2d.c @@ -505,7 +505,7 @@ _cogl_texture_2d_set_region (CoglTexture *tex, static CoglBool _cogl_texture_2d_get_data (CoglTexture *tex, CoglPixelFormat format, - unsigned int rowstride, + int rowstride, uint8_t *data) { CoglContext *ctx = tex->context; diff --git a/cogl/cogl-texture-3d.c b/cogl/cogl-texture-3d.c index dee454290..6000b370e 100644 --- a/cogl/cogl-texture-3d.c +++ b/cogl/cogl-texture-3d.c @@ -572,7 +572,7 @@ _cogl_texture_3d_set_region (CoglTexture *tex, static int _cogl_texture_3d_get_data (CoglTexture *tex, CoglPixelFormat format, - unsigned int rowstride, + int rowstride, uint8_t *data) { /* FIXME: we could probably implement this by assuming the data is diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h index 618191d4e..a52101fbb 100644 --- a/cogl/cogl-texture-private.h +++ b/cogl/cogl-texture-private.h @@ -81,7 +81,7 @@ struct _CoglTextureVtable be necessary). */ CoglBool (* get_data) (CoglTexture *tex, CoglPixelFormat format, - unsigned int rowstride, + int rowstride, uint8_t *data); void (* foreach_sub_texture_in_region) (CoglTexture *tex, diff --git a/cogl/cogl-texture-rectangle.c b/cogl/cogl-texture-rectangle.c index 2d985bb70..3dca1ed4e 100644 --- a/cogl/cogl-texture-rectangle.c +++ b/cogl/cogl-texture-rectangle.c @@ -568,7 +568,7 @@ _cogl_texture_rectangle_set_region (CoglTexture *tex, static CoglBool _cogl_texture_rectangle_get_data (CoglTexture *tex, CoglPixelFormat format, - unsigned int rowstride, + int rowstride, uint8_t *data) { CoglTextureRectangle *tex_rect = COGL_TEXTURE_RECTANGLE (tex); diff --git a/cogl/driver/gl/cogl-texture-2d-gl-private.h b/cogl/driver/gl/cogl-texture-2d-gl-private.h index 492c31477..52378ffac 100644 --- a/cogl/driver/gl/cogl-texture-2d-gl-private.h +++ b/cogl/driver/gl/cogl-texture-2d-gl-private.h @@ -106,7 +106,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d, void _cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d, CoglPixelFormat format, - size_t rowstride, + int rowstride, uint8_t *data); #endif /* _COGL_TEXTURE_2D_GL_PRIVATE_H_ */ diff --git a/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/driver/gl/cogl-texture-2d-gl.c index 889ae121d..5056544a1 100644 --- a/cogl/driver/gl/cogl-texture-2d-gl.c +++ b/cogl/driver/gl/cogl-texture-2d-gl.c @@ -542,7 +542,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d, void _cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d, CoglPixelFormat format, - size_t rowstride, + int rowstride, uint8_t *data) { CoglContext *ctx = COGL_TEXTURE (tex_2d)->context; diff --git a/cogl/winsys/cogl-texture-pixmap-x11.c b/cogl/winsys/cogl-texture-pixmap-x11.c index 7797105a0..b7889bc51 100644 --- a/cogl/winsys/cogl-texture-pixmap-x11.c +++ b/cogl/winsys/cogl-texture-pixmap-x11.c @@ -694,7 +694,7 @@ _cogl_texture_pixmap_x11_set_region (CoglTexture *tex, static CoglBool _cogl_texture_pixmap_x11_get_data (CoglTexture *tex, CoglPixelFormat format, - unsigned int rowstride, + int rowstride, uint8_t *data) { CoglTexturePixmapX11 *tex_pixmap = COGL_TEXTURE_PIXMAP_X11 (tex);