eina - and e3fl in general - stop using eina_error_get/set - useless really

This commit is contained in:
Carsten Haitzler 2013-10-11 16:49:13 +09:00
parent 725237df0a
commit 69e27abdc3
66 changed files with 204 additions and 1509 deletions

View File

@ -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 2013-10-11 Cedric Bail
* Eina: add Eina_Spinlock API, * Eina: add Eina_Spinlock API,

2
NEWS
View File

@ -180,6 +180,8 @@ Removed:
- Remove support for DirectFB, XRender, WinCE, Glew, Direct3d, X11-16 and X11-8. - Remove support for DirectFB, XRender, WinCE, Glew, Direct3d, X11-16 and X11-8.
* Ecore_DirectFB: * Ecore_DirectFB:
- Removed - Removed
* Eina error status:
- eina error status from efl now don't also report error in addition to return.
Improvements: Improvements:
* EFL: * EFL:

View File

@ -254,15 +254,7 @@ cserve2_client_accept(int fd)
while (eina_hash_find(client_list, &client->id)) while (eina_hash_find(client_list, &client->id))
client->id = _client_id++; client->id = _client_id++;
if (!eina_hash_add(client_list, &client->id, client)) 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;
}
cserve2_fd_watch_add(fd, FD_READ | FD_ERROR, cserve2_message_handler, cserve2_fd_watch_add(fd, FD_READ | FD_ERROR, cserve2_message_handler,
client); client);

View File

@ -90,19 +90,12 @@ main(int argc, const char *argv[])
// Modify or add an entry to the hash with eina_hash_set // Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry // Let's first add a new entry
eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas", phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 01 234-56789")); strdup("+55 01 234-56789"));
if (!phone) if (!phone)
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for Raul Seixas. ");
if (!err) printf("Creating new entry.\n");
{
printf("No previous phone found for Raul Seixas. ");
printf("Creating new entry.\n");
}
else
printf("Error when setting phone for Raul Seixas\n");
} }
else else
{ {
@ -113,7 +106,6 @@ main(int argc, const char *argv[])
printf("\n"); printf("\n");
// Now change the phone number // Now change the phone number
eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas", phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 02 222-22222")); strdup("+55 02 222-22222"));
if (phone) if (phone)
@ -124,14 +116,8 @@ main(int argc, const char *argv[])
} }
else else
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for Raul Seixas. ");
if (err) printf("Creating new entry.\n");
printf("Error when changing phone for Raul Seixas\n");
else
{
printf("No previous phone found for Raul Seixas. ");
printf("Creating new entry.\n");
}
} }
// There are many ways to iterate over our Phone book. // There are many ways to iterate over our Phone book.

View File

@ -90,19 +90,12 @@ main(int argc, const char *argv[])
// Modify or add an entry to the hash with eina_hash_set // Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry // Let's first add a new entry
eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas", phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 01 234-56789")); strdup("+55 01 234-56789"));
if (!phone) if (!phone)
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for Raul Seixas. ");
if (!err) printf("Creating new entry.\n");
{
printf("No previous phone found for Raul Seixas. ");
printf("Creating new entry.\n");
}
else
printf("Error when setting phone for Raul Seixas\n");
} }
else else
{ {
@ -113,7 +106,6 @@ main(int argc, const char *argv[])
printf("\n"); printf("\n");
// Now change the phone number // Now change the phone number
eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas", phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 02 222-22222")); strdup("+55 02 222-22222"));
if (phone) if (phone)
@ -124,14 +116,8 @@ main(int argc, const char *argv[])
} }
else else
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for Raul Seixas. ");
if (err) printf("Creating new entry.\n");
printf("Error when changing phone for Raul Seixas\n");
else
{
printf("No previous phone found for Raul Seixas. ");
printf("Creating new entry.\n");
}
} }
// There are many ways to iterate over our Phone book. // There are many ways to iterate over our Phone book.

View File

@ -90,19 +90,12 @@ main(int argc, const char *argv[])
// Modify or add an entry to the hash with eina_hash_set // Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry // Let's first add a new entry
eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas", phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 01 234-56789")); strdup("+55 01 234-56789"));
if (!phone) if (!phone)
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for Raul Seixas. ");
if (!err) printf("Creating new entry.\n");
{
printf("No previous phone found for Raul Seixas. ");
printf("Creating new entry.\n");
}
else
printf("Error when setting phone for Raul Seixas\n");
} }
else else
{ {
@ -113,7 +106,6 @@ main(int argc, const char *argv[])
printf("\n"); printf("\n");
// Now change the phone number // Now change the phone number
eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas", phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 02 222-22222")); strdup("+55 02 222-22222"));
if (phone) if (phone)
@ -124,14 +116,8 @@ main(int argc, const char *argv[])
} }
else else
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for Raul Seixas. ");
if (err) printf("Creating new entry.\n");
printf("Error when changing phone for Raul Seixas\n");
else
{
printf("No previous phone found for Raul Seixas. ");
printf("Creating new entry.\n");
}
} }
// There are many ways to iterate over our Phone book. // There are many ways to iterate over our Phone book.

View File

@ -92,19 +92,12 @@ main(int argc, const char *argv[])
// Modify or add an entry to the hash with eina_hash_set // Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry // Let's first add a new entry
int32_t id5 = 5; int32_t id5 = 5;
eina_error_set(0);
phone = eina_hash_set(phone_book, &id5, phone = eina_hash_set(phone_book, &id5,
strdup("+55 01 234-56789")); strdup("+55 01 234-56789"));
if (!phone) if (!phone)
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for id5. ");
if (!err) printf("Creating new entry.\n");
{
printf("No previous phone found for id5. ");
printf("Creating new entry.\n");
}
else
printf("Error when setting phone for Raul Seixas\n");
} }
else else
{ {
@ -115,7 +108,6 @@ main(int argc, const char *argv[])
printf("\n"); printf("\n");
// Now change the phone number // Now change the phone number
eina_error_set(0);
phone = eina_hash_set(phone_book, &id5, phone = eina_hash_set(phone_book, &id5,
strdup("+55 02 222-22222")); strdup("+55 02 222-22222"));
if (phone) if (phone)
@ -126,14 +118,8 @@ main(int argc, const char *argv[])
} }
else else
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for id5. ");
if (err) printf("Creating new entry.\n");
printf("Error when changing phone for id5\n");
else
{
printf("No previous phone found for id5. ");
printf("Creating new entry.\n");
}
} }
// There are many ways to iterate over our Phone book. // There are many ways to iterate over our Phone book.

View File

@ -92,19 +92,12 @@ main(int argc, const char *argv[])
// Modify or add an entry to the hash with eina_hash_set // Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry // Let's first add a new entry
int64_t id5 = 5; int64_t id5 = 5;
eina_error_set(0);
phone = eina_hash_set(phone_book, &id5, phone = eina_hash_set(phone_book, &id5,
strdup("+55 01 234-56789")); strdup("+55 01 234-56789"));
if (!phone) if (!phone)
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for id5. ");
if (!err) printf("Creating new entry.\n");
{
printf("No previous phone found for id5. ");
printf("Creating new entry.\n");
}
else
printf("Error when setting phone for Raul Seixas\n");
} }
else else
{ {
@ -115,7 +108,6 @@ main(int argc, const char *argv[])
printf("\n"); printf("\n");
// Now change the phone number // Now change the phone number
eina_error_set(0);
phone = eina_hash_set(phone_book, &id5, phone = eina_hash_set(phone_book, &id5,
strdup("+55 02 222-22222")); strdup("+55 02 222-22222"));
if (phone) if (phone)
@ -126,14 +118,8 @@ main(int argc, const char *argv[])
} }
else else
{ {
Eina_Error err = eina_error_get(); printf("No previous phone found for id5. ");
if (err) printf("Creating new entry.\n");
printf("Error when changing phone for id5\n");
else
{
printf("No previous phone found for id5. ");
printf("Creating new entry.\n");
}
} }
// There are many ways to iterate over our Phone book. // There are many ways to iterate over our Phone book.

View File

@ -105,7 +105,6 @@ main(int argc, const char *argv[])
// Modify or add an entry to the hash with eina_hash_set // Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry // Let's first add a new entry
eina_error_set(0);
Phone_Entry *p1 = malloc(sizeof(*p1)); Phone_Entry *p1 = malloc(sizeof(*p1));
p1->name = "Raul Seixas"; p1->name = "Raul Seixas";
p1->number = "+55 01 234-56789"; p1->number = "+55 01 234-56789";
@ -113,14 +112,8 @@ main(int argc, const char *argv[])
strdup("raulzito")); strdup("raulzito"));
if (!nick) if (!nick)
{ {
Eina_Error err = eina_error_get(); printf("No previous nick found for Raul Seixas. ");
if (!err) printf("Creating new entry.\n");
{
printf("No previous nick found for Raul Seixas. ");
printf("Creating new entry.\n");
}
else
printf("Error when setting nick for Raul Seixas\n");
} }
else else
{ {
@ -131,7 +124,6 @@ main(int argc, const char *argv[])
printf("\n"); printf("\n");
// Now change the nick // Now change the nick
eina_error_set(0);
nick = eina_hash_set(phone_book, &p1, nick = eina_hash_set(phone_book, &p1,
strdup("raulzao")); strdup("raulzao"));
if (nick) if (nick)
@ -142,14 +134,8 @@ main(int argc, const char *argv[])
} }
else else
{ {
Eina_Error err = eina_error_get(); printf("No previous nick found for Raul Seixas. ");
if (err) printf("Creating new entry.\n");
printf("Error when changing nick for Raul Seixas\n");
else
{
printf("No previous nick found for Raul Seixas. ");
printf("Creating new entry.\n");
}
} }
// There are many ways to iterate over our Phone book. // There are many ways to iterate over our Phone book.

View File

