From 5f9e775820760cb1d66087bc5e956e7a5655ef64 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 31 Jan 2013 16:30:48 +0000 Subject: [PATCH] Clouseau: Fix seg on 32 bit. SVN revision: 83528 --- src/lib/clouseau_data.c | 6 ++--- src/lib/clouseau_object_information.c | 38 ++++++++++++++------------- src/lib/clouseau_private.h | 2 +- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/lib/clouseau_data.c b/src/lib/clouseau_data.c index 33d2456..acd1a52 100644 --- a/src/lib/clouseau_data.c +++ b/src/lib/clouseau_data.c @@ -29,10 +29,10 @@ clouseau_eo_info_free(Clouseau_Eo_Dbg_Info *parent) { Clouseau_Eo_Dbg_Info *eo; - if (parent->type == EINA_VALUE_TYPE_LIST) + if (parent->type == (uintptr_t) EINA_VALUE_TYPE_LIST) EINA_LIST_FREE(parent->un_dbg_info.dbg.list, eo) clouseau_eo_info_free(eo); - else if (parent->type == EINA_VALUE_TYPE_STRING) + else if (parent->type == (uintptr_t) EINA_VALUE_TYPE_STRING) eina_stringshare_del(parent->un_dbg_info.text.s); eina_stringshare_del(parent->name); @@ -407,7 +407,7 @@ _clouseau_eo_descs_make(void) EET_DATA_DESCRIPTOR_ADD_BASIC (eo_dbg_info_edd, Clouseau_Eo_Dbg_Info, "name", name, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC (eo_dbg_info_edd, Clouseau_Eo_Dbg_Info, - "type", type, EET_T_LONG_LONG); + "type", type, EET_T_ULONG_LONG); /* Here because clouseau_list_desc_make() uses eo_dbg_info_edd */ eo_list_edd = clouseau_list_desc_make(); diff --git a/src/lib/clouseau_object_information.c b/src/lib/clouseau_object_information.c index 631f37a..fc7cc75 100644 --- a/src/lib/clouseau_object_information.c +++ b/src/lib/clouseau_object_information.c @@ -51,27 +51,28 @@ clouseau_object_information_free(Clouseau_Object *oinfo) static void _clouseau_eo_from_legacy_convert_helper(Eo_Dbg_Info *new_root, Clouseau_Eo_Dbg_Info *root) { - if (root->type == EINA_VALUE_TYPE_STRING) + const Eina_Value_Type *type = (void *) (uintptr_t) root->type; + if (type == EINA_VALUE_TYPE_STRING) { - EO_DBG_INFO_APPEND(new_root, root->name, root->type, root->un_dbg_info.text.s); + EO_DBG_INFO_APPEND(new_root, root->name, type, root->un_dbg_info.text.s); } - else if (root->type == EINA_VALUE_TYPE_INT) + else if (type == EINA_VALUE_TYPE_INT) { - EO_DBG_INFO_APPEND(new_root, root->name, root->type, root->un_dbg_info.intg.i); + EO_DBG_INFO_APPEND(new_root, root->name, type, root->un_dbg_info.intg.i); } - else if (root->type == EINA_VALUE_TYPE_CHAR) + else if (type == EINA_VALUE_TYPE_CHAR) { - EO_DBG_INFO_APPEND(new_root, root->name, root->type, root->un_dbg_info.bl.b); + EO_DBG_INFO_APPEND(new_root, root->name, type, root->un_dbg_info.bl.b); } - else if (root->type == EINA_VALUE_TYPE_UINT64) + else if (type == EINA_VALUE_TYPE_UINT64) { - EO_DBG_INFO_APPEND(new_root, root->name, root->type, root->un_dbg_info.ptr.p); + EO_DBG_INFO_APPEND(new_root, root->name, type, root->un_dbg_info.ptr.p); } - else if (root->type == EINA_VALUE_TYPE_DOUBLE) + else if (type == EINA_VALUE_TYPE_DOUBLE) { - EO_DBG_INFO_APPEND(new_root, root->name, root->type, root->un_dbg_info.dbl.d); + EO_DBG_INFO_APPEND(new_root, root->name, type, root->un_dbg_info.dbl.d); } - else if (root->type == EINA_VALUE_TYPE_LIST) + else if (type == EINA_VALUE_TYPE_LIST) { Eina_List *l; Clouseau_Eo_Dbg_Info *eo; @@ -131,34 +132,35 @@ clouseau_eo_to_legacy_convert(Eo_Dbg_Info *root) EINA_LIST_FOREACH(root_list.list, l, eo) { Clouseau_Eo_Dbg_Info *info = calloc(1, sizeof(*info)); - info->type = eina_value_type_get(&(eo->value)); + info->type = (uintptr_t) eina_value_type_get(&(eo->value)); info->name = eina_stringshare_add(eo->name); + const Eina_Value_Type *type = (void *) (uintptr_t) info->type; - if (info->type == EINA_VALUE_TYPE_STRING) + if (type == EINA_VALUE_TYPE_STRING) { const char *tmp; eina_value_get(&(eo->value), &tmp); info->un_dbg_info.text.s = eina_stringshare_add(tmp); } - else if (info->type == EINA_VALUE_TYPE_INT) + else if (type == EINA_VALUE_TYPE_INT) { eina_value_get(&(eo->value), &(info->un_dbg_info.intg.i)); } - else if (info->type == EINA_VALUE_TYPE_CHAR) + else if (type == EINA_VALUE_TYPE_CHAR) { eina_value_get(&(eo->value), &(info->un_dbg_info.bl.b)); } - else if (info->type == EINA_VALUE_TYPE_UINT64) + else if (type == EINA_VALUE_TYPE_UINT64) { uint64_t tmp; eina_value_get(&(eo->value), &tmp); info->un_dbg_info.ptr.p = tmp; } - else if (info->type == EINA_VALUE_TYPE_DOUBLE) + else if (type == EINA_VALUE_TYPE_DOUBLE) { eina_value_get(&(eo->value), &(info->un_dbg_info.dbl.d)); } - else if (info->type == EINA_VALUE_TYPE_LIST) + else if (type == EINA_VALUE_TYPE_LIST) { info->un_dbg_info.dbg.list = clouseau_eo_to_legacy_convert(eo); diff --git a/src/lib/clouseau_private.h b/src/lib/clouseau_private.h index 41863c0..36f31d3 100644 --- a/src/lib/clouseau_private.h +++ b/src/lib/clouseau_private.h @@ -184,7 +184,7 @@ typedef struct _Clouseau_Eo_Dbg_Info Clouseau_Eo_Dbg_Info; struct _Clouseau_Eo_Dbg_Info { /* Debug info composed of a list of Eo_Dbg_Info */ const char *name; - const Eina_Value_Type *type; + unsigned long long type; union _un_dbg_info {