Clouseau: Fix seg on 32 bit.

SVN revision: 83528
This commit is contained in:
Tom Hacohen 2013-01-31 16:30:48 +00:00
parent 18e031694d
commit 5f9e775820
3 changed files with 24 additions and 22 deletions

View File

@ -29,10 +29,10 @@ clouseau_eo_info_free(Clouseau_Eo_Dbg_Info *parent)
{ {
Clouseau_Eo_Dbg_Info *eo; 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) EINA_LIST_FREE(parent->un_dbg_info.dbg.list, eo)
clouseau_eo_info_free(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->un_dbg_info.text.s);
eina_stringshare_del(parent->name); 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, EET_DATA_DESCRIPTOR_ADD_BASIC (eo_dbg_info_edd, Clouseau_Eo_Dbg_Info,
"name", name, EET_T_STRING); "name", name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC (eo_dbg_info_edd, Clouseau_Eo_Dbg_Info, 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 */ /* Here because clouseau_list_desc_make() uses eo_dbg_info_edd */
eo_list_edd = clouseau_list_desc_make(); eo_list_edd = clouseau_list_desc_make();

View File

@ -51,27 +51,28 @@ clouseau_object_information_free(Clouseau_Object *oinfo)
static void static void
_clouseau_eo_from_legacy_convert_helper(Eo_Dbg_Info *new_root, Clouseau_Eo_Dbg_Info *root) _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; Eina_List *l;
Clouseau_Eo_Dbg_Info *eo; 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) EINA_LIST_FOREACH(root_list.list, l, eo)
{ {
Clouseau_Eo_Dbg_Info *info = calloc(1, sizeof(*info)); 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); 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; const char *tmp;
eina_value_get(&(eo->value), &tmp); eina_value_get(&(eo->value), &tmp);
info->un_dbg_info.text.s = eina_stringshare_add(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)); 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)); 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; uint64_t tmp;
eina_value_get(&(eo->value), &tmp); eina_value_get(&(eo->value), &tmp);
info->un_dbg_info.ptr.p = 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)); 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 = info->un_dbg_info.dbg.list =
clouseau_eo_to_legacy_convert(eo); clouseau_eo_to_legacy_convert(eo);

View File

@ -184,7 +184,7 @@ typedef struct _Clouseau_Eo_Dbg_Info Clouseau_Eo_Dbg_Info;
struct _Clouseau_Eo_Dbg_Info struct _Clouseau_Eo_Dbg_Info
{ /* Debug info composed of a list of Eo_Dbg_Info */ { /* Debug info composed of a list of Eo_Dbg_Info */
const char *name; const char *name;
const Eina_Value_Type *type; unsigned long long type;
union _un_dbg_info union _un_dbg_info
{ {