@ -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; struct timezone v = *(struct timezone*)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v.tz_minuteswest; 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 */ other_mem = buf; /* required due &buf == buf */
return eina_value_type_pset(convert, convert_mem, &other_mem); return eina_value_type_pset(convert, convert_mem, &other_mem);
} }
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ /* 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); EINA_MAGIC_CHECK_ARRAY(array);
total = array->total + array->step; total = array->total + array->step;
eina_error_set(0);
tmp = realloc(array->data, sizeof (void *) * total); tmp = realloc(array->data, sizeof (void *) * total);
if (EINA_UNLIKELY(!tmp)) if (EINA_UNLIKELY(!tmp)) return 0;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return 0;
}
array->total = total; array->total = total;
array->data = tmp; array->data = tmp;
@ -266,13 +260,8 @@ eina_array_new(unsigned int step)
{ {
Eina_Array *array; Eina_Array *array;
eina_error_set(0);
array = malloc(sizeof (Eina_Array)); array = malloc(sizeof (Eina_Array));
if (!array) if (!array) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(array, EINA_MAGIC_ARRAY); 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; return EINA_TRUE;
} }
eina_error_set(0);
tmp = malloc(sizeof (void *) * array->total); tmp = malloc(sizeof (void *) * array->total);
if (!tmp) if (!tmp) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
memcpy(tmp, array->data, limit * sizeof(void *)); memcpy(tmp, array->data, limit * sizeof(void *));
total = limit; total = limit;
@ -438,13 +422,8 @@ eina_array_iterator_new(const Eina_Array *array)
EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
EINA_MAGIC_CHECK_ARRAY(array); EINA_MAGIC_CHECK_ARRAY(array);
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Array)); it = calloc(1, sizeof (Eina_Iterator_Array));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(it, EINA_MAGIC_ARRAY_ITERATOR); EINA_MAGIC_SET(it, EINA_MAGIC_ARRAY_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_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_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
EINA_MAGIC_CHECK_ARRAY(array); EINA_MAGIC_CHECK_ARRAY(array);
eina_error_set(0);
ac = calloc(1, sizeof (Eina_Accessor_Array)); ac = calloc(1, sizeof (Eina_Accessor_Array));
if (!ac) if (!ac) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(ac, EINA_MAGIC_ARRAY_ACCESSOR); EINA_MAGIC_SET(ac, EINA_MAGIC_ARRAY_ACCESSOR);
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR); EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);

View File

@ -253,8 +253,7 @@ struct _Eina_Array
* another element will increase the buffer by @p step elements again. * another element will increase the buffer by @p step elements again.
* *
* This function return a valid array on success, or @c NULL if memory * This function return a valid array on success, or @c NULL if memory
* allocation fails. In that case, the error is set * allocation fails.
* to #EINA_ERROR_OUT_OF_MEMORY.
*/ */
EAPI Eina_Array *eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT; 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. * 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 * 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, EAPI Eina_Bool eina_array_remove(Eina_Array * array,
Eina_Bool (*keep)(void *data, void *gdata), 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 * 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 * @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 * 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 * not be allocated, NULL is returned. Otherwise, a valid iterator is returned.
* set. 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; 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 * 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 * @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 * 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 * not be allocated, @c NULL is returned Otherwise, a valid accessor is
* set. Otherwise, a valid accessor is returned. * returned.
*/ */
EAPI Eina_Accessor *eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; EAPI Eina_Accessor *eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/** /**

View File

@ -142,13 +142,8 @@ eina_benchmark_new(const char *name, const char *run)
{ {
Eina_Benchmark *new; Eina_Benchmark *new;
eina_error_set(0);
new = calloc(1, sizeof (Eina_Benchmark)); new = calloc(1, sizeof (Eina_Benchmark));
if (!new) if (!new) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
new->name = name; new->name = name;
new->run = run; new->run = run;
@ -203,13 +198,8 @@ eina_benchmark_register(Eina_Benchmark *bench,
if (count_step == 0) if (count_step == 0)
return EINA_FALSE; return EINA_FALSE;
eina_error_set(0);
run = calloc(1, sizeof (Eina_Run)); run = calloc(1, sizeof (Eina_Run));
if (!run) if (!run) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
run->cb = bench_cb; run->cb = bench_cb;
run->name = name; run->name = name;

View File

@ -365,9 +365,8 @@ typedef void (*Eina_Benchmark_Specimens)(int request);
* to name the gnuplot file that eina_benchmark_run() will create. * to name the gnuplot file that eina_benchmark_run() will create.
* *
* This function return a valid benchmark on success, or @c NULL if * This function return a valid benchmark on success, or @c NULL if
* memory allocation fails. In that case, the error is set * memory allocation fails.
* to #EINA_ERROR_OUT_OF_MEMORY. *
*
* When the new module is not needed anymore, use * When the new module is not needed anymore, use
* eina_benchmark_free() to free the allocated memory. * 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 * 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. * bench_cb when eina_benchmark_run() is called.
* *
* If @p bench is @c NULL, this function returns immediately. If the * If @p bench is @c NULL, this function returns immediately.
* allocation of the memory of the test to add fails, the error is set * This function returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
* to #EINA_ERROR_OUT_OF_MEMORY. This function returns #EINA_FALSE
* on failure, #EINA_TRUE otherwise.
*/ */
EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench, EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
const char *name, const char *name,

View File

@ -39,8 +39,7 @@ typedef struct _Eina_Strbuf Eina_Binbuf;
* @return Newly allocated string buffer instance. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_binbuf_free().
* free the resources, use eina_binbuf_free().
* *
* @see eina_binbuf_free() * @see eina_binbuf_free()
* @see eina_binbuf_append() * @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. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_binbuf_free().
* free the resources, use eina_binbuf_free().
* *
* @see eina_binbuf_manage_new() * @see eina_binbuf_manage_new()
* @since 1.2.0 * @since 1.2.0

View File

@ -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_0X_NOT_FOUND = 0;
EAPI Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH = 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 * @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 * This function sets up the convert module of Eina. It is called by
* eina_init(). * 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() * @see eina_init()
*/ */
Eina_Bool Eina_Bool
@ -128,13 +117,6 @@ eina_convert_init(void)
EINA_LOG_ERR("Could not register log domain: eina_convert"); EINA_LOG_ERR("Could not register log domain: eina_convert");
return EINA_FALSE; 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; 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)) if (strncmp(str, "0x", 2))
{ {
eina_error_set(EINA_ERROR_CONVERT_0X_NOT_FOUND);
DBG("'0x' not found in '%s'", src); DBG("'0x' not found in '%s'", src);
return EINA_FALSE; return EINA_FALSE;
} }
@ -268,7 +249,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e)
/* Compute the exponent. */ /* Compute the exponent. */
if (*str != 'p') if (*str != 'p')
{ {
eina_error_set(EINA_ERROR_CONVERT_P_NOT_FOUND);
DBG("'p' not found in '%s'", src); DBG("'p' not found in '%s'", src);
return EINA_FALSE; return EINA_FALSE;
} }
@ -304,7 +284,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e)
return EINA_TRUE; return EINA_TRUE;
on_length_error: on_length_error:
eina_error_set(EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH);
return EINA_FALSE; return EINA_FALSE;
} }

View File

@ -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; 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; 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; 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 * The mantiss and exponent are stored in the buffers pointed
* respectively by @p m and @p e. * respectively by @p m and @p e.
* *
* If the string is invalid, the error is set to: * If the string is invalid #EINA_FALSE is returned, otherwise #EINA_TRUE is
*
* @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
* returned. * returned.
*/ */
EAPI Eina_Bool eina_convert_atod(const char *src, 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 * The mantiss and exponent are stored in the buffers pointed
* respectively by @p m and @p e. * respectively by @p m and @p e.
* *
* If the string is invalid, the error is set to: * If the string is invalid, #EINA_FALSE is returned,
*
* @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,
* otherwise @p fp is computed and #EINA_TRUE is returned. * otherwise @p fp is computed and #EINA_TRUE is returned.
* *
* @note The code uses eina_convert_atod() and do the correct bit * @note The code uses eina_convert_atod() and do the correct bit

View File

@ -28,7 +28,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_inlist.h" #include "eina_inlist.h"
#include "eina_error.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
#include "eina_safety_checks.h" #include "eina_safety_checks.h"
@ -70,9 +69,6 @@ struct _Eina_Clock
}; };
#ifdef _WIN32 #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; LARGE_INTEGER _eina_counter_frequency;
#endif #endif
@ -134,8 +130,7 @@ _eina_counter_asiprintf(char *base, int *position, const char *format, ...)
* eina_counter_init(). It is called by eina_init(). * eina_counter_init(). It is called by eina_init().
* *
* This function sets up the error module of Eina and only on Windows, * This function sets up the error module of Eina and only on Windows,
* it initializes the high precision timer. It also registers, only on * it initializes the high precision timer. It is also called
* Windows, the error #EINA_ERROR_COUNTER_WINDOWS. It is also called
* by eina_init(). It returns 0 on failure, otherwise it returns the * by eina_init(). It returns 0 on failure, otherwise it returns the
* number of times it has already been called. * number of times it has already been called.
* *
@ -145,14 +140,7 @@ Eina_Bool
eina_counter_init(void) eina_counter_init(void)
{ {
#ifdef _WIN32 #ifdef _WIN32
EINA_ERROR_COUNTER_WINDOWS = eina_error_msg_static_register( if (!QueryPerformanceFrequency(&_eina_counter_frequency)) return EINA_FALSE;
EINA_ERROR_COUNTER_WINDOWS_STR);
if (!QueryPerformanceFrequency(&_eina_counter_frequency))
{
eina_error_set(EINA_ERROR_COUNTER_WINDOWS);
return EINA_FALSE;
}
#endif /* _WIN2 */ #endif /* _WIN2 */
return EINA_TRUE; return EINA_TRUE;
} }
@ -187,14 +175,8 @@ eina_counter_new(const char *name)
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
length = strlen(name) + 1; length = strlen(name) + 1;
eina_error_set(0);
counter = calloc(1, sizeof (Eina_Counter) + length); counter = calloc(1, sizeof (Eina_Counter) + length);
if (!counter) if (!counter) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
counter->name = (char *)(counter + 1); counter->name = (char *)(counter + 1);
memcpy((char *)counter->name, name, length); memcpy((char *)counter->name, name, length);
@ -225,16 +207,10 @@ eina_counter_start(Eina_Counter *counter)
Eina_Nano_Time tp; Eina_Nano_Time tp;
EINA_SAFETY_ON_NULL_RETURN(counter); EINA_SAFETY_ON_NULL_RETURN(counter);
if (_eina_time_get(&tp) != 0) if (_eina_time_get(&tp) != 0) return;
return;
eina_error_set(0);
clk = calloc(1, sizeof (Eina_Clock)); clk = calloc(1, sizeof (Eina_Clock));
if (!clk) if (!clk) return;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return;
}
counter->clocks = eina_inlist_prepend(counter->clocks, EINA_INLIST_GET(clk)); counter->clocks = eina_inlist_prepend(counter->clocks, EINA_INLIST_GET(clk));

View File

@ -129,8 +129,7 @@ typedef struct _Eina_Counter Eina_Counter;
* *
* This function returns a new counter. It is characterized by @p * This function returns a new counter. It is characterized by @p
* name. If @p name is @c NULL, the function returns @c NULL * name. If @p name is @c NULL, the function returns @c NULL
* immediately. If memory allocation fails, @c NULL is returned and the * immediately. If memory allocation fails, @c NULL is returned.
* error is set to #EINA_ERROR_OUT_OF_MEMORY.
* *
* Whe the new counter is not needed anymore, use eina_counter_free() to * Whe the new counter is not needed anymore, use eina_counter_free() to
* free the allocated memory. * 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 * 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 * 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 * To stop the timing, eina_counter_stop() must be called with the
* same counter. * same counter.

View File

