diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2012-09-30 02:11:25 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2012-10-01 18:35:18 +0100 |
commit | eaef6d774a4fd305ce35abebe9d9a350993c23b4 (patch) | |
tree | 50411b949aa1c3eee120d8413bdab3dd4d4c6295 | |
parent | d2f07344a361c43ccdb85a0587812ca3a103078b (diff) | |
download | cogl-eaef6d774a4fd305ce35abebe9d9a350993c23b4.tar.gz |
cogl: Don't expose longs in the API (1/2)
unsigned long have quite a bad property in that they have different
sizes on 64 bits platforms depending on if you are on Linux (LP64) or on
Windows (LLP64).
This makes writing bindings for the CLR really hard as it only has fixed
types and no types which size would depend on the platform.
As the longs exposed in Cogl don't seem to need to be 64 bits
on 64 bits platforms, let's just use ints instead. Well, actually, even
if you wanted to use the 64 bits of longs and not care about Windows,
you couldn't because the API also has to work on Linux 32 bits.
Let's start by changing the type of the variable storing the number of
instances alive (per object type) to an int.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
-rw-r--r-- | cogl/cogl-object-private.h | 2 | ||||
-rw-r--r-- | cogl/cogl-object.c | 4 | ||||
-rw-r--r-- | cogl/cogl-object.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/cogl/cogl-object-private.h b/cogl/cogl-object-private.h index 5510c8ed..d145f317 100644 --- a/cogl/cogl-object-private.h +++ b/cogl/cogl-object-private.h @@ -117,7 +117,7 @@ struct _CoglObject #define COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code) \ \ CoglObjectClass _cogl_##type_name##_class; \ -static unsigned long _cogl_object_##type_name##_count; \ +static unsigned int _cogl_object_##type_name##_count; \ \ static inline void \ _cogl_object_##type_name##_inc (void) \ diff --git a/cogl/cogl-object.c b/cogl/cogl-object.c index 1ec2e8d3..d5023563 100644 --- a/cogl/cogl-object.c +++ b/cogl/cogl-object.c @@ -239,7 +239,7 @@ cogl_debug_object_foreach_type (CoglDebugObjectForeachTypeCallback func, void *user_data) { GHashTableIter iter; - unsigned long *instance_count; + unsigned int *instance_count; CoglDebugObjectTypeInfo info; g_hash_table_iter_init (&iter, _cogl_debug_instances); @@ -256,7 +256,7 @@ static void print_instances_cb (const CoglDebugObjectTypeInfo *info, void *user_data) { - g_print ("\t%s: %lu\n", info->name, info->instance_count); + g_print ("\t%s: %u\n", info->name, info->instance_count); } void diff --git a/cogl/cogl-object.h b/cogl/cogl-object.h index a65bd9c4..a0e099e9 100644 --- a/cogl/cogl-object.h +++ b/cogl/cogl-object.h @@ -117,7 +117,7 @@ typedef void (*CoglUserDataDestroyCallback) (void *user_data); typedef struct { const char *name; - unsigned long instance_count; + unsigned int instance_count; } CoglDebugObjectTypeInfo; /** |