From: Carsten Haitzler (Rasterman) Date: Fri, 11 Oct 2013 07:49:13 +0000 (+0900) Subject: eina - and e3fl in general - stop using eina_error_get/set - useless really X-Git-Tag: submit/devel/efl/20131029.075644~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69e27abdc37f222183ce27f4ce0e3fe2a45ca590;p=platform%2Fupstream%2Fefl.git eina - and e3fl in general - stop using eina_error_get/set - useless really --- diff --git a/ChangeLog b/ChangeLog index 58d181b..ba374ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-10-11 Carsten Haitzler (The Rasterman) + + * deprecate/remove all the eina_error setting (and getting) + within efl no one uses it and it frankly it much more pain + than it's worth. the api's are still there, and efl api's still + fail as they did before.. they just don't ALSO set eina_error. + 2013-10-11 Cedric Bail * Eina: add Eina_Spinlock API, diff --git a/NEWS b/NEWS index 19c4350..210b8f5 100644 --- a/NEWS +++ b/NEWS @@ -180,6 +180,8 @@ Removed: - Remove support for DirectFB, XRender, WinCE, Glew, Direct3d, X11-16 and X11-8. * Ecore_DirectFB: - Removed + * Eina error status: + - eina error status from efl now don't also report error in addition to return. Improvements: * EFL: diff --git a/src/bin/evas/evas_cserve2_main.c b/src/bin/evas/evas_cserve2_main.c index 5f5852f..a2bb9c4 100644 --- a/src/bin/evas/evas_cserve2_main.c +++ b/src/bin/evas/evas_cserve2_main.c @@ -254,15 +254,7 @@ cserve2_client_accept(int fd) while (eina_hash_find(client_list, &client->id)) client->id = _client_id++; - if (!eina_hash_add(client_list, &client->id, client)) - { - Eina_Error err = eina_error_get(); - ERR("Could not add client to the list: \"%s\"", - eina_error_msg_get(err)); - free(client); - close(fd); - return; - } + eina_hash_add(client_list, &client->id, client); cserve2_fd_watch_add(fd, FD_READ | FD_ERROR, cserve2_message_handler, client); diff --git a/src/examples/eina/eina_hash_01.c b/src/examples/eina/eina_hash_01.c index 16418fe..75181af 100644 --- a/src/examples/eina/eina_hash_01.c +++ b/src/examples/eina/eina_hash_01.c @@ -90,19 +90,12 @@ main(int argc, const char *argv[]) // Modify or add an entry to the hash with eina_hash_set // Let's first add a new entry - eina_error_set(0); phone = eina_hash_set(phone_book, "Raul Seixas", strdup("+55 01 234-56789")); if (!phone) { - Eina_Error err = eina_error_get(); - if (!err) - { - printf("No previous phone found for Raul Seixas. "); - printf("Creating new entry.\n"); - } - else - printf("Error when setting phone for Raul Seixas\n"); + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); } else { @@ -113,7 +106,6 @@ main(int argc, const char *argv[]) printf("\n"); // Now change the phone number - eina_error_set(0); phone = eina_hash_set(phone_book, "Raul Seixas", strdup("+55 02 222-22222")); if (phone) @@ -124,14 +116,8 @@ main(int argc, const char *argv[]) } else { - Eina_Error err = eina_error_get(); - if (err) - printf("Error when changing phone for Raul Seixas\n"); - else - { - printf("No previous phone found for Raul Seixas. "); - printf("Creating new entry.\n"); - } + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); } // There are many ways to iterate over our Phone book. diff --git a/src/examples/eina/eina_hash_03.c b/src/examples/eina/eina_hash_03.c index ba543d4..b7323c4 100644 --- a/src/examples/eina/eina_hash_03.c +++ b/src/examples/eina/eina_hash_03.c @@ -90,19 +90,12 @@ main(int argc, const char *argv[]) // Modify or add an entry to the hash with eina_hash_set // Let's first add a new entry - eina_error_set(0); phone = eina_hash_set(phone_book, "Raul Seixas", strdup("+55 01 234-56789")); if (!phone) { - Eina_Error err = eina_error_get(); - if (!err) - { - printf("No previous phone found for Raul Seixas. "); - printf("Creating new entry.\n"); - } - else - printf("Error when setting phone for Raul Seixas\n"); + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); } else { @@ -113,7 +106,6 @@ main(int argc, const char *argv[]) printf("\n"); // Now change the phone number - eina_error_set(0); phone = eina_hash_set(phone_book, "Raul Seixas", strdup("+55 02 222-22222")); if (phone) @@ -124,14 +116,8 @@ main(int argc, const char *argv[]) } else { - Eina_Error err = eina_error_get(); - if (err) - printf("Error when changing phone for Raul Seixas\n"); - else - { - printf("No previous phone found for Raul Seixas. "); - printf("Creating new entry.\n"); - } + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); } // There are many ways to iterate over our Phone book. diff --git a/src/examples/eina/eina_hash_04.c b/src/examples/eina/eina_hash_04.c index da73e04..2441617 100644 --- a/src/examples/eina/eina_hash_04.c +++ b/src/examples/eina/eina_hash_04.c @@ -90,19 +90,12 @@ main(int argc, const char *argv[]) // Modify or add an entry to the hash with eina_hash_set // Let's first add a new entry - eina_error_set(0); phone = eina_hash_set(phone_book, "Raul Seixas", strdup("+55 01 234-56789")); if (!phone) { - Eina_Error err = eina_error_get(); - if (!err) - { - printf("No previous phone found for Raul Seixas. "); - printf("Creating new entry.\n"); - } - else - printf("Error when setting phone for Raul Seixas\n"); + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); } else { @@ -113,7 +106,6 @@ main(int argc, const char *argv[]) printf("\n"); // Now change the phone number - eina_error_set(0); phone = eina_hash_set(phone_book, "Raul Seixas", strdup("+55 02 222-22222")); if (phone) @@ -124,14 +116,8 @@ main(int argc, const char *argv[]) } else { - Eina_Error err = eina_error_get(); - if (err) - printf("Error when changing phone for Raul Seixas\n"); - else - { - printf("No previous phone found for Raul Seixas. "); - printf("Creating new entry.\n"); - } + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); } // There are many ways to iterate over our Phone book. diff --git a/src/examples/eina/eina_hash_05.c b/src/examples/eina/eina_hash_05.c index 6666ce2..5e5c32d 100644 --- a/src/examples/eina/eina_hash_05.c +++ b/src/examples/eina/eina_hash_05.c @@ -92,19 +92,12 @@ main(int argc, const char *argv[]) // Modify or add an entry to the hash with eina_hash_set // Let's first add a new entry int32_t id5 = 5; - eina_error_set(0); phone = eina_hash_set(phone_book, &id5, strdup("+55 01 234-56789")); if (!phone) { - Eina_Error err = eina_error_get(); - if (!err) - { - printf("No previous phone found for id5. "); - printf("Creating new entry.\n"); - } - else - printf("Error when setting phone for Raul Seixas\n"); + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); } else { @@ -115,7 +108,6 @@ main(int argc, const char *argv[]) printf("\n"); // Now change the phone number - eina_error_set(0); phone = eina_hash_set(phone_book, &id5, strdup("+55 02 222-22222")); if (phone) @@ -126,14 +118,8 @@ main(int argc, const char *argv[]) } else { - Eina_Error err = eina_error_get(); - if (err) - printf("Error when changing phone for id5\n"); - else - { - printf("No previous phone found for id5. "); - printf("Creating new entry.\n"); - } + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); } // There are many ways to iterate over our Phone book. diff --git a/src/examples/eina/eina_hash_06.c b/src/examples/eina/eina_hash_06.c index a7a5504..2df8a47 100644 --- a/src/examples/eina/eina_hash_06.c +++ b/src/examples/eina/eina_hash_06.c @@ -92,19 +92,12 @@ main(int argc, const char *argv[]) // Modify or add an entry to the hash with eina_hash_set // Let's first add a new entry int64_t id5 = 5; - eina_error_set(0); phone = eina_hash_set(phone_book, &id5, strdup("+55 01 234-56789")); if (!phone) { - Eina_Error err = eina_error_get(); - if (!err) - { - printf("No previous phone found for id5. "); - printf("Creating new entry.\n"); - } - else - printf("Error when setting phone for Raul Seixas\n"); + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); } else { @@ -115,7 +108,6 @@ main(int argc, const char *argv[]) printf("\n"); // Now change the phone number - eina_error_set(0); phone = eina_hash_set(phone_book, &id5, strdup("+55 02 222-22222")); if (phone) @@ -126,14 +118,8 @@ main(int argc, const char *argv[]) } else { - Eina_Error err = eina_error_get(); - if (err) - printf("Error when changing phone for id5\n"); - else - { - printf("No previous phone found for id5. "); - printf("Creating new entry.\n"); - } + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); } // There are many ways to iterate over our Phone book. diff --git a/src/examples/eina/eina_hash_07.c b/src/examples/eina/eina_hash_07.c index 1464e6b..e6f0455 100644 --- a/src/examples/eina/eina_hash_07.c +++ b/src/examples/eina/eina_hash_07.c @@ -105,7 +105,6 @@ main(int argc, const char *argv[]) // Modify or add an entry to the hash with eina_hash_set // Let's first add a new entry - eina_error_set(0); Phone_Entry *p1 = malloc(sizeof(*p1)); p1->name = "Raul Seixas"; p1->number = "+55 01 234-56789"; @@ -113,14 +112,8 @@ main(int argc, const char *argv[]) strdup("raulzito")); if (!nick) { - Eina_Error err = eina_error_get(); - if (!err) - { - printf("No previous nick found for Raul Seixas. "); - printf("Creating new entry.\n"); - } - else - printf("Error when setting nick for Raul Seixas\n"); + printf("No previous nick found for Raul Seixas. "); + printf("Creating new entry.\n"); } else { @@ -131,7 +124,6 @@ main(int argc, const char *argv[]) printf("\n"); // Now change the nick - eina_error_set(0); nick = eina_hash_set(phone_book, &p1, strdup("raulzao")); if (nick) @@ -142,14 +134,8 @@ main(int argc, const char *argv[]) } else { - Eina_Error err = eina_error_get(); - if (err) - printf("Error when changing nick for Raul Seixas\n"); - else - { - printf("No previous nick found for Raul Seixas. "); - printf("Creating new entry.\n"); - } + printf("No previous nick found for Raul Seixas. "); + printf("Creating new entry.\n"); } // There are many ways to iterate over our Phone book. diff --git a/src/examples/eina/eina_value_03.c b/src/examples/eina/eina_value_03.c index 85f42b3..30520d1 100644 --- a/src/examples/eina/eina_value_03.c +++ b/src/examples/eina/eina_value_03.c @@ -65,8 +65,6 @@ _tz_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, cons { struct timezone v = *(struct timezone*)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v.tz_minuteswest; @@ -130,8 +128,6 @@ _tz_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, cons other_mem = buf; /* required due &buf == buf */ return eina_value_type_pset(convert, convert_mem, &other_mem); } - - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index dabbc4c..3ec5e87 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -24,7 +24,7 @@ static const char EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED_STR[] = "Current group ca static const char EDJE_EDIT_ERROR_GROUP_REFERENCED_STR[] = "Group still in use"; static const char EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST_STR[] = "Group does not exist"; -EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = 0 ; +EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = 0; EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_REFERENCED = 0; EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = 0; @@ -229,17 +229,6 @@ _edje_edit_smart_file_set(Eo *obj, void *_pd, va_list *list) if (ret) *ret = EINA_TRUE; } -static void -_edje_edit_error_register(void) -{ - EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = - eina_error_msg_static_register(EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST_STR); - EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = - eina_error_msg_static_register(EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED_STR); - EDJE_EDIT_ERROR_GROUP_REFERENCED = - eina_error_msg_static_register(EDJE_EDIT_ERROR_GROUP_REFERENCED_STR); -} - EAPI Evas_Object * edje_edit_object_add(Evas *evas) { @@ -256,10 +245,6 @@ _edje_edit_constructor(Eo *obj, void *class_data, va_list *list EINA_UNUSED) eed->base = eo_data_ref(obj, EDJE_OBJ_CLASS); eo_do_super(obj, MY_CLASS, eo_constructor()); - eina_error_set(0); - - if (!EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST) - _edje_edit_error_register(); } static void @@ -896,7 +881,6 @@ _edje_edit_flag_script_dirty(Edje_Edit *eed, Eina_Bool all) EAPI void edje_edit_string_list_free(Eina_List *lst) { - eina_error_set(0); //printf("FREE LIST: \n"); while (lst) { @@ -909,16 +893,12 @@ edje_edit_string_list_free(Eina_List *lst) EAPI void edje_edit_string_free(const char *str) { - eina_error_set(0); - if (str) eina_stringshare_del(str); } EAPI const char* edje_edit_compiler_get(Evas_Object *obj) { - eina_error_set(0); - GET_ED_OR_RETURN(0); return eina_stringshare_add(ed->file->compiler); } @@ -937,8 +917,6 @@ edje_edit_group_add(Evas_Object *obj, const char *name) int search; //Code *cd; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); //printf("ADD GROUP: %s \n", name); @@ -1033,37 +1011,16 @@ edje_edit_group_del(Evas_Object *obj, const char *group_name) char buf[64], **keys; int count; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); /* if (eina_hash_find(ed->file->collection_hash, group_name)) */ /* return EINA_FALSE; */ - if (strcmp(ed->group, group_name) == 0) - { - eina_error_set(EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED); - return EINA_FALSE; - } - + if (strcmp(ed->group, group_name) == 0) return EINA_FALSE; e = eina_hash_find(ed->file->collection, group_name); - if (!e) - { - eina_error_set(EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST); - return EINA_FALSE; - } - - if (e->id == ed->collection->id) - { - eina_error_set(EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED); - return EINA_FALSE; - } - - if (e->ref) - { - eina_error_set(EDJE_EDIT_ERROR_GROUP_REFERENCED); - return EINA_FALSE; - } + if (!e) return EINA_FALSE; + if (e->id == ed->collection->id) return EINA_FALSE; + if (e->ref) return EINA_FALSE; _edje_edit_group_references_update(obj, group_name, NULL); @@ -1118,8 +1075,6 @@ edje_edit_group_del(Evas_Object *obj, const char *group_name) EAPI Eina_Bool edje_edit_group_exist(Evas_Object *obj, const char *group) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (eina_hash_find(ed->file->collection, group)) @@ -1133,8 +1088,6 @@ edje_edit_group_name_set(Evas_Object *obj, const char *new_name) Edje_Part_Collection_Directory_Entry *pce; Edje_Part_Collection *pc; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!new_name) return EINA_FALSE; @@ -1166,7 +1119,6 @@ edje_edit_group_name_set(Evas_Object *obj, const char *new_name) EAPI int \ edje_edit_group_##Class##_##Value##_get(Evas_Object *obj) \ { \ - eina_error_set(0); \ GET_ED_OR_RETURN(-1); \ if (!ed->collection) return -1; \ return ed->collection->prop.Class.Value; \ @@ -1174,7 +1126,6 @@ edje_edit_group_name_set(Evas_Object *obj, const char *new_name) EAPI void \ edje_edit_group_##Class##_##Value##_set(Evas_Object *obj, int v) \ { \ - eina_error_set(0); \ GET_ED_OR_RETURN(); \ ed->collection->prop.Class.Value = v; \ } @@ -1195,8 +1146,6 @@ edje_edit_group_data_list_get(Evas_Object * obj) Eina_List *datas = NULL; const char *key; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file || !ed->collection || !ed->collection->data) @@ -1220,8 +1169,6 @@ edje_edit_data_list_get(Evas_Object * obj) Eina_List *datas = NULL; const char *key; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file || !ed->file->data) @@ -1242,8 +1189,6 @@ edje_edit_group_data_add(Evas_Object *obj, const char *key, const char *value) { Edje_String *es; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!key || !ed->file || !ed->collection) @@ -1274,8 +1219,6 @@ edje_edit_data_add(Evas_Object *obj, const char *itemname, const char *value) { Edje_String *es; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!itemname || !ed->file) @@ -1303,8 +1246,6 @@ edje_edit_group_data_del(Evas_Object *obj, const char *key) { Edje_String *value; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!key || !ed->file || !ed->collection) @@ -1325,8 +1266,6 @@ edje_edit_data_del(Evas_Object *obj, const char *itemname) { Edje_String *value; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!itemname || !ed->file || !ed->file->data) @@ -1348,8 +1287,6 @@ edje_edit_group_data_value_get(Evas_Object * obj, const char *key) { Edje_String *value; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!key || !ed->file || !ed->collection) @@ -1367,8 +1304,6 @@ edje_edit_data_value_get(Evas_Object * obj, const char *itemname) { Edje_String *value; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!itemname || !ed->file || !ed->file->data) @@ -1386,8 +1321,6 @@ edje_edit_group_data_value_set(Evas_Object *obj, const char *key, const char *va { Edje_String *es; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!key || !value || !ed->file || !ed->collection) @@ -1410,8 +1343,6 @@ edje_edit_data_value_set(Evas_Object *obj, const char *itemname, const char *val { Edje_String *es; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!itemname || !value || !ed->file || !ed->file->data) @@ -1431,9 +1362,6 @@ edje_edit_data_value_set(Evas_Object *obj, const char *itemname, const char *val EAPI Eina_Bool edje_edit_group_data_name_set(Evas_Object *obj, const char *key, const char *new_key) { - - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!key || !new_key || !ed->file || !ed->collection) { @@ -1446,9 +1374,6 @@ edje_edit_group_data_name_set(Evas_Object *obj, const char *key, const char *ne EAPI Eina_Bool edje_edit_data_name_set(Evas_Object *obj, const char *itemname, const char *newname) { - - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!itemname || !newname || !ed->file || !ed->file->data) @@ -1468,8 +1393,6 @@ edje_edit_color_classes_list_get(Evas_Object * obj) Eina_List *l; Edje_Color_Class *cc; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file || !ed->file->color_classes) @@ -1487,8 +1410,6 @@ edje_edit_color_class_colors_get(Evas_Object *obj, const char *class_name, int * Eina_List *l; Edje_Color_Class *cc; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!ed->file || !ed->file->color_classes) @@ -1523,8 +1444,6 @@ edje_edit_color_class_colors_set(Evas_Object *obj, const char *class_name, int r Eina_List *l; Edje_Color_Class *cc; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!ed->file || !ed->file->color_classes) @@ -1560,8 +1479,6 @@ edje_edit_color_class_add(Evas_Object *obj, const char *name) Edje_Color_Class *c; Edje_Color_Class *cc; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!name || !ed->file) @@ -1590,8 +1507,6 @@ edje_edit_color_class_del(Evas_Object *obj, const char *name) Eina_List *l; Edje_Color_Class *cc; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!name || !ed->file || !ed->file->color_classes) @@ -1614,8 +1529,6 @@ edje_edit_color_class_name_set(Evas_Object *obj, const char *name, const char *n Eina_List *l; Edje_Color_Class *cc; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!ed->file || !ed->file->color_classes) @@ -1645,8 +1558,6 @@ edje_edit_styles_list_get(Evas_Object * obj) Eina_List *l; Edje_Style *s; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file || !ed->file->styles) @@ -1663,8 +1574,6 @@ edje_edit_style_add(Evas_Object * obj, const char* style) { Edje_Style *s; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); //printf("ADD STYLE '%s'\n", style); @@ -1686,8 +1595,6 @@ edje_edit_style_del(Evas_Object * obj, const char* style) { Edje_Style *s; - eina_error_set(0); - GET_ED_OR_RETURN(); //printf("DEL STYLE '%s'\n", style); @@ -1726,8 +1633,6 @@ edje_edit_style_tags_list_get(Evas_Object * obj, const char* style) Edje_Style *s; Edje_Style_Tag *t; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file || !ed->file->styles || !style) return NULL; @@ -1746,8 +1651,6 @@ edje_edit_style_tag_name_set(Evas_Object * obj, const char* style, const char* t { Edje_Style_Tag *t; - eina_error_set(0); - GET_ED_OR_RETURN(); //printf("SET TAG NAME for '%s' FOR STYLE '%s'\n", tag, style); @@ -1765,8 +1668,6 @@ edje_edit_style_tag_value_get(Evas_Object * obj, const char* style, const char* { Edje_Style_Tag *t; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); //printf("GET TAG '%s' FOR STYLE '%s'\n", tag, style); @@ -1785,8 +1686,6 @@ edje_edit_style_tag_value_set(Evas_Object * obj, const char* style, const char* { Edje_Style_Tag *t; - eina_error_set(0); - GET_ED_OR_RETURN(); //printf("SET TAG VALUE for '%s' FOR STYLE '%s'\n", tag, style); @@ -1805,8 +1704,6 @@ edje_edit_style_tag_add(Evas_Object * obj, const char* style, const char* tag_na Edje_Style *s; Edje_Style_Tag *t; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); //printf("ADD TAG '%s' IN STYLE '%s'\n", tag_name, style); @@ -1832,8 +1729,6 @@ edje_edit_style_tag_del(Evas_Object * obj, const char* style, const char* tag) Edje_Style *s; Edje_Style_Tag *t; - eina_error_set(0); - GET_ED_OR_RETURN(); //printf("DEL TAG '%s' IN STYLE '%s'\n", tag, style); @@ -1859,8 +1754,6 @@ edje_edit_externals_list_get(Evas_Object *obj) Eina_List *externals = NULL; unsigned int i; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file || !ed->file->external_dir) @@ -1880,8 +1773,6 @@ edje_edit_external_add(Evas_Object *obj, const char *external) unsigned int freeid; unsigned int i; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); e = _edje_edit_external_get(ed, external); @@ -1922,8 +1813,6 @@ edje_edit_external_del(Evas_Object *obj, const char *external) { Edje_External_Directory_Entry *e; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); e = _edje_edit_external_get(ed, external); @@ -1945,8 +1834,6 @@ edje_edit_parts_list_get(Evas_Object *obj) Eina_List *parts = NULL; unsigned int i; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); //printf("EE: Found %d parts\n", ed->table_parts_size); @@ -1966,8 +1853,6 @@ edje_edit_parts_list_get(Evas_Object *obj) EAPI Eina_Bool edje_edit_part_name_set(Evas_Object *obj, const char* part, const char* new_name) { - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE); @@ -1989,14 +1874,12 @@ edje_edit_part_name_set(Evas_Object *obj, const char* part, const char* new_name EAPI const char * \ edje_edit_part_api_##Value##_get(Evas_Object *obj, const char *part) \ { \ - eina_error_set(0); \ GET_RP_OR_RETURN(NULL); \ return eina_stringshare_add(rp->part->api.Value); \ } \ EAPI Eina_Bool \ edje_edit_part_api_##Value##_set(Evas_Object *obj, const char *part, const char *s) \ { \ - eina_error_set(0); \ GET_RP_OR_RETURN(EINA_FALSE); \ _edje_if_string_free(ed, rp->part->api.Value); \ rp->part->api.Value = eina_stringshare_add(s); \ @@ -2165,8 +2048,6 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type EAPI Eina_Bool edje_edit_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type) { - eina_error_set(0); - if (type == EDJE_PART_TYPE_EXTERNAL) return EINA_FALSE; return _edje_edit_real_part_add(obj, name, type, NULL); @@ -2175,8 +2056,6 @@ edje_edit_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type) EAPI Eina_Bool edje_edit_part_external_add(Evas_Object *obj, const char *name, const char *source) { - eina_error_set(0); - if (!source) return EINA_FALSE; return _edje_edit_real_part_add(obj, name, EDJE_PART_TYPE_EXTERNAL, source); @@ -2192,8 +2071,6 @@ edje_edit_part_del(Evas_Object *obj, const char* part) unsigned int id; unsigned int i; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE); @@ -2271,8 +2148,6 @@ edje_edit_part_del(Evas_Object *obj, const char* part) EAPI Eina_Bool edje_edit_part_exist(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(EINA_FALSE); return EINA_TRUE; } @@ -2282,8 +2157,6 @@ edje_edit_part_below_get(Evas_Object *obj, const char* part) { Edje_Real_Part *prev; - eina_error_set(0); - GET_RP_OR_RETURN(0); if (rp->part->id < 1) return NULL; @@ -2298,8 +2171,6 @@ edje_edit_part_above_get(Evas_Object *obj, const char* part) { Edje_Real_Part *next; - eina_error_set(0); - GET_RP_OR_RETURN(0); if ((unsigned int) rp->part->id >= ed->table_parts_size - 1) return 0; @@ -2316,8 +2187,6 @@ edje_edit_part_restack_below(Evas_Object *obj, const char* part) Edje_Real_Part *prev; Edje_Part *swap; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE); @@ -2351,8 +2220,6 @@ edje_edit_part_restack_above(Evas_Object *obj, const char* part) Edje_Real_Part *next; Edje_Part *swap; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE); @@ -2384,9 +2251,6 @@ edje_edit_part_restack_above(Evas_Object *obj, const char* part) EAPI Edje_Part_Type edje_edit_part_type_get(Evas_Object *obj, const char *part) { - - eina_error_set(0); - GET_RP_OR_RETURN(0); return rp->part->type; } @@ -2394,8 +2258,6 @@ edje_edit_part_type_get(Evas_Object *obj, const char *part) EAPI const char * edje_edit_part_selected_state_get(Evas_Object *obj, const char *part, double *value) { - eina_error_set(0); - GET_RP_OR_RETURN(NULL); if (!rp->chosen_description) @@ -2413,8 +2275,6 @@ edje_edit_part_selected_state_set(Evas_Object *obj, const char *part, const char { Edje_Part_Description_Common *pd; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE); @@ -2433,8 +2293,6 @@ edje_edit_part_clip_to_get(Evas_Object *obj, const char *part) { Edje_Real_Part *clip = NULL; - eina_error_set(0); - GET_RP_OR_RETURN(NULL); //printf("Get clip_to for part: %s [to_id: %d]\n", part, rp->part->clip_to_id); @@ -2452,8 +2310,6 @@ edje_edit_part_clip_to_set(Evas_Object *obj, const char *part, const char *clip_ Edje_Real_Part *clip; Evas_Object *o, *oo; - eina_error_set(0); - GET_RP_OR_RETURN(EINA_FALSE); /* unset clipping */ @@ -2509,8 +2365,6 @@ edje_edit_part_clip_to_set(Evas_Object *obj, const char *part, const char *clip_ EAPI Eina_Bool edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(EINA_FALSE); //printf("Get mouse_events for part: %s [%d]\n", part, rp->part->mouse_events); return rp->part->mouse_events; @@ -2519,8 +2373,6 @@ edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part) EAPI void edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events) { - eina_error_set(0); - GET_RP_OR_RETURN(); if (!rp->object) return; @@ -2544,8 +2396,6 @@ edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mo EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(EINA_FALSE); //printf("Get repeat_events for part: %s [%d]\n", part, rp->part->repeat_events); @@ -2555,8 +2405,6 @@ edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part) EAPI void edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events) { - eina_error_set(0); - GET_RP_OR_RETURN(); if (!rp->object) return; @@ -2574,8 +2422,6 @@ edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool r EAPI Evas_Event_Flags edje_edit_part_ignore_flags_get(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(0); return rp->part->ignore_flags; @@ -2584,8 +2430,6 @@ edje_edit_part_ignore_flags_get(Evas_Object *obj, const char *part) EAPI void edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags) { - eina_error_set(0); - GET_RP_OR_RETURN(); if (!rp->object) return; @@ -2597,8 +2441,6 @@ edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_F EAPI void edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale) { - eina_error_set(0); - GET_RP_OR_RETURN(); rp->part->scale = scale; @@ -2608,8 +2450,6 @@ edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale) EAPI Eina_Bool edje_edit_part_scale_get(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(EINA_FALSE); return rp->part->scale; @@ -2618,9 +2458,6 @@ edje_edit_part_scale_get(Evas_Object *obj, const char *part) EAPI const char * edje_edit_part_source_get(Evas_Object *obj, const char *part) { - //Edje_Real_Part *clip = NULL; - eina_error_set(0); - GET_RP_OR_RETURN(NULL); //printf("Get source for part: %s\n", part); @@ -2632,8 +2469,6 @@ edje_edit_part_source_get(Evas_Object *obj, const char *part) EAPI Eina_Bool edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source) { - eina_error_set(0); - GET_RP_OR_RETURN(EINA_FALSE); Evas_Object *child_obj; @@ -2665,8 +2500,6 @@ edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source EAPI int edje_edit_part_drag_x_get(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(0); //printf("Get dragX for part: %s\n", part); return rp->part->dragable.x; @@ -2675,8 +2508,6 @@ edje_edit_part_drag_x_get(Evas_Object *obj, const char *part) EAPI void edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag) { - eina_error_set(0); - GET_RP_OR_RETURN(); //printf("Set dragX for part: %s\n", part); rp->part->dragable.x = drag; @@ -2700,8 +2531,6 @@ edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag) EAPI int edje_edit_part_drag_y_get(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(0); //printf("Get dragY for part: %s\n", part); return rp->part->dragable.y; @@ -2710,8 +2539,6 @@ edje_edit_part_drag_y_get(Evas_Object *obj, const char *part) EAPI void edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag) { - eina_error_set(0); - GET_RP_OR_RETURN(); //printf("Set dragY for part: %s\n", part); rp->part->dragable.y = drag; @@ -2736,14 +2563,12 @@ edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag) EAPI int \ edje_edit_part_drag_##Class##_##Value##_get(Evas_Object *obj, const char *part) \ { \ - eina_error_set(0); \ GET_RP_OR_RETURN(0); \ return rp->part->dragable.Class##_##Value; \ } \ EAPI void \ edje_edit_part_drag_##Class##_##Value##_set(Evas_Object *obj, const char *part, int v) \ { \ - eina_error_set(0); \ GET_RP_OR_RETURN(); \ rp->part->dragable.Class##_##Value = v; \ } @@ -2759,8 +2584,6 @@ FUNC_PART_DRAG_INT(count, y); { \ Edje_Real_Part *p; \ \ - eina_error_set(0); \ - \ GET_RP_OR_RETURN(NULL); \ \ if (rp->part->dragable.Id##_id < 0) \ @@ -2774,8 +2597,6 @@ FUNC_PART_DRAG_INT(count, y); { \ Edje_Real_Part *e_part; \ \ - eina_error_set(0); \ - \ GET_RP_OR_RETURN(); \ if (!e) \ { \ @@ -2800,8 +2621,6 @@ edje_edit_part_states_list_get(Evas_Object *obj, const char *part) Eina_List *states = NULL; unsigned int i; - eina_error_set(0); - GET_RP_OR_RETURN(NULL); //Is there a better place to put this? maybe edje_edit_init() ? @@ -2836,8 +2655,6 @@ edje_edit_state_name_set(Evas_Object *obj, const char *part, const char *state, int part_id; int i; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); //printf("Set name of state: %s in part: %s [new name: %s]\n", // part, state, new_name); @@ -2883,8 +2700,6 @@ edje_edit_state_del(Evas_Object *obj, const char *part, const char *state, doubl Edje_Part_Description_Common *pd; unsigned int i; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE); @@ -3184,8 +2999,6 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double EAPI Eina_Bool edje_edit_state_exist(Evas_Object *obj, const char *part, const char *state, double value) { - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); return EINA_TRUE; } @@ -3196,8 +3009,6 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl Edje_Part_Description_Common *pdfrom, *pdto; Edje_External_Param *p; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_RP_OR_RETURN(EINA_FALSE); @@ -3365,14 +3176,12 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl EAPI double \ edje_edit_state_##Sub##_relative_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(0); \ return TO_DOUBLE(pd->Sub.relative_##Value); \ } \ EAPI void \ edje_edit_state_##Sub##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(); \ pd->Sub.relative_##Value = FROM_DOUBLE(v); \ edje_object_calc_force(obj); \ @@ -3387,14 +3196,12 @@ FUNC_STATE_RELATIVE_DOUBLE(rel2, y); EAPI int \ edje_edit_state_##Sub##_offset_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(0); \ return pd->Sub.offset_##Value; \ } \ EAPI void \ edje_edit_state_##Sub##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(); \ pd->Sub.offset_##Value = TO_INT(FROM_DOUBLE(v)); \ edje_object_calc_force(obj); \ @@ -3411,8 +3218,6 @@ FUNC_STATE_OFFSET_INT(rel2, y); { \ Edje_Real_Part *rel; \ \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(NULL); \ \ if (pd->Sub.id_##Value == -1) return NULL; \ @@ -3427,8 +3232,6 @@ FUNC_STATE_OFFSET_INT(rel2, y); { \ Edje_Real_Part *relp; \ \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(); \ \ if (to) \ @@ -3455,7 +3258,6 @@ FUNC_STATE_REL(rel2, y); EAPI void \ edje_edit_state_##Code##_get(Evas_Object *obj, const char *part, const char *state, double value, int *r, int *g, int *b, int *a) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(); \ \ if (r) *r = pd->Code.r; \ @@ -3466,7 +3268,6 @@ FUNC_STATE_REL(rel2, y); EAPI void \ edje_edit_state_##Code##_set(Evas_Object *obj, const char *part, const char *state, double value, int r, int g, int b, int a) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(); \ \ if (r > -1 && r < 256) pd->Code.r = r; \ @@ -3485,8 +3286,6 @@ edje_edit_state_color3_get(Evas_Object *obj, const char *part, const char *state { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(); if ((rp->part->type != EDJE_PART_TYPE_TEXT) && @@ -3512,8 +3311,6 @@ edje_edit_state_color3_set(Evas_Object *obj, const char *part, const char *state { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(); if ((rp->part->type != EDJE_PART_TYPE_TEXT) && @@ -3534,14 +3331,12 @@ edje_edit_state_color3_set(Evas_Object *obj, const char *part, const char *state EAPI double \ edje_edit_state_##Class##_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(0); \ return TO_DOUBLE(pd->Class.Value); \ } \ EAPI void \ edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(); \ pd->Class.Value = FROM_DOUBLE(v); \ edje_object_calc_force(obj); \ @@ -3551,14 +3346,12 @@ edje_edit_state_color3_set(Evas_Object *obj, const char *part, const char *state EAPI int \ edje_edit_state_##Class##_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(0); \ return pd->Class.Value; \ } \ EAPI void \ edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, int v) \ { \ - eina_error_set(0); \ GET_PD_OR_RETURN(); \ pd->Class.Value = v; \ edje_object_calc_force(obj); \ @@ -3577,8 +3370,6 @@ FUNC_STATE_DOUBLE(aspect, max); EAPI double \ edje_edit_state_fill_##Type##_relative_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(0); \ \ switch (rp->part->type) \ @@ -3606,8 +3397,6 @@ FUNC_STATE_DOUBLE(aspect, max); EAPI void \ edje_edit_state_fill_##Type##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ { \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(); \ \ switch (rp->part->type) \ @@ -3643,8 +3432,6 @@ FUNC_STATE_DOUBLE(aspect, max); EAPI int \ edje_edit_state_fill_##Type##_offset_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ { \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(0); \ \ switch (rp->part->type) \ @@ -3671,8 +3458,6 @@ FUNC_STATE_DOUBLE(aspect, max); EAPI void \ edje_edit_state_fill_##Type##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ { \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(); \ \ switch (rp->part->type) \ @@ -3715,8 +3500,6 @@ FUNC_STATE_INT_FILL(, size, y); EAPI Eina_Bool edje_edit_state_visible_get(Evas_Object *obj, const char *part, const char *state, double value) { - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); //printf("Get state visible flag of part: %s state: %s\n", part, state); @@ -3726,8 +3509,6 @@ edje_edit_state_visible_get(Evas_Object *obj, const char *part, const char *stat EAPI void edje_edit_state_visible_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool visible) { - eina_error_set(0); - GET_PD_OR_RETURN(); //printf("Set state visible flag of part: %s state: %s to: %d\n", part, state, visible); if (visible) pd->visible = 1; @@ -3738,8 +3519,6 @@ edje_edit_state_visible_set(Evas_Object *obj, const char *part, const char *stat EAPI unsigned char edje_edit_state_aspect_pref_get(Evas_Object *obj, const char *part, const char *state, double value) { - eina_error_set(0); - GET_PD_OR_RETURN(0); //printf("GET ASPECT_PREF of state '%s' [%d]\n", state, pd->aspect.prefer); @@ -3749,8 +3528,6 @@ edje_edit_state_aspect_pref_get(Evas_Object *obj, const char *part, const char * EAPI void edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char *state, double value, unsigned char pref) { - eina_error_set(0); - GET_PD_OR_RETURN(); //printf("SET ASPECT_PREF of state '%s' [to: %d]\n", state, pref); @@ -3760,8 +3537,6 @@ edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char * EAPI const char* edje_edit_state_color_class_get(Evas_Object *obj, const char *part, const char *state, double value) { - eina_error_set(0); - GET_PD_OR_RETURN(NULL); //printf("Get ColorClass of part: %s state: %s\n", part, state); return eina_stringshare_add(pd->color_class); @@ -3770,8 +3545,6 @@ edje_edit_state_color_class_get(Evas_Object *obj, const char *part, const char * EAPI void edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class) { - eina_error_set(0); - GET_PD_OR_RETURN(); //printf("Set ColorClass of part: %s state: %s [to: %s]\n", part, state, color_class); _edje_if_string_free(ed, pd->color_class); @@ -3783,8 +3556,6 @@ edje_edit_state_external_params_list_get(Evas_Object *obj, const char *part, con { Edje_Part_Description_External *external; - eina_error_set(0); - GET_PD_OR_RETURN(NULL); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -3802,8 +3573,6 @@ edje_edit_state_external_param_get(Evas_Object *obj, const char *part, const cha Edje_External_Param *p; Eina_List *l; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -3845,8 +3614,6 @@ edje_edit_state_external_param_int_get(Evas_Object *obj, const char *part, const Edje_External_Param *p; Eina_List *l; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -3877,8 +3644,6 @@ edje_edit_state_external_param_bool_get(Evas_Object *obj, const char *part, cons Edje_External_Param *p; Eina_List *l; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -3909,8 +3674,6 @@ edje_edit_state_external_param_double_get(Evas_Object *obj, const char *part, co Edje_External_Param *p; Eina_List *l; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -3941,8 +3704,6 @@ edje_edit_state_external_param_string_get(Evas_Object *obj, const char *part, co Edje_External_Param *p; Eina_List *l; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -3973,8 +3734,6 @@ edje_edit_state_external_param_choice_get(Evas_Object *obj, const char *part, co Edje_External_Param *p; Eina_List *l; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -4007,8 +3766,6 @@ edje_edit_state_external_param_set(Evas_Object *obj, const char *part, const cha Edje_External_Param *p = NULL, old_p = { 0, 0, 0, 0, 0 }; int found = 0; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_EXTERNAL) @@ -4103,35 +3860,30 @@ edje_edit_state_external_param_set(Evas_Object *obj, const char *part, const cha EAPI Eina_Bool edje_edit_state_external_param_int_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, int val) { - eina_error_set(0); return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_INT, val); } EAPI Eina_Bool edje_edit_state_external_param_bool_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, Eina_Bool val) { - eina_error_set(0); return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_BOOL, (int)val); } EAPI Eina_Bool edje_edit_state_external_param_double_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, double val) { - eina_error_set(0); return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, val); } EAPI Eina_Bool edje_edit_state_external_param_string_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, const char *val) { - eina_error_set(0); return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_STRING, val); } EAPI Eina_Bool edje_edit_state_external_param_choice_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, const char *val) { - eina_error_set(0); return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_CHOICE, val); } @@ -4144,8 +3896,6 @@ edje_edit_state_text_get(Evas_Object *obj, const char *part, const char *state, { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(NULL); if ((rp->part->type != EDJE_PART_TYPE_TEXT) && @@ -4163,8 +3913,6 @@ edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state, { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(); //printf("SET TEXT of state: %s\n", state); @@ -4189,8 +3937,6 @@ edje_edit_state_text_size_get(Evas_Object *obj, const char *part, const char *st { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(-1); if ((rp->part->type != EDJE_PART_TYPE_TEXT) && @@ -4207,8 +3953,6 @@ edje_edit_state_text_size_set(Evas_Object *obj, const char *part, const char *st { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(); //printf("SET TEXT_SIZE of state: %s [%d]\n", state, size); @@ -4232,8 +3976,6 @@ edje_edit_state_text_size_set(Evas_Object *obj, const char *part, const char *st { \ Edje_Part_Description_Text *txt; \ \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(0); \ \ if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \ @@ -4248,8 +3990,6 @@ edje_edit_state_text_size_set(Evas_Object *obj, const char *part, const char *st { \ Edje_Part_Description_Text *txt; \ \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(); \ \ if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \ @@ -4271,8 +4011,6 @@ FUNC_TEXT_DOUBLE(elipsis, elipsis); { \ Edje_Part_Description_Text *txt; \ \ - eina_error_set(0); \ - \ GET_PD_OR_RETURN(EINA_FALSE); \ \ if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \ @@ -4312,8 +4050,6 @@ edje_edit_fonts_list_get(Evas_Object *obj) Eina_List *fonts = NULL; Edje_Font_Directory_Entry *f; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file || !ed->file->fonts) return NULL; @@ -4337,8 +4073,6 @@ edje_edit_font_add(Evas_Object *obj, const char* path, const char* alias) struct stat st; Edje_Font_Directory_Entry *fnt; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); INF("ADD FONT: %s", path); @@ -4403,8 +4137,6 @@ edje_edit_font_del(Evas_Object *obj, const char* alias) { Edje_Font_Directory_Entry *fnt; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); INF("DEL FONT: %s", alias); @@ -4463,8 +4195,6 @@ edje_edit_font_path_get(Evas_Object *obj, const char *alias) Edje_Font_Directory_Entry *f; const char *str = NULL; - eina_error_set(0); - if (!alias) return NULL; GET_ED_OR_RETURN(NULL); @@ -4489,8 +4219,6 @@ edje_edit_state_font_get(Evas_Object *obj, const char *part, const char *state, { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(NULL); if ((rp->part->type != EDJE_PART_TYPE_TEXT) && @@ -4507,8 +4235,6 @@ edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state, { Edje_Part_Description_Text *txt; - eina_error_set(0); - GET_PD_OR_RETURN(); if ((rp->part->type != EDJE_PART_TYPE_TEXT) && @@ -4527,8 +4253,6 @@ edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state, EAPI Edje_Text_Effect edje_edit_part_effect_get(Evas_Object *obj, const char *part) { - eina_error_set(0); - GET_RP_OR_RETURN(0); //printf("GET EFFECT of part: %s\n", part); @@ -4538,8 +4262,6 @@ edje_edit_part_effect_get(Evas_Object *obj, const char *part) EAPI void edje_edit_part_effect_set(Evas_Object *obj, const char *part, Edje_Text_Effect effect) { - eina_error_set(0); - GET_RP_OR_RETURN(); //printf("SET EFFECT of part: %s [%d]\n", part, effect); @@ -4558,8 +4280,6 @@ edje_edit_images_list_get(Evas_Object *obj) Eina_List *images = NULL; unsigned int i; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); if (!ed->file) return NULL; @@ -4581,8 +4301,6 @@ edje_edit_image_add(Evas_Object *obj, const char* path) int free_id = -1; char *name; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!path) return EINA_FALSE; @@ -4651,8 +4369,6 @@ edje_edit_image_del(Evas_Object *obj, const char* name) Edje_Image_Directory_Entry *de; unsigned int i; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_ED_OR_RETURN(EINA_FALSE); @@ -4726,8 +4442,6 @@ edje_edit_image_data_add(Evas_Object *obj, const char *name, int id) { Edje_Image_Directory_Entry *de; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); if (!name) return EINA_FALSE; @@ -4757,8 +4471,6 @@ edje_edit_image_data_add(Evas_Object *obj, const char *name, int id) EAPI int edje_edit_image_id_get(Evas_Object *obj, const char *image_name) { - eina_error_set(0); - GET_EED_OR_RETURN(-1); return _edje_image_id_find(eed, image_name); @@ -4770,8 +4482,6 @@ edje_edit_image_compression_type_get(Evas_Object *obj, const char *image) Edje_Image_Directory_Entry *de = NULL; unsigned int i; - eina_error_set(0); - GET_ED_OR_RETURN(-1); if (!ed->file) return -1; @@ -4813,8 +4523,6 @@ edje_edit_image_compression_rate_get(Evas_Object *obj, const char *image) Edje_Image_Directory_Entry *de; unsigned int i; - eina_error_set(0); - GET_ED_OR_RETURN(-1); // Gets the Image Entry @@ -4838,8 +4546,6 @@ edje_edit_state_image_get(Evas_Object *obj, const char *part, const char *state, Edje_Part_Description_Image *img; const char *image; - eina_error_set(0); - GET_PD_OR_RETURN(NULL); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -4860,8 +4566,6 @@ edje_edit_state_image_set(Evas_Object *obj, const char *part, const char *state, Edje_Part_Description_Image *img; int id; - eina_error_set(0); - GET_PD_OR_RETURN(); if (!image) return; @@ -4887,8 +4591,6 @@ edje_edit_state_tweens_list_get(Evas_Object *obj, const char *part, const char * const char *name; unsigned int i; - eina_error_set(0); - GET_PD_OR_RETURN(NULL); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -4914,8 +4616,6 @@ edje_edit_state_tween_add(Evas_Object *obj, const char *part, const char *state, Edje_Part_Image_Id *i; int id; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -4953,8 +4653,6 @@ edje_edit_state_tween_del(Evas_Object *obj, const char *part, const char *state, unsigned int i; int search; - eina_error_set(0); - GET_PD_OR_RETURN(EINA_FALSE); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -4987,8 +4685,6 @@ edje_edit_state_image_border_get(Evas_Object *obj, const char *part, const char { Edje_Part_Description_Image *img; - eina_error_set(0); - GET_PD_OR_RETURN(); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -5015,8 +4711,6 @@ edje_edit_state_image_border_set(Evas_Object *obj, const char *part, const char { Edje_Part_Description_Image *img; - eina_error_set(0); - GET_PD_OR_RETURN(); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -5039,8 +4733,6 @@ edje_edit_state_image_border_fill_get(Evas_Object *obj, const char *part, const { Edje_Part_Description_Image *img; - eina_error_set(0); - GET_PD_OR_RETURN(0); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -5059,8 +4751,6 @@ edje_edit_state_image_border_fill_set(Evas_Object *obj, const char *part, const { Edje_Part_Description_Image *img; - eina_error_set(0); - GET_PD_OR_RETURN(); if (rp->part->type != EDJE_PART_TYPE_IMAGE) @@ -5118,8 +4808,6 @@ edje_edit_programs_list_get(Evas_Object *obj) Eina_List *progs = NULL; int i; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); //printf("EE: Found %d programs\n", ed->table_programs_size); @@ -5143,8 +4831,6 @@ edje_edit_program_add(Evas_Object *obj, const char *name) { Edje_Program *epr; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); //printf("ADD PROGRAM [new name: %s]\n", name); @@ -5209,8 +4895,6 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) int id, i; int old_id = -1; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5323,8 +5007,6 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_exist(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); return EINA_TRUE; @@ -5333,8 +5015,6 @@ edje_edit_program_exist(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_run(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5345,8 +5025,6 @@ edje_edit_program_run(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_name_set(Evas_Object *obj, const char *prog, const char* new_name) { - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5368,8 +5046,6 @@ edje_edit_program_name_set(Evas_Object *obj, const char *prog, const char* new_n EAPI const char * edje_edit_program_source_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); if (!epr->source) return NULL; @@ -5380,8 +5056,6 @@ edje_edit_program_source_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_source_set(Evas_Object *obj, const char *prog, const char *source) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5405,8 +5079,6 @@ edje_edit_program_source_set(Evas_Object *obj, const char *prog, const char *sou EAPI const char * edje_edit_program_filter_part_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); if (!epr->filter.part) return NULL; @@ -5416,8 +5088,6 @@ edje_edit_program_filter_part_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_filter_part_set(Evas_Object *obj, const char *prog, const char *filter_part) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5432,8 +5102,6 @@ edje_edit_program_filter_part_set(Evas_Object *obj, const char *prog, const char EAPI const char * edje_edit_program_filter_state_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); if (!epr->filter.state) return NULL; @@ -5443,8 +5111,6 @@ edje_edit_program_filter_state_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_filter_state_set(Evas_Object *obj, const char *prog, const char *filter_state) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5459,8 +5125,6 @@ edje_edit_program_filter_state_set(Evas_Object *obj, const char *prog, const cha EAPI const char * edje_edit_program_signal_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); if (!epr->signal) return NULL; @@ -5471,8 +5135,6 @@ edje_edit_program_signal_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_signal_set(Evas_Object *obj, const char *prog, const char *sig) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5496,8 +5158,6 @@ edje_edit_program_signal_set(Evas_Object *obj, const char *prog, const char *sig EAPI const char * edje_edit_program_state_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); if (!epr->state) return NULL; @@ -5508,8 +5168,6 @@ edje_edit_program_state_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_state_set(Evas_Object *obj, const char *prog, const char *state) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5524,8 +5182,6 @@ edje_edit_program_state_set(Evas_Object *obj, const char *prog, const char *stat EAPI const char * edje_edit_program_state2_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); if (!epr->state2) return NULL; @@ -5536,8 +5192,6 @@ edje_edit_program_state2_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_state2_set(Evas_Object *obj, const char *prog, const char *state2) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5552,8 +5206,6 @@ edje_edit_program_state2_set(Evas_Object *obj, const char *prog, const char *sta EAPI double edje_edit_program_value_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(-1); //printf("GET VALUE for program: %s [%s %.2f]\n", prog, epr->state, epr->value); @@ -5563,8 +5215,6 @@ edje_edit_program_value_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_value_set(Evas_Object *obj, const char *prog, double value) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); //printf("SET VALUE for program: %s [%.2f]\n", prog, value); @@ -5575,8 +5225,6 @@ edje_edit_program_value_set(Evas_Object *obj, const char *prog, double value) EAPI double edje_edit_program_value2_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(-1); //printf("GET VALUE2 for program: %s [%s %.2f]\n", prog, epr->state2, epr->value2); @@ -5586,8 +5234,6 @@ edje_edit_program_value2_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_value2_set(Evas_Object *obj, const char *prog, double value) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); //printf("SET VALUE for program: %s [%.2f]\n", prog, value); @@ -5598,8 +5244,6 @@ edje_edit_program_value2_set(Evas_Object *obj, const char *prog, double value) EAPI double edje_edit_program_in_from_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(0); //printf("GET IN.FROM for program: %s [%f]\n", prog, epr->in.from); @@ -5609,8 +5253,6 @@ edje_edit_program_in_from_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_in_from_set(Evas_Object *obj, const char *prog, double seconds) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); //printf("SET IN.FROM for program: %s [%f]\n", prog, epr->in.from); @@ -5621,8 +5263,6 @@ edje_edit_program_in_from_set(Evas_Object *obj, const char *prog, double seconds EAPI double edje_edit_program_in_range_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(0); //printf("GET IN.RANGE for program: %s [%f]\n", prog, epr->in.range); @@ -5632,8 +5272,6 @@ edje_edit_program_in_range_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_in_range_set(Evas_Object *obj, const char *prog, double seconds) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); //printf("SET IN.RANGE for program: %s [%f]\n", prog, epr->in.range); @@ -5644,8 +5282,6 @@ edje_edit_program_in_range_set(Evas_Object *obj, const char *prog, double second EAPI Edje_Tween_Mode edje_edit_program_transition_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(-1); //printf("GET TRANSITION for program: %s [%d]\n", prog, epr->tween.mode); @@ -5655,8 +5291,6 @@ edje_edit_program_transition_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_transition_set(Evas_Object *obj, const char *prog, Edje_Tween_Mode transition) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); //printf("GET TRANSITION for program: %s [%d]\n", prog, epr->tween.mode); @@ -5667,8 +5301,6 @@ edje_edit_program_transition_set(Evas_Object *obj, const char *prog, Edje_Tween_ EAPI double edje_edit_program_transition_time_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(-1); //printf("GET TRANSITION_TIME for program: %s [%.4f]\n", prog, epr->tween.time); @@ -5678,8 +5310,6 @@ edje_edit_program_transition_time_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_transition_time_set(Evas_Object *obj, const char *prog, double seconds) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); //printf("GET TRANSITION_TIME for program: %s [%.4f]\n", prog, epr->tween.time); @@ -5690,8 +5320,6 @@ edje_edit_program_transition_time_set(Evas_Object *obj, const char *prog, double EAPI Edje_Action_Type edje_edit_program_action_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(-1); //printf("GET ACTION for program: %s [%d]\n", prog, epr->action); @@ -5703,8 +5331,6 @@ edje_edit_program_action_set(Evas_Object *obj, const char *prog, Edje_Action_Typ { Program_Script *ps; - eina_error_set(0); - GET_EED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5754,8 +5380,6 @@ edje_edit_program_targets_get(Evas_Object *obj, const char *prog) Eina_List *l, *targets = NULL; Edje_Program_Target *t; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); GET_EPR_OR_RETURN(NULL); @@ -5789,8 +5413,6 @@ edje_edit_program_targets_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_targets_clear(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); while (epr->targets) @@ -5811,8 +5433,6 @@ edje_edit_program_target_add(Evas_Object *obj, const char *prog, const char *tar int id; Edje_Program_Target *t; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5853,8 +5473,6 @@ edje_edit_program_target_del(Evas_Object *obj, const char *prog, const char *tar Eina_List *l; Edje_Program_Target *t; - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -5894,8 +5512,6 @@ edje_edit_program_afters_get(Evas_Object *obj, const char *prog) Eina_List *l, *afters = NULL; Edje_Program_After *a; - eina_error_set(0); - GET_ED_OR_RETURN(NULL); GET_EPR_OR_RETURN(NULL); @@ -5917,8 +5533,6 @@ edje_edit_program_afters_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_afters_clear(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); while (epr->after) @@ -5939,8 +5553,6 @@ edje_edit_program_after_add(Evas_Object *obj, const char *prog, const char *afte Edje_Program *af; Edje_Program_After *a; - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); af = _edje_program_get_byname(obj, after); @@ -5963,8 +5575,6 @@ edje_edit_program_after_del(Evas_Object *obj, const char *prog, const char *afte Edje_Program_After *a; Eina_List *l; - eina_error_set(0); - GET_EPR_OR_RETURN(EINA_FALSE); af = _edje_program_get_byname(obj, after); @@ -5983,8 +5593,6 @@ edje_edit_program_after_del(Evas_Object *obj, const char *prog, const char *afte EAPI const char * edje_edit_program_api_name_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); return eina_stringshare_add(epr->api.name); @@ -5993,8 +5601,6 @@ edje_edit_program_api_name_get(Evas_Object *obj, const char *prog) EAPI const char * edje_edit_program_api_description_get(Evas_Object *obj, const char *prog) { - eina_error_set(0); - GET_EPR_OR_RETURN(NULL); return eina_stringshare_add(epr->api.description); @@ -6003,8 +5609,6 @@ edje_edit_program_api_description_get(Evas_Object *obj, const char *prog) EAPI Eina_Bool edje_edit_program_api_name_set(Evas_Object *obj, const char *prog, const char* name) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -6017,8 +5621,6 @@ edje_edit_program_api_name_set(Evas_Object *obj, const char *prog, const char* n EAPI Eina_Bool edje_edit_program_api_description_set(Evas_Object *obj, const char *prog, const char *description) { - eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); @@ -6034,8 +5636,6 @@ edje_edit_program_api_description_set(Evas_Object *obj, const char *prog, const EAPI char * edje_edit_script_get(Evas_Object *obj) { - eina_error_set(0); - GET_EED_OR_RETURN(NULL); GET_ED_OR_RETURN(NULL); @@ -6048,8 +5648,6 @@ edje_edit_script_get(Evas_Object *obj) EAPI void edje_edit_script_set(Evas_Object *obj, const char *code) { - eina_error_set(0); - GET_EED_OR_RETURN(); free(eed->embryo_source); @@ -6071,8 +5669,6 @@ edje_edit_script_program_get(Evas_Object *obj, const char *prog) { Program_Script *ps; - eina_error_set(0); - GET_EED_OR_RETURN(NULL); GET_EPR_OR_RETURN(NULL); @@ -6091,8 +5687,6 @@ edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *cod { Program_Script *ps; - eina_error_set(0); - GET_EED_OR_RETURN(); GET_EPR_OR_RETURN(); @@ -7778,16 +7372,12 @@ _edje_edit_internal_save(Evas_Object *obj, int current_only) EAPI Eina_Bool edje_edit_save(Evas_Object *obj) { - eina_error_set(0); - return _edje_edit_internal_save(obj, 1); } EAPI Eina_Bool edje_edit_save_all(Evas_Object *obj) { - eina_error_set(0); - return _edje_edit_internal_save(obj, 0); } @@ -7799,8 +7389,6 @@ edje_edit_print_internal_status(Evas_Object *obj) unsigned int i; int j; */ - eina_error_set(0); - GET_EED_OR_RETURN(); _edje_generate_source(obj); diff --git a/src/lib/eina/eina_array.c b/src/lib/eina/eina_array.c index b460acf..ff727f3 100644 --- a/src/lib/eina/eina_array.c +++ b/src/lib/eina/eina_array.c @@ -28,7 +28,6 @@ #include "eina_config.h" #include "eina_private.h" -#include "eina_error.h" #include "eina_log.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ @@ -185,13 +184,8 @@ eina_array_grow(Eina_Array *array) EINA_MAGIC_CHECK_ARRAY(array); total = array->total + array->step; - eina_error_set(0); tmp = realloc(array->data, sizeof (void *) * total); - if (EINA_UNLIKELY(!tmp)) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return 0; - } + if (EINA_UNLIKELY(!tmp)) return 0; array->total = total; array->data = tmp; @@ -266,13 +260,8 @@ eina_array_new(unsigned int step) { Eina_Array *array; - eina_error_set(0); array = malloc(sizeof (Eina_Array)); - if (!array) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!array) return NULL; EINA_MAGIC_SET(array, EINA_MAGIC_ARRAY); @@ -390,13 +379,8 @@ eina_array_remove(Eina_Array *array, Eina_Bool (*keep)(void *data, return EINA_TRUE; } - eina_error_set(0); tmp = malloc(sizeof (void *) * array->total); - if (!tmp) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (!tmp) return EINA_FALSE; memcpy(tmp, array->data, limit * sizeof(void *)); total = limit; @@ -438,13 +422,8 @@ eina_array_iterator_new(const Eina_Array *array) EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL); EINA_MAGIC_CHECK_ARRAY(array); - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_Array)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(it, EINA_MAGIC_ARRAY_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); @@ -468,13 +447,8 @@ eina_array_accessor_new(const Eina_Array *array) EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL); EINA_MAGIC_CHECK_ARRAY(array); - eina_error_set(0); ac = calloc(1, sizeof (Eina_Accessor_Array)); - if (!ac) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!ac) return NULL; EINA_MAGIC_SET(ac, EINA_MAGIC_ARRAY_ACCESSOR); EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR); diff --git a/src/lib/eina/eina_array.h b/src/lib/eina/eina_array.h index a9f5c7a..5a5199e 100644 --- a/src/lib/eina/eina_array.h +++ b/src/lib/eina/eina_array.h @@ -253,8 +253,7 @@ struct _Eina_Array * another element will increase the buffer by @p step elements again. * * This function return a valid array on success, or @c NULL if memory - * allocation fails. In that case, the error is set - * to #EINA_ERROR_OUT_OF_MEMORY. + * allocation fails. */ EAPI Eina_Array *eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT; @@ -325,7 +324,7 @@ EAPI void eina_array_flush(Eina_Array *array) EINA_ARG_NONNULL(1); * check of @p array. If it is @c NULL or invalid, the program may crash. * * If it wasn't able to remove items due to an allocation failure, it will - * return #EINA_FALSE and the error is set to #EINA_ERROR_OUT_OF_MEMORY. + * return #EINA_FALSE. */ EAPI Eina_Bool eina_array_remove(Eina_Array * array, Eina_Bool (*keep)(void *data, void *gdata), @@ -363,8 +362,7 @@ static inline unsigned int eina_array_count(const Eina_Array *array) EINA_ARG_NO * This function returns a newly allocated iterator associated to * @p array. If @p array is @c NULL or the count member of @p array is * less or equal than 0, this function returns @c NULL. If the memory can - * not be allocated, NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is - * set. Otherwise, a valid iterator is returned. + * not be allocated, NULL is returned. Otherwise, a valid iterator is returned. */ EAPI Eina_Iterator *eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; @@ -377,8 +375,8 @@ EAPI Eina_Iterator *eina_array_iterator_new(const Eina_Array *array) EINA * This function returns a newly allocated accessor associated to * @p array. If @p array is @c NULL or the count member of @p array is * less or equal than 0, this function returns @c NULL. If the memory can - * not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is - * set. Otherwise, a valid accessor is returned. + * not be allocated, @c NULL is returned Otherwise, a valid accessor is + * returned. */ EAPI Eina_Accessor *eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; /** diff --git a/src/lib/eina/eina_benchmark.c b/src/lib/eina/eina_benchmark.c index 701c184..d018a0a 100644 --- a/src/lib/eina/eina_benchmark.c +++ b/src/lib/eina/eina_benchmark.c @@ -142,13 +142,8 @@ eina_benchmark_new(const char *name, const char *run) { Eina_Benchmark *new; - eina_error_set(0); new = calloc(1, sizeof (Eina_Benchmark)); - if (!new) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!new) return NULL; new->name = name; new->run = run; @@ -203,13 +198,8 @@ eina_benchmark_register(Eina_Benchmark *bench, if (count_step == 0) return EINA_FALSE; - eina_error_set(0); run = calloc(1, sizeof (Eina_Run)); - if (!run) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (!run) return EINA_FALSE; run->cb = bench_cb; run->name = name; diff --git a/src/lib/eina/eina_benchmark.h b/src/lib/eina/eina_benchmark.h index a95aadf..8c0c598 100644 --- a/src/lib/eina/eina_benchmark.h +++ b/src/lib/eina/eina_benchmark.h @@ -365,9 +365,8 @@ typedef void (*Eina_Benchmark_Specimens)(int request); * to name the gnuplot file that eina_benchmark_run() will create. * * This function return a valid benchmark on success, or @c NULL if - * memory allocation fails. In that case, the error is set - * to #EINA_ERROR_OUT_OF_MEMORY. - * + * memory allocation fails. + * * When the new module is not needed anymore, use * eina_benchmark_free() to free the allocated memory. */ @@ -403,10 +402,8 @@ EAPI void eina_benchmark_free(Eina_Benchmark *bench); * increasing by @p count_step from @p count_start to @p count_end is passed to @p * bench_cb when eina_benchmark_run() is called. * - * If @p bench is @c NULL, this function returns immediately. If the - * allocation of the memory of the test to add fails, the error is set - * to #EINA_ERROR_OUT_OF_MEMORY. This function returns #EINA_FALSE - * on failure, #EINA_TRUE otherwise. + * If @p bench is @c NULL, this function returns immediately. + * This function returns #EINA_FALSE on failure, #EINA_TRUE otherwise. */ EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench, const char *name, diff --git a/src/lib/eina/eina_binbuf.h b/src/lib/eina/eina_binbuf.h index c28df05..c0a2069 100644 --- a/src/lib/eina/eina_binbuf.h +++ b/src/lib/eina/eina_binbuf.h @@ -39,8 +39,7 @@ typedef struct _Eina_Strbuf Eina_Binbuf; * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_binbuf_free(). + * returned. To free the resources, use eina_binbuf_free(). * * @see eina_binbuf_free() * @see eina_binbuf_append() @@ -58,8 +57,7 @@ EAPI Eina_Binbuf *eina_binbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT; * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_binbuf_free(). + * returned. To free the resources, use eina_binbuf_free(). * * @see eina_binbuf_manage_new() * @since 1.2.0 diff --git a/src/lib/eina/eina_convert.c b/src/lib/eina/eina_convert.c index 7e397e0..3eeacda 100644 --- a/src/lib/eina/eina_convert.c +++ b/src/lib/eina/eina_convert.c @@ -92,13 +92,6 @@ EAPI Eina_Error EINA_ERROR_CONVERT_P_NOT_FOUND = 0; EAPI Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND = 0; EAPI Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH = 0; -static const char EINA_ERROR_CONVERT_0X_NOT_FOUND_STR[] = - "Error during string conversion to float, First '0x' was not found."; -static const char EINA_ERROR_CONVERT_P_NOT_FOUND_STR[] = - "Error during string conversion to float, First 'p' was not found."; -static const char EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH_STR[] = - "Error outrun string limit during conversion string conversion to float."; - /** * @endcond */ @@ -112,10 +105,6 @@ static const char EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH_STR[] = * This function sets up the convert module of Eina. It is called by * eina_init(). * - * This function sets up the error module of Eina and registers the - * errors #EINA_ERROR_CONVERT_0X_NOT_FOUND, #EINA_ERROR_CONVERT_P_NOT_FOUND - * and #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH. - * * @see eina_init() */ Eina_Bool @@ -128,13 +117,6 @@ eina_convert_init(void) EINA_LOG_ERR("Could not register log domain: eina_convert"); return EINA_FALSE; } - -#define EEMR(n) n = eina_error_msg_static_register(n ## _STR) - EEMR(EINA_ERROR_CONVERT_0X_NOT_FOUND); - EEMR(EINA_ERROR_CONVERT_P_NOT_FOUND); - EEMR(EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH); -#undef EEMR - return EINA_TRUE; } @@ -239,7 +221,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e) if (strncmp(str, "0x", 2)) { - eina_error_set(EINA_ERROR_CONVERT_0X_NOT_FOUND); DBG("'0x' not found in '%s'", src); return EINA_FALSE; } @@ -268,7 +249,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e) /* Compute the exponent. */ if (*str != 'p') { - eina_error_set(EINA_ERROR_CONVERT_P_NOT_FOUND); DBG("'p' not found in '%s'", src); return EINA_FALSE; } @@ -304,7 +284,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e) return EINA_TRUE; on_length_error: - eina_error_set(EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH); return EINA_FALSE; } diff --git a/src/lib/eina/eina_convert.h b/src/lib/eina/eina_convert.h index 6493964..fa463d9 100644 --- a/src/lib/eina/eina_convert.h +++ b/src/lib/eina/eina_convert.h @@ -158,23 +158,8 @@ * @{ */ -/** - * @var EINA_ERROR_CONVERT_P_NOT_FOUND - * Error identifier corresponding to string not containing 'p'. - */ - EAPI extern Eina_Error EINA_ERROR_CONVERT_P_NOT_FOUND; - -/** - * @var EINA_ERROR_CONVERT_0X_NOT_FOUND - * Error identifier corresponding to string not containing '0x'. - */ EAPI extern Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND; - -/** - * @var EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH - * Error identifier corresponding to length of the string being too small. - */ EAPI extern Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH; /** @@ -269,14 +254,7 @@ EAPI int eina_convert_dtoa(double d, char *des) EINA_ARG_NONNULL(2); * The mantiss and exponent are stored in the buffers pointed * respectively by @p m and @p e. * - * If the string is invalid, the error is set to: - * - * @li #EINA_ERROR_CONVERT_0X_NOT_FOUND if no 0x is found, - * @li #EINA_ERROR_CONVERT_P_NOT_FOUND if no p is found, - * @li #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH if @p length is not - * correct. - * - * In those cases, #EINA_FALSE is returned, otherwise #EINA_TRUE is + * If the string is invalid #EINA_FALSE is returned, otherwise #EINA_TRUE is * returned. */ EAPI Eina_Bool eina_convert_atod(const char *src, @@ -346,14 +324,7 @@ EAPI int eina_convert_fptoa(Eina_F32p32 fp, * The mantiss and exponent are stored in the buffers pointed * respectively by @p m and @p e. * - * If the string is invalid, the error is set to: - * - * @li #EINA_ERROR_CONVERT_0X_NOT_FOUND if no 0x is found, - * @li #EINA_ERROR_CONVERT_P_NOT_FOUND if no p is found, - * @li #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH if @p length is not - * correct. - * - * In those cases, or if @p fp is @c NULL, #EINA_FALSE is returned, + * If the string is invalid, #EINA_FALSE is returned, * otherwise @p fp is computed and #EINA_TRUE is returned. * * @note The code uses eina_convert_atod() and do the correct bit diff --git a/src/lib/eina/eina_counter.c b/src/lib/eina/eina_counter.c index 63a183d..084788e 100644 --- a/src/lib/eina/eina_counter.c +++ b/src/lib/eina/eina_counter.c @@ -28,7 +28,6 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_inlist.h" -#include "eina_error.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ #include "eina_safety_checks.h" @@ -70,9 +69,6 @@ struct _Eina_Clock }; #ifdef _WIN32 -static const char EINA_ERROR_COUNTER_WINDOWS_STR[] = - "Change your OS, you moron !"; -static int EINA_ERROR_COUNTER_WINDOWS = 0; LARGE_INTEGER _eina_counter_frequency; #endif @@ -134,8 +130,7 @@ _eina_counter_asiprintf(char *base, int *position, const char *format, ...) * eina_counter_init(). It is called by eina_init(). * * This function sets up the error module of Eina and only on Windows, - * it initializes the high precision timer. It also registers, only on - * Windows, the error #EINA_ERROR_COUNTER_WINDOWS. It is also called + * it initializes the high precision timer. It is also called * by eina_init(). It returns 0 on failure, otherwise it returns the * number of times it has already been called. * @@ -145,14 +140,7 @@ Eina_Bool eina_counter_init(void) { #ifdef _WIN32 - EINA_ERROR_COUNTER_WINDOWS = eina_error_msg_static_register( - EINA_ERROR_COUNTER_WINDOWS_STR); - if (!QueryPerformanceFrequency(&_eina_counter_frequency)) - { - eina_error_set(EINA_ERROR_COUNTER_WINDOWS); - return EINA_FALSE; - } - + if (!QueryPerformanceFrequency(&_eina_counter_frequency)) return EINA_FALSE; #endif /* _WIN2 */ return EINA_TRUE; } @@ -187,14 +175,8 @@ eina_counter_new(const char *name) EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); length = strlen(name) + 1; - - eina_error_set(0); counter = calloc(1, sizeof (Eina_Counter) + length); - if (!counter) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!counter) return NULL; counter->name = (char *)(counter + 1); memcpy((char *)counter->name, name, length); @@ -225,16 +207,10 @@ eina_counter_start(Eina_Counter *counter) Eina_Nano_Time tp; EINA_SAFETY_ON_NULL_RETURN(counter); - if (_eina_time_get(&tp) != 0) - return; + if (_eina_time_get(&tp) != 0) return; - eina_error_set(0); clk = calloc(1, sizeof (Eina_Clock)); - if (!clk) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return; - } + if (!clk) return; counter->clocks = eina_inlist_prepend(counter->clocks, EINA_INLIST_GET(clk)); diff --git a/src/lib/eina/eina_counter.h b/src/lib/eina/eina_counter.h index 677d97e..5d54e90 100644 --- a/src/lib/eina/eina_counter.h +++ b/src/lib/eina/eina_counter.h @@ -129,8 +129,7 @@ typedef struct _Eina_Counter Eina_Counter; * * This function returns a new counter. It is characterized by @p * name. If @p name is @c NULL, the function returns @c NULL - * immediately. If memory allocation fails, @c NULL is returned and the - * error is set to #EINA_ERROR_OUT_OF_MEMORY. + * immediately. If memory allocation fails, @c NULL is returned. * * Whe the new counter is not needed anymore, use eina_counter_free() to * free the allocated memory. @@ -160,7 +159,7 @@ EAPI void eina_counter_free(Eina_Counter *counter) EINA_ARG_NONNULL(1); * * This function adds the clock associated to @p counter in a list. If * the memory needed by that clock can not be allocated, the function - * returns and the error is set to #EINA_ERROR_OUT_OF_MEMORY. + * returns and nothing is done. * * To stop the timing, eina_counter_stop() must be called with the * same counter. diff --git a/src/lib/eina/eina_hash.c b/src/lib/eina/eina_hash.c index eec34f9..87dd686 100644 --- a/src/lib/eina/eina_hash.c +++ b/src/lib/eina/eina_hash.c @@ -33,7 +33,6 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_rbtree.h" -#include "eina_error.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ #include "eina_safety_checks.h" @@ -219,7 +218,6 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash, { Eina_Hash_Element *new_hash_element = NULL; Eina_Hash_Head *hash_head; - Eina_Error error = 0; int original_key; int hash_num; @@ -228,8 +226,6 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash, EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE); EINA_MAGIC_CHECK_HASH(hash); - error = EINA_ERROR_OUT_OF_MEMORY; - /* Apply eina mask to hash. */ original_key = key_hash; hash_num = key_hash & hash->mask; @@ -299,7 +295,6 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash, return EINA_TRUE; on_error: - eina_error_set(error); return EINA_FALSE; } @@ -729,7 +724,6 @@ eina_hash_new(Eina_Key_Length key_length_cb, /* FIXME: Use mempool. */ Eina_Hash *new; - eina_error_set(0); EINA_SAFETY_ON_NULL_RETURN_VAL(key_cmp_cb, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(key_hash_cb, NULL); EINA_SAFETY_ON_TRUE_RETURN_VAL(buckets_power_size <= 2, NULL); @@ -754,7 +748,6 @@ eina_hash_new(Eina_Key_Length key_length_cb, return new; on_error: - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return NULL; } @@ -1234,13 +1227,8 @@ eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL); EINA_MAGIC_CHECK_HASH(hash); - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_Hash)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; it->hash = hash; it->get_content = FUNC_ITERATOR_GET_CONTENT(_eina_hash_iterator_data_get_content); @@ -1265,13 +1253,8 @@ eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL); EINA_MAGIC_CHECK_HASH(hash); - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_Hash)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; it->hash = hash; it->get_content = FUNC_ITERATOR_GET_CONTENT( @@ -1297,13 +1280,8 @@ eina_hash_iterator_tuple_new(const Eina_Hash *hash) EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL); EINA_MAGIC_CHECK_HASH(hash); - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_Hash)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; it->hash = hash; it->get_content = FUNC_ITERATOR_GET_CONTENT( diff --git a/src/lib/eina/eina_hash.h b/src/lib/eina/eina_hash.h index a127dda..4f4aac9 100644 --- a/src/lib/eina/eina_hash.h +++ b/src/lib/eina/eina_hash.h @@ -330,8 +330,8 @@ typedef Eina_Bool (*Eina_Hash_Foreach)(const Eina_Hash *hash, const void *key * @return The new hash table. * * This function creates a new hash table using user-defined callbacks - * to manage the hash table. On failure, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. If @p key_cmp_cb or @p key_hash_cb + * to manage the hash table. On failure, @c NULL is returned. + * If @p key_cmp_cb or @p key_hash_cb * are @c NULL, @c NULL is returned. If @p buckets_power_size is * smaller or equal than 2, or if it is greater or equal than 17, * @c NULL is returned. @@ -518,9 +518,7 @@ EAPI Eina_Hash *eina_hash_stringshared_new(Eina_Free_Cb data_free_cb); * values as unique. Failure to use sufficient uniqueness will * result in unexpected results when inserting data pointers accessed * with eina_hash_find(), and removed with eina_hash_del(). Key - * strings are case sensitive. If an error occurs, eina_error_get() - * should be used to determine if an allocation error occurred during - * this function. This function returns #EINA_FALSE if an error + * strings are case sensitive. This function returns #EINA_FALSE if an error * occurred, #EINA_TRUE otherwise. */ EAPI Eina_Bool eina_hash_add(Eina_Hash *hash, @@ -548,9 +546,7 @@ EAPI Eina_Bool eina_hash_add(Eina_Hash *hash, * with eina_hash_find(), and removed with eina_hash_del(). This * function does not make a copy of @p key, so it must be a string * constant or stored elsewhere ( in the object being added). Key - * strings are case sensitive. If an error occurs, eina_error_get() - * should be used to determine if an allocation error occurred during - * this function. This function returns #EINA_FALSE if an error + * strings are case sensitive. This function returns #EINA_FALSE if an error * occurred, #EINA_TRUE otherwise. */ EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash, @@ -630,8 +626,7 @@ EAPI void *eina_hash_modify(Eina_Hash *hash, * This function modifies the data of @p key with @p data in @p * hash. If no entry is found, @p data is added to @p hash with the * key @p key. On success this function returns the old entry, - * otherwise it returns @c NULL. To check for errors, use - * eina_error_get(). + * otherwise it returns @c NULL. */ EAPI void *eina_hash_set(Eina_Hash *hash, const void *key, @@ -722,9 +717,7 @@ EAPI int eina_hash_population(const Eina_Hash *hash) EINA_ARG_NONNULL(1); * not forget to count '\\0' for string when setting the value of * @p key_length. @p key_hash is expected to always match * @p key. Otherwise, one cannot be sure to find it again with @ref - * eina_hash_find_by_hash. Key strings are case sensitive. If an error - * occurs, eina_error_get() should be used to determine if an - * allocation error occurred during this function. This function + * eina_hash_find_by_hash. Key strings are case sensitive. This function * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise. * * @see eina_hash_add() @@ -758,9 +751,7 @@ EAPI Eina_Bool eina_hash_add_by_hash(Eina_Hash *hash, * not forget to count '\\0' for string when setting the value of * @p key_length. @p key_hash is expected to always match * @p key. Otherwise, one cannot be sure to find it again with @ref - * eina_hash_find_by_hash. Key strings are case sensitive. If an error - * occurs, eina_error_get() should be used to determine if an - * allocation error occurred during this function. This function + * eina_hash_find_by_hash. Key strings are case sensitive. This function * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise. * * @see eina_hash_direct_add() @@ -934,9 +925,8 @@ EAPI void *eina_hash_modify_by_hash(Eina_Hash *hash, * valid iterator that will always return false on * eina_iterator_next(), thus keeping API sane. * - * If the memory can not be allocated, NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * If the memory can not be allocated, NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning if the hash structure changes then the iterator becomes * invalid! That is, if you add or remove items this iterator @@ -955,9 +945,8 @@ EAPI Eina_Iterator *eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_MALLO * valid iterator that will always return false on * eina_iterator_next(), thus keeping API sane. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning if the hash structure changes then the iterator becomes * invalid. That is, if you add or remove items this iterator behavior @@ -976,9 +965,8 @@ EAPI Eina_Iterator *eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_MALL * valid iterator that will always return false on * eina_iterator_next(), thus keeping API sane. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid iterator is returned. * * @note iterator data will provide values as Eina_Hash_Tuple that should not * be modified! diff --git a/src/lib/eina/eina_inarray.c b/src/lib/eina/eina_inarray.c index 1e962e4..e674a20 100644 --- a/src/lib/eina/eina_inarray.c +++ b/src/lib/eina/eina_inarray.c @@ -25,7 +25,6 @@ #include "eina_config.h" #include "eina_private.h" -#include "eina_error.h" #include "eina_log.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ @@ -82,7 +81,6 @@ static int _eina_inarray_log_dom = -1; EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY); \ return __VA_ARGS__; \ } \ - eina_error_set(0); \ } \ while(0) @@ -94,7 +92,6 @@ static int _eina_inarray_log_dom = -1; EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ITERATOR); \ return __VA_ARGS__; \ } \ - eina_error_set(0); \ } \ while(0) @@ -106,7 +103,6 @@ static int _eina_inarray_log_dom = -1; EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ACCESSOR); \ return __VA_ARGS__; \ } \ - eina_error_set(0); \ } \ while(0) @@ -137,11 +133,7 @@ _eina_inarray_resize(Eina_Inarray *array, unsigned int new_size) new_max = ((new_size / array->step) + 1) * array->step; tmp = realloc(array->members, new_max * array->member_size); - if ((!tmp) && (new_max > 0)) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if ((!tmp) && (new_max > 0)) return EINA_FALSE; array->members = tmp; array->max = new_max; @@ -342,12 +334,7 @@ eina_inarray_new(unsigned int member_size, unsigned int step) EINA_SAFETY_ON_TRUE_RETURN_VAL(member_size == 0, NULL); ret = malloc(sizeof(*ret)); - if (!ret) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } - eina_error_set(0); + if (!ret) return NULL; _eina_inarray_setup(ret, member_size, step); return ret; } @@ -730,13 +717,8 @@ eina_inarray_iterator_new(const Eina_Inarray *array) EINA_MAGIC_CHECK_INARRAY(array, NULL); - eina_error_set(0); it = calloc(1, sizeof(Eina_Iterator_Inarray)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); @@ -759,13 +741,8 @@ eina_inarray_iterator_reversed_new(const Eina_Inarray *array) EINA_MAGIC_CHECK_INARRAY(array, NULL); - eina_error_set(0); it = calloc(1, sizeof(Eina_Iterator_Inarray)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); @@ -789,13 +766,8 @@ eina_inarray_accessor_new(const Eina_Inarray *array) EINA_MAGIC_CHECK_INARRAY(array, NULL); - eina_error_set(0); ac = calloc(1, sizeof(Eina_Accessor_Inarray)); - if (!ac) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!ac) return NULL; EINA_MAGIC_SET(ac, EINA_MAGIC_INARRAY_ACCESSOR); EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR); diff --git a/src/lib/eina/eina_inarray.h b/src/lib/eina/eina_inarray.h index ed1a84b..9d7f9f6 100644 --- a/src/lib/eina/eina_inarray.h +++ b/src/lib/eina/eina_inarray.h @@ -224,8 +224,8 @@ struct _Eina_Inarray * * If the @a step is 0, then a safe default is chosen. * - * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is - * set. If @a member_size is zero, then @c NULL is returned. + * On failure, @c NULL is returned. If @a member_size is zero, then @c NULL + * is returned. * * @see eina_inarray_free() * @@ -618,9 +618,8 @@ EAPI unsigned int eina_inarray_count(const Eina_Inarray *array) EINA_ARG_NONNULL * This function returns a newly allocated iterator associated to * @p array. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning if the array structure changes then the iterator becomes * invalid! That is, if you add or remove members this @@ -641,8 +640,7 @@ EAPI Eina_Iterator *eina_inarray_iterator_new(const Eina_Inarray *array) EINA_MA * Unlike eina_inarray_iterator_new(), this will walk the array backwards. * * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * Otherwise, a valid iterator is returned. * * @warning if the array structure changes then the iterator becomes * invalid! That is, if you add or remove nodes this iterator @@ -660,9 +658,8 @@ EAPI Eina_Iterator *eina_inarray_iterator_reversed_new(const Eina_Inarray *array * This function returns a newly allocated accessor associated to * @p array. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid accessor is - * returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid accessor is returned. * * @since 1.2 */ diff --git a/src/lib/eina/eina_inline_array.x b/src/lib/eina/eina_inline_array.x index 179d43c..45d7189 100644 --- a/src/lib/eina/eina_inline_array.x +++ b/src/lib/eina/eina_inline_array.x @@ -52,8 +52,7 @@ EAPI Eina_Bool eina_array_grow(Eina_Array *array); * reasons, there is no check of @p array. If it is @c NULL or * invalid, the program may crash. If @p data is @c NULL, or if an * allocation is necessary and fails, #EINA_FALSE is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, #EINA_TRUE is - * returned. + * Otherwise, #EINA_TRUE is returned. */ static inline Eina_Bool diff --git a/src/lib/eina/eina_inline_value.x b/src/lib/eina/eina_inline_value.x index 9ed7620..1021dca 100644 --- a/src/lib/eina/eina_inline_value.x +++ b/src/lib/eina/eina_inline_value.x @@ -64,8 +64,6 @@ EAPI extern const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END; { \ if (type->method) \ type->method(type, ##__VA_ARGS__); \ - else \ - eina_error_set(no_method_err); \ } \ while (0) @@ -74,7 +72,6 @@ EAPI extern const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END; { \ if (type->method) \ return type->method(type, ##__VA_ARGS__); \ - eina_error_set(no_method_err); \ return def_ret; \ } \ while (0) @@ -126,12 +123,11 @@ eina_value_setup(Eina_Value *value, const Eina_Value_Type *type) if (EINA_VALUE_TYPE_DEFAULT(type)) { - eina_error_set(0); return EINA_TRUE; } EINA_VALUE_TYPE_DISPATCH_RETURN(type, setup, - EINA_ERROR_VALUE_FAILED, EINA_FALSE, mem); + 0, EINA_FALSE, mem); } static inline void @@ -157,11 +153,10 @@ eina_value_flush(Eina_Value *value) } else if (type->value_size > 8) eina_value_inner_free(type->value_size, mem); - eina_error_set(0); return; } - EINA_VALUE_TYPE_DISPATCH(type, flush, EINA_ERROR_VALUE_FAILED, mem); + EINA_VALUE_TYPE_DISPATCH(type, flush, 0, mem); if (type->value_size > 8) eina_value_inner_free(type->value_size, mem); value->type = NULL; @@ -177,7 +172,6 @@ eina_value_compare(const Eina_Value *a, const Eina_Value *b) EINA_SAFETY_ON_NULL_RETURN_VAL(b, -1); EINA_SAFETY_ON_FALSE_RETURN_VAL(a->type == b->type, -1); - eina_error_set(0); type = a->type; pa = eina_value_memory_get(a); pb = eina_value_memory_get(b); @@ -306,7 +300,7 @@ eina_value_compare(const Eina_Value *a, const Eina_Value *b) } #endif - EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, EINA_ERROR_VALUE_FAILED, + EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, 0, EINA_FALSE, pa, pb); } @@ -342,7 +336,6 @@ eina_value_vset(Eina_Value *value, va_list args) type = value->type; mem = eina_value_memory_get(value); - eina_error_set(0); #ifndef EINA_VALUE_NO_OPTIMIZE if (type == EINA_VALUE_TYPE_UCHAR) { @@ -433,11 +426,7 @@ eina_value_vset(Eina_Value *value, va_list args) else { char *tmp = strdup(str); - if (!tmp) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (!tmp) return EINA_FALSE; free(value->value.ptr); value->value.ptr = tmp; } @@ -445,7 +434,7 @@ eina_value_vset(Eina_Value *value, va_list args) } #endif - EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, EINA_ERROR_VALUE_FAILED, + EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, 0, EINA_FALSE, mem, args); } @@ -461,14 +450,13 @@ eina_value_vget(const Eina_Value *value, va_list args) type = value->type; mem = eina_value_memory_get(value); ptr = va_arg(args, void *); - eina_error_set(0); if (EINA_VALUE_TYPE_DEFAULT(type)) { memcpy(ptr, mem, type->value_size); return EINA_TRUE; } - EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, EINA_ERROR_VALUE_FAILED, + EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, 0, EINA_FALSE, mem, ptr); } @@ -483,7 +471,6 @@ eina_value_pset(Eina_Value *value, const void *ptr) type = value->type; mem = eina_value_memory_get(value); - eina_error_set(0); if (EINA_VALUE_TYPE_DEFAULT(type)) { @@ -506,11 +493,7 @@ eina_value_pset(Eina_Value *value, const void *ptr) else { char *tmp = strdup(str); - if (!tmp) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (!tmp) return EINA_FALSE; free(value->value.ptr); value->value.ptr = tmp; } @@ -521,7 +504,7 @@ eina_value_pset(Eina_Value *value, const void *ptr) return EINA_TRUE; } - EINA_VALUE_TYPE_DISPATCH_RETURN(value, pset, EINA_ERROR_VALUE_FAILED, + EINA_VALUE_TYPE_DISPATCH_RETURN(value, pset, 0, EINA_FALSE, mem, ptr); } @@ -536,14 +519,13 @@ eina_value_pget(const Eina_Value *value, void *ptr) type = value->type; mem = eina_value_memory_get(value); - eina_error_set(0); if (EINA_VALUE_TYPE_DEFAULT(type)) { memcpy(ptr, mem, type->value_size); return EINA_TRUE; } - EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, EINA_ERROR_VALUE_FAILED, + EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, 0, EINA_FALSE, mem, ptr); } @@ -1281,11 +1263,7 @@ eina_value_hash_vset(Eina_Value *value, const char *key, va_list args) if (!mem) { mem = malloc(desc->subtype->value_size); - if (!mem) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (!mem) return EINA_FALSE; if (!eina_hash_add(desc->hash, key, mem)) { free(mem); @@ -1364,11 +1342,7 @@ eina_value_hash_pset(Eina_Value *value, const char *key, const void *ptr) if (!mem) { mem = malloc(desc->subtype->value_size); - if (!mem) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (!mem) return EINA_FALSE; if (!eina_hash_add(desc->hash, key, mem)) { free(mem); @@ -1678,11 +1652,7 @@ static inline Eina_Bool eina_value_type_setup(const Eina_Value_Type *type, void *mem) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->setup) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->setup) return EINA_FALSE; return type->setup(type, mem); } @@ -1690,11 +1660,7 @@ static inline Eina_Bool eina_value_type_flush(const Eina_Value_Type *type, void *mem) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->flush) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->flush) return EINA_FALSE; return type->flush(type, mem); } @@ -1702,11 +1668,7 @@ static inline Eina_Bool eina_value_type_copy(const Eina_Value_Type *type, const void *src, void *dst) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->copy) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->copy) return EINA_FALSE; return type->copy(type, src, dst); } @@ -1714,11 +1676,7 @@ static inline int eina_value_type_compare(const Eina_Value_Type *type, const void *a, const void *b) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->compare) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->compare) return EINA_FALSE; return type->compare(type, a, b); } @@ -1726,11 +1684,7 @@ static inline Eina_Bool eina_value_type_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, const void *type_mem, void *convert_mem) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->convert_to) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->convert_to) return EINA_FALSE; return type->convert_to(type, convert, type_mem, convert_mem); } @@ -1738,11 +1692,7 @@ static inline Eina_Bool eina_value_type_convert_from(const Eina_Value_Type *type, const Eina_Value_Type *convert, void *type_mem, const void *convert_mem) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->convert_from) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->convert_from) return EINA_FALSE; return type->convert_from(type, convert, type_mem, convert_mem); } @@ -1750,11 +1700,7 @@ static inline Eina_Bool eina_value_type_vset(const Eina_Value_Type *type, void *mem, va_list args) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->vset) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->vset) return EINA_FALSE; return type->vset(type, mem, args); } @@ -1762,11 +1708,7 @@ static inline Eina_Bool eina_value_type_pset(const Eina_Value_Type *type, void *mem, const void *ptr) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->pset) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->pset) return EINA_FALSE; return type->pset(type, mem, ptr); } @@ -1774,11 +1716,7 @@ static inline Eina_Bool eina_value_type_pget(const Eina_Value_Type *type, const void *mem, void *ptr) { EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); - if (!type->pget) - { - eina_error_set(EINA_ERROR_VALUE_FAILED); - return EINA_FALSE; - } + if (!type->pget) return EINA_FALSE; return type->pget(type, mem, ptr); } diff --git a/src/lib/eina/eina_inlist.c b/src/lib/eina/eina_inlist.c index 24e7826..f2eb42b 100644 --- a/src/lib/eina/eina_inlist.c +++ b/src/lib/eina/eina_inlist.c @@ -27,7 +27,6 @@ #include "eina_config.h" #include "eina_private.h" -#include "eina_error.h" #include "eina_log.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ @@ -342,7 +341,6 @@ eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item) EINA_SAFETY_ON_NULL_RETURN_VAL(item, list); if (EINA_UNLIKELY((item != list) && (!item->prev) && (!item->next))) { - eina_error_set(EINA_ERROR_SAFETY_FAILED); EINA_LOG_ERR("safety check failed: item %p does not appear to be part of an inlist!", item); return list; } @@ -870,13 +868,8 @@ eina_inlist_iterator_new(const Eina_Inlist *list) { Eina_Iterator_Inlist *it; - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_Inlist)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; it->head = list; it->current = list; @@ -897,13 +890,8 @@ eina_inlist_accessor_new(const Eina_Inlist *list) { Eina_Accessor_Inlist *ac; - eina_error_set(0); ac = calloc(1, sizeof (Eina_Accessor_Inlist)); - if (!ac) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!ac) return NULL; ac->head = list; ac->current = list; diff --git a/src/lib/eina/eina_inlist.h b/src/lib/eina/eina_inlist.h index ba7ffec..ccca63e 100644 --- a/src/lib/eina/eina_inlist.h +++ b/src/lib/eina/eina_inlist.h @@ -639,9 +639,8 @@ EAPI unsigned int eina_inlist_count(const Eina_Inlist *list) EINA_WARN_UNUSED_ * will always return false on eina_iterator_next(), thus keeping API * sane. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator - * is returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning if the list structure changes then the iterator becomes * invalid, and if you add or remove nodes iterator @@ -658,8 +657,8 @@ EAPI Eina_Iterator *eina_inlist_iterator_new(const Eina_Inlist *in_list) EINA_MA * This function returns a newly allocated accessor associated to * @p in_list. If @p in_list is @c NULL or the count member of @p in_list is * less or equal than @c 0, this function returns @c NULL. If the memory can - * not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is - * set. Otherwise, a valid accessor is returned. + * not be allocated, @c NULL is returned and Otherwise, a valid accessor is + * returned. */ EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MALLOC EINA_WARN_UNUSED_RESULT; @@ -676,7 +675,7 @@ EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MA * sorted and the result will be sorted. If @p list is @c NULLL, item * is returned. On success, a new list pointer that should be * used in place of the one given to this function is - * returned. Otherwise, the old pointer is returned. See eina_error_get(). + * returned. Otherwise, the old pointer is returned. * * @note O(log2(n)) comparisons (calls to @p func) average/worst case * performance. As said in eina_list_search_sorted_near_list(), @@ -738,7 +737,7 @@ EAPI void eina_inlist_sorted_state_free(Eina_Inlist_Sorted_State *state); * list with an updated state.. If @p list is @c NULLL, item * is returned. On success, a new list pointer that should be * used in place of the one given to this function is - * returned. Otherwise, the old pointer is returned. See eina_error_get(). + * returned. Otherwise, the old pointer is returned. * * @note O(log2(n)) comparisons (calls to @p func) average/worst case * performance. As said in eina_list_search_sorted_near_list(), diff --git a/src/lib/eina/eina_list.c b/src/lib/eina/eina_list.c index b4707c7..9162088 100644 --- a/src/lib/eina/eina_list.c +++ b/src/lib/eina/eina_list.c @@ -68,7 +68,6 @@ #include "eina_config.h" #include "eina_private.h" -#include "eina_error.h" #include "eina_log.h" #include "eina_mempool.h" @@ -532,10 +531,8 @@ eina_list_append(Eina_List *list, const void *data) { Eina_List *l, *new_l; - eina_error_set(0); new_l = _eina_list_mempool_list_new(list); - if (!new_l) - return list; + if (!new_l) return list; new_l->next = NULL; new_l->data = (void *)data; @@ -562,10 +559,8 @@ eina_list_prepend(Eina_List *list, const void *data) { Eina_List *new_l; - eina_error_set(0); new_l = _eina_list_mempool_list_new(list); - if (!new_l) - return list; + if (!new_l) return list; new_l->prev = NULL; new_l->next = list; @@ -613,10 +608,8 @@ eina_list_append_relative_list(Eina_List *list, if ((!list) || (!relative)) return eina_list_append(list, data); - eina_error_set(0); new_l = _eina_list_mempool_list_new(list); - if (!new_l) - return list; + if (!new_l) return list; EINA_MAGIC_CHECK_LIST(relative, NULL); new_l->next = relative->next; @@ -665,10 +658,8 @@ eina_list_prepend_relative_list(Eina_List *list, if ((!list) || (!relative)) return eina_list_prepend(list, data); - eina_error_set(0); new_l = _eina_list_mempool_list_new(list); - if (!new_l) - return list; + if (!new_l) return list; EINA_MAGIC_CHECK_LIST(relative, NULL); @@ -1493,13 +1484,8 @@ eina_list_iterator_new(const Eina_List *list) { Eina_Iterator_List *it; - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_List)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); @@ -1521,13 +1507,8 @@ eina_list_iterator_reversed_new(const Eina_List *list) { Eina_Iterator_List *it; - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_List)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); @@ -1551,13 +1532,8 @@ eina_list_accessor_new(const Eina_List *list) EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL); - eina_error_set(0); ac = calloc(1, sizeof (Eina_Accessor_List)); - if (!ac) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!ac) return NULL; EINA_MAGIC_SET(ac, EINA_MAGIC_LIST_ACCESSOR); EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR); diff --git a/src/lib/eina/eina_list.h b/src/lib/eina/eina_list.h index a3c17d3..2f9c17e 100644 --- a/src/lib/eina/eina_list.h +++ b/src/lib/eina/eina_list.h @@ -361,11 +361,6 @@ struct _Eina_List_Accounting * extern void *my_data; * * list = eina_list_append(list, my_data); - * if (eina_error_get()) - * { - * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n"); - * exit(-1); - * } * @endcode * * @warning @p list must be a pointer to the first element of the list(or NULL). @@ -394,11 +389,6 @@ EAPI Eina_List *eina_list_append(Eina_List *list, const void *data) E * extern void *my_data; * * list = eina_list_prepend(list, my_data); - * if (eina_error_get()) - * { - * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n"); - * exit(-1); - * } * @endcode * * @warning @p list must be a pointer to the first element of the list. @@ -431,17 +421,7 @@ EAPI Eina_List *eina_list_prepend(Eina_List *list, const void *data) * extern void *relative_member; * * list = eina_list_append(list, relative_member); - * if (eina_error_get()) - * { - * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n"); - * exit(-1); - * } * list = eina_list_append_relative(list, my_data, relative_member); - * if (eina_error_get()) - * { - * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n"); - * exit(-1); - * } * @endcode * * @warning @p list must be a pointer to the first element of the list. @@ -496,17 +476,7 @@ EAPI Eina_List *eina_list_append_relative_list(Eina_List *list, const * extern void *relative_member; * * list = eina_list_append(list, relative_member); - * if (eina_error_get_error()) - * { - * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n"); - * exit(-1); - * } * list = eina_list_prepend_relative(list, my_data, relative_member); - * if (eina_error_get()) - * { - * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n"); - * exit(-1); - * } * @endcode * * @warning @p list must be a pointer to the first element of the list. @@ -548,7 +518,7 @@ EAPI Eina_List *eina_list_prepend_relative_list(Eina_List *list, cons * sorted and the result will be sorted. If @p list is @c NULLL, a new * list is returned. On success, a new list pointer that should be * used in place of the one given to this function is - * returned. Otherwise, the old pointer is returned. See eina_error_get(). + * returned. Otherwise, the old pointer is returned. * * @note O(log2(n)) comparisons (calls to @p func) average/worst case * performance as it uses eina_list_search_sorted_near_list() and thus @@ -1310,9 +1280,8 @@ static inline unsigned int eina_list_count(const Eina_List *list) EINA_PURE; * will always return false on eina_iterator_next(), thus keeping API * sane. * - * If the memory can not be allocated, NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator - * is returned. + * If the memory can not be allocated, NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning @p list must be a pointer to the first element of the list. * @@ -1337,9 +1306,8 @@ EAPI Eina_Iterator *eina_list_iterator_new(const Eina_List *list) EINA_MA * * Unlike eina_list_iterator_new(), this will walk the list backwards. * - * If the memory can not be allocated, NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator - * is returned. + * If the memory can not be allocated, NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning @p list must be a pointer to the first element of the list. * @@ -1359,8 +1327,8 @@ EAPI Eina_Iterator *eina_list_iterator_reversed_new(const Eina_List *list * This function returns a newly allocated accessor associated to * @p list. If @p list is @c NULL or the count member of @p list is * less or equal than 0, this function returns @c NULL. If the memory can - * not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is - * set. Otherwise, a valid accessor is returned. + * not be allocated, @c NULL is returned Otherwise, a valid accessor is + * returned. * * @warning @p list must be a pointer to the first element of the list. */ diff --git a/src/lib/eina/eina_lock.h b/src/lib/eina/eina_lock.h index 3e4a510..b0afa41 100644 --- a/src/lib/eina/eina_lock.h +++ b/src/lib/eina/eina_lock.h @@ -129,7 +129,6 @@ static inline void eina_spinlock_free(Eina_Spinlock *spinlock); do { \ if (EINA_UNLIKELY(!eina_main_loop_is())) \ { \ - eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \ EINA_LOG_ERR("You are calling %s from outside" \ "of the main loop threads in %s at line %i", \ __FUNCTION__, \ @@ -142,7 +141,6 @@ static inline void eina_spinlock_free(Eina_Spinlock *spinlock); do { \ if (EINA_UNLIKELY(!eina_main_loop_is())) \ { \ - eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \ EINA_LOG_ERR("You are calling %s from outside" \ "of the main loop threads in %s at line %i", \ __FUNCTION__, \ diff --git a/src/lib/eina/eina_magic.c b/src/lib/eina/eina_magic.c index ee9c9e2..f228dbd 100644 --- a/src/lib/eina/eina_magic.c +++ b/src/lib/eina/eina_magic.c @@ -29,7 +29,6 @@ #include "eina_config.h" #include "eina_private.h" -#include "eina_error.h" #include "eina_log.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ @@ -126,8 +125,6 @@ _eina_magic_strings_alloc(void) EAPI Eina_Error EINA_ERROR_MAGIC_FAILED = 0; -static const char EINA_ERROR_MAGIC_FAILED_STR[] = "Magic check failed."; - /** * @internal * @brief Initialize the magic string module. @@ -149,9 +146,6 @@ eina_magic_string_init(void) EINA_LOG_ERR("Could not register log domain: eina_magic_string"); return EINA_FALSE; } - EINA_ERROR_MAGIC_FAILED = eina_error_msg_static_register( - EINA_ERROR_MAGIC_FAILED_STR); - return EINA_TRUE; } @@ -272,7 +266,6 @@ eina_magic_fail(void *d, const char *fnc, int line) { - eina_error_set(EINA_ERROR_MAGIC_FAILED); if (!d) eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR, file, fnc, line, diff --git a/src/lib/eina/eina_magic.h b/src/lib/eina/eina_magic.h index 5e8d376..847f7e0 100644 --- a/src/lib/eina/eina_magic.h +++ b/src/lib/eina/eina_magic.h @@ -201,13 +201,8 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic, */ #define EINA_MAGIC_NONE 0x1234fedc -/** - * @var EINA_ERROR_MAGIC_FAILED - * Error identifier corresponding to magic check failure. - */ EAPI extern Eina_Error EINA_ERROR_MAGIC_FAILED; - #ifdef EINA_MAGIC_DEBUG /** diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c index 3219460..808e02e 100644 --- a/src/lib/eina/eina_main.c +++ b/src/lib/eina/eina_main.c @@ -102,8 +102,6 @@ EAPI Eina_Bool _eina_threads_activated = EINA_FALSE; EAPI Eina_Error EINA_ERROR_NOT_MAIN_LOOP = 0; EAPI unsigned int eina_seed = 0; -static const char EINA_ERROR_NOT_MAIN_LOOP_STR[] = "Main loop thread check failed."; - #ifdef EFL_HAVE_THREADS # ifdef _WIN32 EAPI DWORD _eina_main_loop; @@ -279,9 +277,6 @@ eina_init(void) return 0; } - EINA_ERROR_NOT_MAIN_LOOP = eina_error_msg_static_register( - EINA_ERROR_NOT_MAIN_LOOP_STR); - #ifdef EFL_HAVE_THREADS # ifdef _WIN32 _eina_main_loop = GetCurrentThreadId(); diff --git a/src/lib/eina/eina_matrixsparse.c b/src/lib/eina/eina_matrixsparse.c index d287545..e82212b 100644 --- a/src/lib/eina/eina_matrixsparse.c +++ b/src/lib/eina/eina_matrixsparse.c @@ -39,7 +39,6 @@ #include "eina_config.h" #include "eina_private.h" -#include "eina_error.h" #include "eina_log.h" #include "eina_magic.h" #include "eina_mempool.h" @@ -943,11 +942,7 @@ eina_matrixsparse_new(unsigned long rows, unsigned long cols, void (*free_func)( EINA_SAFETY_ON_FALSE_RETURN_VAL(cols > 0, NULL); m = malloc(sizeof(Eina_Matrixsparse)); - if (!m) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!m) return NULL; EINA_MAGIC_SET(m, EINA_MAGIC_MATRIXSPARSE); @@ -960,7 +955,6 @@ eina_matrixsparse_new(unsigned long rows, unsigned long cols, void (*free_func)( m->free.func = free_func; m->free.user_data = (void *)user_data; - eina_error_set(0); return m; } @@ -1364,11 +1358,7 @@ eina_matrixsparse_iterator_new(const Eina_Matrixsparse *m) Eina_Matrixsparse_Iterator *it; it = calloc(1, sizeof(*it)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); @@ -1391,11 +1381,7 @@ eina_matrixsparse_iterator_complete_new(const Eina_Matrixsparse *m) Eina_Matrixsparse_Iterator_Complete *it; it = calloc(1, sizeof(*it)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); diff --git a/src/lib/eina/eina_matrixsparse.h b/src/lib/eina/eina_matrixsparse.h index e7db606..5523c0f 100644 --- a/src/lib/eina/eina_matrixsparse.h +++ b/src/lib/eina/eina_matrixsparse.h @@ -87,8 +87,7 @@ typedef struct _Eina_Matrixsparse_Cell Eina_Matrixsparse_Cell; * eina_matrixsparse_cell_idx_clear() and possible others. * @param user_data given to @a free_func as first parameter. * - * @return Newly allocated matrix or @c NULL if allocation failed and eina_error - * is set. + * @return Newly allocated matrix or @c NULL if allocation failed. */ EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows, unsigned long cols, diff --git a/src/lib/eina/eina_mempool.c b/src/lib/eina/eina_mempool.c index 55723a4..1757975 100644 --- a/src/lib/eina/eina_mempool.c +++ b/src/lib/eina/eina_mempool.c @@ -68,9 +68,6 @@ _new_va(const char *name, Eina_Mempool_Backend *be = NULL; Eina_Mempool *mp; - Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE; - - eina_error_set(0); if (getenv("EINA_MEMPOOL_PASS")) { be = eina_hash_find(_backends, "pass_through"); @@ -79,10 +76,8 @@ _new_va(const char *name, else be = eina_hash_find(_backends, name); if ((!be) || (!be->init)) goto on_error; - err = EINA_ERROR_OUT_OF_MEMORY; mp = calloc(1, sizeof(Eina_Mempool)); - if (!mp) - goto on_error; + if (!mp) goto on_error; /* Work around ABI incompability introduced in Eina 1.1 */ #define SBP(Property) mp->backend.Property = be->Property; @@ -104,11 +99,9 @@ _new_va(const char *name, } mp->backend_data = mp->backend.init(context, options, args); - return mp; on_error: - eina_error_set(err); return NULL; } @@ -143,9 +136,6 @@ void pass_through_shutdown(void); EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0; -static const char EINA_ERROR_NOT_MEMPOOL_MODULE_STR[] = - "Not a memory pool module."; - /** * @endcond */ @@ -179,8 +169,6 @@ eina_mempool_init(void) return 0; } - EINA_ERROR_NOT_MEMPOOL_MODULE = eina_error_msg_static_register( - EINA_ERROR_NOT_MEMPOOL_MODULE_STR); _backends = eina_hash_string_superfast_new(NULL); /* dynamic backends */ diff --git a/src/lib/eina/eina_model.c b/src/lib/eina/eina_model.c index 4d7f341..e1931fd 100644 --- a/src/lib/eina/eina_model.c +++ b/src/lib/eina/eina_model.c @@ -27,7 +27,6 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_alloca.h" -#include "eina_error.h" #include "eina_log.h" #include "eina_mempool.h" #include "eina_lock.h" @@ -1204,10 +1203,6 @@ _eina_model_event_callback_call(Eina_Model *model, const char *name, const void return EINA_FALSE; } -static const char EINA_ERROR_MODEL_FAILED_STR[] = "Model check failed."; -static const char EINA_ERROR_MODEL_METHOD_MISSING_STR[] = "Model method is missing."; -static const char EINA_MAGIC_MODEL_STR[] = "Eina Model"; - static void _eina_model_unref(Eina_Model *model); /** @@ -1422,7 +1417,7 @@ _eina_model_type_base_properties_compare(const Eina_Model *a, const Eina_Model * } *cmp = eina_value_compare(&atmp, &btmp); - if (eina_error_get() != 0) + if (*cmp == -2) { char *astr = eina_value_to_string(&atmp); char *bstr = eina_value_to_string(&btmp); @@ -1509,7 +1504,7 @@ _eina_model_type_base_children_compare(const Eina_Model *a, const Eina_Model *b, } *cmp = eina_model_compare(achild, bchild); - if (eina_error_get()) + if (*cmp == -2) { ERR("Could not compare children #%d %p (%s) and %p (%s) " "from models %p (%s) and %p (%s)", i, @@ -3035,11 +3030,6 @@ eina_model_init(void) goto on_init_fail_lock_debug; } - EINA_ERROR_MODEL_FAILED = eina_error_msg_static_register( - EINA_ERROR_MODEL_FAILED_STR); - EINA_ERROR_MODEL_METHOD_MISSING = eina_error_msg_static_register( - EINA_ERROR_MODEL_METHOD_MISSING_STR); - EINA_MODEL_TYPE_BASE = &_EINA_MODEL_TYPE_BASE; EINA_MODEL_TYPE_MIXIN = &_EINA_MODEL_TYPE_MIXIN; EINA_MODEL_TYPE_GENERIC = &_EINA_MODEL_TYPE_GENERIC; @@ -3430,7 +3420,6 @@ _eina_model_unref(Eina_Model *model) #define EINA_MODEL_TYPE_CALL_OPTIONAL_RETURN(model, method, def_retval, ...) \ do \ { \ - eina_error_set(0); \ if (model->desc->ops.type.method) \ return model->desc->ops.type.method(model, ## __VA_ARGS__); \ DBG("Optional method" # method "() not implemented for model %p (%s)", \ @@ -3442,7 +3431,6 @@ _eina_model_unref(Eina_Model *model) #define EINA_MODEL_TYPE_CALL_OPTIONAL(model, method, ...) \ do \ { \ - eina_error_set(0); \ if (model->desc->ops.type.method) \ model->desc->ops.type.method(model, ## __VA_ARGS__); \ else \ @@ -3454,10 +3442,8 @@ _eina_model_unref(Eina_Model *model) #define EINA_MODEL_TYPE_CALL_MANDATORY_RETURN(model, method, def_retval, ...) \ do \ { \ - eina_error_set(0); \ if (model->desc->ops.type.method) \ return model->desc->ops.type.method(model, ## __VA_ARGS__); \ - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \ CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \ model, model->desc->cache.types[0]->name); \ return def_retval; \ @@ -3467,12 +3453,10 @@ _eina_model_unref(Eina_Model *model) #define EINA_MODEL_TYPE_CALL_MANDATORY(model, method, ...) \ do \ { \ - eina_error_set(0); \ if (model->desc->ops.type.method) \ model->desc->ops.type.method(model, ## __VA_ARGS__); \ else \ { \ - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \ CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \ model, model->desc->cache.types[0]->name); \ } \ @@ -3483,10 +3467,8 @@ _eina_model_unref(Eina_Model *model) #define EINA_MODEL_TYPE_CALL_RETURN(model, method, def_retval, ...) \ do \ { \ - eina_error_set(0); \ if (model->desc->ops.type.method) \ return model->desc->ops.type.method(model, ## __VA_ARGS__); \ - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \ ERR("Method" # method "() not implemented for model %p (%s)", \ model, model->desc->cache.types[0]->name); \ return def_retval; \ @@ -3496,12 +3478,10 @@ _eina_model_unref(Eina_Model *model) #define EINA_MODEL_TYPE_CALL(model, method, ...) \ do \ { \ - eina_error_set(0); \ if (model->desc->ops.type.method) \ model->desc->ops.type.method(model, ## __VA_ARGS__); \ else \ { \ - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \ ERR("Method" # method "() not implemented for model %p (%s)", \ model, model->desc->cache.types[0]->name); \ } \ @@ -3985,8 +3965,7 @@ eina_model_compare(const Eina_Model *a, const Eina_Model *b) ERR("Models %p (%s) and %p (%s) can't compare", a, desc_a->cache.types[0]->name, b, desc_b->cache.types[0]->name); - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); - return -1; + return -2; } else if ((desc_a->ops.type.compare) && (desc_b->ops.type.compare)) { @@ -4012,8 +3991,7 @@ eina_model_compare(const Eina_Model *a, const Eina_Model *b) ERR("Could not compare models %p (%s) and %p (%s)", a, desc_a->cache.types[0]->name, b, desc_b->cache.types[0]->name); - eina_error_set(EINA_ERROR_MODEL_FAILED); - return -1; + return -2; } return cmp; @@ -4026,7 +4004,6 @@ eina_model_load(Eina_Model *model) EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE); - eina_error_set(0); if (model->desc->ops.type.load) { ret = model->desc->ops.type.load(model); @@ -4035,7 +4012,6 @@ eina_model_load(Eina_Model *model) } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method load() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); @@ -4051,7 +4027,6 @@ eina_model_unload(Eina_Model *model) EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE); - eina_error_set(0); if (model->desc->ops.type.unload) { ret = model->desc->ops.type.unload(model); @@ -4061,7 +4036,6 @@ eina_model_unload(Eina_Model *model) } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method unload() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); @@ -4090,7 +4064,6 @@ eina_model_property_set(Eina_Model *model, const const char *name, const Eina_Va EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type), EINA_FALSE); - eina_error_set(0); if (model->desc->ops.type.property_set) { ret = model->desc->ops.type.property_set(model, name, value); @@ -4100,7 +4073,6 @@ eina_model_property_set(Eina_Model *model, const const char *name, const Eina_Va } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method property_set() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); @@ -4117,7 +4089,6 @@ eina_model_property_del(Eina_Model *model, const char *name) EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE); - eina_error_set(0); if (model->desc->ops.type.property_del) { ret = model->desc->ops.type.property_del(model, name); @@ -4127,7 +4098,6 @@ eina_model_property_del(Eina_Model *model, const char *name) } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method property_del() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); @@ -4173,7 +4143,6 @@ eina_model_child_set(Eina_Model *model, unsigned int position, Eina_Model *child EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE); EINA_MODEL_INSTANCE_CHECK_VAL(child, EINA_FALSE); - eina_error_set(0); if (model->desc->ops.type.child_set) { ret = model->desc->ops.type.child_set(model, position, child); @@ -4183,7 +4152,6 @@ eina_model_child_set(Eina_Model *model, unsigned int position, Eina_Model *child } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method child_set() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); @@ -4199,7 +4167,6 @@ eina_model_child_del(Eina_Model *model, unsigned int position) EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE); - eina_error_set(0); if (model->desc->ops.type.child_del) { ret = model->desc->ops.type.child_del(model, position); @@ -4213,7 +4180,6 @@ eina_model_child_del(Eina_Model *model, unsigned int position) } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method child_del() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); @@ -4230,7 +4196,6 @@ eina_model_child_insert_at(Eina_Model *model, unsigned int position, Eina_Model EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE); - eina_error_set(0); if (model->desc->ops.type.child_insert_at) { ret = model->desc->ops.type.child_insert_at(model, position, child); @@ -4244,7 +4209,6 @@ eina_model_child_insert_at(Eina_Model *model, unsigned int position, Eina_Model } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method child_insert_at() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); @@ -4266,7 +4230,6 @@ eina_model_child_append(Eina_Model *model, Eina_Model *child) if (position < 0) return -1; - eina_error_set(0); if (model->desc->ops.type.child_insert_at) { ret = model->desc->ops.type.child_insert_at(model, position, child); @@ -4280,7 +4243,6 @@ eina_model_child_append(Eina_Model *model, Eina_Model *child) } else { - eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); ret = EINA_FALSE; ERR("Method child_insert_at() not implemented for model %p (%s)", model, model->desc->cache.types[0]->name); diff --git a/src/lib/eina/eina_model.h b/src/lib/eina/eina_model.h index 892a1d5..b6229c1 100644 --- a/src/lib/eina/eina_model.h +++ b/src/lib/eina/eina_model.h @@ -302,16 +302,7 @@ * @{ */ -/** - * @var EINA_ERROR_MODEL_FAILED - * Defined when model-specific errors happens. - */ EAPI extern Eina_Error EINA_ERROR_MODEL_FAILED; - -/** - * @var EINA_ERROR_MODEL_METHOD_MISSING - * Defined when model-specific errors happens. - */ EAPI extern Eina_Error EINA_ERROR_MODEL_METHOD_MISSING; /** diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index 9289f71..5a30e26 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -45,7 +45,6 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_alloca.h" -#include "eina_error.h" #include "eina_file.h" #include "eina_log.h" @@ -188,11 +187,6 @@ static void _dir_arch_list_cb(const char *name, const char *path, void *data) * @cond LOCAL */ -static const char EINA_ERROR_WRONG_MODULE_STR[] = - "Wrong file format or no file module found"; -static const char EINA_ERROR_MODULE_INIT_FAILED_STR[] = - "Module initialisation function failed"; - EAPI Eina_Error EINA_ERROR_WRONG_MODULE = 0; EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED = 0; @@ -209,8 +203,7 @@ EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED = 0; * This function sets up the module loader module of Eina. It is * called by eina_init(). * - * This function sets up the module module of Eina. It also registers - * the errors #EINA_ERROR_WRONG_MODULE and #EINA_ERROR_MODULE_INIT_FAILED. + * This function sets up the module module of Eina. * * @see eina_init() */ @@ -224,12 +217,6 @@ eina_module_init(void) EINA_LOG_ERR("Could not register log domain: eina_module"); return EINA_FALSE; } - -#define EEMR(n) n = eina_error_msg_static_register(n ## _STR) - EEMR(EINA_ERROR_WRONG_MODULE); - EEMR(EINA_ERROR_MODULE_INIT_FAILED); -#undef EEMR - return EINA_TRUE; } @@ -321,7 +308,6 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m) { WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(), (flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY"); - eina_error_set(EINA_ERROR_WRONG_MODULE); return EINA_FALSE; } @@ -334,7 +320,6 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m) WRN("could not find eina's entry symbol %s inside module %s, or the init function failed", EINA_MODULE_SYMBOL_INIT, m->file); - eina_error_set(EINA_ERROR_MODULE_INIT_FAILED); dlclose(dl_handle); return EINA_FALSE; ok: @@ -343,8 +328,6 @@ ok: loaded: m->ref++; DBG("ref %d", m->ref); - - eina_error_set(0); return EINA_TRUE; #else (void) m; diff --git a/src/lib/eina/eina_module.h b/src/lib/eina/eina_module.h index 24a491d..6f9b08e 100644 --- a/src/lib/eina/eina_module.h +++ b/src/lib/eina/eina_module.h @@ -105,16 +105,7 @@ typedef void (*Eina_Module_Shutdown)(void); */ #define EINA_MODULE_SHUTDOWN(f) EAPI Eina_Module_Shutdown __eina_module_shutdown = &f -/** - * @var EINA_ERROR_WRONG_MODULE - * Error identifier corresponding to a wrong module. - */ extern EAPI Eina_Error EINA_ERROR_WRONG_MODULE; - -/** - * @var EINA_ERROR_MODULE_INIT_FAILED - * Error identifier corresponding to a failure during the initialisation of a module. - */ extern EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED; /** @@ -156,13 +147,12 @@ EAPI Eina_Bool * * This function load the shared file object passed in * eina_module_new(). If it is a internal Eina module (like the - * mempools), it also initialize it. It the shared file object can not - * be loaded, the error #EINA_ERROR_WRONG_MODULE is set and - * and #EINA_FALSE is returned. If it is a internal Eina module and the - * module can not be initialized, the error #EINA_ERROR_MODULE_INIT_FAILED - * is set and #EINA_FALSE is returned. If the module has already been loaded, - * it's reference counter is increased by one and #EINA_TRUE is returned. - * If @p module is @c NULL, the function returns immediately #EINA_FALSE. + * mempools), it also initialize it. If the shared file object can not + * be loaded, #EINA_FALSE is returned. If it is an internal Eina module and the + * module can not be initialized, #EINA_FALSE is returned. If the module has + * already been loaded, it's reference counter is increased by one and + * #EINA_TRUE is returned. If @p module is @c NULL, the function returns + * immediately #EINA_FALSE. * * When the symbols of the shared file objects are not needed * anymore, call eina_module_unload() to unload the module. diff --git a/src/lib/eina/eina_rbtree.c b/src/lib/eina/eina_rbtree.c index 394007f..abf4ad0 100644 --- a/src/lib/eina/eina_rbtree.c +++ b/src/lib/eina/eina_rbtree.c @@ -69,16 +69,11 @@ _eina_rbtree_iterator_list_new(Eina_Iterator_Rbtree *it, const Eina_Rbtree *tree { Eina_Iterator_Rbtree_List *new; - eina_error_set(0); new = eina_trash_pop(&it->trash); if (!new) { new = malloc(sizeof (Eina_Iterator_Rbtree_List)); - if (!new) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!new) return NULL; } new->tree = (Eina_Rbtree *)tree; @@ -195,13 +190,8 @@ _eina_rbtree_iterator_build(const Eina_Rbtree *root, unsigned char mask) Eina_Iterator_Rbtree_List *first; Eina_Iterator_Rbtree *it; - eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_Rbtree)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; eina_trash_init(&it->trash); diff --git a/src/lib/eina/eina_rbtree.h b/src/lib/eina/eina_rbtree.h index e61a920..e8bcc65 100644 --- a/src/lib/eina/eina_rbtree.h +++ b/src/lib/eina/eina_rbtree.h @@ -202,9 +202,8 @@ static inline Eina_Rbtree *eina_rbtree_inline_lookup(const Eina_Rbtree *root, co * NULL, this function still returns a valid iterator that will always * return false on eina_iterator_next(), thus keeping API sane. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning if the rbtree structure changes then the iterator becomes * invalid! That is, if you add or remove nodes this iterator @@ -223,9 +222,8 @@ EAPI Eina_Iterator *eina_rbtree_iterator_prefix(const Eina_Rbtree *root) * NULL, this function still returns a valid iterator that will always * return false on eina_iterator_next(), thus keeping API sane. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning if the rbtree structure changes then the iterator becomes * invalid! That is, if you add or remove nodes this iterator @@ -244,9 +242,8 @@ EAPI Eina_Iterator *eina_rbtree_iterator_infix(const Eina_Rbtree *root) E * NULL, this function still returns a valid iterator that will always * return false on eina_iterator_next(), thus keeping API sane. * - * If the memory can not be allocated, @c NULL is returned - * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is - * returned. + * If the memory can not be allocated, @c NULL is returned. + * Otherwise, a valid iterator is returned. * * @warning if the rbtree structure changes then the iterator becomes * invalid! That is, if you add or remove nodes this iterator diff --git a/src/lib/eina/eina_safety_checks.c b/src/lib/eina/eina_safety_checks.c index eed7c59..5ae59ac 100644 --- a/src/lib/eina/eina_safety_checks.c +++ b/src/lib/eina/eina_safety_checks.c @@ -80,8 +80,6 @@ static const char EINA_ERROR_SAFETY_FAILED_STR[] = "Safety check failed."; Eina_Bool eina_safety_checks_init(void) { - EINA_ERROR_SAFETY_FAILED = eina_error_msg_static_register( - EINA_ERROR_SAFETY_FAILED_STR); return EINA_TRUE; } diff --git a/src/lib/eina/eina_safety_checks.h b/src/lib/eina/eina_safety_checks.h index 73ae1b2..d9c22d9 100644 --- a/src/lib/eina/eina_safety_checks.h +++ b/src/lib/eina/eina_safety_checks.h @@ -50,7 +50,6 @@ * // all these files will emit warning from EINA_ARG_NONNULL() * #include // third party headers * #include - * #include // eina own header * * #include * // all these files below will NOT emit warning from EINA_ARG_NONNULL(), @@ -77,9 +76,8 @@ * options to @c configure script. * * Whenever these macros capture an error, EINA_LOG_ERR() will be - * called and @c eina_error set to @c EINA_ERROR_SAFETY_FAILED and can - * be checked with eina_error_get() after call. - * + * called. + * * @see EINA_SAFETY_ON_NULL_RETURN(), EINA_SAFETY_ON_NULL_RETURN_VAL() * and other macros. * @@ -89,10 +87,6 @@ #include "eina_config.h" #include "eina_error.h" -/** - * @var EINA_ERROR_SAFETY_FAILED - * Error identifier corresponding to safety check failure. - */ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; #ifdef EINA_SAFETY_CHECKS @@ -104,7 +98,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY((exp) == NULL)) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \ return; \ } \ @@ -116,7 +109,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY((exp) == NULL)) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \ return (val); \ } \ @@ -128,7 +120,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY((exp) == NULL)) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \ goto label; \ } \ @@ -140,7 +131,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY(exp)) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \ return; \ } \ @@ -152,7 +142,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY(exp)) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \ return val; \ } \ @@ -164,7 +153,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY(exp)) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \ goto label; \ } \ @@ -176,7 +164,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY(!(exp))) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \ return; \ } \ @@ -188,7 +175,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY(!(exp))) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \ return val; \ } \ @@ -200,7 +186,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED; { \ if (EINA_UNLIKELY(!(exp))) \ { \ - eina_error_set(EINA_ERROR_SAFETY_FAILED); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \ goto label; \ } \ diff --git a/src/lib/eina/eina_share_common.c b/src/lib/eina/eina_share_common.c index 0682b6e..563289e 100644 --- a/src/lib/eina/eina_share_common.c +++ b/src/lib/eina/eina_share_common.c @@ -71,7 +71,6 @@ #include "eina_private.h" #include "eina_hash.h" #include "eina_rbtree.h" -#include "eina_error.h" #include "eina_lock.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ @@ -401,9 +400,6 @@ _eina_share_common_head_alloc(int slen) const size_t head_size = offsetof(Eina_Share_Common_Head, builtin_node.str); head = malloc(head_size + slen); - if (!head) - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return head; } @@ -546,9 +542,6 @@ _eina_share_common_node_alloc(unsigned int slen, unsigned int null_size) const size_t node_size = offsetof(Eina_Share_Common_Node, str); node = malloc(node_size + slen + null_size); - if (!node) - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return node; } diff --git a/src/lib/eina/eina_strbuf.h b/src/lib/eina/eina_strbuf.h index 60cc58f..e7f25b9 100644 --- a/src/lib/eina/eina_strbuf.h +++ b/src/lib/eina/eina_strbuf.h @@ -70,8 +70,7 @@ typedef struct _Eina_Strbuf Eina_Strbuf; * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_strbuf_free(). + * returned. To free the resources, use eina_strbuf_free(). * * @see eina_strbuf_free() * @see eina_strbuf_append() @@ -88,8 +87,7 @@ EAPI Eina_Strbuf *eina_strbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT; * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_strbuf_free(). + * returned. To free the resources, use eina_strbuf_free(). * * @see eina_strbuf_free() * @see eina_strbuf_append() @@ -108,8 +106,7 @@ EAPI Eina_Strbuf *eina_strbuf_manage_new(char *str) EINA_MALLOC EINA_WARN_UNUSED * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_strbuf_free(). + * returned. To free the resources, use eina_strbuf_free(). * * @see eina_strbuf_manage_new() * @since 1.2.0 diff --git a/src/lib/eina/eina_strbuf_common.c b/src/lib/eina/eina_strbuf_common.c index 31ad683..e0faf49 100644 --- a/src/lib/eina/eina_strbuf_common.c +++ b/src/lib/eina/eina_strbuf_common.c @@ -13,7 +13,6 @@ #include "eina_private.h" #include "eina_str.h" #include "eina_magic.h" -#include "eina_error.h" #include "eina_safety_checks.h" #include "eina_strbuf.h" #include "eina_strbuf_common.h" @@ -88,14 +87,8 @@ _eina_strbuf_common_init(size_t csize, Eina_Strbuf *buf) buf->size = EINA_STRBUF_INIT_SIZE; buf->step = EINA_STRBUF_INIT_STEP; - eina_error_set(0); buf->buf = calloc(csize, buf->size); - if (EINA_UNLIKELY(!buf->buf)) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } - + if (EINA_UNLIKELY(!buf->buf)) return EINA_FALSE; return EINA_TRUE; } @@ -159,16 +152,11 @@ _eina_strbuf_common_resize(size_t csize, Eina_Strbuf *buf, size_t size) /* reallocate the buffer to the new size */ buffer = realloc(buf->buf, new_size * csize); - if (EINA_UNLIKELY(!buffer)) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (EINA_UNLIKELY(!buffer)) return EINA_FALSE; buf->buf = buffer; buf->size = new_size; buf->step = new_step; - eina_error_set(0); return EINA_TRUE; } @@ -239,8 +227,7 @@ _eina_strbuf_common_insert_length(size_t csize, * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_strbuf_common_free(). + * returned. To free the resources, use eina_strbuf_common_free(). * * @see eina_strbuf_common_free() * @see eina_strbuf_common_append() @@ -251,13 +238,8 @@ eina_strbuf_common_new(size_t csize) { Eina_Strbuf *buf; - eina_error_set(0); buf = malloc(sizeof(Eina_Strbuf)); - if (EINA_UNLIKELY(!buf)) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (EINA_UNLIKELY(!buf)) return NULL; if (EINA_UNLIKELY(!_eina_strbuf_common_init(csize, buf))) { eina_strbuf_common_free(buf); @@ -276,8 +258,7 @@ eina_strbuf_common_new(size_t csize) * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_strbuf_common_free(). + * returned. To free the resources, use eina_strbuf_common_free(). * * @see eina_strbuf_common_free() * @see eina_strbuf_common_append() @@ -291,14 +272,9 @@ eina_strbuf_common_manage_new(size_t csize, { Eina_Strbuf *buf; - eina_error_set(0); buf = malloc(sizeof(Eina_Strbuf)); - if (EINA_UNLIKELY(!buf)) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } - if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len))) + if (EINA_UNLIKELY(!buf)) return NULL; + if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len))) { eina_strbuf_common_free(buf); return NULL; diff --git a/src/lib/eina/eina_stringshare.c b/src/lib/eina/eina_stringshare.c index 2232fa9..a630368 100644 --- a/src/lib/eina/eina_stringshare.c +++ b/src/lib/eina/eina_stringshare.c @@ -37,7 +37,6 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_alloca.h" -#include "eina_error.h" #include "eina_log.h" #include "eina_lock.h" #include "eina_share_common.h" @@ -212,30 +211,15 @@ _eina_stringshare_small_bucket_resize(Eina_Stringshare_Small_Bucket *bucket, void *tmp; tmp = realloc((void *)bucket->strings, size * sizeof(bucket->strings[0])); - if (!tmp) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return 0; - } - + if (!tmp) return 0; bucket->strings = tmp; tmp = realloc(bucket->lengths, size * sizeof(bucket->lengths[0])); - if (!tmp) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return 0; - } - + if (!tmp) return 0; bucket->lengths = tmp; tmp = realloc(bucket->references, size * sizeof(bucket->references[0])); - if (!tmp) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return 0; - } - + if (!tmp) return 0; bucket->references = tmp; bucket->size = size; @@ -256,11 +240,7 @@ _eina_stringshare_small_bucket_insert_at( if (!bucket) { *p_bucket = bucket = calloc(1, sizeof(*bucket)); - if (!bucket) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!bucket) return NULL; } if (bucket->count + 1 >= bucket->size) @@ -271,11 +251,7 @@ _eina_stringshare_small_bucket_insert_at( } snew = malloc(length + 1); - if (!snew) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!snew) return NULL; memcpy(snew, str, length); snew[length] = '\0'; diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c index 0700650..6f42fcf 100644 --- a/src/lib/eina/eina_thread.c +++ b/src/lib/eina/eina_thread.c @@ -23,7 +23,6 @@ #include #include "eina_config.h" -#include "eina_error.h" #include "eina_thread.h" #include "eina_sched.h" #ifdef _WIN32 @@ -34,18 +33,6 @@ #include "eina_safety_checks.h" #include "eina_thread.h" -EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED = 0; -EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES = 0; -EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS = 0; -EAPI Eina_Error EINA_ERROR_THREAD_JOIN_DEADLOCK = 0; -EAPI Eina_Error EINA_ERROR_THREAD_JOIN_INVALID = 0; - -static const char EINA_ERROR_THREAD_CREATION_FAILED_STR[] = "Generic error creating thread"; -static const char EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES_STR[] = "No resources to create thread"; -static const char EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS_STR[] = "No permissions to create thread"; -static const char EINA_ERROR_THREAD_JOIN_DEADLOCK_STR[] = "Deadlock detected"; -static const char EINA_ERROR_THREAD_JOIN_INVALID_STR[] = "Invalid thread to join"; - #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include @@ -161,11 +148,7 @@ _eina_thread_join(Eina_Thread t) void *ret; tw = _eina_thread_win32_find(t); - if (!tw) - { - eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID); - return NULL; - } + if (!tw) return NULL; WaitForSingleObject(tw->thread, INFINITE); CloseHandle(tw->thread); @@ -193,13 +176,7 @@ _eina_thread_join(Eina_Thread t) void *ret = NULL; int err = pthread_join(t, &ret); - if (err == 0) - return ret; - else if (err == EDEADLK) - eina_error_set(EINA_ERROR_THREAD_JOIN_DEADLOCK); - else - eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID); - + if (err == 0) return ret; return NULL; } @@ -228,14 +205,7 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi err = pthread_create(t, &attr, func, data); pthread_attr_destroy(&attr); - if (err == 0) - return EINA_TRUE; - else if (err == EAGAIN) - eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES); - else if (err == EPERM) - eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS); - else - eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED); + if (err == 0) return EINA_TRUE; return EINA_FALSE; } @@ -306,14 +276,8 @@ eina_thread_create(Eina_Thread *t, EINA_SAFETY_ON_NULL_RETURN_VAL(t, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(func, EINA_FALSE); - eina_error_set(0); - c = malloc(sizeof (Eina_Thread_Call)); - if (!c) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + if (!c) return EINA_FALSE; c->func = func; c->data = data; @@ -324,28 +288,18 @@ eina_thread_create(Eina_Thread *t, return EINA_TRUE; free(c); - if (eina_error_get() == 0) - eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED); - return EINA_FALSE; } EAPI void * eina_thread_join(Eina_Thread t) { - eina_error_set(0); return _eina_thread_join(t); } Eina_Bool eina_thread_init(void) { - EINA_ERROR_THREAD_CREATION_FAILED = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_STR); - EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES_STR); - EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS_STR); - EINA_ERROR_THREAD_JOIN_DEADLOCK = eina_error_msg_static_register(EINA_ERROR_THREAD_JOIN_DEADLOCK_STR); - EINA_ERROR_THREAD_JOIN_INVALID = eina_error_msg_static_register(EINA_ERROR_THREAD_JOIN_INVALID_STR); - return EINA_TRUE; } diff --git a/src/lib/eina/eina_thread.h b/src/lib/eina/eina_thread.h index 6751a6e..3e89ea9 100644 --- a/src/lib/eina/eina_thread.h +++ b/src/lib/eina/eina_thread.h @@ -42,46 +42,6 @@ * @{ */ -/** - * @var EINA_ERROR_THREAD_CREATION_FAILED - * Generic error happened and thread couldn't be created. - * @since 1.8 - */ -EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED; - -/** - * @var EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES - * System lacked resources to create thread. - * @since 1.8 - */ -EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES; - -/** - * @var EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS - * System lacked permissions to create thread. - * @since 1.8 - */ -EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS; - -/** - * @var EINA_ERROR_THREAD_JOIN_DEADLOCK - * The system has detected a deadlock situation where both threads - * would wait each other. Or the thread wanted to wait for itself. - * @since 1.8 - */ -EAPI extern Eina_Error EINA_ERROR_THREAD_JOIN_DEADLOCK; - -/** - * @var EINA_ERROR_THREAD_JOIN_INVALID - * One of the following happened: - * @li thread is not a joinable. - * @li thread does not exist. - * @li another thread is already waiting for that thread. - * @since 1.8 - */ -EAPI extern Eina_Error EINA_ERROR_THREAD_JOIN_INVALID; - - typedef unsigned long int Eina_Thread; typedef void *(*Eina_Thread_Cb)(void *data, Eina_Thread t); diff --git a/src/lib/eina/eina_tiler.c b/src/lib/eina/eina_tiler.c index 6734b2f..0301737 100644 --- a/src/lib/eina/eina_tiler.c +++ b/src/lib/eina/eina_tiler.c @@ -33,7 +33,6 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_tiler.h" -#include "eina_error.h" /*============================================================================* * Local * @@ -1386,11 +1385,7 @@ eina_tile_grid_slicer_iterator_new(int x, return NULL; it = calloc(1, sizeof(*it)); - if (!it) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!it) return NULL; EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); diff --git a/src/lib/eina/eina_tmpstr.c b/src/lib/eina/eina_tmpstr.c index 5ce79c3..bc31a58 100644 --- a/src/lib/eina/eina_tmpstr.c +++ b/src/lib/eina/eina_tmpstr.c @@ -32,7 +32,6 @@ #include "eina_config.h" #include "eina_private.h" -#include "eina_error.h" #include "eina_log.h" #include "eina_lock.h" #include "eina_share_common.h" diff --git a/src/lib/eina/eina_ustrbuf.h b/src/lib/eina/eina_ustrbuf.h index ad2dc8d..ca834a7 100644 --- a/src/lib/eina/eina_ustrbuf.h +++ b/src/lib/eina/eina_ustrbuf.h @@ -39,8 +39,7 @@ typedef struct _Eina_Strbuf Eina_UStrbuf; * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_ustrbuf_free(). + * returned. To free the resources, use eina_ustrbuf_free(). * * @see eina_ustrbuf_free() * @see eina_ustrbuf_append() @@ -57,8 +56,7 @@ EAPI Eina_UStrbuf *eina_ustrbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT; * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_strbuf_free(). + * returned. To free the resources, use eina_strbuf_free(). * * @see eina_ustrbuf_free() * @see eina_ustrbuf_append() @@ -77,8 +75,7 @@ EAPI Eina_UStrbuf *eina_ustrbuf_manage_new(Eina_Unicode *str) EINA_MALLOC EINA_W * @return Newly allocated string buffer instance. * * This function creates a new string buffer. On error, @c NULL is - * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To - * free the resources, use eina_ustrbuf_free(). + * returned. To free the resources, use eina_ustrbuf_free(). * * @see eina_ustrbuf_manage_new() * @since 1.2.0 diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c index 9dc811b..a4fbd5c 100644 --- a/src/lib/eina/eina_value.c +++ b/src/lib/eina/eina_value.c @@ -31,7 +31,6 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_alloca.h" -#include "eina_error.h" #include "eina_log.h" #include "eina_strbuf.h" #include "eina_mempool.h" @@ -134,8 +133,6 @@ _eina_value_type_uchar_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const unsigned char v = *(const unsigned char *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -209,7 +206,6 @@ _eina_value_type_uchar_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -281,8 +277,6 @@ _eina_value_type_ushort_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons { const unsigned short v = *(const unsigned short *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -360,7 +354,6 @@ _eina_value_type_ushort_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -432,8 +425,6 @@ _eina_value_type_uint_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const unsigned int v = *(const unsigned int *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -515,7 +506,6 @@ _eina_value_type_uint_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -587,8 +577,6 @@ _eina_value_type_ulong_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const unsigned long v = *(const unsigned long *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -674,7 +662,6 @@ _eina_value_type_ulong_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -746,8 +733,6 @@ _eina_value_type_uint64_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons { const uint64_t v = *(const uint64_t *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -838,7 +823,6 @@ _eina_value_type_uint64_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -910,8 +894,6 @@ _eina_value_type_char_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const signed char v = *(const signed char *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -993,7 +975,6 @@ _eina_value_type_char_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -1065,8 +1046,6 @@ _eina_value_type_short_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const short v = *(const short *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -1154,7 +1133,6 @@ _eina_value_type_short_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -1226,8 +1204,6 @@ _eina_value_type_int_convert_to(const Eina_Value_Type *type EINA_UNUSED, const E { const int v = *(const int *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -1321,7 +1297,6 @@ _eina_value_type_int_convert_to(const Eina_Value_Type *type EINA_UNUSED, const E } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -1393,8 +1368,6 @@ _eina_value_type_long_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const long v = *(const long *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -1494,7 +1467,6 @@ _eina_value_type_long_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -1566,8 +1538,6 @@ _eina_value_type_int64_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const int64_t v = *(const int64_t *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -1674,7 +1644,6 @@ _eina_value_type_int64_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -1746,8 +1715,6 @@ _eina_value_type_float_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const float v = *(const float *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -1860,7 +1827,6 @@ _eina_value_type_float_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -1932,8 +1898,6 @@ _eina_value_type_double_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons { const double v = *(const double *)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v; @@ -2040,7 +2004,6 @@ _eina_value_type_double_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -2100,8 +2063,6 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type EINA_UNUSE { const char *v = *(const char **)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem; @@ -2213,7 +2174,6 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type EINA_UNUSE } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -2286,7 +2246,6 @@ _eina_value_type_string_copy(const Eina_Value_Type *type EINA_UNUSED, const void *d = strdup(*s); if (*d == NULL) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } } @@ -2298,7 +2257,7 @@ _eina_value_type_string_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem, { char **tmem = mem; const char *str = va_arg(args, const char *); - eina_error_set(0); + if (str == *tmem) return EINA_TRUE; if (!str) { @@ -2310,7 +2269,6 @@ _eina_value_type_string_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem, char *tmp = strdup(str); if (!tmp) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } free(*tmem); @@ -2324,7 +2282,7 @@ _eina_value_type_string_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem, { char **tmem = mem; const char * const *str = ptr; - eina_error_set(0); + if (*str == *tmem) return EINA_TRUE; if (!*str) { @@ -2336,7 +2294,6 @@ _eina_value_type_string_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem, char *tmp = strdup(*str); if (!tmp) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } free(*tmem); @@ -2405,7 +2362,6 @@ _eina_value_type_array_copy(const Eina_Value_Type *type EINA_UNUSED, const void if (!subtype->copy) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -2448,14 +2404,12 @@ _eina_value_type_array_compare(const Eina_Value_Type *type EINA_UNUSED, const vo if (eva_a->subtype != eva_b->subtype) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return -1; } subtype = eva_a->subtype; if (!subtype->compare) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return 0; } @@ -2570,7 +2524,6 @@ _eina_value_type_array_convert_to(const Eina_Value_Type *type EINA_UNUSED, const if (!ret) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } return EINA_TRUE; @@ -2613,7 +2566,6 @@ _eina_value_type_array_pset(const Eina_Value_Type *type, void *mem, const void * const Eina_Value_Array *desc = ptr; Eina_Inarray *desc_array; - eina_error_set(0); if ((!tmem->subtype) && (!desc->subtype)) return EINA_TRUE; @@ -2740,7 +2692,6 @@ _eina_value_type_list_copy(const Eina_Value_Type *type EINA_UNUSED, const void * if (!subtype->copy) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -2781,14 +2732,12 @@ _eina_value_type_list_compare(const Eina_Value_Type *type EINA_UNUSED, const voi if (eva_a->subtype != eva_b->subtype) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return -1; } subtype = eva_a->subtype; if (!subtype->compare) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return 0; } @@ -2894,7 +2843,6 @@ _eina_value_type_list_convert_to(const Eina_Value_Type *type EINA_UNUSED, const if (!ret) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } return EINA_TRUE; @@ -2946,7 +2894,6 @@ _eina_value_type_list_pset(const Eina_Value_Type *type, void *mem, const void *p Eina_Value_List *tmem = mem; const Eina_Value_List *desc = ptr; - eina_error_set(0); if ((!tmem->subtype) && (!desc->subtype)) return EINA_TRUE; @@ -3133,7 +3080,6 @@ _eina_value_type_hash_copy(const Eina_Value_Type *type EINA_UNUSED, const void * if (!s->subtype->copy) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -3177,13 +3123,11 @@ _eina_value_type_hash_compare(const Eina_Value_Type *type EINA_UNUSED, const voi if (eva_a->subtype != eva_b->subtype) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return -1; } if (!eva_a->subtype->compare) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return 0; } @@ -3309,7 +3253,6 @@ _eina_value_type_hash_convert_to(const Eina_Value_Type *type EINA_UNUSED, const if (!ret) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } return EINA_TRUE; @@ -3321,7 +3264,6 @@ _eina_value_type_hash_pset(const Eina_Value_Type *type, void *mem, const void *p Eina_Value_Hash *tmem = mem; const Eina_Value_Hash *desc = ptr; - eina_error_set(0); if ((!tmem->subtype) && (!desc->subtype)) return EINA_TRUE; @@ -3439,8 +3381,6 @@ _eina_value_type_timeval_convert_to(const Eina_Value_Type *type EINA_UNUSED, con { struct timeval v = _eina_value_type_timeval_fix(type_mem); - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_UCHAR) { unsigned char other_mem = v.tv_sec; @@ -3550,7 +3490,6 @@ _eina_value_type_timeval_convert_to(const Eina_Value_Type *type EINA_UNUSED, con } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } } @@ -3649,7 +3588,6 @@ _eina_value_type_blob_compare(const Eina_Value_Type *type EINA_UNUSED, const voi size_t minsize; if (ta->ops != tb->ops) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return -1; } if ((ops) && (ops->compare)) @@ -3668,7 +3606,6 @@ _eina_value_type_blob_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const Eina_Value_Blob *tmem = type_mem; - eina_error_set(0); if (convert == EINA_VALUE_TYPE_STRINGSHARE || convert == EINA_VALUE_TYPE_STRING) { @@ -3726,7 +3663,6 @@ _eina_value_type_blob_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } } @@ -3754,7 +3690,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value desc.memory = buf = malloc(desc.size); if (!desc.memory) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } memcpy(buf, str, desc.size); @@ -3774,7 +3709,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value desc.memory = buf = malloc(desc.size); if (!desc.memory) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } memcpy(buf, a->array->members, desc.size); @@ -3794,7 +3728,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value desc.memory = buf = malloc(desc.size); if (!desc.memory) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } memcpy(buf, b->memory, desc.size); @@ -3806,7 +3739,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value desc.memory = buf = malloc(convert->value_size); if (!desc.memory) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } if (!eina_value_type_pget(convert, convert_mem, buf)) @@ -3825,7 +3757,6 @@ _eina_value_type_blob_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem, c Eina_Value_Blob *tmem = mem; const Eina_Value_Blob *desc = ptr; - eina_error_set(0); if ((tmem->memory) && (tmem->memory == desc->memory)) { tmem->ops = desc->ops; @@ -4101,7 +4032,6 @@ _eina_value_type_struct_copy(const Eina_Value_Type *type EINA_UNUSED, const void d->memory = malloc(s->desc->size); if (!d->memory) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } @@ -4156,12 +4086,10 @@ _eina_value_type_struct_compare(const Eina_Value_Type *type EINA_UNUSED, const v return 0; else if (ta->desc != tb->desc) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return -1; } if (ta->desc->ops != tb->desc->ops) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return -1; } if ((!ta->memory) && (!tb->memory)) @@ -4222,7 +4150,6 @@ _eina_value_type_struct_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons { const Eina_Value_Struct *tmem = type_mem; - eina_error_set(0); if (convert == EINA_VALUE_TYPE_STRINGSHARE || convert == EINA_VALUE_TYPE_STRING) { @@ -4262,7 +4189,6 @@ _eina_value_type_struct_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } } @@ -4327,11 +4253,9 @@ _eina_value_type_struct_pset(const Eina_Value_Type *type, void *mem, const void if (!_eina_value_type_struct_desc_check(desc->desc)) { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } - eina_error_set(0); if ((tmem->memory) && (tmem->memory == desc->memory)) { tmem->desc = desc->desc; @@ -4362,7 +4286,6 @@ _eina_value_type_struct_pset(const Eina_Value_Type *type, void *mem, const void if (!tmem->memory) { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } @@ -4478,8 +4401,6 @@ _eina_value_type_model_convert_to(const Eina_Value_Type *type EINA_UNUSED, const { const Eina_Model *v = *(const Eina_Model **)type_mem; - eina_error_set(0); - if (convert == EINA_VALUE_TYPE_STRINGSHARE || convert == EINA_VALUE_TYPE_STRING) { @@ -4490,7 +4411,6 @@ _eina_value_type_model_convert_to(const Eina_Value_Type *type EINA_UNUSED, const } else { - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } @@ -4518,7 +4438,6 @@ _eina_value_type_model_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem, Eina_Model **tmem = mem; Eina_Model **p = (Eina_Model **)ptr; - eina_error_set(0); if (*tmem == *p) return EINA_TRUE; if (*p) eina_model_ref(*p); @@ -4783,11 +4702,7 @@ static void * _eina_value_blob_operations_malloc_copy(const Eina_Value_Blob_Operations *ops EINA_UNUSED, const void *memory, size_t size) { void *ret = malloc(size); - if (!ret) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!ret) return NULL; memcpy(ret, memory, size); return ret; } @@ -4811,8 +4726,6 @@ struct _Eina_Value_Inner_Mp * @endcond */ -static const char EINA_ERROR_VALUE_FAILED_STR[] = "Value check failed."; - /** */ @@ -4968,9 +4881,6 @@ eina_value_init(void) goto on_init_fail_hash; } - EINA_ERROR_VALUE_FAILED = eina_error_msg_static_register( - EINA_ERROR_VALUE_FAILED_STR); - EINA_VALUE_TYPE_UCHAR = _EINA_VALUE_TYPE_BASICS + 0; EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1; EINA_VALUE_TYPE_UINT = _EINA_VALUE_TYPE_BASICS + 2; @@ -5106,11 +5016,7 @@ EAPI Eina_Value * eina_value_new(const Eina_Value_Type *type) { Eina_Value *value = eina_mempool_malloc(_eina_value_mp, sizeof(Eina_Value)); - if (!value) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!value) return NULL; if (!eina_value_setup(value, type)) { free(value); diff --git a/src/lib/eina/eina_value.h b/src/lib/eina/eina_value.h index d029976..bb619dd 100644 --- a/src/lib/eina/eina_value.h +++ b/src/lib/eina/eina_value.h @@ -587,13 +587,7 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_BLOB; */ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_STRUCT; -/** - * @var EINA_ERROR_VALUE_FAILED - * Error identifier corresponding to value check failure. - * - * @since 1.2 - */ -EAPI extern int EINA_ERROR_VALUE_FAILED; +EAPI extern Eina_Error EINA_ERROR_VALUE_FAILED; /** * @defgroup Eina_Value_Value_Group Generic Value management @@ -625,8 +619,7 @@ struct _Eina_Value * eg. #EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(), * eina_value_array_get() and so on. * - * On failure, @c NULL is returned and either #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, @c NULL is returned. * * @note this calls creates from mempool and then uses * eina_value_setup(). Consider using eina_value_flush() and @@ -664,8 +657,7 @@ EAPI void eina_value_free(Eina_Value *value) EINA_ARG_NONNULL(1); * @note Existing contents are ignored! If the value was previously used, then * use eina_value_flush() first. * - * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, #EINA_FALSE is returned. * * @see eina_value_flush() * @@ -1103,8 +1095,7 @@ struct _Eina_Value_Array * Create a new generic value storage of type array. The members are * managed using the description specified by @a subtype. * - * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, @c NULL is returned. * * @note this creates from mempool and then uses * eina_value_array_setup(). @see eina_value_free() @see @@ -1132,8 +1123,7 @@ EAPI Eina_Value *eina_value_array_new(const Eina_Value_Type *subtype, * @note Existing contents are ignored! If the value was previously used, then * use eina_value_flush() first. * - * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, #EINA_FALSE is returned. * * @see eina_value_flush() * @@ -1753,8 +1743,7 @@ struct _Eina_Value_List * Create a new generic value storage of type list. The members are * managed using the description specified by @a subtype. * - * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, @c NULL is returned. * * @note this creates from mempool and then uses * eina_value_list_setup(). @@ -1782,8 +1771,7 @@ EAPI Eina_Value *eina_value_list_new(const Eina_Value_Type *subtype) EINA_ARG_NO * @note Existing contents are ignored! If the value was previously used, then * use eina_value_flush() first. * - * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, #EINA_FALSE is returned. * * @see eina_value_flush() * @@ -2379,8 +2367,7 @@ struct _Eina_Value_Hash * Create a new generic value storage of type hash. The members are * managed using the description specified by @a subtype. * - * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, @c NULL is returned. * * @note this creates from mempool and then uses * eina_value_hash_setup(). @@ -2410,8 +2397,7 @@ EAPI Eina_Value *eina_value_hash_new(const Eina_Value_Type *subtype, unsigned in * @note Existing contents are ignored! If the value was previously used, then * use eina_value_flush() first. * - * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, #EINA_FALSE is returned. * * @see eina_value_flush() * @@ -2942,8 +2928,7 @@ struct _Eina_Value_Struct * Create a new generic value storage of type struct. The members are * managed using the description specified by @a desc. * - * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, @c NULL is returned. * * @note this creates from mempool and then uses * eina_value_struct_setup(). @@ -2971,8 +2956,7 @@ EAPI Eina_Value *eina_value_struct_new(const Eina_Value_Struct_Desc *desc) EINA_ * @note Existing contents are ignored! If the value was previously used, then * use eina_value_flush() first. * - * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY - * or #EINA_ERROR_VALUE_FAILED is set. + * On failure, #EINA_FALSE is returned. * * @see eina_value_flush() * diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index 0e32a99..5fea6ed 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -826,8 +826,6 @@ _eo_dbg_info_convert_to(const Eina_Value_Type *type EINA_UNUSED, const Eina_Valu free(inner_val); return ret; } - - eina_error_set(EINA_ERROR_VALUE_FAILED); return EINA_FALSE; } diff --git a/src/lib/evas/canvas/evas_key_grab.c b/src/lib/evas/canvas/evas_key_grab.c index a9f9480..0104b96 100644 --- a/src/lib/evas/canvas/evas_key_grab.c +++ b/src/lib/evas/canvas/evas_key_grab.c @@ -40,34 +40,7 @@ evas_key_grab_new(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, const ch } } obj->grabs = eina_list_append(obj->grabs, g); - if (eina_error_get()) - { - MERR_BAD(); - evas_mem_free(sizeof(Eina_List)); - obj->grabs = eina_list_append(obj->grabs, g); - if (eina_error_get()) - { - MERR_FATAL(); - free(g->keyname); - free(g); - return NULL; - } - } obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g); - if (eina_error_get()) - { - MERR_BAD(); - evas_mem_free(sizeof(Eina_List)); - obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g); - if (eina_error_get()) - { - MERR_FATAL(); - obj->grabs = eina_list_remove(obj->grabs, g); - free(g->keyname); - free(g); - return NULL; - } - } return g; } diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c index e3fcb59..b71b79d 100644 --- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c +++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c @@ -33,7 +33,6 @@ #include "eina_config.h" #include "eina_inlist.h" -#include "eina_error.h" #include "eina_module.h" #include "eina_mempool.h" #include "eina_trash.h" @@ -123,13 +122,8 @@ _eina_chained_mp_pool_new(Chained_Mempool *pool) Chained_Pool *p; unsigned char *ptr; - eina_error_set(0); p = malloc(pool->alloc_size); - if (!p) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return NULL; - } + if (!p) return NULL; #ifdef EINA_DEBUG_MALLOC { diff --git a/src/modules/eina/mp/one_big/eina_one_big.c b/src/modules/eina/mp/one_big/eina_one_big.c index e658013..470a2dd 100644 --- a/src/modules/eina/mp/one_big/eina_one_big.c +++ b/src/modules/eina/mp/one_big/eina_one_big.c @@ -100,11 +100,7 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size) if (!pool->base) { pool->base = malloc(pool->item_size * pool->max); - if (!pool->base) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - goto retry_smaller; - } + if (!pool->base) goto retry_smaller; #ifndef NVALGRIND VALGRIND_MAKE_MEM_NOACCESS(pool->base, pool->item_size * pool->max); #endif @@ -118,11 +114,8 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size) } retry_smaller: - eina_error_set(0); mem = malloc(sizeof(Eina_Inlist) + pool->item_size); - if (!mem) - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - else + if (mem) { pool->over++; /* Only need to zero list elements and not the payload here */ diff --git a/src/modules/emotion/gstreamer/emotion_gstreamer.c b/src/modules/emotion/gstreamer/emotion_gstreamer.c index f678bf0..cf40c7f 100644 --- a/src/modules/emotion/gstreamer/emotion_gstreamer.c +++ b/src/modules/emotion/gstreamer/emotion_gstreamer.c @@ -64,11 +64,6 @@ emotion_video_stream_new(Emotion_Gstreamer_Video *ev) if (!vstream) return NULL; ev->video_streams = eina_list_append(ev->video_streams, vstream); - if (eina_error_get()) - { - free(vstream); - return NULL; - } return vstream; } @@ -1893,11 +1888,6 @@ _emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev, astream = calloc(1, sizeof(Emotion_Audio_Stream)); if (!astream) continue; ev->audio_streams = eina_list_append(ev->audio_streams, astream); - if (eina_error_get()) - { - free(astream); - continue; - } astream->length_time = length_time; astream->channels = channels; diff --git a/src/tests/eina/eina_test_barrier.c b/src/tests/eina/eina_test_barrier.c index 59ce191..3cd6147 100644 --- a/src/tests/eina/eina_test_barrier.c +++ b/src/tests/eina/eina_test_barrier.c @@ -91,19 +91,14 @@ START_TEST(eina_barrier_test_simple) eina_barrier_wait(&barrier); eina_thread_join(wk1); - ck_assert_int_eq(eina_error_get(), 0); eina_thread_join(wk2); - ck_assert_int_eq(eina_error_get(), 0); eina_thread_join(wk3); - ck_assert_int_eq(eina_error_get(), 0); eina_thread_join(wk4); - ck_assert_int_eq(eina_error_get(), 0); eina_thread_join(wk5); - ck_assert_int_eq(eina_error_get(), 0); eina_barrier_free(&barrier); diff --git a/src/tests/eina/eina_test_counter.c b/src/tests/eina/eina_test_counter.c index 1a6c77c..83fe29b 100644 --- a/src/tests/eina/eina_test_counter.c +++ b/src/tests/eina/eina_test_counter.c @@ -141,7 +141,6 @@ START_TEST(eina_counter_break) "safety check failed: name == NULL"); cnt = eina_counter_new(NULL); fail_if(cnt); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -150,7 +149,6 @@ START_TEST(eina_counter_break) TEST_MAGIC_SAFETY("eina_counter_free", "safety check failed: counter == NULL"); eina_counter_free(NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -159,7 +157,6 @@ START_TEST(eina_counter_break) TEST_MAGIC_SAFETY("eina_counter_start", "safety check failed: counter == NULL"); eina_counter_start(NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -168,7 +165,6 @@ START_TEST(eina_counter_break) TEST_MAGIC_SAFETY("eina_counter_stop", "safety check failed: counter == NULL"); eina_counter_stop(NULL, 0); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); @@ -179,7 +175,6 @@ START_TEST(eina_counter_break) "safety check failed: counter == NULL"); dump = eina_counter_dump(NULL); fail_if(dump); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c index 534ae78..cfd8585 100644 --- a/src/tests/eina/eina_test_file.c +++ b/src/tests/eina/eina_test_file.c @@ -94,7 +94,6 @@ START_TEST(eina_file_split_simple) TEST_MAGIC_SAFETY("eina_file_split", "safety check failed: path == NULL"); ea = eina_file_split(NULL); fail_if(ea); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); diff --git a/src/tests/eina/eina_test_inlist.c b/src/tests/eina/eina_test_inlist.c index 46257c8..2a26169 100644 --- a/src/tests/eina/eina_test_inlist.c +++ b/src/tests/eina/eina_test_inlist.c @@ -167,7 +167,6 @@ START_TEST(eina_inlist_simple) tmp2 = eina_inlist_remove(NULL, EINA_INLIST_GET(tmp)); fail_if(tmp2 != NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); } @@ -177,7 +176,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_remove", "safety check failed: item == NULL"); lst = eina_inlist_remove(lst, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -186,7 +184,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_append", "safety check failed: new_l == NULL"); lst = eina_inlist_append(lst, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -195,7 +192,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_append_relative", "safety check failed: new_l == NULL"); lst = eina_inlist_append_relative(lst, NULL, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -204,7 +200,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_prepend", "safety check failed: new_l == NULL"); lst = eina_inlist_prepend(lst, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -213,7 +208,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_prepend_relative", "safety check failed: new_l == NULL"); lst = eina_inlist_prepend_relative(lst, NULL, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -222,7 +216,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_find", "safety check failed: item == NULL"); lst = eina_inlist_find(lst, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -231,7 +224,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_demote", "safety check failed: list == NULL"); lst = eina_inlist_demote(NULL, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -240,7 +232,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_demote", "safety check failed: item == NULL"); lst = eina_inlist_demote((void*)1L, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); lst = NULL; @@ -250,7 +241,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_promote", "safety check failed: list == NULL"); lst = eina_inlist_promote(NULL, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -259,7 +249,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_promote", "safety check failed: item == NULL"); lst = eina_inlist_promote((void*)1L, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); lst = NULL; @@ -269,7 +258,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_sorted_insert", "safety check failed: item == NULL"); lst = eina_inlist_sorted_insert(NULL, NULL, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -278,7 +266,6 @@ START_TEST(eina_inlist_simple) TEST_MAGIC_SAFETY("eina_inlist_sorted_insert", "safety check failed: func == NULL"); lst = eina_inlist_sorted_insert(NULL, (void*)1L, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); lst = NULL; diff --git a/src/tests/eina/eina_test_magic.c b/src/tests/eina/eina_test_magic.c index 07b2537..a5d07cb 100644 --- a/src/tests/eina/eina_test_magic.c +++ b/src/tests/eina/eina_test_magic.c @@ -121,7 +121,6 @@ START_TEST(eina_magic_simple) TEST_MAGIC_SAFETY("eina_magic_string_set", "safety check failed: magic_name == NULL"); eina_magic_string_set(EINA_MAGIC_TEST2, NULL); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); fail_unless(ctx.did); #ifdef SHOW_LOG @@ -131,7 +130,6 @@ START_TEST(eina_magic_simple) "safety check failed: magic_name == NULL"); eina_magic_string_set(EINA_MAGIC_TEST2, NULL); fail_unless(ctx.did); - fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); #endif eina_magic_string_set(EINA_MAGIC_TEST2, EINA_MAGIC_STRING);