@ -33,7 +33,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_rbtree.h" #include "eina_rbtree.h"
#include "eina_error.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
#include "eina_safety_checks.h" #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_Element *new_hash_element = NULL;
Eina_Hash_Head *hash_head; Eina_Hash_Head *hash_head;
Eina_Error error = 0;
int original_key; int original_key;
int hash_num; 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_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
EINA_MAGIC_CHECK_HASH(hash); EINA_MAGIC_CHECK_HASH(hash);
error = EINA_ERROR_OUT_OF_MEMORY;
/* Apply eina mask to hash. */ /* Apply eina mask to hash. */
original_key = key_hash; original_key = key_hash;
hash_num = key_hash & hash->mask; hash_num = key_hash & hash->mask;
@ -299,7 +295,6 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash,
return EINA_TRUE; return EINA_TRUE;
on_error: on_error:
eina_error_set(error);
return EINA_FALSE; return EINA_FALSE;
} }
@ -729,7 +724,6 @@ eina_hash_new(Eina_Key_Length key_length_cb,
/* FIXME: Use mempool. */ /* FIXME: Use mempool. */
Eina_Hash *new; Eina_Hash *new;
eina_error_set(0);
EINA_SAFETY_ON_NULL_RETURN_VAL(key_cmp_cb, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(key_cmp_cb, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key_hash_cb, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(key_hash_cb, NULL);
EINA_SAFETY_ON_TRUE_RETURN_VAL(buckets_power_size <= 2, 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; return new;
on_error: on_error:
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL; return NULL;
} }
@ -1234,13 +1227,8 @@ eina_hash_iterator_data_new(const Eina_Hash *hash)
EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
EINA_MAGIC_CHECK_HASH(hash); EINA_MAGIC_CHECK_HASH(hash);
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Hash)); it = calloc(1, sizeof (Eina_Iterator_Hash));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
it->hash = hash; it->hash = hash;
it->get_content = FUNC_ITERATOR_GET_CONTENT(_eina_hash_iterator_data_get_content); 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_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
EINA_MAGIC_CHECK_HASH(hash); EINA_MAGIC_CHECK_HASH(hash);
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Hash)); it = calloc(1, sizeof (Eina_Iterator_Hash));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
it->hash = hash; it->hash = hash;
it->get_content = FUNC_ITERATOR_GET_CONTENT( 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_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
EINA_MAGIC_CHECK_HASH(hash); EINA_MAGIC_CHECK_HASH(hash);
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Hash)); it = calloc(1, sizeof (Eina_Iterator_Hash));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
it->hash = hash; it->hash = hash;
it->get_content = FUNC_ITERATOR_GET_CONTENT( it->get_content = FUNC_ITERATOR_GET_CONTENT(

View File

@ -330,8 +330,8 @@ typedef Eina_Bool (*Eina_Hash_Foreach)(const Eina_Hash *hash, const void *key
* @return The new hash table. * @return The new hash table.
* *
* This function creates a new hash table using user-defined callbacks * This function creates a new hash table using user-defined callbacks
* to manage the hash table. On failure, @c NULL is returned * 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 * If @p key_cmp_cb or @p key_hash_cb
* are @c NULL, @c NULL is returned. If @p buckets_power_size is * 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, * smaller or equal than 2, or if it is greater or equal than 17,
* @c NULL is returned. * @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 * values as unique. Failure to use sufficient uniqueness will
* result in unexpected results when inserting data pointers accessed * result in unexpected results when inserting data pointers accessed
* with eina_hash_find(), and removed with eina_hash_del(). Key * with eina_hash_find(), and removed with eina_hash_del(). Key
* strings are case sensitive. If an error occurs, eina_error_get() * strings are case sensitive. This function returns #EINA_FALSE if an error
* should be used to determine if an allocation error occurred during
* this function. This function returns #EINA_FALSE if an error
* occurred, #EINA_TRUE otherwise. * occurred, #EINA_TRUE otherwise.
*/ */
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash, 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 * 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 * 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 * constant or stored elsewhere ( in the object being added). Key
* strings are case sensitive. If an error occurs, eina_error_get() * strings are case sensitive. This function returns #EINA_FALSE if an error
* should be used to determine if an allocation error occurred during
* this function. This function returns #EINA_FALSE if an error
* occurred, #EINA_TRUE otherwise. * occurred, #EINA_TRUE otherwise.
*/ */
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash, 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 * 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 * 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, * key @p key. On success this function returns the old entry,
* otherwise it returns @c NULL. To check for errors, use * otherwise it returns @c NULL.
* eina_error_get().
*/ */
EAPI void *eina_hash_set(Eina_Hash *hash, EAPI void *eina_hash_set(Eina_Hash *hash,
const void *key, 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 * 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_length. @p key_hash is expected to always match
* @p key. Otherwise, one cannot be sure to find it again with @ref * @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 * eina_hash_find_by_hash. Key strings are case sensitive. This function
* 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 occurred, #EINA_TRUE otherwise. * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
* *
* @see eina_hash_add() * @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 * 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_length. @p key_hash is expected to always match
* @p key. Otherwise, one cannot be sure to find it again with @ref * @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 * eina_hash_find_by_hash. Key strings are case sensitive. This function
* 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 occurred, #EINA_TRUE otherwise. * returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
* *
* @see eina_hash_direct_add() * @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 * valid iterator that will always return false on
* eina_iterator_next(), thus keeping API sane. * eina_iterator_next(), thus keeping API sane.
* *
* If the memory can not be allocated, NULL is returned * If the memory can not be allocated, NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @warning if the hash structure changes then the iterator becomes * @warning if the hash structure changes then the iterator becomes
* invalid! That is, if you add or remove items this iterator * 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 * valid iterator that will always return false on
* eina_iterator_next(), thus keeping API sane. * eina_iterator_next(), thus keeping API sane.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @warning if the hash structure changes then the iterator becomes * @warning if the hash structure changes then the iterator becomes
* invalid. That is, if you add or remove items this iterator behavior * 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 * valid iterator that will always return false on
* eina_iterator_next(), thus keeping API sane. * eina_iterator_next(), thus keeping API sane.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @note iterator data will provide values as Eina_Hash_Tuple that should not * @note iterator data will provide values as Eina_Hash_Tuple that should not
* be modified! * be modified!

View File

@ -25,7 +25,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ /* 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); \ EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY); \
return __VA_ARGS__; \ return __VA_ARGS__; \
} \ } \
eina_error_set(0); \
} \ } \
while(0) while(0)
@ -94,7 +92,6 @@ static int _eina_inarray_log_dom = -1;
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ITERATOR); \ EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ITERATOR); \
return __VA_ARGS__; \ return __VA_ARGS__; \
} \ } \
eina_error_set(0); \
} \ } \
while(0) while(0)
@ -106,7 +103,6 @@ static int _eina_inarray_log_dom = -1;
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ACCESSOR); \ EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ACCESSOR); \
return __VA_ARGS__; \ return __VA_ARGS__; \
} \ } \
eina_error_set(0); \
} \ } \
while(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; new_max = ((new_size / array->step) + 1) * array->step;
tmp = realloc(array->members, new_max * array->member_size); tmp = realloc(array->members, new_max * array->member_size);
if ((!tmp) && (new_max > 0)) if ((!tmp) && (new_max > 0)) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
array->members = tmp; array->members = tmp;
array->max = new_max; 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); EINA_SAFETY_ON_TRUE_RETURN_VAL(member_size == 0, NULL);
ret = malloc(sizeof(*ret)); ret = malloc(sizeof(*ret));
if (!ret) if (!ret) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
eina_error_set(0);
_eina_inarray_setup(ret, member_size, step); _eina_inarray_setup(ret, member_size, step);
return ret; return ret;
} }
@ -730,13 +717,8 @@ eina_inarray_iterator_new(const Eina_Inarray *array)
EINA_MAGIC_CHECK_INARRAY(array, NULL); EINA_MAGIC_CHECK_INARRAY(array, NULL);
eina_error_set(0);
it = calloc(1, sizeof(Eina_Iterator_Inarray)); it = calloc(1, sizeof(Eina_Iterator_Inarray));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR); EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_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_MAGIC_CHECK_INARRAY(array, NULL);
eina_error_set(0);
it = calloc(1, sizeof(Eina_Iterator_Inarray)); it = calloc(1, sizeof(Eina_Iterator_Inarray));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR); EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_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_MAGIC_CHECK_INARRAY(array, NULL);
eina_error_set(0);
ac = calloc(1, sizeof(Eina_Accessor_Inarray)); ac = calloc(1, sizeof(Eina_Accessor_Inarray));
if (!ac) if (!ac) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(ac, EINA_MAGIC_INARRAY_ACCESSOR); EINA_MAGIC_SET(ac, EINA_MAGIC_INARRAY_ACCESSOR);
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR); EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);

View File

@ -224,8 +224,8 @@ struct _Eina_Inarray
* *
* If the @a step is 0, then a safe default is chosen. * 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 * On failure, @c NULL is returned. If @a member_size is zero, then @c NULL
* set. If @a member_size is zero, then @c NULL is returned. * is returned.
* *
* @see eina_inarray_free() * @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 * This function returns a newly allocated iterator associated to
* @p array. * @p array.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @warning if the array structure changes then the iterator becomes * @warning if the array structure changes then the iterator becomes
* invalid! That is, if you add or remove members this * 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. * Unlike eina_inarray_iterator_new(), this will walk the array backwards.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @warning if the array structure changes then the iterator becomes * @warning if the array structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator * 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 * This function returns a newly allocated accessor associated to
* @p array. * @p array.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid accessor is * Otherwise, a valid accessor is returned.
* returned.
* *
* @since 1.2 * @since 1.2
*/ */

View File

@ -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 * 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 * invalid, the program may crash. If @p data is @c NULL, or if an
* allocation is necessary and fails, #EINA_FALSE is returned * allocation is necessary and fails, #EINA_FALSE is returned
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, #EINA_TRUE is * Otherwise, #EINA_TRUE is returned.
* returned.
*/ */
static inline Eina_Bool static inline Eina_Bool

View File

@ -64,8 +64,6 @@ EAPI extern const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END;
{ \ { \
if (type->method) \ if (type->method) \
type->method(type, ##__VA_ARGS__); \ type->method(type, ##__VA_ARGS__); \
else \
eina_error_set(no_method_err); \
} \ } \
while (0) while (0)
@ -74,7 +72,6 @@ EAPI extern const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END;
{ \ { \
if (type->method) \ if (type->method) \
return type->method(type, ##__VA_ARGS__); \ return type->method(type, ##__VA_ARGS__); \
eina_error_set(no_method_err); \
return def_ret; \ return def_ret; \
} \ } \
while (0) while (0)
@ -126,12 +123,11 @@ eina_value_setup(Eina_Value *value, const Eina_Value_Type *type)
if (EINA_VALUE_TYPE_DEFAULT(type)) if (EINA_VALUE_TYPE_DEFAULT(type))
{ {
eina_error_set(0);
return EINA_TRUE; return EINA_TRUE;
} }
EINA_VALUE_TYPE_DISPATCH_RETURN(type, setup, EINA_VALUE_TYPE_DISPATCH_RETURN(type, setup,
EINA_ERROR_VALUE_FAILED, EINA_FALSE, mem); 0, EINA_FALSE, mem);
} }
static inline void static inline void
@ -157,11 +153,10 @@ eina_value_flush(Eina_Value *value)
} }
else if (type->value_size > 8) else if (type->value_size > 8)
eina_value_inner_free(type->value_size, mem); eina_value_inner_free(type->value_size, mem);
eina_error_set(0);
return; 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) if (type->value_size > 8)
eina_value_inner_free(type->value_size, mem); eina_value_inner_free(type->value_size, mem);
value->type = NULL; 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_NULL_RETURN_VAL(b, -1);
EINA_SAFETY_ON_FALSE_RETURN_VAL(a->type == b->type, -1); EINA_SAFETY_ON_FALSE_RETURN_VAL(a->type == b->type, -1);
eina_error_set(0);
type = a->type; type = a->type;
pa = eina_value_memory_get(a); pa = eina_value_memory_get(a);
pb = eina_value_memory_get(b); pb = eina_value_memory_get(b);
@ -306,7 +300,7 @@ eina_value_compare(const Eina_Value *a, const Eina_Value *b)
} }
#endif #endif
EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, EINA_ERROR_VALUE_FAILED, EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, 0,
EINA_FALSE, pa, pb); EINA_FALSE, pa, pb);
} }
@ -342,7 +336,6 @@ eina_value_vset(Eina_Value *value, va_list args)
type = value->type; type = value->type;
mem = eina_value_memory_get(value); mem = eina_value_memory_get(value);
eina_error_set(0);
#ifndef EINA_VALUE_NO_OPTIMIZE #ifndef EINA_VALUE_NO_OPTIMIZE
if (type == EINA_VALUE_TYPE_UCHAR) if (type == EINA_VALUE_TYPE_UCHAR)
{ {
@ -433,11 +426,7 @@ eina_value_vset(Eina_Value *value, va_list args)
else else
{ {
char *tmp = strdup(str); char *tmp = strdup(str);
if (!tmp) if (!tmp) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
free(value->value.ptr); free(value->value.ptr);
value->value.ptr = tmp; value->value.ptr = tmp;
} }
@ -445,7 +434,7 @@ eina_value_vset(Eina_Value *value, va_list args)
} }
#endif #endif
EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, EINA_ERROR_VALUE_FAILED, EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, 0,
EINA_FALSE, mem, args); EINA_FALSE, mem, args);
} }
@ -461,14 +450,13 @@ eina_value_vget(const Eina_Value *value, va_list args)
type = value->type; type = value->type;
mem = eina_value_memory_get(value); mem = eina_value_memory_get(value);
ptr = va_arg(args, void *); ptr = va_arg(args, void *);
eina_error_set(0);
if (EINA_VALUE_TYPE_DEFAULT(type)) if (EINA_VALUE_TYPE_DEFAULT(type))
{ {
memcpy(ptr, mem, type->value_size); memcpy(ptr, mem, type->value_size);
return EINA_TRUE; 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); EINA_FALSE, mem, ptr);
} }
@ -483,7 +471,6 @@ eina_value_pset(Eina_Value *value, const void *ptr)
type = value->type; type = value->type;
mem = eina_value_memory_get(value); mem = eina_value_memory_get(value);
eina_error_set(0);
if (EINA_VALUE_TYPE_DEFAULT(type)) if (EINA_VALUE_TYPE_DEFAULT(type))
{ {
@ -506,11 +493,7 @@ eina_value_pset(Eina_Value *value, const void *ptr)
else else
{ {
char *tmp = strdup(str); char *tmp = strdup(str);
if (!tmp) if (!tmp) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
free(value->value.ptr); free(value->value.ptr);
value->value.ptr = tmp; value->value.ptr = tmp;
} }
@ -521,7 +504,7 @@ eina_value_pset(Eina_Value *value, const void *ptr)
return EINA_TRUE; 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); EINA_FALSE, mem, ptr);
} }
@ -536,14 +519,13 @@ eina_value_pget(const Eina_Value *value, void *ptr)
type = value->type; type = value->type;
mem = eina_value_memory_get(value); mem = eina_value_memory_get(value);
eina_error_set(0);
if (EINA_VALUE_TYPE_DEFAULT(type)) if (EINA_VALUE_TYPE_DEFAULT(type))
{ {
memcpy(ptr, mem, type->value_size); memcpy(ptr, mem, type->value_size);
return EINA_TRUE; 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); EINA_FALSE, mem, ptr);
} }
@ -1281,11 +1263,7 @@ eina_value_hash_vset(Eina_Value *value, const char *key, va_list args)
if (!mem) if (!mem)
{ {
mem = malloc(desc->subtype->value_size); mem = malloc(desc->subtype->value_size);
if (!mem) if (!mem) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
if (!eina_hash_add(desc->hash, key, mem)) if (!eina_hash_add(desc->hash, key, mem))
{ {
free(mem); free(mem);
@ -1364,11 +1342,7 @@ eina_value_hash_pset(Eina_Value *value, const char *key, const void *ptr)
if (!mem) if (!mem)
{ {
mem = malloc(desc->subtype->value_size); mem = malloc(desc->subtype->value_size);
if (!mem) if (!mem) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
if (!eina_hash_add(desc->hash, key, mem)) if (!eina_hash_add(desc->hash, key, mem))
{ {
free(mem); free(mem);
@ -1678,11 +1652,7 @@ static inline Eina_Bool
eina_value_type_setup(const Eina_Value_Type *type, void *mem) eina_value_type_setup(const Eina_Value_Type *type, void *mem)
{ {
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->setup) if (!type->setup) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->setup(type, mem); 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_value_type_flush(const Eina_Value_Type *type, void *mem)
{ {
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->flush) if (!type->flush) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->flush(type, mem); 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_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); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->copy) if (!type->copy) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->copy(type, src, dst); 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_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); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->compare) if (!type->compare) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->compare(type, a, b); 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_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); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->convert_to) if (!type->convert_to) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->convert_to(type, convert, type_mem, convert_mem); 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_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); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->convert_from) if (!type->convert_from) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->convert_from(type, convert, type_mem, convert_mem); 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_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); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->vset) if (!type->vset) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->vset(type, mem, args); 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_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); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->pset) if (!type->pset) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->pset(type, mem, ptr); 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_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); EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
if (!type->pget) if (!type->pget) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return type->pget(type, mem, ptr); return type->pget(type, mem, ptr);
} }

View File

