[Cogl] [PATCH 10/13] texture: return ints from _get_width/height

Robert Bragg robert at sixbynine.org
Wed Dec 11 10:31:31 PST 2013


From: Robert Bragg <robert at linux.intel.com>

This changes cogl_texture_get_width/height to return signed integers
just because unsigned integers in C often cause un-obvious arithmetic
issues due to implicit casting.
---
 cogl/cogl-texture.c | 4 ++--
 cogl/cogl-texture.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index a2df38d..6bc67c2 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -170,13 +170,13 @@ _cogl_texture_is_foreign (CoglTexture *texture)
     return FALSE;
 }
 
-unsigned int
+int
 cogl_texture_get_width (CoglTexture *texture)
 {
   return texture->width;
 }
 
-unsigned int
+int
 cogl_texture_get_height (CoglTexture *texture)
 {
   return texture->height;
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 308eaa3..9c3d193 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -132,7 +132,7 @@ cogl_is_texture (void *object);
  *
  * Return value: the width of the GPU side texture in pixels
  */
-unsigned int
+int
 cogl_texture_get_width (CoglTexture *texture);
 
 /**
@@ -143,7 +143,7 @@ cogl_texture_get_width (CoglTexture *texture);
  *
  * Return value: the height of the GPU side texture in pixels
  */
-unsigned int
+int
 cogl_texture_get_height (CoglTexture *texture);
 
 /**
-- 
1.8.3.1



More information about the Cogl mailing list