[cogl/wip/lazy-texture-allocate: 8/11] texture: return ints from _get_width/height



commit 021a44dd6020b4f4df911931b78a96e4ff504fdf
Author: Robert Bragg <robert linux intel com>
Date:   Thu Jun 27 18:55:43 2013 +0100

    texture: return ints from _get_width/height
    
    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);
 
 /**


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