@ -27,7 +27,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ /* 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); EINA_SAFETY_ON_NULL_RETURN_VAL(item, list);
if (EINA_UNLIKELY((item != list) && (!item->prev) && (!item->next))) 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); EINA_LOG_ERR("safety check failed: item %p does not appear to be part of an inlist!", item);
return list; return list;
} }
@ -870,13 +868,8 @@ eina_inlist_iterator_new(const Eina_Inlist *list)
{ {
Eina_Iterator_Inlist *it; Eina_Iterator_Inlist *it;
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Inlist)); it = calloc(1, sizeof (Eina_Iterator_Inlist));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
it->head = list; it->head = list;
it->current = list; it->current = list;
@ -897,13 +890,8 @@ eina_inlist_accessor_new(const Eina_Inlist *list)
{ {
Eina_Accessor_Inlist *ac; Eina_Accessor_Inlist *ac;
eina_error_set(0);
ac = calloc(1, sizeof (Eina_Accessor_Inlist)); ac = calloc(1, sizeof (Eina_Accessor_Inlist));
if (!ac) if (!ac) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
ac->head = list; ac->head = list;
ac->current = list; ac->current = list;

View File

@ -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 * will always return false on eina_iterator_next(), thus keeping API
* sane. * sane.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator * Otherwise, a valid iterator is returned.
* is returned.
* *
* @warning if the list structure changes then the iterator becomes * @warning if the list structure changes then the iterator becomes
* invalid, and if you add or remove nodes iterator * 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 * 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 * @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 * 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 * not be allocated, @c NULL is returned and Otherwise, a valid accessor is
* set. Otherwise, a valid accessor is returned. * returned.
*/ */
EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MALLOC EINA_WARN_UNUSED_RESULT; 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 * 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 * is returned. On success, a new list pointer that should be
* used in place of the one given to this function is * 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 * @note O(log2(n)) comparisons (calls to @p func) average/worst case
* performance. As said in eina_list_search_sorted_near_list(), * 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 * list with an updated state.. If @p list is @c NULLL, item
* is returned. On success, a new list pointer that should be * is returned. On success, a new list pointer that should be
* used in place of the one given to this function is * 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 * @note O(log2(n)) comparisons (calls to @p func) average/worst case
* performance. As said in eina_list_search_sorted_near_list(), * performance. As said in eina_list_search_sorted_near_list(),

View File

@ -68,7 +68,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
#include "eina_mempool.h" #include "eina_mempool.h"
@ -532,10 +531,8 @@ eina_list_append(Eina_List *list, const void *data)
{ {
Eina_List *l, *new_l; Eina_List *l, *new_l;
eina_error_set(0);
new_l = _eina_list_mempool_list_new(list); new_l = _eina_list_mempool_list_new(list);
if (!new_l) if (!new_l) return list;
return list;
new_l->next = NULL; new_l->next = NULL;
new_l->data = (void *)data; new_l->data = (void *)data;
@ -562,10 +559,8 @@ eina_list_prepend(Eina_List *list, const void *data)
{ {
Eina_List *new_l; Eina_List *new_l;
eina_error_set(0);
new_l = _eina_list_mempool_list_new(list); new_l = _eina_list_mempool_list_new(list);
if (!new_l) if (!new_l) return list;
return list;
new_l->prev = NULL; new_l->prev = NULL;
new_l->next = list; new_l->next = list;
@ -613,10 +608,8 @@ eina_list_append_relative_list(Eina_List *list,
if ((!list) || (!relative)) if ((!list) || (!relative))
return eina_list_append(list, data); return eina_list_append(list, data);
eina_error_set(0);
new_l = _eina_list_mempool_list_new(list); new_l = _eina_list_mempool_list_new(list);
if (!new_l) if (!new_l) return list;
return list;
EINA_MAGIC_CHECK_LIST(relative, NULL); EINA_MAGIC_CHECK_LIST(relative, NULL);
new_l->next = relative->next; new_l->next = relative->next;
@ -665,10 +658,8 @@ eina_list_prepend_relative_list(Eina_List *list,
if ((!list) || (!relative)) if ((!list) || (!relative))
return eina_list_prepend(list, data); return eina_list_prepend(list, data);
eina_error_set(0);
new_l = _eina_list_mempool_list_new(list); new_l = _eina_list_mempool_list_new(list);
if (!new_l) if (!new_l) return list;
return list;
EINA_MAGIC_CHECK_LIST(relative, NULL); EINA_MAGIC_CHECK_LIST(relative, NULL);
@ -1493,13 +1484,8 @@ eina_list_iterator_new(const Eina_List *list)
{ {
Eina_Iterator_List *it; Eina_Iterator_List *it;
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_List)); it = calloc(1, sizeof (Eina_Iterator_List));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR); EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_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_Iterator_List *it;
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_List)); it = calloc(1, sizeof (Eina_Iterator_List));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR); EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_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_SAFETY_ON_NULL_RETURN_VAL(list, NULL);
eina_error_set(0);
ac = calloc(1, sizeof (Eina_Accessor_List)); ac = calloc(1, sizeof (Eina_Accessor_List));
if (!ac) if (!ac) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(ac, EINA_MAGIC_LIST_ACCESSOR); EINA_MAGIC_SET(ac, EINA_MAGIC_LIST_ACCESSOR);
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR); EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);

View File

@ -361,11 +361,6 @@ struct _Eina_List_Accounting
* extern void *my_data; * extern void *my_data;
* *
* list = eina_list_append(list, 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 * @endcode
* *
* @warning @p list must be a pointer to the first element of the list(or NULL). * @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; * extern void *my_data;
* *
* list = eina_list_prepend(list, 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 * @endcode
* *
* @warning @p list must be a pointer to the first element of the list. * @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; * extern void *relative_member;
* *
* list = eina_list_append(list, 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); * 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 * @endcode
* *
* @warning @p list must be a pointer to the first element of the list. * @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; * extern void *relative_member;
* *
* list = eina_list_append(list, 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); * 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 * @endcode
* *
* @warning @p list must be a pointer to the first element of the list. * @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 * 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 * list is returned. On success, a new list pointer that should be
* used in place of the one given to this function is * 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 * @note O(log2(n)) comparisons (calls to @p func) average/worst case
* performance as it uses eina_list_search_sorted_near_list() and thus * 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 * will always return false on eina_iterator_next(), thus keeping API
* sane. * sane.
* *
* If the memory can not be allocated, NULL is returned * If the memory can not be allocated, NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator * Otherwise, a valid iterator is returned.
* is returned.
* *
* @warning @p list must be a pointer to the first element of the list. * @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. * Unlike eina_list_iterator_new(), this will walk the list backwards.
* *
* If the memory can not be allocated, NULL is returned * If the memory can not be allocated, NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator * Otherwise, a valid iterator is returned.
* is returned.
* *
* @warning @p list must be a pointer to the first element of the list. * @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 * 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 * @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 * 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 * not be allocated, @c NULL is returned Otherwise, a valid accessor is
* set. Otherwise, a valid accessor is returned. * returned.
* *
* @warning @p list must be a pointer to the first element of the list. * @warning @p list must be a pointer to the first element of the list.
*/ */

View File

@ -129,7 +129,6 @@ static inline void eina_spinlock_free(Eina_Spinlock *spinlock);
do { \ do { \
if (EINA_UNLIKELY(!eina_main_loop_is())) \ if (EINA_UNLIKELY(!eina_main_loop_is())) \
{ \ { \
eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \
EINA_LOG_ERR("You are calling %s from outside" \ EINA_LOG_ERR("You are calling %s from outside" \
"of the main loop threads in %s at line %i", \ "of the main loop threads in %s at line %i", \
__FUNCTION__, \ __FUNCTION__, \
@ -142,7 +141,6 @@ static inline void eina_spinlock_free(Eina_Spinlock *spinlock);
do { \ do { \
if (EINA_UNLIKELY(!eina_main_loop_is())) \ if (EINA_UNLIKELY(!eina_main_loop_is())) \
{ \ { \
eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \
EINA_LOG_ERR("You are calling %s from outside" \ EINA_LOG_ERR("You are calling %s from outside" \
"of the main loop threads in %s at line %i", \ "of the main loop threads in %s at line %i", \
__FUNCTION__, \ __FUNCTION__, \

View File

@ -29,7 +29,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ /* 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; EAPI Eina_Error EINA_ERROR_MAGIC_FAILED = 0;
static const char EINA_ERROR_MAGIC_FAILED_STR[] = "Magic check failed.";
/** /**
* @internal * @internal
* @brief Initialize the magic string module. * @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"); EINA_LOG_ERR("Could not register log domain: eina_magic_string");
return EINA_FALSE; return EINA_FALSE;
} }
EINA_ERROR_MAGIC_FAILED = eina_error_msg_static_register(
EINA_ERROR_MAGIC_FAILED_STR);
return EINA_TRUE; return EINA_TRUE;
} }
@ -272,7 +266,6 @@ eina_magic_fail(void *d,
const char *fnc, const char *fnc,
int line) int line)
{ {
eina_error_set(EINA_ERROR_MAGIC_FAILED);
if (!d) if (!d)
eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR, eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR,
file, fnc, line, file, fnc, line,

View File

@ -201,13 +201,8 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
*/ */
#define EINA_MAGIC_NONE 0x1234fedc #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; EAPI extern Eina_Error EINA_ERROR_MAGIC_FAILED;
#ifdef EINA_MAGIC_DEBUG #ifdef EINA_MAGIC_DEBUG
/** /**

View File

@ -102,8 +102,6 @@ EAPI Eina_Bool _eina_threads_activated = EINA_FALSE;
EAPI Eina_Error EINA_ERROR_NOT_MAIN_LOOP = 0; EAPI Eina_Error EINA_ERROR_NOT_MAIN_LOOP = 0;
EAPI unsigned int eina_seed = 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 EFL_HAVE_THREADS
# ifdef _WIN32 # ifdef _WIN32
EAPI DWORD _eina_main_loop; EAPI DWORD _eina_main_loop;
@ -279,9 +277,6 @@ eina_init(void)
return 0; return 0;
} }
EINA_ERROR_NOT_MAIN_LOOP = eina_error_msg_static_register(
EINA_ERROR_NOT_MAIN_LOOP_STR);
#ifdef EFL_HAVE_THREADS #ifdef EFL_HAVE_THREADS
# ifdef _WIN32 # ifdef _WIN32
_eina_main_loop = GetCurrentThreadId(); _eina_main_loop = GetCurrentThreadId();

View File

@ -39,7 +39,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
#include "eina_magic.h" #include "eina_magic.h"
#include "eina_mempool.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); EINA_SAFETY_ON_FALSE_RETURN_VAL(cols > 0, NULL);
m = malloc(sizeof(Eina_Matrixsparse)); m = malloc(sizeof(Eina_Matrixsparse));
if (!m) if (!m) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(m, EINA_MAGIC_MATRIXSPARSE); 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.func = free_func;
m->free.user_data = (void *)user_data; m->free.user_data = (void *)user_data;
eina_error_set(0);
return m; return m;
} }
@ -1364,11 +1358,7 @@ eina_matrixsparse_iterator_new(const Eina_Matrixsparse *m)
Eina_Matrixsparse_Iterator *it; Eina_Matrixsparse_Iterator *it;
it = calloc(1, sizeof(*it)); it = calloc(1, sizeof(*it));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR); EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_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; Eina_Matrixsparse_Iterator_Complete *it;
it = calloc(1, sizeof(*it)); it = calloc(1, sizeof(*it));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR); EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);

View File

@ -87,8 +87,7 @@ typedef struct _Eina_Matrixsparse_Cell Eina_Matrixsparse_Cell;
* eina_matrixsparse_cell_idx_clear() and possible others. * eina_matrixsparse_cell_idx_clear() and possible others.
* @param user_data given to @a free_func as first parameter. * @param user_data given to @a free_func as first parameter.
* *
* @return Newly allocated matrix or @c NULL if allocation failed and eina_error * @return Newly allocated matrix or @c NULL if allocation failed.
* is set.
*/ */
EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows, EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows,
unsigned long cols, unsigned long cols,

View File

@ -68,9 +68,6 @@ _new_va(const char *name,
Eina_Mempool_Backend *be = NULL; Eina_Mempool_Backend *be = NULL;
Eina_Mempool *mp; Eina_Mempool *mp;
Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE;
eina_error_set(0);
if (getenv("EINA_MEMPOOL_PASS")) if (getenv("EINA_MEMPOOL_PASS"))
{ {
be = eina_hash_find(_backends, "pass_through"); be = eina_hash_find(_backends, "pass_through");
@ -79,10 +76,8 @@ _new_va(const char *name,
else be = eina_hash_find(_backends, name); else be = eina_hash_find(_backends, name);
if ((!be) || (!be->init)) goto on_error; if ((!be) || (!be->init)) goto on_error;
err = EINA_ERROR_OUT_OF_MEMORY;
mp = calloc(1, sizeof(Eina_Mempool)); mp = calloc(1, sizeof(Eina_Mempool));
if (!mp) if (!mp) goto on_error;
goto on_error;
/* Work around ABI incompability introduced in Eina 1.1 */ /* Work around ABI incompability introduced in Eina 1.1 */
#define SBP(Property) mp->backend.Property = be->Property; #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); mp->backend_data = mp->backend.init(context, options, args);
return mp; return mp;
on_error: on_error:
eina_error_set(err);
return NULL; return NULL;
} }
@ -143,9 +136,6 @@ void pass_through_shutdown(void);
EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0; EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0;
static const char EINA_ERROR_NOT_MEMPOOL_MODULE_STR[] =
"Not a memory pool module.";
/** /**
* @endcond * @endcond
*/ */
@ -179,8 +169,6 @@ eina_mempool_init(void)
return 0; 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); _backends = eina_hash_string_superfast_new(NULL);
/* dynamic backends */ /* dynamic backends */

View File

@ -27,7 +27,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_alloca.h" #include "eina_alloca.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
#include "eina_mempool.h" #include "eina_mempool.h"
#include "eina_lock.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; 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); 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); *cmp = eina_value_compare(&atmp, &btmp);
if (eina_error_get() != 0) if (*cmp == -2)
{ {
char *astr = eina_value_to_string(&atmp); char *astr = eina_value_to_string(&atmp);
char *bstr = eina_value_to_string(&btmp); 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); *cmp = eina_model_compare(achild, bchild);
if (eina_error_get()) if (*cmp == -2)
{ {
ERR("Could not compare children #%d %p (%s) and %p (%s) " ERR("Could not compare children #%d %p (%s) and %p (%s) "
"from models %p (%s) and %p (%s)", i, "from models %p (%s) and %p (%s)", i,
@ -3035,11 +3030,6 @@ eina_model_init(void)
goto on_init_fail_lock_debug; 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_BASE = &_EINA_MODEL_TYPE_BASE;
EINA_MODEL_TYPE_MIXIN = &_EINA_MODEL_TYPE_MIXIN; EINA_MODEL_TYPE_MIXIN = &_EINA_MODEL_TYPE_MIXIN;
EINA_MODEL_TYPE_GENERIC = &_EINA_MODEL_TYPE_GENERIC; 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, ...) \ #define EINA_MODEL_TYPE_CALL_OPTIONAL_RETURN(model, method, def_retval, ...) \
do \ do \
{ \ { \
eina_error_set(0); \
if (model->desc->ops.type.method) \ if (model->desc->ops.type.method) \
return model->desc->ops.type.method(model, ## __VA_ARGS__); \ return model->desc->ops.type.method(model, ## __VA_ARGS__); \
DBG("Optional method" # method "() not implemented for model %p (%s)", \ 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, ...) \ #define EINA_MODEL_TYPE_CALL_OPTIONAL(model, method, ...) \
do \ do \
{ \ { \
eina_error_set(0); \
if (model->desc->ops.type.method) \ if (model->desc->ops.type.method) \
model->desc->ops.type.method(model, ## __VA_ARGS__); \ model->desc->ops.type.method(model, ## __VA_ARGS__); \
else \ else \
@ -3454,10 +3442,8 @@ _eina_model_unref(Eina_Model *model)
#define EINA_MODEL_TYPE_CALL_MANDATORY_RETURN(model, method, def_retval, ...) \ #define EINA_MODEL_TYPE_CALL_MANDATORY_RETURN(model, method, def_retval, ...) \
do \ do \
{ \ { \
eina_error_set(0); \
if (model->desc->ops.type.method) \ if (model->desc->ops.type.method) \
return model->desc->ops.type.method(model, ## __VA_ARGS__); \ 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)", \ CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \ model, model->desc->cache.types[0]->name); \
return def_retval; \ return def_retval; \
@ -3467,12 +3453,10 @@ _eina_model_unref(Eina_Model *model)
#define EINA_MODEL_TYPE_CALL_MANDATORY(model, method, ...) \ #define EINA_MODEL_TYPE_CALL_MANDATORY(model, method, ...) \
do \ do \
{ \ { \
eina_error_set(0); \
if (model->desc->ops.type.method) \ if (model->desc->ops.type.method) \
model->desc->ops.type.method(model, ## __VA_ARGS__); \ model->desc->ops.type.method(model, ## __VA_ARGS__); \
else \ else \
{ \ { \
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \ CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \ 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, ...) \ #define EINA_MODEL_TYPE_CALL_RETURN(model, method, def_retval, ...) \
do \ do \
{ \ { \
eina_error_set(0); \
if (model->desc->ops.type.method) \ if (model->desc->ops.type.method) \
return model->desc->ops.type.method(model, ## __VA_ARGS__); \ 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)", \ ERR("Method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \ model, model->desc->cache.types[0]->name); \
return def_retval; \ return def_retval; \
@ -3496,12 +3478,10 @@ _eina_model_unref(Eina_Model *model)
#define EINA_MODEL_TYPE_CALL(model, method, ...) \ #define EINA_MODEL_TYPE_CALL(model, method, ...) \
do \ do \
{ \ { \
eina_error_set(0); \
if (model->desc->ops.type.method) \ if (model->desc->ops.type.method) \
model->desc->ops.type.method(model, ## __VA_ARGS__); \ model->desc->ops.type.method(model, ## __VA_ARGS__); \
else \ else \
{ \ { \
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
ERR("Method" # method "() not implemented for model %p (%s)", \ ERR("Method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \ 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", ERR("Models %p (%s) and %p (%s) can't compare",
a, desc_a->cache.types[0]->name, a, desc_a->cache.types[0]->name,
b, desc_b->cache.types[0]->name); b, desc_b->cache.types[0]->name);
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); return -2;
return -1;
} }
else if ((desc_a->ops.type.compare) && (desc_b->ops.type.compare)) 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)", ERR("Could not compare models %p (%s) and %p (%s)",
a, desc_a->cache.types[0]->name, a, desc_a->cache.types[0]->name,
b, desc_b->cache.types[0]->name); b, desc_b->cache.types[0]->name);
eina_error_set(EINA_ERROR_MODEL_FAILED); return -2;
return -1;
} }
return cmp; return cmp;
@ -4026,7 +4004,6 @@ eina_model_load(Eina_Model *model)
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE); EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
eina_error_set(0);
if (model->desc->ops.type.load) if (model->desc->ops.type.load)
{ {
ret = model->desc->ops.type.load(model); ret = model->desc->ops.type.load(model);
@ -4035,7 +4012,6 @@ eina_model_load(Eina_Model *model)
} }
else else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method load() not implemented for model %p (%s)", ERR("Method load() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); 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_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
eina_error_set(0);
if (model->desc->ops.type.unload) if (model->desc->ops.type.unload)
{ {
ret = model->desc->ops.type.unload(model); ret = model->desc->ops.type.unload(model);
@ -4061,7 +4036,6 @@ eina_model_unload(Eina_Model *model)
} }
else else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method unload() not implemented for model %p (%s)", ERR("Method unload() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); 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_NULL_RETURN_VAL(value, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type), 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) if (model->desc->ops.type.property_set)
{ {
ret = model->desc->ops.type.property_set(model, name, value); 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 else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method property_set() not implemented for model %p (%s)", ERR("Method property_set() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); 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_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
eina_error_set(0);
if (model->desc->ops.type.property_del) if (model->desc->ops.type.property_del)
{ {
ret = model->desc->ops.type.property_del(model, name); ret = model->desc->ops.type.property_del(model, name);
@ -4127,7 +4098,6 @@ eina_model_property_del(Eina_Model *model, const char *name)
} }
else else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method property_del() not implemented for model %p (%s)", ERR("Method property_del() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); 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(model, EINA_FALSE);
EINA_MODEL_INSTANCE_CHECK_VAL(child, EINA_FALSE); EINA_MODEL_INSTANCE_CHECK_VAL(child, EINA_FALSE);
eina_error_set(0);
if (model->desc->ops.type.child_set) if (model->desc->ops.type.child_set)
{ {
ret = model->desc->ops.type.child_set(model, position, child); 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 else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method child_set() not implemented for model %p (%s)", ERR("Method child_set() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); 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_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
eina_error_set(0);
if (model->desc->ops.type.child_del) if (model->desc->ops.type.child_del)
{ {
ret = model->desc->ops.type.child_del(model, position); ret = model->desc->ops.type.child_del(model, position);
@ -4213,7 +4180,6 @@ eina_model_child_del(Eina_Model *model, unsigned int position)
} }
else else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method child_del() not implemented for model %p (%s)", ERR("Method child_del() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); 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_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE);
eina_error_set(0);
if (model->desc->ops.type.child_insert_at) if (model->desc->ops.type.child_insert_at)
{ {
ret = model->desc->ops.type.child_insert_at(model, position, child); 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 else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method child_insert_at() not implemented for model %p (%s)", ERR("Method child_insert_at() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); model, model->desc->cache.types[0]->name);
@ -4266,7 +4230,6 @@ eina_model_child_append(Eina_Model *model, Eina_Model *child)
if (position < 0) if (position < 0)
return -1; return -1;
eina_error_set(0);
if (model->desc->ops.type.child_insert_at) if (model->desc->ops.type.child_insert_at)
{ {
ret = model->desc->ops.type.child_insert_at(model, position, child); 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 else
{ {
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE; ret = EINA_FALSE;
ERR("Method child_insert_at() not implemented for model %p (%s)", ERR("Method child_insert_at() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name); model, model->desc->cache.types[0]->name);

View File

@ -302,16 +302,7 @@
* @{ * @{
*/ */
/**
* @var EINA_ERROR_MODEL_FAILED
* Defined when model-specific errors happens.
*/
EAPI extern Eina_Error EINA_ERROR_MODEL_FAILED; 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; EAPI extern Eina_Error EINA_ERROR_MODEL_METHOD_MISSING;
/** /**

View File

@ -45,7 +45,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_alloca.h" #include "eina_alloca.h"
#include "eina_error.h"
#include "eina_file.h" #include "eina_file.h"
#include "eina_log.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 * @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_WRONG_MODULE = 0;
EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED = 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 * This function sets up the module loader module of Eina. It is
* called by eina_init(). * called by eina_init().
* *
* This function sets up the module module of Eina. It also registers * This function sets up the module module of Eina.
* the errors #EINA_ERROR_WRONG_MODULE and #EINA_ERROR_MODULE_INIT_FAILED.
* *
* @see eina_init() * @see eina_init()
*/ */
@ -224,12 +217,6 @@ eina_module_init(void)
EINA_LOG_ERR("Could not register log domain: eina_module"); EINA_LOG_ERR("Could not register log domain: eina_module");
return EINA_FALSE; 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; 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(), WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(),
(flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY"); (flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY");
eina_error_set(EINA_ERROR_WRONG_MODULE);
return EINA_FALSE; 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", WRN("could not find eina's entry symbol %s inside module %s, or the init function failed",
EINA_MODULE_SYMBOL_INIT, m->file); EINA_MODULE_SYMBOL_INIT, m->file);
eina_error_set(EINA_ERROR_MODULE_INIT_FAILED);
dlclose(dl_handle); dlclose(dl_handle);
return EINA_FALSE; return EINA_FALSE;
ok: ok:
@ -343,8 +328,6 @@ ok:
loaded: loaded:
m->ref++; m->ref++;
DBG("ref %d", m->ref); DBG("ref %d", m->ref);
eina_error_set(0);
return EINA_TRUE; return EINA_TRUE;
#else #else
(void) m; (void) m;

View File

@ -105,16 +105,7 @@ typedef void (*Eina_Module_Shutdown)(void);
*/ */
#define EINA_MODULE_SHUTDOWN(f) EAPI Eina_Module_Shutdown __eina_module_shutdown = &f #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; 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; 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 * This function load the shared file object passed in
* eina_module_new(). If it is a internal Eina module (like the * eina_module_new(). If it is a internal Eina module (like the
* mempools), it also initialize it. It the shared file object can not * mempools), it also initialize it. If the shared file object can not
* be loaded, the error #EINA_ERROR_WRONG_MODULE is set and * be loaded, #EINA_FALSE is returned. If it is an internal Eina module and the
* and #EINA_FALSE is returned. If it is a internal Eina module and the * module can not be initialized, #EINA_FALSE is returned. If the module has
* module can not be initialized, the error #EINA_ERROR_MODULE_INIT_FAILED * already been loaded, it's reference counter is increased by one and
* is set and #EINA_FALSE is returned. If the module has already been loaded, * #EINA_TRUE is returned. If @p module is @c NULL, the function returns
* it's reference counter is increased by one and #EINA_TRUE is returned. * immediately #EINA_FALSE.
* If @p module is @c NULL, the function returns immediately #EINA_FALSE.
* *
* When the symbols of the shared file objects are not needed * When the symbols of the shared file objects are not needed
* anymore, call eina_module_unload() to unload the module. * anymore, call eina_module_unload() to unload the module.

View File

@ -69,16 +69,11 @@ _eina_rbtree_iterator_list_new(Eina_Iterator_Rbtree *it, const Eina_Rbtree *tree
{ {
Eina_Iterator_Rbtree_List *new; Eina_Iterator_Rbtree_List *new;
eina_error_set(0);
new = eina_trash_pop(&it->trash); new = eina_trash_pop(&it->trash);
if (!new) if (!new)
{ {
new = malloc(sizeof (Eina_Iterator_Rbtree_List)); new = malloc(sizeof (Eina_Iterator_Rbtree_List));
if (!new) if (!new) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
} }
new->tree = (Eina_Rbtree *)tree; 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_List *first;
Eina_Iterator_Rbtree *it; Eina_Iterator_Rbtree *it;
eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Rbtree)); it = calloc(1, sizeof (Eina_Iterator_Rbtree));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
eina_trash_init(&it->trash); eina_trash_init(&it->trash);

View File

@ -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 * NULL, this function still returns a valid iterator that will always
* return false on eina_iterator_next(), thus keeping API sane. * return false on eina_iterator_next(), thus keeping API sane.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @warning if the rbtree structure changes then the iterator becomes * @warning if the rbtree structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator * 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 * NULL, this function still returns a valid iterator that will always
* return false on eina_iterator_next(), thus keeping API sane. * return false on eina_iterator_next(), thus keeping API sane.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @warning if the rbtree structure changes then the iterator becomes * @warning if the rbtree structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator * 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 * NULL, this function still returns a valid iterator that will always
* return false on eina_iterator_next(), thus keeping API sane. * return false on eina_iterator_next(), thus keeping API sane.
* *
* If the memory can not be allocated, @c NULL is returned * If the memory can not be allocated, @c NULL is returned.
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is * Otherwise, a valid iterator is returned.
* returned.
* *
* @warning if the rbtree structure changes then the iterator becomes * @warning if the rbtree structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator * invalid! That is, if you add or remove nodes this iterator

View File

@ -80,8 +80,6 @@ static const char EINA_ERROR_SAFETY_FAILED_STR[] = "Safety check failed.";
Eina_Bool Eina_Bool
eina_safety_checks_init(void) eina_safety_checks_init(void)
{ {
EINA_ERROR_SAFETY_FAILED = eina_error_msg_static_register(
EINA_ERROR_SAFETY_FAILED_STR);
return EINA_TRUE; return EINA_TRUE;
} }

View File

@ -50,7 +50,6 @@
* // all these files will emit warning from EINA_ARG_NONNULL() * // all these files will emit warning from EINA_ARG_NONNULL()
* #include <Evas.h> // third party headers * #include <Evas.h> // third party headers
* #include <Ecore.h> * #include <Ecore.h>
* #include <eina_error.h> // eina own header
* *
* #include <eina_safety_checks.h> * #include <eina_safety_checks.h>
* // all these files below will NOT emit warning from EINA_ARG_NONNULL(), * // all these files below will NOT emit warning from EINA_ARG_NONNULL(),
@ -77,9 +76,8 @@
* options to @c configure script. * options to @c configure script.
* *
* Whenever these macros capture an error, EINA_LOG_ERR() will be * 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 * called.
* be checked with eina_error_get() after call. *
*
* @see EINA_SAFETY_ON_NULL_RETURN(), EINA_SAFETY_ON_NULL_RETURN_VAL() * @see EINA_SAFETY_ON_NULL_RETURN(), EINA_SAFETY_ON_NULL_RETURN_VAL()
* and other macros. * and other macros.
* *
@ -89,10 +87,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_error.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; EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
#ifdef EINA_SAFETY_CHECKS #ifdef EINA_SAFETY_CHECKS
@ -104,7 +98,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY((exp) == NULL)) \ if (EINA_UNLIKELY((exp) == NULL)) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
return; \ return; \
} \ } \
@ -116,7 +109,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY((exp) == NULL)) \ if (EINA_UNLIKELY((exp) == NULL)) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
return (val); \ return (val); \
} \ } \
@ -128,7 +120,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY((exp) == NULL)) \ if (EINA_UNLIKELY((exp) == NULL)) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
goto label; \ goto label; \
} \ } \
@ -140,7 +131,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY(exp)) \ if (EINA_UNLIKELY(exp)) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
return; \ return; \
} \ } \
@ -152,7 +142,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY(exp)) \ if (EINA_UNLIKELY(exp)) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
return val; \ return val; \
} \ } \
@ -164,7 +153,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY(exp)) \ if (EINA_UNLIKELY(exp)) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
goto label; \ goto label; \
} \ } \
@ -176,7 +164,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY(!(exp))) \ if (EINA_UNLIKELY(!(exp))) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
return; \ return; \
} \ } \
@ -188,7 +175,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY(!(exp))) \ if (EINA_UNLIKELY(!(exp))) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
return val; \ return val; \
} \ } \
@ -200,7 +186,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
{ \ { \
if (EINA_UNLIKELY(!(exp))) \ if (EINA_UNLIKELY(!(exp))) \
{ \ { \
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \ EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
goto label; \ goto label; \
} \ } \

View File

@ -71,7 +71,6 @@
#include "eina_private.h" #include "eina_private.h"
#include "eina_hash.h" #include "eina_hash.h"
#include "eina_rbtree.h" #include "eina_rbtree.h"
#include "eina_error.h"
#include "eina_lock.h" #include "eina_lock.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ /* 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); const size_t head_size = offsetof(Eina_Share_Common_Head, builtin_node.str);
head = malloc(head_size + slen); head = malloc(head_size + slen);
if (!head)
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return head; 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); const size_t node_size = offsetof(Eina_Share_Common_Node, str);
node = malloc(node_size + slen + null_size); node = malloc(node_size + slen + null_size);
if (!node)
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return node; return node;
} }

View File

@ -70,8 +70,7 @@ typedef struct _Eina_Strbuf Eina_Strbuf;
* @return Newly allocated string buffer instance. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_strbuf_free().
* free the resources, use eina_strbuf_free().
* *
* @see eina_strbuf_free() * @see eina_strbuf_free()
* @see eina_strbuf_append() * @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. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_strbuf_free().
* free the resources, use eina_strbuf_free().
* *
* @see eina_strbuf_free() * @see eina_strbuf_free()
* @see eina_strbuf_append() * @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. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_strbuf_free().
* free the resources, use eina_strbuf_free().
* *
* @see eina_strbuf_manage_new() * @see eina_strbuf_manage_new()
* @since 1.2.0 * @since 1.2.0

View File

@ -13,7 +13,6 @@
#include "eina_private.h" #include "eina_private.h"
#include "eina_str.h" #include "eina_str.h"
#include "eina_magic.h" #include "eina_magic.h"
#include "eina_error.h"
#include "eina_safety_checks.h" #include "eina_safety_checks.h"
#include "eina_strbuf.h" #include "eina_strbuf.h"
#include "eina_strbuf_common.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->size = EINA_STRBUF_INIT_SIZE;
buf->step = EINA_STRBUF_INIT_STEP; buf->step = EINA_STRBUF_INIT_STEP;
eina_error_set(0);
buf->buf = calloc(csize, buf->size); buf->buf = calloc(csize, buf->size);
if (EINA_UNLIKELY(!buf->buf)) if (EINA_UNLIKELY(!buf->buf)) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
return EINA_TRUE; 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 */ /* reallocate the buffer to the new size */
buffer = realloc(buf->buf, new_size * csize); buffer = realloc(buf->buf, new_size * csize);
if (EINA_UNLIKELY(!buffer)) if (EINA_UNLIKELY(!buffer)) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
buf->buf = buffer; buf->buf = buffer;
buf->size = new_size; buf->size = new_size;
buf->step = new_step; buf->step = new_step;
eina_error_set(0);
return EINA_TRUE; return EINA_TRUE;
} }
@ -239,8 +227,7 @@ _eina_strbuf_common_insert_length(size_t csize,
* @return Newly allocated string buffer instance. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_strbuf_common_free().
* free the resources, use eina_strbuf_common_free().
* *
* @see eina_strbuf_common_free() * @see eina_strbuf_common_free()
* @see eina_strbuf_common_append() * @see eina_strbuf_common_append()
@ -251,13 +238,8 @@ eina_strbuf_common_new(size_t csize)
{ {
Eina_Strbuf *buf; Eina_Strbuf *buf;
eina_error_set(0);
buf = malloc(sizeof(Eina_Strbuf)); buf = malloc(sizeof(Eina_Strbuf));
if (EINA_UNLIKELY(!buf)) if (EINA_UNLIKELY(!buf)) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
if (EINA_UNLIKELY(!_eina_strbuf_common_init(csize, buf))) if (EINA_UNLIKELY(!_eina_strbuf_common_init(csize, buf)))
{ {
eina_strbuf_common_free(buf); eina_strbuf_common_free(buf);
@ -276,8 +258,7 @@ eina_strbuf_common_new(size_t csize)
* @return Newly allocated string buffer instance. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_strbuf_common_free().
* free the resources, use eina_strbuf_common_free().
* *
* @see eina_strbuf_common_free() * @see eina_strbuf_common_free()
* @see eina_strbuf_common_append() * @see eina_strbuf_common_append()
@ -291,14 +272,9 @@ eina_strbuf_common_manage_new(size_t csize,
{ {
Eina_Strbuf *buf; Eina_Strbuf *buf;
eina_error_set(0);
buf = malloc(sizeof(Eina_Strbuf)); buf = malloc(sizeof(Eina_Strbuf));
if (EINA_UNLIKELY(!buf)) if (EINA_UNLIKELY(!buf)) return NULL;
{ if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len)))
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len)))
{ {
eina_strbuf_common_free(buf); eina_strbuf_common_free(buf);
return NULL; return NULL;

View File

@ -37,7 +37,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_alloca.h" #include "eina_alloca.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
#include "eina_lock.h" #include "eina_lock.h"
#include "eina_share_common.h" #include "eina_share_common.h"
@ -212,30 +211,15 @@ _eina_stringshare_small_bucket_resize(Eina_Stringshare_Small_Bucket *bucket,
void *tmp; void *tmp;
tmp = realloc((void *)bucket->strings, size * sizeof(bucket->strings[0])); tmp = realloc((void *)bucket->strings, size * sizeof(bucket->strings[0]));
if (!tmp) if (!tmp) return 0;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return 0;
}
bucket->strings = tmp; bucket->strings = tmp;
tmp = realloc(bucket->lengths, size * sizeof(bucket->lengths[0])); tmp = realloc(bucket->lengths, size * sizeof(bucket->lengths[0]));
if (!tmp) if (!tmp) return 0;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return 0;
}
bucket->lengths = tmp; bucket->lengths = tmp;
tmp = realloc(bucket->references, size * sizeof(bucket->references[0])); tmp = realloc(bucket->references, size * sizeof(bucket->references[0]));
if (!tmp) if (!tmp) return 0;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return 0;
}
bucket->references = tmp; bucket->references = tmp;
bucket->size = size; bucket->size = size;
@ -256,11 +240,7 @@ _eina_stringshare_small_bucket_insert_at(
if (!bucket) if (!bucket)
{ {
*p_bucket = bucket = calloc(1, sizeof(*bucket)); *p_bucket = bucket = calloc(1, sizeof(*bucket));
if (!bucket) if (!bucket) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
} }
if (bucket->count + 1 >= bucket->size) if (bucket->count + 1 >= bucket->size)
@ -271,11 +251,7 @@ _eina_stringshare_small_bucket_insert_at(
} }
snew = malloc(length + 1); snew = malloc(length + 1);
if (!snew) if (!snew) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
memcpy(snew, str, length); memcpy(snew, str, length);
snew[length] = '\0'; snew[length] = '\0';

View File

@ -23,7 +23,6 @@
#include <stdlib.h> #include <stdlib.h>
#include "eina_config.h" #include "eina_config.h"
#include "eina_error.h"
#include "eina_thread.h" #include "eina_thread.h"
#include "eina_sched.h" #include "eina_sched.h"
#ifdef _WIN32 #ifdef _WIN32
@ -34,18 +33,6 @@
#include "eina_safety_checks.h" #include "eina_safety_checks.h"
#include "eina_thread.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 #ifdef _WIN32
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
@ -161,11 +148,7 @@ _eina_thread_join(Eina_Thread t)
void *ret; void *ret;
tw = _eina_thread_win32_find(t); tw = _eina_thread_win32_find(t);
if (!tw) if (!tw) return NULL;
{
eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID);
return NULL;
}
WaitForSingleObject(tw->thread, INFINITE); WaitForSingleObject(tw->thread, INFINITE);
CloseHandle(tw->thread); CloseHandle(tw->thread);
@ -193,13 +176,7 @@ _eina_thread_join(Eina_Thread t)
void *ret = NULL; void *ret = NULL;
int err = pthread_join(t, &ret); int err = pthread_join(t, &ret);
if (err == 0) if (err == 0) return ret;
return ret;
else if (err == EDEADLK)
eina_error_set(EINA_ERROR_THREAD_JOIN_DEADLOCK);
else
eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID);
return NULL; 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); err = pthread_create(t, &attr, func, data);
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
if (err == 0) if (err == 0) return EINA_TRUE;
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);
return EINA_FALSE; 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(t, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(func, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(func, EINA_FALSE);
eina_error_set(0);
c = malloc(sizeof (Eina_Thread_Call)); c = malloc(sizeof (Eina_Thread_Call));
if (!c) if (!c) return EINA_FALSE;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
c->func = func; c->func = func;
c->data = data; c->data = data;
@ -324,28 +288,18 @@ eina_thread_create(Eina_Thread *t,
return EINA_TRUE; return EINA_TRUE;
free(c); free(c);
if (eina_error_get() == 0)
eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }
EAPI void * EAPI void *
eina_thread_join(Eina_Thread t) eina_thread_join(Eina_Thread t)
{ {
eina_error_set(0);
return _eina_thread_join(t); return _eina_thread_join(t);
} }
Eina_Bool Eina_Bool
eina_thread_init(void) 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; return EINA_TRUE;
} }

View File

@ -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 unsigned long int Eina_Thread;
typedef void *(*Eina_Thread_Cb)(void *data, Eina_Thread t); typedef void *(*Eina_Thread_Cb)(void *data, Eina_Thread t);

View File

@ -33,7 +33,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_tiler.h" #include "eina_tiler.h"
#include "eina_error.h"
/*============================================================================* /*============================================================================*
* Local * * Local *
@ -1386,11 +1385,7 @@ eina_tile_grid_slicer_iterator_new(int x,
return NULL; return NULL;
it = calloc(1, sizeof(*it)); it = calloc(1, sizeof(*it));
if (!it) if (!it) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);

View File

@ -32,7 +32,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
#include "eina_lock.h" #include "eina_lock.h"
#include "eina_share_common.h" #include "eina_share_common.h"

View File

@ -39,8 +39,7 @@ typedef struct _Eina_Strbuf Eina_UStrbuf;
* @return Newly allocated string buffer instance. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_ustrbuf_free().
* free the resources, use eina_ustrbuf_free().
* *
* @see eina_ustrbuf_free() * @see eina_ustrbuf_free()
* @see eina_ustrbuf_append() * @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. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_strbuf_free().
* free the resources, use eina_strbuf_free().
* *
* @see eina_ustrbuf_free() * @see eina_ustrbuf_free()
* @see eina_ustrbuf_append() * @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. * @return Newly allocated string buffer instance.
* *
* This function creates a new string buffer. On error, @c NULL is * 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 * returned. To free the resources, use eina_ustrbuf_free().
* free the resources, use eina_ustrbuf_free().
* *
* @see eina_ustrbuf_manage_new() * @see eina_ustrbuf_manage_new()
* @since 1.2.0 * @since 1.2.0

View File

@ -31,7 +31,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_private.h" #include "eina_private.h"
#include "eina_alloca.h" #include "eina_alloca.h"
#include "eina_error.h"
#include "eina_log.h" #include "eina_log.h"
#include "eina_strbuf.h" #include "eina_strbuf.h"
#include "eina_mempool.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; const unsigned char v = *(const unsigned char *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -209,7 +206,6 @@ _eina_value_type_uchar_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const unsigned short v = *(const unsigned short *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -360,7 +354,6 @@ _eina_value_type_ushort_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const unsigned int v = *(const unsigned int *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -515,7 +506,6 @@ _eina_value_type_uint_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const unsigned long v = *(const unsigned long *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -674,7 +662,6 @@ _eina_value_type_ulong_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const uint64_t v = *(const uint64_t *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -838,7 +823,6 @@ _eina_value_type_uint64_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const signed char v = *(const signed char *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -993,7 +975,6 @@ _eina_value_type_char_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const short v = *(const short *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -1154,7 +1133,6 @@ _eina_value_type_short_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const int v = *(const int *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; 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 else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const long v = *(const long *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -1494,7 +1467,6 @@ _eina_value_type_long_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const int64_t v = *(const int64_t *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -1674,7 +1644,6 @@ _eina_value_type_int64_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const float v = *(const float *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -1860,7 +1827,6 @@ _eina_value_type_float_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const double v = *(const double *)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v; unsigned char other_mem = v;
@ -2040,7 +2004,6 @@ _eina_value_type_double_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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; const char *v = *(const char **)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem; unsigned char other_mem;
@ -2213,7 +2174,6 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type EINA_UNUSE
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }
@ -2286,7 +2246,6 @@ _eina_value_type_string_copy(const Eina_Value_Type *type EINA_UNUSED, const void
*d = strdup(*s); *d = strdup(*s);
if (*d == NULL) if (*d == NULL)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
} }
@ -2298,7 +2257,7 @@ _eina_value_type_string_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
{ {
char **tmem = mem; char **tmem = mem;
const char *str = va_arg(args, const char *); const char *str = va_arg(args, const char *);
eina_error_set(0);
if (str == *tmem) return EINA_TRUE; if (str == *tmem) return EINA_TRUE;
if (!str) if (!str)
{ {
@ -2310,7 +2269,6 @@ _eina_value_type_string_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
char *tmp = strdup(str); char *tmp = strdup(str);
if (!tmp) if (!tmp)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
free(*tmem); free(*tmem);
@ -2324,7 +2282,7 @@ _eina_value_type_string_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
{ {
char **tmem = mem; char **tmem = mem;
const char * const *str = ptr; const char * const *str = ptr;
eina_error_set(0);
if (*str == *tmem) return EINA_TRUE; if (*str == *tmem) return EINA_TRUE;
if (!*str) if (!*str)
{ {
@ -2336,7 +2294,6 @@ _eina_value_type_string_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
char *tmp = strdup(*str); char *tmp = strdup(*str);
if (!tmp) if (!tmp)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
free(*tmem); free(*tmem);
@ -2405,7 +2362,6 @@ _eina_value_type_array_copy(const Eina_Value_Type *type EINA_UNUSED, const void
if (!subtype->copy) if (!subtype->copy)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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) if (eva_a->subtype != eva_b->subtype)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1; return -1;
} }
subtype = eva_a->subtype; subtype = eva_a->subtype;
if (!subtype->compare) if (!subtype->compare)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return 0; return 0;
} }
@ -2570,7 +2524,6 @@ _eina_value_type_array_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
if (!ret) if (!ret)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }
return EINA_TRUE; 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; const Eina_Value_Array *desc = ptr;
Eina_Inarray *desc_array; Eina_Inarray *desc_array;
eina_error_set(0);
if ((!tmem->subtype) && (!desc->subtype)) if ((!tmem->subtype) && (!desc->subtype))
return EINA_TRUE; return EINA_TRUE;
@ -2740,7 +2692,6 @@ _eina_value_type_list_copy(const Eina_Value_Type *type EINA_UNUSED, const void *
if (!subtype->copy) if (!subtype->copy)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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) if (eva_a->subtype != eva_b->subtype)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1; return -1;
} }
subtype = eva_a->subtype; subtype = eva_a->subtype;
if (!subtype->compare) if (!subtype->compare)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return 0; return 0;
} }
@ -2894,7 +2843,6 @@ _eina_value_type_list_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
if (!ret) if (!ret)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }
return EINA_TRUE; 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; Eina_Value_List *tmem = mem;
const Eina_Value_List *desc = ptr; const Eina_Value_List *desc = ptr;
eina_error_set(0);
if ((!tmem->subtype) && (!desc->subtype)) if ((!tmem->subtype) && (!desc->subtype))
return EINA_TRUE; 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) if (!s->subtype->copy)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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) if (eva_a->subtype != eva_b->subtype)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1; return -1;
} }
if (!eva_a->subtype->compare) if (!eva_a->subtype->compare)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return 0; return 0;
} }
@ -3309,7 +3253,6 @@ _eina_value_type_hash_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
if (!ret) if (!ret)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }
return EINA_TRUE; 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; Eina_Value_Hash *tmem = mem;
const Eina_Value_Hash *desc = ptr; const Eina_Value_Hash *desc = ptr;
eina_error_set(0);
if ((!tmem->subtype) && (!desc->subtype)) if ((!tmem->subtype) && (!desc->subtype))
return EINA_TRUE; 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); struct timeval v = _eina_value_type_timeval_fix(type_mem);
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_UCHAR) if (convert == EINA_VALUE_TYPE_UCHAR)
{ {
unsigned char other_mem = v.tv_sec; 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 else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }
} }
@ -3649,7 +3588,6 @@ _eina_value_type_blob_compare(const Eina_Value_Type *type EINA_UNUSED, const voi
size_t minsize; size_t minsize;
if (ta->ops != tb->ops) if (ta->ops != tb->ops)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1; return -1;
} }
if ((ops) && (ops->compare)) 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; const Eina_Value_Blob *tmem = type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_STRINGSHARE || if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
convert == EINA_VALUE_TYPE_STRING) convert == EINA_VALUE_TYPE_STRING)
{ {
@ -3726,7 +3663,6 @@ _eina_value_type_blob_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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); desc.memory = buf = malloc(desc.size);
if (!desc.memory) if (!desc.memory)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
memcpy(buf, str, desc.size); 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); desc.memory = buf = malloc(desc.size);
if (!desc.memory) if (!desc.memory)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
memcpy(buf, a->array->members, desc.size); 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); desc.memory = buf = malloc(desc.size);
if (!desc.memory) if (!desc.memory)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
memcpy(buf, b->memory, desc.size); 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); desc.memory = buf = malloc(convert->value_size);
if (!desc.memory) if (!desc.memory)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
if (!eina_value_type_pget(convert, convert_mem, buf)) 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; Eina_Value_Blob *tmem = mem;
const Eina_Value_Blob *desc = ptr; const Eina_Value_Blob *desc = ptr;
eina_error_set(0);
if ((tmem->memory) && (tmem->memory == desc->memory)) if ((tmem->memory) && (tmem->memory == desc->memory))
{ {
tmem->ops = desc->ops; 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); d->memory = malloc(s->desc->size);
if (!d->memory) if (!d->memory)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; return EINA_FALSE;
} }
@ -4156,12 +4086,10 @@ _eina_value_type_struct_compare(const Eina_Value_Type *type EINA_UNUSED, const v
return 0; return 0;
else if (ta->desc != tb->desc) else if (ta->desc != tb->desc)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1; return -1;
} }
if (ta->desc->ops != tb->desc->ops) if (ta->desc->ops != tb->desc->ops)
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1; return -1;
} }
if ((!ta->memory) && (!tb->memory)) 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; const Eina_Value_Struct *tmem = type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_STRINGSHARE || if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
convert == EINA_VALUE_TYPE_STRING) convert == EINA_VALUE_TYPE_STRING)
{ {
@ -4262,7 +4189,6 @@ _eina_value_type_struct_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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)) if (!_eina_value_type_struct_desc_check(desc->desc))
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }
eina_error_set(0);
if ((tmem->memory) && (tmem->memory == desc->memory)) if ((tmem->memory) && (tmem->memory == desc->memory))
{ {
tmem->desc = desc->desc; 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) if (!tmem->memory)
{ {
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE; 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; const Eina_Model *v = *(const Eina_Model **)type_mem;
eina_error_set(0);
if (convert == EINA_VALUE_TYPE_STRINGSHARE || if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
convert == EINA_VALUE_TYPE_STRING) convert == EINA_VALUE_TYPE_STRING)
{ {
@ -4490,7 +4411,6 @@ _eina_value_type_model_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
} }
else else
{ {
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; 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 **tmem = mem;
Eina_Model **p = (Eina_Model **)ptr; Eina_Model **p = (Eina_Model **)ptr;
eina_error_set(0);
if (*tmem == *p) return EINA_TRUE; if (*tmem == *p) return EINA_TRUE;
if (*p) eina_model_ref(*p); 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) _eina_value_blob_operations_malloc_copy(const Eina_Value_Blob_Operations *ops EINA_UNUSED, const void *memory, size_t size)
{ {
void *ret = malloc(size); void *ret = malloc(size);
if (!ret) if (!ret) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
memcpy(ret, memory, size); memcpy(ret, memory, size);
return ret; return ret;
} }
@ -4811,8 +4726,6 @@ struct _Eina_Value_Inner_Mp
* @endcond * @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; 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_UCHAR = _EINA_VALUE_TYPE_BASICS + 0;
EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1; EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1;
EINA_VALUE_TYPE_UINT = _EINA_VALUE_TYPE_BASICS + 2; 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_new(const Eina_Value_Type *type)
{ {
Eina_Value *value = eina_mempool_malloc(_eina_value_mp, sizeof(Eina_Value)); Eina_Value *value = eina_mempool_malloc(_eina_value_mp, sizeof(Eina_Value));
if (!value) if (!value) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
if (!eina_value_setup(value, type)) if (!eina_value_setup(value, type))
{ {
free(value); free(value);

View File

@ -587,13 +587,7 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_BLOB;
*/ */
EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_STRUCT; EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_STRUCT;
/** EAPI extern Eina_Error EINA_ERROR_VALUE_FAILED;
* @var EINA_ERROR_VALUE_FAILED
* Error identifier corresponding to value check failure.
*
* @since 1.2
*/
EAPI extern int EINA_ERROR_VALUE_FAILED;
/** /**
* @defgroup Eina_Value_Value_Group Generic Value management * @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(), * eg. #EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(),
* eina_value_array_get() and so on. * eina_value_array_get() and so on.
* *
* On failure, @c NULL is returned and either #EINA_ERROR_OUT_OF_MEMORY * On failure, @c NULL is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @note this calls creates from mempool and then uses * @note this calls creates from mempool and then uses
* eina_value_setup(). Consider using eina_value_flush() and * 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 * @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first. * use eina_value_flush() first.
* *
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, #EINA_FALSE is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @see eina_value_flush() * @see eina_value_flush()
* *
@ -1103,8 +1095,7 @@ struct _Eina_Value_Array
* Create a new generic value storage of type array. The members are * Create a new generic value storage of type array. The members are
* managed using the description specified by @a subtype. * managed using the description specified by @a subtype.
* *
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, @c NULL is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @note this creates from mempool and then uses * @note this creates from mempool and then uses
* eina_value_array_setup(). @see eina_value_free() @see * 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 * @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first. * use eina_value_flush() first.
* *
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, #EINA_FALSE is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @see eina_value_flush() * @see eina_value_flush()
* *
@ -1753,8 +1743,7 @@ struct _Eina_Value_List
* Create a new generic value storage of type list. The members are * Create a new generic value storage of type list. The members are
* managed using the description specified by @a subtype. * managed using the description specified by @a subtype.
* *
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, @c NULL is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @note this creates from mempool and then uses * @note this creates from mempool and then uses
* eina_value_list_setup(). * 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 * @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first. * use eina_value_flush() first.
* *
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, #EINA_FALSE is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @see eina_value_flush() * @see eina_value_flush()
* *
@ -2379,8 +2367,7 @@ struct _Eina_Value_Hash
* Create a new generic value storage of type hash. The members are * Create a new generic value storage of type hash. The members are
* managed using the description specified by @a subtype. * managed using the description specified by @a subtype.
* *
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, @c NULL is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @note this creates from mempool and then uses * @note this creates from mempool and then uses
* eina_value_hash_setup(). * 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 * @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first. * use eina_value_flush() first.
* *
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, #EINA_FALSE is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @see eina_value_flush() * @see eina_value_flush()
* *
@ -2942,8 +2928,7 @@ struct _Eina_Value_Struct
* Create a new generic value storage of type struct. The members are * Create a new generic value storage of type struct. The members are
* managed using the description specified by @a desc. * managed using the description specified by @a desc.
* *
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, @c NULL is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @note this creates from mempool and then uses * @note this creates from mempool and then uses
* eina_value_struct_setup(). * 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 * @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first. * use eina_value_flush() first.
* *
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY * On failure, #EINA_FALSE is returned.
* or #EINA_ERROR_VALUE_FAILED is set.
* *
* @see eina_value_flush() * @see eina_value_flush()
* *

View File

@ -826,8 +826,6 @@ _eo_dbg_info_convert_to(const Eina_Value_Type *type EINA_UNUSED, const Eina_Valu
free(inner_val); free(inner_val);
return ret; return ret;
} }
eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE; return EINA_FALSE;
} }

View File

@ -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); 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); 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; return g;
} }

View File

@ -33,7 +33,6 @@
#include "eina_config.h" #include "eina_config.h"
#include "eina_inlist.h" #include "eina_inlist.h"
#include "eina_error.h"
#include "eina_module.h" #include "eina_module.h"
#include "eina_mempool.h" #include "eina_mempool.h"
#include "eina_trash.h" #include "eina_trash.h"
@ -123,13 +122,8 @@ _eina_chained_mp_pool_new(Chained_Mempool *pool)
Chained_Pool *p; Chained_Pool *p;
unsigned char *ptr; unsigned char *ptr;
eina_error_set(0);
p = malloc(pool->alloc_size); p = malloc(pool->alloc_size);
if (!p) if (!p) return NULL;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
#ifdef EINA_DEBUG_MALLOC #ifdef EINA_DEBUG_MALLOC
{ {

View File

@ -100,11 +100,7 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size)
if (!pool->base) if (!pool->base)
{ {
pool->base = malloc(pool->item_size * pool->max); pool->base = malloc(pool->item_size * pool->max);
if (!pool->base) if (!pool->base) goto retry_smaller;
{
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
goto retry_smaller;
}
#ifndef NVALGRIND #ifndef NVALGRIND
VALGRIND_MAKE_MEM_NOACCESS(pool->base, pool->item_size * pool->max); VALGRIND_MAKE_MEM_NOACCESS(pool->base, pool->item_size * pool->max);
#endif #endif
@ -118,11 +114,8 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size)
} }
retry_smaller: retry_smaller:
eina_error_set(0);
mem = malloc(sizeof(Eina_Inlist) + pool->item_size); mem = malloc(sizeof(Eina_Inlist) + pool->item_size);
if (!mem) if (mem)
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
else
{ {
pool->over++; pool->over++;
/* Only need to zero list elements and not the payload here */ /* Only need to zero list elements and not the payload here */

View File

@ -64,11 +64,6 @@ emotion_video_stream_new(Emotion_Gstreamer_Video *ev)
if (!vstream) return NULL; if (!vstream) return NULL;
ev->video_streams = eina_list_append(ev->video_streams, vstream); ev->video_streams = eina_list_append(ev->video_streams, vstream);
if (eina_error_get())
{
free(vstream);
return NULL;
}
return vstream; return vstream;
} }
@ -1893,11 +1888,6 @@ _emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev,
astream = calloc(1, sizeof(Emotion_Audio_Stream)); astream = calloc(1, sizeof(Emotion_Audio_Stream));
if (!astream) continue; if (!astream) continue;
ev->audio_streams = eina_list_append(ev->audio_streams, astream); ev->audio_streams = eina_list_append(ev->audio_streams, astream);
if (eina_error_get())
{
free(astream);
continue;
}
astream->length_time = length_time; astream->length_time = length_time;
astream->channels = channels; astream->channels = channels;

View File

@ -91,19 +91,14 @@ START_TEST(eina_barrier_test_simple)
eina_barrier_wait(&barrier); eina_barrier_wait(&barrier);
eina_thread_join(wk1); eina_thread_join(wk1);
ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk2); eina_thread_join(wk2);
ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk3); eina_thread_join(wk3);
ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk4); eina_thread_join(wk4);
ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk5); eina_thread_join(wk5);
ck_assert_int_eq(eina_error_get(), 0);
eina_barrier_free(&barrier); eina_barrier_free(&barrier);

View File

@ -141,7 +141,6 @@ START_TEST(eina_counter_break)
"safety check failed: name == NULL"); "safety check failed: name == NULL");
cnt = eina_counter_new(NULL); cnt = eina_counter_new(NULL);
fail_if(cnt); fail_if(cnt);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -150,7 +149,6 @@ START_TEST(eina_counter_break)
TEST_MAGIC_SAFETY("eina_counter_free", TEST_MAGIC_SAFETY("eina_counter_free",
"safety check failed: counter == NULL"); "safety check failed: counter == NULL");
eina_counter_free(NULL); eina_counter_free(NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -159,7 +157,6 @@ START_TEST(eina_counter_break)
TEST_MAGIC_SAFETY("eina_counter_start", TEST_MAGIC_SAFETY("eina_counter_start",
"safety check failed: counter == NULL"); "safety check failed: counter == NULL");
eina_counter_start(NULL); eina_counter_start(NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -168,7 +165,6 @@ START_TEST(eina_counter_break)
TEST_MAGIC_SAFETY("eina_counter_stop", TEST_MAGIC_SAFETY("eina_counter_stop",
"safety check failed: counter == NULL"); "safety check failed: counter == NULL");
eina_counter_stop(NULL, 0); eina_counter_stop(NULL, 0);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
@ -179,7 +175,6 @@ START_TEST(eina_counter_break)
"safety check failed: counter == NULL"); "safety check failed: counter == NULL");
dump = eina_counter_dump(NULL); dump = eina_counter_dump(NULL);
fail_if(dump); fail_if(dump);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);

View File

@ -94,7 +94,6 @@ START_TEST(eina_file_split_simple)
TEST_MAGIC_SAFETY("eina_file_split", "safety check failed: path == NULL"); TEST_MAGIC_SAFETY("eina_file_split", "safety check failed: path == NULL");
ea = eina_file_split(NULL); ea = eina_file_split(NULL);
fail_if(ea); fail_if(ea);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);

View File

@ -167,7 +167,6 @@ START_TEST(eina_inlist_simple)
tmp2 = eina_inlist_remove(NULL, EINA_INLIST_GET(tmp)); tmp2 = eina_inlist_remove(NULL, EINA_INLIST_GET(tmp));
fail_if(tmp2 != NULL); fail_if(tmp2 != NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
} }
@ -177,7 +176,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_remove", TEST_MAGIC_SAFETY("eina_inlist_remove",
"safety check failed: item == NULL"); "safety check failed: item == NULL");
lst = eina_inlist_remove(lst, NULL); lst = eina_inlist_remove(lst, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -186,7 +184,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_append", TEST_MAGIC_SAFETY("eina_inlist_append",
"safety check failed: new_l == NULL"); "safety check failed: new_l == NULL");
lst = eina_inlist_append(lst, NULL); lst = eina_inlist_append(lst, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -195,7 +192,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_append_relative", TEST_MAGIC_SAFETY("eina_inlist_append_relative",
"safety check failed: new_l == NULL"); "safety check failed: new_l == NULL");
lst = eina_inlist_append_relative(lst, NULL, NULL); lst = eina_inlist_append_relative(lst, NULL, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -204,7 +200,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_prepend", TEST_MAGIC_SAFETY("eina_inlist_prepend",
"safety check failed: new_l == NULL"); "safety check failed: new_l == NULL");
lst = eina_inlist_prepend(lst, NULL); lst = eina_inlist_prepend(lst, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -213,7 +208,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_prepend_relative", TEST_MAGIC_SAFETY("eina_inlist_prepend_relative",
"safety check failed: new_l == NULL"); "safety check failed: new_l == NULL");
lst = eina_inlist_prepend_relative(lst, NULL, NULL); lst = eina_inlist_prepend_relative(lst, NULL, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -222,7 +216,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_find", TEST_MAGIC_SAFETY("eina_inlist_find",
"safety check failed: item == NULL"); "safety check failed: item == NULL");
lst = eina_inlist_find(lst, NULL); lst = eina_inlist_find(lst, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -231,7 +224,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_demote", TEST_MAGIC_SAFETY("eina_inlist_demote",
"safety check failed: list == NULL"); "safety check failed: list == NULL");
lst = eina_inlist_demote(NULL, NULL); lst = eina_inlist_demote(NULL, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -240,7 +232,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_demote", TEST_MAGIC_SAFETY("eina_inlist_demote",
"safety check failed: item == NULL"); "safety check failed: item == NULL");
lst = eina_inlist_demote((void*)1L, NULL); lst = eina_inlist_demote((void*)1L, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
lst = NULL; lst = NULL;
@ -250,7 +241,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_promote", TEST_MAGIC_SAFETY("eina_inlist_promote",
"safety check failed: list == NULL"); "safety check failed: list == NULL");
lst = eina_inlist_promote(NULL, NULL); lst = eina_inlist_promote(NULL, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -259,7 +249,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_promote", TEST_MAGIC_SAFETY("eina_inlist_promote",
"safety check failed: item == NULL"); "safety check failed: item == NULL");
lst = eina_inlist_promote((void*)1L, NULL); lst = eina_inlist_promote((void*)1L, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
lst = NULL; lst = NULL;
@ -269,7 +258,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_sorted_insert", TEST_MAGIC_SAFETY("eina_inlist_sorted_insert",
"safety check failed: item == NULL"); "safety check failed: item == NULL");
lst = eina_inlist_sorted_insert(NULL, NULL, NULL); lst = eina_inlist_sorted_insert(NULL, NULL, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -278,7 +266,6 @@ START_TEST(eina_inlist_simple)
TEST_MAGIC_SAFETY("eina_inlist_sorted_insert", TEST_MAGIC_SAFETY("eina_inlist_sorted_insert",
"safety check failed: func == NULL"); "safety check failed: func == NULL");
lst = eina_inlist_sorted_insert(NULL, (void*)1L, NULL); lst = eina_inlist_sorted_insert(NULL, (void*)1L, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
lst = NULL; lst = NULL;

View File

@ -121,7 +121,6 @@ START_TEST(eina_magic_simple)
TEST_MAGIC_SAFETY("eina_magic_string_set", TEST_MAGIC_SAFETY("eina_magic_string_set",
"safety check failed: magic_name == NULL"); "safety check failed: magic_name == NULL");
eina_magic_string_set(EINA_MAGIC_TEST2, NULL); eina_magic_string_set(EINA_MAGIC_TEST2, NULL);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did); fail_unless(ctx.did);
#ifdef SHOW_LOG #ifdef SHOW_LOG
@ -131,7 +130,6 @@ START_TEST(eina_magic_simple)
"safety check failed: magic_name == NULL"); "safety check failed: magic_name == NULL");
eina_magic_string_set(EINA_MAGIC_TEST2, NULL); eina_magic_string_set(EINA_MAGIC_TEST2, NULL);
fail_unless(ctx.did); fail_unless(ctx.did);
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
#endif #endif
eina_magic_string_set(EINA_MAGIC_TEST2, EINA_MAGIC_STRING); eina_magic_string_set(EINA_MAGIC_TEST2, EINA_MAGIC_STRING);