forked from enlightenment/efl
eina - and e3fl in general - stop using eina_error_get/set - useless really
This commit is contained in:
parent
725237df0a
commit
69e27abdc3
|
@ -1,3 +1,10 @@
|
|||
2013-10-11 Carsten Haitzler (The Rasterman)
|
||||
|
||||
* deprecate/remove all the eina_error setting (and getting)
|
||||
within efl no one uses it and it frankly it much more pain
|
||||
than it's worth. the api's are still there, and efl api's still
|
||||
fail as they did before.. they just don't ALSO set eina_error.
|
||||
|
||||
2013-10-11 Cedric Bail
|
||||
|
||||
* Eina: add Eina_Spinlock API,
|
||||
|
|
2
NEWS
2
NEWS
|
@ -180,6 +180,8 @@ Removed:
|
|||
- Remove support for DirectFB, XRender, WinCE, Glew, Direct3d, X11-16 and X11-8.
|
||||
* Ecore_DirectFB:
|
||||
- Removed
|
||||
* Eina error status:
|
||||
- eina error status from efl now don't also report error in addition to return.
|
||||
|
||||
Improvements:
|
||||
* EFL:
|
||||
|
|
|
@ -254,15 +254,7 @@ cserve2_client_accept(int fd)
|
|||
while (eina_hash_find(client_list, &client->id))
|
||||
client->id = _client_id++;
|
||||
|
||||
if (!eina_hash_add(client_list, &client->id, client))
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
ERR("Could not add client to the list: \"%s\"",
|
||||
eina_error_msg_get(err));
|
||||
free(client);
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
eina_hash_add(client_list, &client->id, client);
|
||||
|
||||
cserve2_fd_watch_add(fd, FD_READ | FD_ERROR, cserve2_message_handler,
|
||||
client);
|
||||
|
|
|
@ -90,19 +90,12 @@ main(int argc, const char *argv[])
|
|||
|
||||
// Modify or add an entry to the hash with eina_hash_set
|
||||
// Let's first add a new entry
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, "Raul Seixas",
|
||||
strdup("+55 01 234-56789"));
|
||||
if (!phone)
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (!err)
|
||||
{
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
printf("Error when setting phone for Raul Seixas\n");
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -113,7 +106,6 @@ main(int argc, const char *argv[])
|
|||
printf("\n");
|
||||
|
||||
// Now change the phone number
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, "Raul Seixas",
|
||||
strdup("+55 02 222-22222"));
|
||||
if (phone)
|
||||
|
@ -124,14 +116,8 @@ main(int argc, const char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (err)
|
||||
printf("Error when changing phone for Raul Seixas\n");
|
||||
else
|
||||
{
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
|
||||
// There are many ways to iterate over our Phone book.
|
||||
|
|
|
@ -90,19 +90,12 @@ main(int argc, const char *argv[])
|
|||
|
||||
// Modify or add an entry to the hash with eina_hash_set
|
||||
// Let's first add a new entry
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, "Raul Seixas",
|
||||
strdup("+55 01 234-56789"));
|
||||
if (!phone)
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (!err)
|
||||
{
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
printf("Error when setting phone for Raul Seixas\n");
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -113,7 +106,6 @@ main(int argc, const char *argv[])
|
|||
printf("\n");
|
||||
|
||||
// Now change the phone number
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, "Raul Seixas",
|
||||
strdup("+55 02 222-22222"));
|
||||
if (phone)
|
||||
|
@ -124,14 +116,8 @@ main(int argc, const char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (err)
|
||||
printf("Error when changing phone for Raul Seixas\n");
|
||||
else
|
||||
{
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
|
||||
// There are many ways to iterate over our Phone book.
|
||||
|
|
|
@ -90,19 +90,12 @@ main(int argc, const char *argv[])
|
|||
|
||||
// Modify or add an entry to the hash with eina_hash_set
|
||||
// Let's first add a new entry
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, "Raul Seixas",
|
||||
strdup("+55 01 234-56789"));
|
||||
if (!phone)
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (!err)
|
||||
{
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
printf("Error when setting phone for Raul Seixas\n");
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -113,7 +106,6 @@ main(int argc, const char *argv[])
|
|||
printf("\n");
|
||||
|
||||
// Now change the phone number
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, "Raul Seixas",
|
||||
strdup("+55 02 222-22222"));
|
||||
if (phone)
|
||||
|
@ -124,14 +116,8 @@ main(int argc, const char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (err)
|
||||
printf("Error when changing phone for Raul Seixas\n");
|
||||
else
|
||||
{
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
printf("No previous phone found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
|
||||
// There are many ways to iterate over our Phone book.
|
||||
|
|
|
@ -92,19 +92,12 @@ main(int argc, const char *argv[])
|
|||
// Modify or add an entry to the hash with eina_hash_set
|
||||
// Let's first add a new entry
|
||||
int32_t id5 = 5;
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, &id5,
|
||||
strdup("+55 01 234-56789"));
|
||||
if (!phone)
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (!err)
|
||||
{
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
printf("Error when setting phone for Raul Seixas\n");
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -115,7 +108,6 @@ main(int argc, const char *argv[])
|
|||
printf("\n");
|
||||
|
||||
// Now change the phone number
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, &id5,
|
||||
strdup("+55 02 222-22222"));
|
||||
if (phone)
|
||||
|
@ -126,14 +118,8 @@ main(int argc, const char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (err)
|
||||
printf("Error when changing phone for id5\n");
|
||||
else
|
||||
{
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
|
||||
// There are many ways to iterate over our Phone book.
|
||||
|
|
|
@ -92,19 +92,12 @@ main(int argc, const char *argv[])
|
|||
// Modify or add an entry to the hash with eina_hash_set
|
||||
// Let's first add a new entry
|
||||
int64_t id5 = 5;
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, &id5,
|
||||
strdup("+55 01 234-56789"));
|
||||
if (!phone)
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (!err)
|
||||
{
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
printf("Error when setting phone for Raul Seixas\n");
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -115,7 +108,6 @@ main(int argc, const char *argv[])
|
|||
printf("\n");
|
||||
|
||||
// Now change the phone number
|
||||
eina_error_set(0);
|
||||
phone = eina_hash_set(phone_book, &id5,
|
||||
strdup("+55 02 222-22222"));
|
||||
if (phone)
|
||||
|
@ -126,14 +118,8 @@ main(int argc, const char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (err)
|
||||
printf("Error when changing phone for id5\n");
|
||||
else
|
||||
{
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
printf("No previous phone found for id5. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
|
||||
// There are many ways to iterate over our Phone book.
|
||||
|
|
|
@ -105,7 +105,6 @@ main(int argc, const char *argv[])
|
|||
|
||||
// Modify or add an entry to the hash with eina_hash_set
|
||||
// Let's first add a new entry
|
||||
eina_error_set(0);
|
||||
Phone_Entry *p1 = malloc(sizeof(*p1));
|
||||
p1->name = "Raul Seixas";
|
||||
p1->number = "+55 01 234-56789";
|
||||
|
@ -113,14 +112,8 @@ main(int argc, const char *argv[])
|
|||
strdup("raulzito"));
|
||||
if (!nick)
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (!err)
|
||||
{
|
||||
printf("No previous nick found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
printf("Error when setting nick for Raul Seixas\n");
|
||||
printf("No previous nick found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -131,7 +124,6 @@ main(int argc, const char *argv[])
|
|||
printf("\n");
|
||||
|
||||
// Now change the nick
|
||||
eina_error_set(0);
|
||||
nick = eina_hash_set(phone_book, &p1,
|
||||
strdup("raulzao"));
|
||||
if (nick)
|
||||
|
@ -142,14 +134,8 @@ main(int argc, const char *argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Error err = eina_error_get();
|
||||
if (err)
|
||||
printf("Error when changing nick for Raul Seixas\n");
|
||||
else
|
||||
{
|
||||
printf("No previous nick found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
printf("No previous nick found for Raul Seixas. ");
|
||||
printf("Creating new entry.\n");
|
||||
}
|
||||
|
||||
// There are many ways to iterate over our Phone book.
|
||||
|
|
|
@ -65,8 +65,6 @@ _tz_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, cons
|
|||
{
|
||||
struct timezone v = *(struct timezone*)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v.tz_minuteswest;
|
||||
|
@ -130,8 +128,6 @@ _tz_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, cons
|
|||
other_mem = buf; /* required due &buf == buf */
|
||||
return eina_value_type_pset(convert, convert_mem, &other_mem);
|
||||
}
|
||||
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
|
||||
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
|
||||
|
@ -185,13 +184,8 @@ eina_array_grow(Eina_Array *array)
|
|||
EINA_MAGIC_CHECK_ARRAY(array);
|
||||
|
||||
total = array->total + array->step;
|
||||
eina_error_set(0);
|
||||
tmp = realloc(array->data, sizeof (void *) * total);
|
||||
if (EINA_UNLIKELY(!tmp))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return 0;
|
||||
}
|
||||
if (EINA_UNLIKELY(!tmp)) return 0;
|
||||
|
||||
array->total = total;
|
||||
array->data = tmp;
|
||||
|
@ -266,13 +260,8 @@ eina_array_new(unsigned int step)
|
|||
{
|
||||
Eina_Array *array;
|
||||
|
||||
eina_error_set(0);
|
||||
array = malloc(sizeof (Eina_Array));
|
||||
if (!array)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!array) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(array, EINA_MAGIC_ARRAY);
|
||||
|
||||
|
@ -390,13 +379,8 @@ eina_array_remove(Eina_Array *array, Eina_Bool (*keep)(void *data,
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
eina_error_set(0);
|
||||
tmp = malloc(sizeof (void *) * array->total);
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!tmp) return EINA_FALSE;
|
||||
|
||||
memcpy(tmp, array->data, limit * sizeof(void *));
|
||||
total = limit;
|
||||
|
@ -438,13 +422,8 @@ eina_array_iterator_new(const Eina_Array *array)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
|
||||
EINA_MAGIC_CHECK_ARRAY(array);
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_Array));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(it, EINA_MAGIC_ARRAY_ITERATOR);
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
@ -468,13 +447,8 @@ eina_array_accessor_new(const Eina_Array *array)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
|
||||
EINA_MAGIC_CHECK_ARRAY(array);
|
||||
|
||||
eina_error_set(0);
|
||||
ac = calloc(1, sizeof (Eina_Accessor_Array));
|
||||
if (!ac)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!ac) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(ac, EINA_MAGIC_ARRAY_ACCESSOR);
|
||||
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);
|
||||
|
|
|
@ -253,8 +253,7 @@ struct _Eina_Array
|
|||
* another element will increase the buffer by @p step elements again.
|
||||
*
|
||||
* This function return a valid array on success, or @c NULL if memory
|
||||
* allocation fails. In that case, the error is set
|
||||
* to #EINA_ERROR_OUT_OF_MEMORY.
|
||||
* allocation fails.
|
||||
*/
|
||||
EAPI Eina_Array *eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
|
@ -325,7 +324,7 @@ EAPI void eina_array_flush(Eina_Array *array) EINA_ARG_NONNULL(1);
|
|||
* check of @p array. If it is @c NULL or invalid, the program may crash.
|
||||
*
|
||||
* If it wasn't able to remove items due to an allocation failure, it will
|
||||
* return #EINA_FALSE and the error is set to #EINA_ERROR_OUT_OF_MEMORY.
|
||||
* return #EINA_FALSE.
|
||||
*/
|
||||
EAPI Eina_Bool eina_array_remove(Eina_Array * array,
|
||||
Eina_Bool (*keep)(void *data, void *gdata),
|
||||
|
@ -363,8 +362,7 @@ static inline unsigned int eina_array_count(const Eina_Array *array) EINA_ARG_NO
|
|||
* This function returns a newly allocated iterator associated to
|
||||
* @p array. If @p array is @c NULL or the count member of @p array is
|
||||
* less or equal than 0, this function returns @c NULL. If the memory can
|
||||
* not be allocated, NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
|
||||
* set. Otherwise, a valid iterator is returned.
|
||||
* not be allocated, NULL is returned. Otherwise, a valid iterator is returned.
|
||||
*/
|
||||
EAPI Eina_Iterator *eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
|
@ -377,8 +375,8 @@ EAPI Eina_Iterator *eina_array_iterator_new(const Eina_Array *array) EINA
|
|||
* This function returns a newly allocated accessor associated to
|
||||
* @p array. If @p array is @c NULL or the count member of @p array is
|
||||
* less or equal than 0, this function returns @c NULL. If the memory can
|
||||
* not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
|
||||
* set. Otherwise, a valid accessor is returned.
|
||||
* not be allocated, @c NULL is returned Otherwise, a valid accessor is
|
||||
* returned.
|
||||
*/
|
||||
EAPI Eina_Accessor *eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
/**
|
||||
|
|
|
@ -142,13 +142,8 @@ eina_benchmark_new(const char *name, const char *run)
|
|||
{
|
||||
Eina_Benchmark *new;
|
||||
|
||||
eina_error_set(0);
|
||||
new = calloc(1, sizeof (Eina_Benchmark));
|
||||
if (!new)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!new) return NULL;
|
||||
|
||||
new->name = name;
|
||||
new->run = run;
|
||||
|
@ -203,13 +198,8 @@ eina_benchmark_register(Eina_Benchmark *bench,
|
|||
if (count_step == 0)
|
||||
return EINA_FALSE;
|
||||
|
||||
eina_error_set(0);
|
||||
run = calloc(1, sizeof (Eina_Run));
|
||||
if (!run)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!run) return EINA_FALSE;
|
||||
|
||||
run->cb = bench_cb;
|
||||
run->name = name;
|
||||
|
|
|
@ -365,9 +365,8 @@ typedef void (*Eina_Benchmark_Specimens)(int request);
|
|||
* to name the gnuplot file that eina_benchmark_run() will create.
|
||||
*
|
||||
* This function return a valid benchmark on success, or @c NULL if
|
||||
* memory allocation fails. In that case, the error is set
|
||||
* to #EINA_ERROR_OUT_OF_MEMORY.
|
||||
*
|
||||
* memory allocation fails.
|
||||
*
|
||||
* When the new module is not needed anymore, use
|
||||
* eina_benchmark_free() to free the allocated memory.
|
||||
*/
|
||||
|
@ -403,10 +402,8 @@ EAPI void eina_benchmark_free(Eina_Benchmark *bench);
|
|||
* increasing by @p count_step from @p count_start to @p count_end is passed to @p
|
||||
* bench_cb when eina_benchmark_run() is called.
|
||||
*
|
||||
* If @p bench is @c NULL, this function returns immediately. If the
|
||||
* allocation of the memory of the test to add fails, the error is set
|
||||
* to #EINA_ERROR_OUT_OF_MEMORY. This function returns #EINA_FALSE
|
||||
* on failure, #EINA_TRUE otherwise.
|
||||
* If @p bench is @c NULL, this function returns immediately.
|
||||
* This function returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
|
||||
*/
|
||||
EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
|
||||
const char *name,
|
||||
|
|
|
@ -39,8 +39,7 @@ typedef struct _Eina_Strbuf Eina_Binbuf;
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_binbuf_free().
|
||||
* returned. To free the resources, use eina_binbuf_free().
|
||||
*
|
||||
* @see eina_binbuf_free()
|
||||
* @see eina_binbuf_append()
|
||||
|
@ -58,8 +57,7 @@ EAPI Eina_Binbuf *eina_binbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_binbuf_free().
|
||||
* returned. To free the resources, use eina_binbuf_free().
|
||||
*
|
||||
* @see eina_binbuf_manage_new()
|
||||
* @since 1.2.0
|
||||
|
|
|
@ -92,13 +92,6 @@ EAPI Eina_Error EINA_ERROR_CONVERT_P_NOT_FOUND = 0;
|
|||
EAPI Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND = 0;
|
||||
EAPI Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH = 0;
|
||||
|
||||
static const char EINA_ERROR_CONVERT_0X_NOT_FOUND_STR[] =
|
||||
"Error during string conversion to float, First '0x' was not found.";
|
||||
static const char EINA_ERROR_CONVERT_P_NOT_FOUND_STR[] =
|
||||
"Error during string conversion to float, First 'p' was not found.";
|
||||
static const char EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH_STR[] =
|
||||
"Error outrun string limit during conversion string conversion to float.";
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
*/
|
||||
|
@ -112,10 +105,6 @@ static const char EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH_STR[] =
|
|||
* This function sets up the convert module of Eina. It is called by
|
||||
* eina_init().
|
||||
*
|
||||
* This function sets up the error module of Eina and registers the
|
||||
* errors #EINA_ERROR_CONVERT_0X_NOT_FOUND, #EINA_ERROR_CONVERT_P_NOT_FOUND
|
||||
* and #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH.
|
||||
*
|
||||
* @see eina_init()
|
||||
*/
|
||||
Eina_Bool
|
||||
|
@ -128,13 +117,6 @@ eina_convert_init(void)
|
|||
EINA_LOG_ERR("Could not register log domain: eina_convert");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
#define EEMR(n) n = eina_error_msg_static_register(n ## _STR)
|
||||
EEMR(EINA_ERROR_CONVERT_0X_NOT_FOUND);
|
||||
EEMR(EINA_ERROR_CONVERT_P_NOT_FOUND);
|
||||
EEMR(EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH);
|
||||
#undef EEMR
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -239,7 +221,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e)
|
|||
|
||||
if (strncmp(str, "0x", 2))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_CONVERT_0X_NOT_FOUND);
|
||||
DBG("'0x' not found in '%s'", src);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
@ -268,7 +249,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e)
|
|||
/* Compute the exponent. */
|
||||
if (*str != 'p')
|
||||
{
|
||||
eina_error_set(EINA_ERROR_CONVERT_P_NOT_FOUND);
|
||||
DBG("'p' not found in '%s'", src);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
@ -304,7 +284,6 @@ eina_convert_atod(const char *src, int length, long long *m, long *e)
|
|||
return EINA_TRUE;
|
||||
|
||||
on_length_error:
|
||||
eina_error_set(EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -158,23 +158,8 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_CONVERT_P_NOT_FOUND
|
||||
* Error identifier corresponding to string not containing 'p'.
|
||||
*/
|
||||
|
||||
EAPI extern Eina_Error EINA_ERROR_CONVERT_P_NOT_FOUND;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_CONVERT_0X_NOT_FOUND
|
||||
* Error identifier corresponding to string not containing '0x'.
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH
|
||||
* Error identifier corresponding to length of the string being too small.
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH;
|
||||
|
||||
/**
|
||||
|
@ -269,14 +254,7 @@ EAPI int eina_convert_dtoa(double d, char *des) EINA_ARG_NONNULL(2);
|
|||
* The mantiss and exponent are stored in the buffers pointed
|
||||
* respectively by @p m and @p e.
|
||||
*
|
||||
* If the string is invalid, the error is set to:
|
||||
*
|
||||
* @li #EINA_ERROR_CONVERT_0X_NOT_FOUND if no 0x is found,
|
||||
* @li #EINA_ERROR_CONVERT_P_NOT_FOUND if no p is found,
|
||||
* @li #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH if @p length is not
|
||||
* correct.
|
||||
*
|
||||
* In those cases, #EINA_FALSE is returned, otherwise #EINA_TRUE is
|
||||
* If the string is invalid #EINA_FALSE is returned, otherwise #EINA_TRUE is
|
||||
* returned.
|
||||
*/
|
||||
EAPI Eina_Bool eina_convert_atod(const char *src,
|
||||
|
@ -346,14 +324,7 @@ EAPI int eina_convert_fptoa(Eina_F32p32 fp,
|
|||
* The mantiss and exponent are stored in the buffers pointed
|
||||
* respectively by @p m and @p e.
|
||||
*
|
||||
* If the string is invalid, the error is set to:
|
||||
*
|
||||
* @li #EINA_ERROR_CONVERT_0X_NOT_FOUND if no 0x is found,
|
||||
* @li #EINA_ERROR_CONVERT_P_NOT_FOUND if no p is found,
|
||||
* @li #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH if @p length is not
|
||||
* correct.
|
||||
*
|
||||
* In those cases, or if @p fp is @c NULL, #EINA_FALSE is returned,
|
||||
* If the string is invalid, #EINA_FALSE is returned,
|
||||
* otherwise @p fp is computed and #EINA_TRUE is returned.
|
||||
*
|
||||
* @note The code uses eina_convert_atod() and do the correct bit
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_inlist.h"
|
||||
#include "eina_error.h"
|
||||
|
||||
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
|
||||
#include "eina_safety_checks.h"
|
||||
|
@ -70,9 +69,6 @@ struct _Eina_Clock
|
|||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
static const char EINA_ERROR_COUNTER_WINDOWS_STR[] =
|
||||
"Change your OS, you moron !";
|
||||
static int EINA_ERROR_COUNTER_WINDOWS = 0;
|
||||
LARGE_INTEGER _eina_counter_frequency;
|
||||
#endif
|
||||
|
||||
|
@ -134,8 +130,7 @@ _eina_counter_asiprintf(char *base, int *position, const char *format, ...)
|
|||
* eina_counter_init(). It is called by eina_init().
|
||||
*
|
||||
* This function sets up the error module of Eina and only on Windows,
|
||||
* it initializes the high precision timer. It also registers, only on
|
||||
* Windows, the error #EINA_ERROR_COUNTER_WINDOWS. It is also called
|
||||
* it initializes the high precision timer. It is also called
|
||||
* by eina_init(). It returns 0 on failure, otherwise it returns the
|
||||
* number of times it has already been called.
|
||||
*
|
||||
|
@ -145,14 +140,7 @@ Eina_Bool
|
|||
eina_counter_init(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
EINA_ERROR_COUNTER_WINDOWS = eina_error_msg_static_register(
|
||||
EINA_ERROR_COUNTER_WINDOWS_STR);
|
||||
if (!QueryPerformanceFrequency(&_eina_counter_frequency))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_COUNTER_WINDOWS);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
if (!QueryPerformanceFrequency(&_eina_counter_frequency)) return EINA_FALSE;
|
||||
#endif /* _WIN2 */
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -187,14 +175,8 @@ eina_counter_new(const char *name)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
|
||||
|
||||
length = strlen(name) + 1;
|
||||
|
||||
eina_error_set(0);
|
||||
counter = calloc(1, sizeof (Eina_Counter) + length);
|
||||
if (!counter)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!counter) return NULL;
|
||||
|
||||
counter->name = (char *)(counter + 1);
|
||||
memcpy((char *)counter->name, name, length);
|
||||
|
@ -225,16 +207,10 @@ eina_counter_start(Eina_Counter *counter)
|
|||
Eina_Nano_Time tp;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(counter);
|
||||
if (_eina_time_get(&tp) != 0)
|
||||
return;
|
||||
if (_eina_time_get(&tp) != 0) return;
|
||||
|
||||
eina_error_set(0);
|
||||
clk = calloc(1, sizeof (Eina_Clock));
|
||||
if (!clk)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return;
|
||||
}
|
||||
if (!clk) return;
|
||||
|
||||
counter->clocks = eina_inlist_prepend(counter->clocks, EINA_INLIST_GET(clk));
|
||||
|
||||
|
|
|
@ -129,8 +129,7 @@ typedef struct _Eina_Counter Eina_Counter;
|
|||
*
|
||||
* This function returns a new counter. It is characterized by @p
|
||||
* name. If @p name is @c NULL, the function returns @c NULL
|
||||
* immediately. If memory allocation fails, @c NULL is returned and the
|
||||
* error is set to #EINA_ERROR_OUT_OF_MEMORY.
|
||||
* immediately. If memory allocation fails, @c NULL is returned.
|
||||
*
|
||||
* Whe the new counter is not needed anymore, use eina_counter_free() to
|
||||
* free the allocated memory.
|
||||
|
@ -160,7 +159,7 @@ EAPI void eina_counter_free(Eina_Counter *counter) EINA_ARG_NONNULL(1);
|
|||
*
|
||||
* This function adds the clock associated to @p counter in a list. If
|
||||
* the memory needed by that clock can not be allocated, the function
|
||||
* returns and the error is set to #EINA_ERROR_OUT_OF_MEMORY.
|
||||
* returns and nothing is done.
|
||||
*
|
||||
* To stop the timing, eina_counter_stop() must be called with the
|
||||
* same counter.
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_rbtree.h"
|
||||
#include "eina_error.h"
|
||||
|
||||
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
|
||||
#include "eina_safety_checks.h"
|
||||
|
@ -219,7 +218,6 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash,
|
|||
{
|
||||
Eina_Hash_Element *new_hash_element = NULL;
|
||||
Eina_Hash_Head *hash_head;
|
||||
Eina_Error error = 0;
|
||||
int original_key;
|
||||
int hash_num;
|
||||
|
||||
|
@ -228,8 +226,6 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash,
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
|
||||
EINA_MAGIC_CHECK_HASH(hash);
|
||||
|
||||
error = EINA_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
/* Apply eina mask to hash. */
|
||||
original_key = key_hash;
|
||||
hash_num = key_hash & hash->mask;
|
||||
|
@ -299,7 +295,6 @@ eina_hash_add_alloc_by_hash(Eina_Hash *hash,
|
|||
return EINA_TRUE;
|
||||
|
||||
on_error:
|
||||
eina_error_set(error);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -729,7 +724,6 @@ eina_hash_new(Eina_Key_Length key_length_cb,
|
|||
/* FIXME: Use mempool. */
|
||||
Eina_Hash *new;
|
||||
|
||||
eina_error_set(0);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(key_cmp_cb, NULL);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(key_hash_cb, NULL);
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL(buckets_power_size <= 2, NULL);
|
||||
|
@ -754,7 +748,6 @@ eina_hash_new(Eina_Key_Length key_length_cb,
|
|||
return new;
|
||||
|
||||
on_error:
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1234,13 +1227,8 @@ eina_hash_iterator_data_new(const Eina_Hash *hash)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
|
||||
EINA_MAGIC_CHECK_HASH(hash);
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_Hash));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
it->hash = hash;
|
||||
it->get_content = FUNC_ITERATOR_GET_CONTENT(_eina_hash_iterator_data_get_content);
|
||||
|
@ -1265,13 +1253,8 @@ eina_hash_iterator_key_new(const Eina_Hash *hash)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
|
||||
EINA_MAGIC_CHECK_HASH(hash);
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_Hash));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
it->hash = hash;
|
||||
it->get_content = FUNC_ITERATOR_GET_CONTENT(
|
||||
|
@ -1297,13 +1280,8 @@ eina_hash_iterator_tuple_new(const Eina_Hash *hash)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
|
||||
EINA_MAGIC_CHECK_HASH(hash);
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_Hash));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
it->hash = hash;
|
||||
it->get_content = FUNC_ITERATOR_GET_CONTENT(
|
||||
|
|
|
@ -330,8 +330,8 @@ typedef Eina_Bool (*Eina_Hash_Foreach)(const Eina_Hash *hash, const void *key
|
|||
* @return The new hash table.
|
||||
*
|
||||
* This function creates a new hash table using user-defined callbacks
|
||||
* to manage the hash table. On failure, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. If @p key_cmp_cb or @p key_hash_cb
|
||||
* to manage the hash table. On failure, @c NULL is returned.
|
||||
* If @p key_cmp_cb or @p key_hash_cb
|
||||
* are @c NULL, @c NULL is returned. If @p buckets_power_size is
|
||||
* smaller or equal than 2, or if it is greater or equal than 17,
|
||||
* @c NULL is returned.
|
||||
|
@ -518,9 +518,7 @@ EAPI Eina_Hash *eina_hash_stringshared_new(Eina_Free_Cb data_free_cb);
|
|||
* values as unique. Failure to use sufficient uniqueness will
|
||||
* result in unexpected results when inserting data pointers accessed
|
||||
* with eina_hash_find(), and removed with eina_hash_del(). Key
|
||||
* strings are case sensitive. If an error occurs, eina_error_get()
|
||||
* should be used to determine if an allocation error occurred during
|
||||
* this function. This function returns #EINA_FALSE if an error
|
||||
* strings are case sensitive. This function returns #EINA_FALSE if an error
|
||||
* occurred, #EINA_TRUE otherwise.
|
||||
*/
|
||||
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
|
||||
|
@ -548,9 +546,7 @@ EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
|
|||
* with eina_hash_find(), and removed with eina_hash_del(). This
|
||||
* function does not make a copy of @p key, so it must be a string
|
||||
* constant or stored elsewhere ( in the object being added). Key
|
||||
* strings are case sensitive. If an error occurs, eina_error_get()
|
||||
* should be used to determine if an allocation error occurred during
|
||||
* this function. This function returns #EINA_FALSE if an error
|
||||
* strings are case sensitive. This function returns #EINA_FALSE if an error
|
||||
* occurred, #EINA_TRUE otherwise.
|
||||
*/
|
||||
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash,
|
||||
|
@ -630,8 +626,7 @@ EAPI void *eina_hash_modify(Eina_Hash *hash,
|
|||
* This function modifies the data of @p key with @p data in @p
|
||||
* hash. If no entry is found, @p data is added to @p hash with the
|
||||
* key @p key. On success this function returns the old entry,
|
||||
* otherwise it returns @c NULL. To check for errors, use
|
||||
* eina_error_get().
|
||||
* otherwise it returns @c NULL.
|
||||
*/
|
||||
EAPI void *eina_hash_set(Eina_Hash *hash,
|
||||
const void *key,
|
||||
|
@ -722,9 +717,7 @@ EAPI int eina_hash_population(const Eina_Hash *hash) EINA_ARG_NONNULL(1);
|
|||
* not forget to count '\\0' for string when setting the value of
|
||||
* @p key_length. @p key_hash is expected to always match
|
||||
* @p key. Otherwise, one cannot be sure to find it again with @ref
|
||||
* eina_hash_find_by_hash. Key strings are case sensitive. If an error
|
||||
* occurs, eina_error_get() should be used to determine if an
|
||||
* allocation error occurred during this function. This function
|
||||
* eina_hash_find_by_hash. Key strings are case sensitive. This function
|
||||
* returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
|
||||
*
|
||||
* @see eina_hash_add()
|
||||
|
@ -758,9 +751,7 @@ EAPI Eina_Bool eina_hash_add_by_hash(Eina_Hash *hash,
|
|||
* not forget to count '\\0' for string when setting the value of
|
||||
* @p key_length. @p key_hash is expected to always match
|
||||
* @p key. Otherwise, one cannot be sure to find it again with @ref
|
||||
* eina_hash_find_by_hash. Key strings are case sensitive. If an error
|
||||
* occurs, eina_error_get() should be used to determine if an
|
||||
* allocation error occurred during this function. This function
|
||||
* eina_hash_find_by_hash. Key strings are case sensitive. This function
|
||||
* returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
|
||||
*
|
||||
* @see eina_hash_direct_add()
|
||||
|
@ -934,9 +925,8 @@ EAPI void *eina_hash_modify_by_hash(Eina_Hash *hash,
|
|||
* valid iterator that will always return false on
|
||||
* eina_iterator_next(), thus keeping API sane.
|
||||
*
|
||||
* If the memory can not be allocated, NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* If the memory can not be allocated, NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the hash structure changes then the iterator becomes
|
||||
* invalid! That is, if you add or remove items this iterator
|
||||
|
@ -955,9 +945,8 @@ EAPI Eina_Iterator *eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_MALLO
|
|||
* valid iterator that will always return false on
|
||||
* eina_iterator_next(), thus keeping API sane.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the hash structure changes then the iterator becomes
|
||||
* invalid. That is, if you add or remove items this iterator behavior
|
||||
|
@ -976,9 +965,8 @@ EAPI Eina_Iterator *eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_MALL
|
|||
* valid iterator that will always return false on
|
||||
* eina_iterator_next(), thus keeping API sane.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @note iterator data will provide values as Eina_Hash_Tuple that should not
|
||||
* be modified!
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
|
||||
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
|
||||
|
@ -82,7 +81,6 @@ static int _eina_inarray_log_dom = -1;
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
eina_error_set(0); \
|
||||
} \
|
||||
while(0)
|
||||
|
||||
|
@ -94,7 +92,6 @@ static int _eina_inarray_log_dom = -1;
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ITERATOR); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
eina_error_set(0); \
|
||||
} \
|
||||
while(0)
|
||||
|
||||
|
@ -106,7 +103,6 @@ static int _eina_inarray_log_dom = -1;
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ACCESSOR); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
eina_error_set(0); \
|
||||
} \
|
||||
while(0)
|
||||
|
||||
|
@ -137,11 +133,7 @@ _eina_inarray_resize(Eina_Inarray *array, unsigned int new_size)
|
|||
new_max = ((new_size / array->step) + 1) * array->step;
|
||||
|
||||
tmp = realloc(array->members, new_max * array->member_size);
|
||||
if ((!tmp) && (new_max > 0))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if ((!tmp) && (new_max > 0)) return EINA_FALSE;
|
||||
|
||||
array->members = tmp;
|
||||
array->max = new_max;
|
||||
|
@ -342,12 +334,7 @@ eina_inarray_new(unsigned int member_size, unsigned int step)
|
|||
EINA_SAFETY_ON_TRUE_RETURN_VAL(member_size == 0, NULL);
|
||||
|
||||
ret = malloc(sizeof(*ret));
|
||||
if (!ret)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
eina_error_set(0);
|
||||
if (!ret) return NULL;
|
||||
_eina_inarray_setup(ret, member_size, step);
|
||||
return ret;
|
||||
}
|
||||
|
@ -730,13 +717,8 @@ eina_inarray_iterator_new(const Eina_Inarray *array)
|
|||
|
||||
EINA_MAGIC_CHECK_INARRAY(array, NULL);
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof(Eina_Iterator_Inarray));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR);
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
@ -759,13 +741,8 @@ eina_inarray_iterator_reversed_new(const Eina_Inarray *array)
|
|||
|
||||
EINA_MAGIC_CHECK_INARRAY(array, NULL);
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof(Eina_Iterator_Inarray));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR);
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
@ -789,13 +766,8 @@ eina_inarray_accessor_new(const Eina_Inarray *array)
|
|||
|
||||
EINA_MAGIC_CHECK_INARRAY(array, NULL);
|
||||
|
||||
eina_error_set(0);
|
||||
ac = calloc(1, sizeof(Eina_Accessor_Inarray));
|
||||
if (!ac)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!ac) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(ac, EINA_MAGIC_INARRAY_ACCESSOR);
|
||||
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);
|
||||
|
|
|
@ -224,8 +224,8 @@ struct _Eina_Inarray
|
|||
*
|
||||
* If the @a step is 0, then a safe default is chosen.
|
||||
*
|
||||
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
|
||||
* set. If @a member_size is zero, then @c NULL is returned.
|
||||
* On failure, @c NULL is returned. If @a member_size is zero, then @c NULL
|
||||
* is returned.
|
||||
*
|
||||
* @see eina_inarray_free()
|
||||
*
|
||||
|
@ -618,9 +618,8 @@ EAPI unsigned int eina_inarray_count(const Eina_Inarray *array) EINA_ARG_NONNULL
|
|||
* This function returns a newly allocated iterator associated to
|
||||
* @p array.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the array structure changes then the iterator becomes
|
||||
* invalid! That is, if you add or remove members this
|
||||
|
@ -641,8 +640,7 @@ EAPI Eina_Iterator *eina_inarray_iterator_new(const Eina_Inarray *array) EINA_MA
|
|||
* Unlike eina_inarray_iterator_new(), this will walk the array backwards.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the array structure changes then the iterator becomes
|
||||
* invalid! That is, if you add or remove nodes this iterator
|
||||
|
@ -660,9 +658,8 @@ EAPI Eina_Iterator *eina_inarray_iterator_reversed_new(const Eina_Inarray *array
|
|||
* This function returns a newly allocated accessor associated to
|
||||
* @p array.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid accessor is
|
||||
* returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid accessor is returned.
|
||||
*
|
||||
* @since 1.2
|
||||
*/
|
||||
|
|
|
@ -52,8 +52,7 @@ EAPI Eina_Bool eina_array_grow(Eina_Array *array);
|
|||
* reasons, there is no check of @p array. If it is @c NULL or
|
||||
* invalid, the program may crash. If @p data is @c NULL, or if an
|
||||
* allocation is necessary and fails, #EINA_FALSE is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, #EINA_TRUE is
|
||||
* returned.
|
||||
* Otherwise, #EINA_TRUE is returned.
|
||||
*/
|
||||
|
||||
static inline Eina_Bool
|
||||
|
|
|
@ -64,8 +64,6 @@ EAPI extern const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END;
|
|||
{ \
|
||||
if (type->method) \
|
||||
type->method(type, ##__VA_ARGS__); \
|
||||
else \
|
||||
eina_error_set(no_method_err); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
@ -74,7 +72,6 @@ EAPI extern const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END;
|
|||
{ \
|
||||
if (type->method) \
|
||||
return type->method(type, ##__VA_ARGS__); \
|
||||
eina_error_set(no_method_err); \
|
||||
return def_ret; \
|
||||
} \
|
||||
while (0)
|
||||
|
@ -126,12 +123,11 @@ eina_value_setup(Eina_Value *value, const Eina_Value_Type *type)
|
|||
|
||||
if (EINA_VALUE_TYPE_DEFAULT(type))
|
||||
{
|
||||
eina_error_set(0);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(type, setup,
|
||||
EINA_ERROR_VALUE_FAILED, EINA_FALSE, mem);
|
||||
0, EINA_FALSE, mem);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -157,11 +153,10 @@ eina_value_flush(Eina_Value *value)
|
|||
}
|
||||
else if (type->value_size > 8)
|
||||
eina_value_inner_free(type->value_size, mem);
|
||||
eina_error_set(0);
|
||||
return;
|
||||
}
|
||||
|
||||
EINA_VALUE_TYPE_DISPATCH(type, flush, EINA_ERROR_VALUE_FAILED, mem);
|
||||
EINA_VALUE_TYPE_DISPATCH(type, flush, 0, mem);
|
||||
if (type->value_size > 8)
|
||||
eina_value_inner_free(type->value_size, mem);
|
||||
value->type = NULL;
|
||||
|
@ -177,7 +172,6 @@ eina_value_compare(const Eina_Value *a, const Eina_Value *b)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(b, -1);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(a->type == b->type, -1);
|
||||
|
||||
eina_error_set(0);
|
||||
type = a->type;
|
||||
pa = eina_value_memory_get(a);
|
||||
pb = eina_value_memory_get(b);
|
||||
|
@ -306,7 +300,7 @@ eina_value_compare(const Eina_Value *a, const Eina_Value *b)
|
|||
}
|
||||
#endif
|
||||
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, EINA_ERROR_VALUE_FAILED,
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, 0,
|
||||
EINA_FALSE, pa, pb);
|
||||
}
|
||||
|
||||
|
@ -342,7 +336,6 @@ eina_value_vset(Eina_Value *value, va_list args)
|
|||
|
||||
type = value->type;
|
||||
mem = eina_value_memory_get(value);
|
||||
eina_error_set(0);
|
||||
#ifndef EINA_VALUE_NO_OPTIMIZE
|
||||
if (type == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
|
@ -433,11 +426,7 @@ eina_value_vset(Eina_Value *value, va_list args)
|
|||
else
|
||||
{
|
||||
char *tmp = strdup(str);
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!tmp) return EINA_FALSE;
|
||||
free(value->value.ptr);
|
||||
value->value.ptr = tmp;
|
||||
}
|
||||
|
@ -445,7 +434,7 @@ eina_value_vset(Eina_Value *value, va_list args)
|
|||
}
|
||||
#endif
|
||||
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, EINA_ERROR_VALUE_FAILED,
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, 0,
|
||||
EINA_FALSE, mem, args);
|
||||
}
|
||||
|
||||
|
@ -461,14 +450,13 @@ eina_value_vget(const Eina_Value *value, va_list args)
|
|||
type = value->type;
|
||||
mem = eina_value_memory_get(value);
|
||||
ptr = va_arg(args, void *);
|
||||
eina_error_set(0);
|
||||
if (EINA_VALUE_TYPE_DEFAULT(type))
|
||||
{
|
||||
memcpy(ptr, mem, type->value_size);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, EINA_ERROR_VALUE_FAILED,
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, 0,
|
||||
EINA_FALSE, mem, ptr);
|
||||
}
|
||||
|
||||
|
@ -483,7 +471,6 @@ eina_value_pset(Eina_Value *value, const void *ptr)
|
|||
|
||||
type = value->type;
|
||||
mem = eina_value_memory_get(value);
|
||||
eina_error_set(0);
|
||||
|
||||
if (EINA_VALUE_TYPE_DEFAULT(type))
|
||||
{
|
||||
|
@ -506,11 +493,7 @@ eina_value_pset(Eina_Value *value, const void *ptr)
|
|||
else
|
||||
{
|
||||
char *tmp = strdup(str);
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!tmp) return EINA_FALSE;
|
||||
free(value->value.ptr);
|
||||
value->value.ptr = tmp;
|
||||
}
|
||||
|
@ -521,7 +504,7 @@ eina_value_pset(Eina_Value *value, const void *ptr)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, pset, EINA_ERROR_VALUE_FAILED,
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, pset, 0,
|
||||
EINA_FALSE, mem, ptr);
|
||||
}
|
||||
|
||||
|
@ -536,14 +519,13 @@ eina_value_pget(const Eina_Value *value, void *ptr)
|
|||
|
||||
type = value->type;
|
||||
mem = eina_value_memory_get(value);
|
||||
eina_error_set(0);
|
||||
if (EINA_VALUE_TYPE_DEFAULT(type))
|
||||
{
|
||||
memcpy(ptr, mem, type->value_size);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, EINA_ERROR_VALUE_FAILED,
|
||||
EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, 0,
|
||||
EINA_FALSE, mem, ptr);
|
||||
}
|
||||
|
||||
|
@ -1281,11 +1263,7 @@ eina_value_hash_vset(Eina_Value *value, const char *key, va_list args)
|
|||
if (!mem)
|
||||
{
|
||||
mem = malloc(desc->subtype->value_size);
|
||||
if (!mem)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!mem) return EINA_FALSE;
|
||||
if (!eina_hash_add(desc->hash, key, mem))
|
||||
{
|
||||
free(mem);
|
||||
|
@ -1364,11 +1342,7 @@ eina_value_hash_pset(Eina_Value *value, const char *key, const void *ptr)
|
|||
if (!mem)
|
||||
{
|
||||
mem = malloc(desc->subtype->value_size);
|
||||
if (!mem)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!mem) return EINA_FALSE;
|
||||
if (!eina_hash_add(desc->hash, key, mem))
|
||||
{
|
||||
free(mem);
|
||||
|
@ -1678,11 +1652,7 @@ static inline Eina_Bool
|
|||
eina_value_type_setup(const Eina_Value_Type *type, void *mem)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->setup)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->setup) return EINA_FALSE;
|
||||
return type->setup(type, mem);
|
||||
}
|
||||
|
||||
|
@ -1690,11 +1660,7 @@ static inline Eina_Bool
|
|||
eina_value_type_flush(const Eina_Value_Type *type, void *mem)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->flush)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->flush) return EINA_FALSE;
|
||||
return type->flush(type, mem);
|
||||
}
|
||||
|
||||
|
@ -1702,11 +1668,7 @@ static inline Eina_Bool
|
|||
eina_value_type_copy(const Eina_Value_Type *type, const void *src, void *dst)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->copy)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->copy) return EINA_FALSE;
|
||||
return type->copy(type, src, dst);
|
||||
}
|
||||
|
||||
|
@ -1714,11 +1676,7 @@ static inline int
|
|||
eina_value_type_compare(const Eina_Value_Type *type, const void *a, const void *b)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->compare)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->compare) return EINA_FALSE;
|
||||
return type->compare(type, a, b);
|
||||
}
|
||||
|
||||
|
@ -1726,11 +1684,7 @@ static inline Eina_Bool
|
|||
eina_value_type_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, const void *type_mem, void *convert_mem)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->convert_to)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->convert_to) return EINA_FALSE;
|
||||
return type->convert_to(type, convert, type_mem, convert_mem);
|
||||
}
|
||||
|
||||
|
@ -1738,11 +1692,7 @@ static inline Eina_Bool
|
|||
eina_value_type_convert_from(const Eina_Value_Type *type, const Eina_Value_Type *convert, void *type_mem, const void *convert_mem)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->convert_from)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->convert_from) return EINA_FALSE;
|
||||
return type->convert_from(type, convert, type_mem, convert_mem);
|
||||
}
|
||||
|
||||
|
@ -1750,11 +1700,7 @@ static inline Eina_Bool
|
|||
eina_value_type_vset(const Eina_Value_Type *type, void *mem, va_list args)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->vset)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->vset) return EINA_FALSE;
|
||||
return type->vset(type, mem, args);
|
||||
}
|
||||
|
||||
|
@ -1762,11 +1708,7 @@ static inline Eina_Bool
|
|||
eina_value_type_pset(const Eina_Value_Type *type, void *mem, const void *ptr)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->pset)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->pset) return EINA_FALSE;
|
||||
return type->pset(type, mem, ptr);
|
||||
}
|
||||
|
||||
|
@ -1774,11 +1716,7 @@ static inline Eina_Bool
|
|||
eina_value_type_pget(const Eina_Value_Type *type, const void *mem, void *ptr)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
|
||||
if (!type->pget)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!type->pget) return EINA_FALSE;
|
||||
return type->pget(type, mem, ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
|
||||
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
|
||||
|
@ -342,7 +341,6 @@ eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(item, list);
|
||||
if (EINA_UNLIKELY((item != list) && (!item->prev) && (!item->next)))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED);
|
||||
EINA_LOG_ERR("safety check failed: item %p does not appear to be part of an inlist!", item);
|
||||
return list;
|
||||
}
|
||||
|
@ -870,13 +868,8 @@ eina_inlist_iterator_new(const Eina_Inlist *list)
|
|||
{
|
||||
Eina_Iterator_Inlist *it;
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_Inlist));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
it->head = list;
|
||||
it->current = list;
|
||||
|
@ -897,13 +890,8 @@ eina_inlist_accessor_new(const Eina_Inlist *list)
|
|||
{
|
||||
Eina_Accessor_Inlist *ac;
|
||||
|
||||
eina_error_set(0);
|
||||
ac = calloc(1, sizeof (Eina_Accessor_Inlist));
|
||||
if (!ac)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!ac) return NULL;
|
||||
|
||||
ac->head = list;
|
||||
ac->current = list;
|
||||
|
|
|
@ -639,9 +639,8 @@ EAPI unsigned int eina_inlist_count(const Eina_Inlist *list) EINA_WARN_UNUSED_
|
|||
* will always return false on eina_iterator_next(), thus keeping API
|
||||
* sane.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator
|
||||
* is returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the list structure changes then the iterator becomes
|
||||
* invalid, and if you add or remove nodes iterator
|
||||
|
@ -658,8 +657,8 @@ EAPI Eina_Iterator *eina_inlist_iterator_new(const Eina_Inlist *in_list) EINA_MA
|
|||
* This function returns a newly allocated accessor associated to
|
||||
* @p in_list. If @p in_list is @c NULL or the count member of @p in_list is
|
||||
* less or equal than @c 0, this function returns @c NULL. If the memory can
|
||||
* not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
|
||||
* set. Otherwise, a valid accessor is returned.
|
||||
* not be allocated, @c NULL is returned and Otherwise, a valid accessor is
|
||||
* returned.
|
||||
*/
|
||||
EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
|
@ -676,7 +675,7 @@ EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MA
|
|||
* sorted and the result will be sorted. If @p list is @c NULLL, item
|
||||
* is returned. On success, a new list pointer that should be
|
||||
* used in place of the one given to this function is
|
||||
* returned. Otherwise, the old pointer is returned. See eina_error_get().
|
||||
* returned. Otherwise, the old pointer is returned.
|
||||
*
|
||||
* @note O(log2(n)) comparisons (calls to @p func) average/worst case
|
||||
* performance. As said in eina_list_search_sorted_near_list(),
|
||||
|
@ -738,7 +737,7 @@ EAPI void eina_inlist_sorted_state_free(Eina_Inlist_Sorted_State *state);
|
|||
* list with an updated state.. If @p list is @c NULLL, item
|
||||
* is returned. On success, a new list pointer that should be
|
||||
* used in place of the one given to this function is
|
||||
* returned. Otherwise, the old pointer is returned. See eina_error_get().
|
||||
* returned. Otherwise, the old pointer is returned.
|
||||
*
|
||||
* @note O(log2(n)) comparisons (calls to @p func) average/worst case
|
||||
* performance. As said in eina_list_search_sorted_near_list(),
|
||||
|
|
|
@ -68,7 +68,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
#include "eina_mempool.h"
|
||||
|
||||
|
@ -532,10 +531,8 @@ eina_list_append(Eina_List *list, const void *data)
|
|||
{
|
||||
Eina_List *l, *new_l;
|
||||
|
||||
eina_error_set(0);
|
||||
new_l = _eina_list_mempool_list_new(list);
|
||||
if (!new_l)
|
||||
return list;
|
||||
if (!new_l) return list;
|
||||
|
||||
new_l->next = NULL;
|
||||
new_l->data = (void *)data;
|
||||
|
@ -562,10 +559,8 @@ eina_list_prepend(Eina_List *list, const void *data)
|
|||
{
|
||||
Eina_List *new_l;
|
||||
|
||||
eina_error_set(0);
|
||||
new_l = _eina_list_mempool_list_new(list);
|
||||
if (!new_l)
|
||||
return list;
|
||||
if (!new_l) return list;
|
||||
|
||||
new_l->prev = NULL;
|
||||
new_l->next = list;
|
||||
|
@ -613,10 +608,8 @@ eina_list_append_relative_list(Eina_List *list,
|
|||
if ((!list) || (!relative))
|
||||
return eina_list_append(list, data);
|
||||
|
||||
eina_error_set(0);
|
||||
new_l = _eina_list_mempool_list_new(list);
|
||||
if (!new_l)
|
||||
return list;
|
||||
if (!new_l) return list;
|
||||
|
||||
EINA_MAGIC_CHECK_LIST(relative, NULL);
|
||||
new_l->next = relative->next;
|
||||
|
@ -665,10 +658,8 @@ eina_list_prepend_relative_list(Eina_List *list,
|
|||
if ((!list) || (!relative))
|
||||
return eina_list_prepend(list, data);
|
||||
|
||||
eina_error_set(0);
|
||||
new_l = _eina_list_mempool_list_new(list);
|
||||
if (!new_l)
|
||||
return list;
|
||||
if (!new_l) return list;
|
||||
|
||||
EINA_MAGIC_CHECK_LIST(relative, NULL);
|
||||
|
||||
|
@ -1493,13 +1484,8 @@ eina_list_iterator_new(const Eina_List *list)
|
|||
{
|
||||
Eina_Iterator_List *it;
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_List));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR);
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
@ -1521,13 +1507,8 @@ eina_list_iterator_reversed_new(const Eina_List *list)
|
|||
{
|
||||
Eina_Iterator_List *it;
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_List));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR);
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
@ -1551,13 +1532,8 @@ eina_list_accessor_new(const Eina_List *list)
|
|||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL);
|
||||
|
||||
eina_error_set(0);
|
||||
ac = calloc(1, sizeof (Eina_Accessor_List));
|
||||
if (!ac)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!ac) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(ac, EINA_MAGIC_LIST_ACCESSOR);
|
||||
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);
|
||||
|
|
|
@ -361,11 +361,6 @@ struct _Eina_List_Accounting
|
|||
* extern void *my_data;
|
||||
*
|
||||
* list = eina_list_append(list, my_data);
|
||||
* if (eina_error_get())
|
||||
* {
|
||||
* fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
|
||||
* exit(-1);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @warning @p list must be a pointer to the first element of the list(or NULL).
|
||||
|
@ -394,11 +389,6 @@ EAPI Eina_List *eina_list_append(Eina_List *list, const void *data) E
|
|||
* extern void *my_data;
|
||||
*
|
||||
* list = eina_list_prepend(list, my_data);
|
||||
* if (eina_error_get())
|
||||
* {
|
||||
* fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
|
||||
* exit(-1);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @warning @p list must be a pointer to the first element of the list.
|
||||
|
@ -431,17 +421,7 @@ EAPI Eina_List *eina_list_prepend(Eina_List *list, const void *data)
|
|||
* extern void *relative_member;
|
||||
*
|
||||
* list = eina_list_append(list, relative_member);
|
||||
* if (eina_error_get())
|
||||
* {
|
||||
* fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
|
||||
* exit(-1);
|
||||
* }
|
||||
* list = eina_list_append_relative(list, my_data, relative_member);
|
||||
* if (eina_error_get())
|
||||
* {
|
||||
* fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
|
||||
* exit(-1);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @warning @p list must be a pointer to the first element of the list.
|
||||
|
@ -496,17 +476,7 @@ EAPI Eina_List *eina_list_append_relative_list(Eina_List *list, const
|
|||
* extern void *relative_member;
|
||||
*
|
||||
* list = eina_list_append(list, relative_member);
|
||||
* if (eina_error_get_error())
|
||||
* {
|
||||
* fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
|
||||
* exit(-1);
|
||||
* }
|
||||
* list = eina_list_prepend_relative(list, my_data, relative_member);
|
||||
* if (eina_error_get())
|
||||
* {
|
||||
* fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
|
||||
* exit(-1);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @warning @p list must be a pointer to the first element of the list.
|
||||
|
@ -548,7 +518,7 @@ EAPI Eina_List *eina_list_prepend_relative_list(Eina_List *list, cons
|
|||
* sorted and the result will be sorted. If @p list is @c NULLL, a new
|
||||
* list is returned. On success, a new list pointer that should be
|
||||
* used in place of the one given to this function is
|
||||
* returned. Otherwise, the old pointer is returned. See eina_error_get().
|
||||
* returned. Otherwise, the old pointer is returned.
|
||||
*
|
||||
* @note O(log2(n)) comparisons (calls to @p func) average/worst case
|
||||
* performance as it uses eina_list_search_sorted_near_list() and thus
|
||||
|
@ -1310,9 +1280,8 @@ static inline unsigned int eina_list_count(const Eina_List *list) EINA_PURE;
|
|||
* will always return false on eina_iterator_next(), thus keeping API
|
||||
* sane.
|
||||
*
|
||||
* If the memory can not be allocated, NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator
|
||||
* is returned.
|
||||
* If the memory can not be allocated, NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning @p list must be a pointer to the first element of the list.
|
||||
*
|
||||
|
@ -1337,9 +1306,8 @@ EAPI Eina_Iterator *eina_list_iterator_new(const Eina_List *list) EINA_MA
|
|||
*
|
||||
* Unlike eina_list_iterator_new(), this will walk the list backwards.
|
||||
*
|
||||
* If the memory can not be allocated, NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator
|
||||
* is returned.
|
||||
* If the memory can not be allocated, NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning @p list must be a pointer to the first element of the list.
|
||||
*
|
||||
|
@ -1359,8 +1327,8 @@ EAPI Eina_Iterator *eina_list_iterator_reversed_new(const Eina_List *list
|
|||
* This function returns a newly allocated accessor associated to
|
||||
* @p list. If @p list is @c NULL or the count member of @p list is
|
||||
* less or equal than 0, this function returns @c NULL. If the memory can
|
||||
* not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
|
||||
* set. Otherwise, a valid accessor is returned.
|
||||
* not be allocated, @c NULL is returned Otherwise, a valid accessor is
|
||||
* returned.
|
||||
*
|
||||
* @warning @p list must be a pointer to the first element of the list.
|
||||
*/
|
||||
|
|
|
@ -129,7 +129,6 @@ static inline void eina_spinlock_free(Eina_Spinlock *spinlock);
|
|||
do { \
|
||||
if (EINA_UNLIKELY(!eina_main_loop_is())) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \
|
||||
EINA_LOG_ERR("You are calling %s from outside" \
|
||||
"of the main loop threads in %s at line %i", \
|
||||
__FUNCTION__, \
|
||||
|
@ -142,7 +141,6 @@ static inline void eina_spinlock_free(Eina_Spinlock *spinlock);
|
|||
do { \
|
||||
if (EINA_UNLIKELY(!eina_main_loop_is())) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \
|
||||
EINA_LOG_ERR("You are calling %s from outside" \
|
||||
"of the main loop threads in %s at line %i", \
|
||||
__FUNCTION__, \
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
|
||||
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
|
||||
|
@ -126,8 +125,6 @@ _eina_magic_strings_alloc(void)
|
|||
|
||||
EAPI Eina_Error EINA_ERROR_MAGIC_FAILED = 0;
|
||||
|
||||
static const char EINA_ERROR_MAGIC_FAILED_STR[] = "Magic check failed.";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @brief Initialize the magic string module.
|
||||
|
@ -149,9 +146,6 @@ eina_magic_string_init(void)
|
|||
EINA_LOG_ERR("Could not register log domain: eina_magic_string");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
EINA_ERROR_MAGIC_FAILED = eina_error_msg_static_register(
|
||||
EINA_ERROR_MAGIC_FAILED_STR);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -272,7 +266,6 @@ eina_magic_fail(void *d,
|
|||
const char *fnc,
|
||||
int line)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MAGIC_FAILED);
|
||||
if (!d)
|
||||
eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR,
|
||||
file, fnc, line,
|
||||
|
|
|
@ -201,13 +201,8 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
|||
*/
|
||||
#define EINA_MAGIC_NONE 0x1234fedc
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_MAGIC_FAILED
|
||||
* Error identifier corresponding to magic check failure.
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_MAGIC_FAILED;
|
||||
|
||||
|
||||
#ifdef EINA_MAGIC_DEBUG
|
||||
|
||||
/**
|
||||
|
|
|
@ -102,8 +102,6 @@ EAPI Eina_Bool _eina_threads_activated = EINA_FALSE;
|
|||
EAPI Eina_Error EINA_ERROR_NOT_MAIN_LOOP = 0;
|
||||
EAPI unsigned int eina_seed = 0;
|
||||
|
||||
static const char EINA_ERROR_NOT_MAIN_LOOP_STR[] = "Main loop thread check failed.";
|
||||
|
||||
#ifdef EFL_HAVE_THREADS
|
||||
# ifdef _WIN32
|
||||
EAPI DWORD _eina_main_loop;
|
||||
|
@ -279,9 +277,6 @@ eina_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
EINA_ERROR_NOT_MAIN_LOOP = eina_error_msg_static_register(
|
||||
EINA_ERROR_NOT_MAIN_LOOP_STR);
|
||||
|
||||
#ifdef EFL_HAVE_THREADS
|
||||
# ifdef _WIN32
|
||||
_eina_main_loop = GetCurrentThreadId();
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
#include "eina_magic.h"
|
||||
#include "eina_mempool.h"
|
||||
|
@ -943,11 +942,7 @@ eina_matrixsparse_new(unsigned long rows, unsigned long cols, void (*free_func)(
|
|||
EINA_SAFETY_ON_FALSE_RETURN_VAL(cols > 0, NULL);
|
||||
|
||||
m = malloc(sizeof(Eina_Matrixsparse));
|
||||
if (!m)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!m) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(m, EINA_MAGIC_MATRIXSPARSE);
|
||||
|
||||
|
@ -960,7 +955,6 @@ eina_matrixsparse_new(unsigned long rows, unsigned long cols, void (*free_func)(
|
|||
m->free.func = free_func;
|
||||
m->free.user_data = (void *)user_data;
|
||||
|
||||
eina_error_set(0);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
@ -1364,11 +1358,7 @@ eina_matrixsparse_iterator_new(const Eina_Matrixsparse *m)
|
|||
Eina_Matrixsparse_Iterator *it;
|
||||
|
||||
it = calloc(1, sizeof(*it));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR);
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
@ -1391,11 +1381,7 @@ eina_matrixsparse_iterator_complete_new(const Eina_Matrixsparse *m)
|
|||
Eina_Matrixsparse_Iterator_Complete *it;
|
||||
|
||||
it = calloc(1, sizeof(*it));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR);
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
|
|
@ -87,8 +87,7 @@ typedef struct _Eina_Matrixsparse_Cell Eina_Matrixsparse_Cell;
|
|||
* eina_matrixsparse_cell_idx_clear() and possible others.
|
||||
* @param user_data given to @a free_func as first parameter.
|
||||
*
|
||||
* @return Newly allocated matrix or @c NULL if allocation failed and eina_error
|
||||
* is set.
|
||||
* @return Newly allocated matrix or @c NULL if allocation failed.
|
||||
*/
|
||||
EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows,
|
||||
unsigned long cols,
|
||||
|
|
|
@ -68,9 +68,6 @@ _new_va(const char *name,
|
|||
Eina_Mempool_Backend *be = NULL;
|
||||
Eina_Mempool *mp;
|
||||
|
||||
Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE;
|
||||
|
||||
eina_error_set(0);
|
||||
if (getenv("EINA_MEMPOOL_PASS"))
|
||||
{
|
||||
be = eina_hash_find(_backends, "pass_through");
|
||||
|
@ -79,10 +76,8 @@ _new_va(const char *name,
|
|||
else be = eina_hash_find(_backends, name);
|
||||
if ((!be) || (!be->init)) goto on_error;
|
||||
|
||||
err = EINA_ERROR_OUT_OF_MEMORY;
|
||||
mp = calloc(1, sizeof(Eina_Mempool));
|
||||
if (!mp)
|
||||
goto on_error;
|
||||
if (!mp) goto on_error;
|
||||
|
||||
/* Work around ABI incompability introduced in Eina 1.1 */
|
||||
#define SBP(Property) mp->backend.Property = be->Property;
|
||||
|
@ -104,11 +99,9 @@ _new_va(const char *name,
|
|||
}
|
||||
|
||||
mp->backend_data = mp->backend.init(context, options, args);
|
||||
|
||||
return mp;
|
||||
|
||||
on_error:
|
||||
eina_error_set(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -143,9 +136,6 @@ void pass_through_shutdown(void);
|
|||
|
||||
EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0;
|
||||
|
||||
static const char EINA_ERROR_NOT_MEMPOOL_MODULE_STR[] =
|
||||
"Not a memory pool module.";
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
*/
|
||||
|
@ -179,8 +169,6 @@ eina_mempool_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
EINA_ERROR_NOT_MEMPOOL_MODULE = eina_error_msg_static_register(
|
||||
EINA_ERROR_NOT_MEMPOOL_MODULE_STR);
|
||||
_backends = eina_hash_string_superfast_new(NULL);
|
||||
|
||||
/* dynamic backends */
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_alloca.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
#include "eina_mempool.h"
|
||||
#include "eina_lock.h"
|
||||
|
@ -1204,10 +1203,6 @@ _eina_model_event_callback_call(Eina_Model *model, const char *name, const void
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static const char EINA_ERROR_MODEL_FAILED_STR[] = "Model check failed.";
|
||||
static const char EINA_ERROR_MODEL_METHOD_MISSING_STR[] = "Model method is missing.";
|
||||
static const char EINA_MAGIC_MODEL_STR[] = "Eina Model";
|
||||
|
||||
static void _eina_model_unref(Eina_Model *model);
|
||||
|
||||
/**
|
||||
|
@ -1422,7 +1417,7 @@ _eina_model_type_base_properties_compare(const Eina_Model *a, const Eina_Model *
|
|||
}
|
||||
|
||||
*cmp = eina_value_compare(&atmp, &btmp);
|
||||
if (eina_error_get() != 0)
|
||||
if (*cmp == -2)
|
||||
{
|
||||
char *astr = eina_value_to_string(&atmp);
|
||||
char *bstr = eina_value_to_string(&btmp);
|
||||
|
@ -1509,7 +1504,7 @@ _eina_model_type_base_children_compare(const Eina_Model *a, const Eina_Model *b,
|
|||
}
|
||||
|
||||
*cmp = eina_model_compare(achild, bchild);
|
||||
if (eina_error_get())
|
||||
if (*cmp == -2)
|
||||
{
|
||||
ERR("Could not compare children #%d %p (%s) and %p (%s) "
|
||||
"from models %p (%s) and %p (%s)", i,
|
||||
|
@ -3035,11 +3030,6 @@ eina_model_init(void)
|
|||
goto on_init_fail_lock_debug;
|
||||
}
|
||||
|
||||
EINA_ERROR_MODEL_FAILED = eina_error_msg_static_register(
|
||||
EINA_ERROR_MODEL_FAILED_STR);
|
||||
EINA_ERROR_MODEL_METHOD_MISSING = eina_error_msg_static_register(
|
||||
EINA_ERROR_MODEL_METHOD_MISSING_STR);
|
||||
|
||||
EINA_MODEL_TYPE_BASE = &_EINA_MODEL_TYPE_BASE;
|
||||
EINA_MODEL_TYPE_MIXIN = &_EINA_MODEL_TYPE_MIXIN;
|
||||
EINA_MODEL_TYPE_GENERIC = &_EINA_MODEL_TYPE_GENERIC;
|
||||
|
@ -3430,7 +3420,6 @@ _eina_model_unref(Eina_Model *model)
|
|||
#define EINA_MODEL_TYPE_CALL_OPTIONAL_RETURN(model, method, def_retval, ...) \
|
||||
do \
|
||||
{ \
|
||||
eina_error_set(0); \
|
||||
if (model->desc->ops.type.method) \
|
||||
return model->desc->ops.type.method(model, ## __VA_ARGS__); \
|
||||
DBG("Optional method" # method "() not implemented for model %p (%s)", \
|
||||
|
@ -3442,7 +3431,6 @@ _eina_model_unref(Eina_Model *model)
|
|||
#define EINA_MODEL_TYPE_CALL_OPTIONAL(model, method, ...) \
|
||||
do \
|
||||
{ \
|
||||
eina_error_set(0); \
|
||||
if (model->desc->ops.type.method) \
|
||||
model->desc->ops.type.method(model, ## __VA_ARGS__); \
|
||||
else \
|
||||
|
@ -3454,10 +3442,8 @@ _eina_model_unref(Eina_Model *model)
|
|||
#define EINA_MODEL_TYPE_CALL_MANDATORY_RETURN(model, method, def_retval, ...) \
|
||||
do \
|
||||
{ \
|
||||
eina_error_set(0); \
|
||||
if (model->desc->ops.type.method) \
|
||||
return model->desc->ops.type.method(model, ## __VA_ARGS__); \
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
|
||||
CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \
|
||||
model, model->desc->cache.types[0]->name); \
|
||||
return def_retval; \
|
||||
|
@ -3467,12 +3453,10 @@ _eina_model_unref(Eina_Model *model)
|
|||
#define EINA_MODEL_TYPE_CALL_MANDATORY(model, method, ...) \
|
||||
do \
|
||||
{ \
|
||||
eina_error_set(0); \
|
||||
if (model->desc->ops.type.method) \
|
||||
model->desc->ops.type.method(model, ## __VA_ARGS__); \
|
||||
else \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
|
||||
CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \
|
||||
model, model->desc->cache.types[0]->name); \
|
||||
} \
|
||||
|
@ -3483,10 +3467,8 @@ _eina_model_unref(Eina_Model *model)
|
|||
#define EINA_MODEL_TYPE_CALL_RETURN(model, method, def_retval, ...) \
|
||||
do \
|
||||
{ \
|
||||
eina_error_set(0); \
|
||||
if (model->desc->ops.type.method) \
|
||||
return model->desc->ops.type.method(model, ## __VA_ARGS__); \
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
|
||||
ERR("Method" # method "() not implemented for model %p (%s)", \
|
||||
model, model->desc->cache.types[0]->name); \
|
||||
return def_retval; \
|
||||
|
@ -3496,12 +3478,10 @@ _eina_model_unref(Eina_Model *model)
|
|||
#define EINA_MODEL_TYPE_CALL(model, method, ...) \
|
||||
do \
|
||||
{ \
|
||||
eina_error_set(0); \
|
||||
if (model->desc->ops.type.method) \
|
||||
model->desc->ops.type.method(model, ## __VA_ARGS__); \
|
||||
else \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
|
||||
ERR("Method" # method "() not implemented for model %p (%s)", \
|
||||
model, model->desc->cache.types[0]->name); \
|
||||
} \
|
||||
|
@ -3985,8 +3965,7 @@ eina_model_compare(const Eina_Model *a, const Eina_Model *b)
|
|||
ERR("Models %p (%s) and %p (%s) can't compare",
|
||||
a, desc_a->cache.types[0]->name,
|
||||
b, desc_b->cache.types[0]->name);
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
return -1;
|
||||
return -2;
|
||||
}
|
||||
else if ((desc_a->ops.type.compare) && (desc_b->ops.type.compare))
|
||||
{
|
||||
|
@ -4012,8 +3991,7 @@ eina_model_compare(const Eina_Model *a, const Eina_Model *b)
|
|||
ERR("Could not compare models %p (%s) and %p (%s)",
|
||||
a, desc_a->cache.types[0]->name,
|
||||
b, desc_b->cache.types[0]->name);
|
||||
eina_error_set(EINA_ERROR_MODEL_FAILED);
|
||||
return -1;
|
||||
return -2;
|
||||
}
|
||||
|
||||
return cmp;
|
||||
|
@ -4026,7 +4004,6 @@ eina_model_load(Eina_Model *model)
|
|||
|
||||
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.load)
|
||||
{
|
||||
ret = model->desc->ops.type.load(model);
|
||||
|
@ -4035,7 +4012,6 @@ eina_model_load(Eina_Model *model)
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method load() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
@ -4051,7 +4027,6 @@ eina_model_unload(Eina_Model *model)
|
|||
|
||||
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.unload)
|
||||
{
|
||||
ret = model->desc->ops.type.unload(model);
|
||||
|
@ -4061,7 +4036,6 @@ eina_model_unload(Eina_Model *model)
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method unload() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
@ -4090,7 +4064,6 @@ eina_model_property_set(Eina_Model *model, const const char *name, const Eina_Va
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE);
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type), EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.property_set)
|
||||
{
|
||||
ret = model->desc->ops.type.property_set(model, name, value);
|
||||
|
@ -4100,7 +4073,6 @@ eina_model_property_set(Eina_Model *model, const const char *name, const Eina_Va
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method property_set() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
@ -4117,7 +4089,6 @@ eina_model_property_del(Eina_Model *model, const char *name)
|
|||
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.property_del)
|
||||
{
|
||||
ret = model->desc->ops.type.property_del(model, name);
|
||||
|
@ -4127,7 +4098,6 @@ eina_model_property_del(Eina_Model *model, const char *name)
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method property_del() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
@ -4173,7 +4143,6 @@ eina_model_child_set(Eina_Model *model, unsigned int position, Eina_Model *child
|
|||
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
|
||||
EINA_MODEL_INSTANCE_CHECK_VAL(child, EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.child_set)
|
||||
{
|
||||
ret = model->desc->ops.type.child_set(model, position, child);
|
||||
|
@ -4183,7 +4152,6 @@ eina_model_child_set(Eina_Model *model, unsigned int position, Eina_Model *child
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method child_set() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
@ -4199,7 +4167,6 @@ eina_model_child_del(Eina_Model *model, unsigned int position)
|
|||
|
||||
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.child_del)
|
||||
{
|
||||
ret = model->desc->ops.type.child_del(model, position);
|
||||
|
@ -4213,7 +4180,6 @@ eina_model_child_del(Eina_Model *model, unsigned int position)
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method child_del() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
@ -4230,7 +4196,6 @@ eina_model_child_insert_at(Eina_Model *model, unsigned int position, Eina_Model
|
|||
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.child_insert_at)
|
||||
{
|
||||
ret = model->desc->ops.type.child_insert_at(model, position, child);
|
||||
|
@ -4244,7 +4209,6 @@ eina_model_child_insert_at(Eina_Model *model, unsigned int position, Eina_Model
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method child_insert_at() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
@ -4266,7 +4230,6 @@ eina_model_child_append(Eina_Model *model, Eina_Model *child)
|
|||
if (position < 0)
|
||||
return -1;
|
||||
|
||||
eina_error_set(0);
|
||||
if (model->desc->ops.type.child_insert_at)
|
||||
{
|
||||
ret = model->desc->ops.type.child_insert_at(model, position, child);
|
||||
|
@ -4280,7 +4243,6 @@ eina_model_child_append(Eina_Model *model, Eina_Model *child)
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
|
||||
ret = EINA_FALSE;
|
||||
ERR("Method child_insert_at() not implemented for model %p (%s)",
|
||||
model, model->desc->cache.types[0]->name);
|
||||
|
|
|
@ -302,16 +302,7 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_MODEL_FAILED
|
||||
* Defined when model-specific errors happens.
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_MODEL_FAILED;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_MODEL_METHOD_MISSING
|
||||
* Defined when model-specific errors happens.
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_MODEL_METHOD_MISSING;
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_alloca.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_file.h"
|
||||
#include "eina_log.h"
|
||||
|
||||
|
@ -188,11 +187,6 @@ static void _dir_arch_list_cb(const char *name, const char *path, void *data)
|
|||
* @cond LOCAL
|
||||
*/
|
||||
|
||||
static const char EINA_ERROR_WRONG_MODULE_STR[] =
|
||||
"Wrong file format or no file module found";
|
||||
static const char EINA_ERROR_MODULE_INIT_FAILED_STR[] =
|
||||
"Module initialisation function failed";
|
||||
|
||||
EAPI Eina_Error EINA_ERROR_WRONG_MODULE = 0;
|
||||
EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED = 0;
|
||||
|
||||
|
@ -209,8 +203,7 @@ EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED = 0;
|
|||
* This function sets up the module loader module of Eina. It is
|
||||
* called by eina_init().
|
||||
*
|
||||
* This function sets up the module module of Eina. It also registers
|
||||
* the errors #EINA_ERROR_WRONG_MODULE and #EINA_ERROR_MODULE_INIT_FAILED.
|
||||
* This function sets up the module module of Eina.
|
||||
*
|
||||
* @see eina_init()
|
||||
*/
|
||||
|
@ -224,12 +217,6 @@ eina_module_init(void)
|
|||
EINA_LOG_ERR("Could not register log domain: eina_module");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
#define EEMR(n) n = eina_error_msg_static_register(n ## _STR)
|
||||
EEMR(EINA_ERROR_WRONG_MODULE);
|
||||
EEMR(EINA_ERROR_MODULE_INIT_FAILED);
|
||||
#undef EEMR
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -321,7 +308,6 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m)
|
|||
{
|
||||
WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(),
|
||||
(flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY");
|
||||
eina_error_set(EINA_ERROR_WRONG_MODULE);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -334,7 +320,6 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m)
|
|||
|
||||
WRN("could not find eina's entry symbol %s inside module %s, or the init function failed",
|
||||
EINA_MODULE_SYMBOL_INIT, m->file);
|
||||
eina_error_set(EINA_ERROR_MODULE_INIT_FAILED);
|
||||
dlclose(dl_handle);
|
||||
return EINA_FALSE;
|
||||
ok:
|
||||
|
@ -343,8 +328,6 @@ ok:
|
|||
loaded:
|
||||
m->ref++;
|
||||
DBG("ref %d", m->ref);
|
||||
|
||||
eina_error_set(0);
|
||||
return EINA_TRUE;
|
||||
#else
|
||||
(void) m;
|
||||
|
|
|
@ -105,16 +105,7 @@ typedef void (*Eina_Module_Shutdown)(void);
|
|||
*/
|
||||
#define EINA_MODULE_SHUTDOWN(f) EAPI Eina_Module_Shutdown __eina_module_shutdown = &f
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_WRONG_MODULE
|
||||
* Error identifier corresponding to a wrong module.
|
||||
*/
|
||||
extern EAPI Eina_Error EINA_ERROR_WRONG_MODULE;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_MODULE_INIT_FAILED
|
||||
* Error identifier corresponding to a failure during the initialisation of a module.
|
||||
*/
|
||||
extern EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED;
|
||||
|
||||
/**
|
||||
|
@ -156,13 +147,12 @@ EAPI Eina_Bool
|
|||
*
|
||||
* This function load the shared file object passed in
|
||||
* eina_module_new(). If it is a internal Eina module (like the
|
||||
* mempools), it also initialize it. It the shared file object can not
|
||||
* be loaded, the error #EINA_ERROR_WRONG_MODULE is set and
|
||||
* and #EINA_FALSE is returned. If it is a internal Eina module and the
|
||||
* module can not be initialized, the error #EINA_ERROR_MODULE_INIT_FAILED
|
||||
* is set and #EINA_FALSE is returned. If the module has already been loaded,
|
||||
* it's reference counter is increased by one and #EINA_TRUE is returned.
|
||||
* If @p module is @c NULL, the function returns immediately #EINA_FALSE.
|
||||
* mempools), it also initialize it. If the shared file object can not
|
||||
* be loaded, #EINA_FALSE is returned. If it is an internal Eina module and the
|
||||
* module can not be initialized, #EINA_FALSE is returned. If the module has
|
||||
* already been loaded, it's reference counter is increased by one and
|
||||
* #EINA_TRUE is returned. If @p module is @c NULL, the function returns
|
||||
* immediately #EINA_FALSE.
|
||||
*
|
||||
* When the symbols of the shared file objects are not needed
|
||||
* anymore, call eina_module_unload() to unload the module.
|
||||
|
|
|
@ -69,16 +69,11 @@ _eina_rbtree_iterator_list_new(Eina_Iterator_Rbtree *it, const Eina_Rbtree *tree
|
|||
{
|
||||
Eina_Iterator_Rbtree_List *new;
|
||||
|
||||
eina_error_set(0);
|
||||
new = eina_trash_pop(&it->trash);
|
||||
if (!new)
|
||||
{
|
||||
new = malloc(sizeof (Eina_Iterator_Rbtree_List));
|
||||
if (!new)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!new) return NULL;
|
||||
}
|
||||
|
||||
new->tree = (Eina_Rbtree *)tree;
|
||||
|
@ -195,13 +190,8 @@ _eina_rbtree_iterator_build(const Eina_Rbtree *root, unsigned char mask)
|
|||
Eina_Iterator_Rbtree_List *first;
|
||||
Eina_Iterator_Rbtree *it;
|
||||
|
||||
eina_error_set(0);
|
||||
it = calloc(1, sizeof (Eina_Iterator_Rbtree));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
eina_trash_init(&it->trash);
|
||||
|
||||
|
|
|
@ -202,9 +202,8 @@ static inline Eina_Rbtree *eina_rbtree_inline_lookup(const Eina_Rbtree *root, co
|
|||
* NULL, this function still returns a valid iterator that will always
|
||||
* return false on eina_iterator_next(), thus keeping API sane.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the rbtree structure changes then the iterator becomes
|
||||
* invalid! That is, if you add or remove nodes this iterator
|
||||
|
@ -223,9 +222,8 @@ EAPI Eina_Iterator *eina_rbtree_iterator_prefix(const Eina_Rbtree *root)
|
|||
* NULL, this function still returns a valid iterator that will always
|
||||
* return false on eina_iterator_next(), thus keeping API sane.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the rbtree structure changes then the iterator becomes
|
||||
* invalid! That is, if you add or remove nodes this iterator
|
||||
|
@ -244,9 +242,8 @@ EAPI Eina_Iterator *eina_rbtree_iterator_infix(const Eina_Rbtree *root) E
|
|||
* NULL, this function still returns a valid iterator that will always
|
||||
* return false on eina_iterator_next(), thus keeping API sane.
|
||||
*
|
||||
* If the memory can not be allocated, @c NULL is returned
|
||||
* and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
|
||||
* returned.
|
||||
* If the memory can not be allocated, @c NULL is returned.
|
||||
* Otherwise, a valid iterator is returned.
|
||||
*
|
||||
* @warning if the rbtree structure changes then the iterator becomes
|
||||
* invalid! That is, if you add or remove nodes this iterator
|
||||
|
|
|
@ -80,8 +80,6 @@ static const char EINA_ERROR_SAFETY_FAILED_STR[] = "Safety check failed.";
|
|||
Eina_Bool
|
||||
eina_safety_checks_init(void)
|
||||
{
|
||||
EINA_ERROR_SAFETY_FAILED = eina_error_msg_static_register(
|
||||
EINA_ERROR_SAFETY_FAILED_STR);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
* // all these files will emit warning from EINA_ARG_NONNULL()
|
||||
* #include <Evas.h> // third party headers
|
||||
* #include <Ecore.h>
|
||||
* #include <eina_error.h> // eina own header
|
||||
*
|
||||
* #include <eina_safety_checks.h>
|
||||
* // all these files below will NOT emit warning from EINA_ARG_NONNULL(),
|
||||
|
@ -77,9 +76,8 @@
|
|||
* options to @c configure script.
|
||||
*
|
||||
* Whenever these macros capture an error, EINA_LOG_ERR() will be
|
||||
* called and @c eina_error set to @c EINA_ERROR_SAFETY_FAILED and can
|
||||
* be checked with eina_error_get() after call.
|
||||
*
|
||||
* called.
|
||||
*
|
||||
* @see EINA_SAFETY_ON_NULL_RETURN(), EINA_SAFETY_ON_NULL_RETURN_VAL()
|
||||
* and other macros.
|
||||
*
|
||||
|
@ -89,10 +87,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_error.h"
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_SAFETY_FAILED
|
||||
* Error identifier corresponding to safety check failure.
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
||||
|
||||
#ifdef EINA_SAFETY_CHECKS
|
||||
|
@ -104,7 +98,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
return; \
|
||||
} \
|
||||
|
@ -116,7 +109,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
return (val); \
|
||||
} \
|
||||
|
@ -128,7 +120,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
goto label; \
|
||||
} \
|
||||
|
@ -140,7 +131,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
return; \
|
||||
} \
|
||||
|
@ -152,7 +142,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
return val; \
|
||||
} \
|
||||
|
@ -164,7 +153,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
goto label; \
|
||||
} \
|
||||
|
@ -176,7 +164,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
return; \
|
||||
} \
|
||||
|
@ -188,7 +175,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
return val; \
|
||||
} \
|
||||
|
@ -200,7 +186,6 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
goto label; \
|
||||
} \
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
#include "eina_private.h"
|
||||
#include "eina_hash.h"
|
||||
#include "eina_rbtree.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_lock.h"
|
||||
|
||||
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
|
||||
|
@ -401,9 +400,6 @@ _eina_share_common_head_alloc(int slen)
|
|||
const size_t head_size = offsetof(Eina_Share_Common_Head, builtin_node.str);
|
||||
|
||||
head = malloc(head_size + slen);
|
||||
if (!head)
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
|
@ -546,9 +542,6 @@ _eina_share_common_node_alloc(unsigned int slen, unsigned int null_size)
|
|||
const size_t node_size = offsetof(Eina_Share_Common_Node, str);
|
||||
|
||||
node = malloc(node_size + slen + null_size);
|
||||
if (!node)
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,8 +70,7 @@ typedef struct _Eina_Strbuf Eina_Strbuf;
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_strbuf_free().
|
||||
* returned. To free the resources, use eina_strbuf_free().
|
||||
*
|
||||
* @see eina_strbuf_free()
|
||||
* @see eina_strbuf_append()
|
||||
|
@ -88,8 +87,7 @@ EAPI Eina_Strbuf *eina_strbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_strbuf_free().
|
||||
* returned. To free the resources, use eina_strbuf_free().
|
||||
*
|
||||
* @see eina_strbuf_free()
|
||||
* @see eina_strbuf_append()
|
||||
|
@ -108,8 +106,7 @@ EAPI Eina_Strbuf *eina_strbuf_manage_new(char *str) EINA_MALLOC EINA_WARN_UNUSED
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_strbuf_free().
|
||||
* returned. To free the resources, use eina_strbuf_free().
|
||||
*
|
||||
* @see eina_strbuf_manage_new()
|
||||
* @since 1.2.0
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "eina_private.h"
|
||||
#include "eina_str.h"
|
||||
#include "eina_magic.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_safety_checks.h"
|
||||
#include "eina_strbuf.h"
|
||||
#include "eina_strbuf_common.h"
|
||||
|
@ -88,14 +87,8 @@ _eina_strbuf_common_init(size_t csize, Eina_Strbuf *buf)
|
|||
buf->size = EINA_STRBUF_INIT_SIZE;
|
||||
buf->step = EINA_STRBUF_INIT_STEP;
|
||||
|
||||
eina_error_set(0);
|
||||
buf->buf = calloc(csize, buf->size);
|
||||
if (EINA_UNLIKELY(!buf->buf))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
if (EINA_UNLIKELY(!buf->buf)) return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -159,16 +152,11 @@ _eina_strbuf_common_resize(size_t csize, Eina_Strbuf *buf, size_t size)
|
|||
|
||||
/* reallocate the buffer to the new size */
|
||||
buffer = realloc(buf->buf, new_size * csize);
|
||||
if (EINA_UNLIKELY(!buffer))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (EINA_UNLIKELY(!buffer)) return EINA_FALSE;
|
||||
|
||||
buf->buf = buffer;
|
||||
buf->size = new_size;
|
||||
buf->step = new_step;
|
||||
eina_error_set(0);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -239,8 +227,7 @@ _eina_strbuf_common_insert_length(size_t csize,
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_strbuf_common_free().
|
||||
* returned. To free the resources, use eina_strbuf_common_free().
|
||||
*
|
||||
* @see eina_strbuf_common_free()
|
||||
* @see eina_strbuf_common_append()
|
||||
|
@ -251,13 +238,8 @@ eina_strbuf_common_new(size_t csize)
|
|||
{
|
||||
Eina_Strbuf *buf;
|
||||
|
||||
eina_error_set(0);
|
||||
buf = malloc(sizeof(Eina_Strbuf));
|
||||
if (EINA_UNLIKELY(!buf))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (EINA_UNLIKELY(!buf)) return NULL;
|
||||
if (EINA_UNLIKELY(!_eina_strbuf_common_init(csize, buf)))
|
||||
{
|
||||
eina_strbuf_common_free(buf);
|
||||
|
@ -276,8 +258,7 @@ eina_strbuf_common_new(size_t csize)
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_strbuf_common_free().
|
||||
* returned. To free the resources, use eina_strbuf_common_free().
|
||||
*
|
||||
* @see eina_strbuf_common_free()
|
||||
* @see eina_strbuf_common_append()
|
||||
|
@ -291,14 +272,9 @@ eina_strbuf_common_manage_new(size_t csize,
|
|||
{
|
||||
Eina_Strbuf *buf;
|
||||
|
||||
eina_error_set(0);
|
||||
buf = malloc(sizeof(Eina_Strbuf));
|
||||
if (EINA_UNLIKELY(!buf))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len)))
|
||||
if (EINA_UNLIKELY(!buf)) return NULL;
|
||||
if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len)))
|
||||
{
|
||||
eina_strbuf_common_free(buf);
|
||||
return NULL;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_alloca.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
#include "eina_lock.h"
|
||||
#include "eina_share_common.h"
|
||||
|
@ -212,30 +211,15 @@ _eina_stringshare_small_bucket_resize(Eina_Stringshare_Small_Bucket *bucket,
|
|||
void *tmp;
|
||||
|
||||
tmp = realloc((void *)bucket->strings, size * sizeof(bucket->strings[0]));
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!tmp) return 0;
|
||||
bucket->strings = tmp;
|
||||
|
||||
tmp = realloc(bucket->lengths, size * sizeof(bucket->lengths[0]));
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!tmp) return 0;
|
||||
bucket->lengths = tmp;
|
||||
|
||||
tmp = realloc(bucket->references, size * sizeof(bucket->references[0]));
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!tmp) return 0;
|
||||
bucket->references = tmp;
|
||||
|
||||
bucket->size = size;
|
||||
|
@ -256,11 +240,7 @@ _eina_stringshare_small_bucket_insert_at(
|
|||
if (!bucket)
|
||||
{
|
||||
*p_bucket = bucket = calloc(1, sizeof(*bucket));
|
||||
if (!bucket)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!bucket) return NULL;
|
||||
}
|
||||
|
||||
if (bucket->count + 1 >= bucket->size)
|
||||
|
@ -271,11 +251,7 @@ _eina_stringshare_small_bucket_insert_at(
|
|||
}
|
||||
|
||||
snew = malloc(length + 1);
|
||||
if (!snew)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!snew) return NULL;
|
||||
|
||||
memcpy(snew, str, length);
|
||||
snew[length] = '\0';
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "eina_config.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_thread.h"
|
||||
#include "eina_sched.h"
|
||||
#ifdef _WIN32
|
||||
|
@ -34,18 +33,6 @@
|
|||
#include "eina_safety_checks.h"
|
||||
#include "eina_thread.h"
|
||||
|
||||
EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED = 0;
|
||||
EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES = 0;
|
||||
EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS = 0;
|
||||
EAPI Eina_Error EINA_ERROR_THREAD_JOIN_DEADLOCK = 0;
|
||||
EAPI Eina_Error EINA_ERROR_THREAD_JOIN_INVALID = 0;
|
||||
|
||||
static const char EINA_ERROR_THREAD_CREATION_FAILED_STR[] = "Generic error creating thread";
|
||||
static const char EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES_STR[] = "No resources to create thread";
|
||||
static const char EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS_STR[] = "No permissions to create thread";
|
||||
static const char EINA_ERROR_THREAD_JOIN_DEADLOCK_STR[] = "Deadlock detected";
|
||||
static const char EINA_ERROR_THREAD_JOIN_INVALID_STR[] = "Invalid thread to join";
|
||||
|
||||
#ifdef _WIN32
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
|
@ -161,11 +148,7 @@ _eina_thread_join(Eina_Thread t)
|
|||
void *ret;
|
||||
|
||||
tw = _eina_thread_win32_find(t);
|
||||
if (!tw)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
if (!tw) return NULL;
|
||||
|
||||
WaitForSingleObject(tw->thread, INFINITE);
|
||||
CloseHandle(tw->thread);
|
||||
|
@ -193,13 +176,7 @@ _eina_thread_join(Eina_Thread t)
|
|||
void *ret = NULL;
|
||||
int err = pthread_join(t, &ret);
|
||||
|
||||
if (err == 0)
|
||||
return ret;
|
||||
else if (err == EDEADLK)
|
||||
eina_error_set(EINA_ERROR_THREAD_JOIN_DEADLOCK);
|
||||
else
|
||||
eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID);
|
||||
|
||||
if (err == 0) return ret;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -228,14 +205,7 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi
|
|||
err = pthread_create(t, &attr, func, data);
|
||||
pthread_attr_destroy(&attr);
|
||||
|
||||
if (err == 0)
|
||||
return EINA_TRUE;
|
||||
else if (err == EAGAIN)
|
||||
eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES);
|
||||
else if (err == EPERM)
|
||||
eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS);
|
||||
else
|
||||
eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED);
|
||||
if (err == 0) return EINA_TRUE;
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
@ -306,14 +276,8 @@ eina_thread_create(Eina_Thread *t,
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(t, EINA_FALSE);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(func, EINA_FALSE);
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
c = malloc(sizeof (Eina_Thread_Call));
|
||||
if (!c)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!c) return EINA_FALSE;
|
||||
|
||||
c->func = func;
|
||||
c->data = data;
|
||||
|
@ -324,28 +288,18 @@ eina_thread_create(Eina_Thread *t,
|
|||
return EINA_TRUE;
|
||||
|
||||
free(c);
|
||||
if (eina_error_get() == 0)
|
||||
eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI void *
|
||||
eina_thread_join(Eina_Thread t)
|
||||
{
|
||||
eina_error_set(0);
|
||||
return _eina_thread_join(t);
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
eina_thread_init(void)
|
||||
{
|
||||
EINA_ERROR_THREAD_CREATION_FAILED = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_STR);
|
||||
EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES_STR);
|
||||
EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS_STR);
|
||||
EINA_ERROR_THREAD_JOIN_DEADLOCK = eina_error_msg_static_register(EINA_ERROR_THREAD_JOIN_DEADLOCK_STR);
|
||||
EINA_ERROR_THREAD_JOIN_INVALID = eina_error_msg_static_register(EINA_ERROR_THREAD_JOIN_INVALID_STR);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,46 +42,6 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_THREAD_CREATION_FAILED
|
||||
* Generic error happened and thread couldn't be created.
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES
|
||||
* System lacked resources to create thread.
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS
|
||||
* System lacked permissions to create thread.
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_THREAD_JOIN_DEADLOCK
|
||||
* The system has detected a deadlock situation where both threads
|
||||
* would wait each other. Or the thread wanted to wait for itself.
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_THREAD_JOIN_DEADLOCK;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_THREAD_JOIN_INVALID
|
||||
* One of the following happened:
|
||||
* @li thread is not a joinable.
|
||||
* @li thread does not exist.
|
||||
* @li another thread is already waiting for that thread.
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI extern Eina_Error EINA_ERROR_THREAD_JOIN_INVALID;
|
||||
|
||||
|
||||
typedef unsigned long int Eina_Thread;
|
||||
|
||||
typedef void *(*Eina_Thread_Cb)(void *data, Eina_Thread t);
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_tiler.h"
|
||||
#include "eina_error.h"
|
||||
|
||||
/*============================================================================*
|
||||
* Local *
|
||||
|
@ -1386,11 +1385,7 @@ eina_tile_grid_slicer_iterator_new(int x,
|
|||
return NULL;
|
||||
|
||||
it = calloc(1, sizeof(*it));
|
||||
if (!it)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!it) return NULL;
|
||||
|
||||
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
#include "eina_lock.h"
|
||||
#include "eina_share_common.h"
|
||||
|
|
|
@ -39,8 +39,7 @@ typedef struct _Eina_Strbuf Eina_UStrbuf;
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_ustrbuf_free().
|
||||
* returned. To free the resources, use eina_ustrbuf_free().
|
||||
*
|
||||
* @see eina_ustrbuf_free()
|
||||
* @see eina_ustrbuf_append()
|
||||
|
@ -57,8 +56,7 @@ EAPI Eina_UStrbuf *eina_ustrbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_strbuf_free().
|
||||
* returned. To free the resources, use eina_strbuf_free().
|
||||
*
|
||||
* @see eina_ustrbuf_free()
|
||||
* @see eina_ustrbuf_append()
|
||||
|
@ -77,8 +75,7 @@ EAPI Eina_UStrbuf *eina_ustrbuf_manage_new(Eina_Unicode *str) EINA_MALLOC EINA_W
|
|||
* @return Newly allocated string buffer instance.
|
||||
*
|
||||
* This function creates a new string buffer. On error, @c NULL is
|
||||
* returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
|
||||
* free the resources, use eina_ustrbuf_free().
|
||||
* returned. To free the resources, use eina_ustrbuf_free().
|
||||
*
|
||||
* @see eina_ustrbuf_manage_new()
|
||||
* @since 1.2.0
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "eina_config.h"
|
||||
#include "eina_private.h"
|
||||
#include "eina_alloca.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_log.h"
|
||||
#include "eina_strbuf.h"
|
||||
#include "eina_mempool.h"
|
||||
|
@ -134,8 +133,6 @@ _eina_value_type_uchar_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const unsigned char v = *(const unsigned char *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -209,7 +206,6 @@ _eina_value_type_uchar_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -281,8 +277,6 @@ _eina_value_type_ushort_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
{
|
||||
const unsigned short v = *(const unsigned short *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -360,7 +354,6 @@ _eina_value_type_ushort_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -432,8 +425,6 @@ _eina_value_type_uint_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const unsigned int v = *(const unsigned int *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -515,7 +506,6 @@ _eina_value_type_uint_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -587,8 +577,6 @@ _eina_value_type_ulong_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const unsigned long v = *(const unsigned long *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -674,7 +662,6 @@ _eina_value_type_ulong_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -746,8 +733,6 @@ _eina_value_type_uint64_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
{
|
||||
const uint64_t v = *(const uint64_t *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -838,7 +823,6 @@ _eina_value_type_uint64_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -910,8 +894,6 @@ _eina_value_type_char_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const signed char v = *(const signed char *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -993,7 +975,6 @@ _eina_value_type_char_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1065,8 +1046,6 @@ _eina_value_type_short_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const short v = *(const short *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -1154,7 +1133,6 @@ _eina_value_type_short_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1226,8 +1204,6 @@ _eina_value_type_int_convert_to(const Eina_Value_Type *type EINA_UNUSED, const E
|
|||
{
|
||||
const int v = *(const int *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -1321,7 +1297,6 @@ _eina_value_type_int_convert_to(const Eina_Value_Type *type EINA_UNUSED, const E
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1393,8 +1368,6 @@ _eina_value_type_long_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const long v = *(const long *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -1494,7 +1467,6 @@ _eina_value_type_long_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1566,8 +1538,6 @@ _eina_value_type_int64_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const int64_t v = *(const int64_t *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -1674,7 +1644,6 @@ _eina_value_type_int64_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1746,8 +1715,6 @@ _eina_value_type_float_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const float v = *(const float *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -1860,7 +1827,6 @@ _eina_value_type_float_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1932,8 +1898,6 @@ _eina_value_type_double_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
{
|
||||
const double v = *(const double *)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v;
|
||||
|
@ -2040,7 +2004,6 @@ _eina_value_type_double_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2100,8 +2063,6 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type EINA_UNUSE
|
|||
{
|
||||
const char *v = *(const char **)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem;
|
||||
|
@ -2213,7 +2174,6 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type EINA_UNUSE
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2286,7 +2246,6 @@ _eina_value_type_string_copy(const Eina_Value_Type *type EINA_UNUSED, const void
|
|||
*d = strdup(*s);
|
||||
if (*d == NULL)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -2298,7 +2257,7 @@ _eina_value_type_string_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
|
|||
{
|
||||
char **tmem = mem;
|
||||
const char *str = va_arg(args, const char *);
|
||||
eina_error_set(0);
|
||||
|
||||
if (str == *tmem) return EINA_TRUE;
|
||||
if (!str)
|
||||
{
|
||||
|
@ -2310,7 +2269,6 @@ _eina_value_type_string_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
|
|||
char *tmp = strdup(str);
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
free(*tmem);
|
||||
|
@ -2324,7 +2282,7 @@ _eina_value_type_string_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
|
|||
{
|
||||
char **tmem = mem;
|
||||
const char * const *str = ptr;
|
||||
eina_error_set(0);
|
||||
|
||||
if (*str == *tmem) return EINA_TRUE;
|
||||
if (!*str)
|
||||
{
|
||||
|
@ -2336,7 +2294,6 @@ _eina_value_type_string_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
|
|||
char *tmp = strdup(*str);
|
||||
if (!tmp)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
free(*tmem);
|
||||
|
@ -2405,7 +2362,6 @@ _eina_value_type_array_copy(const Eina_Value_Type *type EINA_UNUSED, const void
|
|||
|
||||
if (!subtype->copy)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2448,14 +2404,12 @@ _eina_value_type_array_compare(const Eina_Value_Type *type EINA_UNUSED, const vo
|
|||
|
||||
if (eva_a->subtype != eva_b->subtype)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
subtype = eva_a->subtype;
|
||||
if (!subtype->compare)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2570,7 +2524,6 @@ _eina_value_type_array_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
|
||||
if (!ret)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
return EINA_TRUE;
|
||||
|
@ -2613,7 +2566,6 @@ _eina_value_type_array_pset(const Eina_Value_Type *type, void *mem, const void *
|
|||
const Eina_Value_Array *desc = ptr;
|
||||
Eina_Inarray *desc_array;
|
||||
|
||||
eina_error_set(0);
|
||||
if ((!tmem->subtype) && (!desc->subtype))
|
||||
return EINA_TRUE;
|
||||
|
||||
|
@ -2740,7 +2692,6 @@ _eina_value_type_list_copy(const Eina_Value_Type *type EINA_UNUSED, const void *
|
|||
|
||||
if (!subtype->copy)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2781,14 +2732,12 @@ _eina_value_type_list_compare(const Eina_Value_Type *type EINA_UNUSED, const voi
|
|||
|
||||
if (eva_a->subtype != eva_b->subtype)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
subtype = eva_a->subtype;
|
||||
if (!subtype->compare)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2894,7 +2843,6 @@ _eina_value_type_list_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
|
||||
if (!ret)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
return EINA_TRUE;
|
||||
|
@ -2946,7 +2894,6 @@ _eina_value_type_list_pset(const Eina_Value_Type *type, void *mem, const void *p
|
|||
Eina_Value_List *tmem = mem;
|
||||
const Eina_Value_List *desc = ptr;
|
||||
|
||||
eina_error_set(0);
|
||||
if ((!tmem->subtype) && (!desc->subtype))
|
||||
return EINA_TRUE;
|
||||
|
||||
|
@ -3133,7 +3080,6 @@ _eina_value_type_hash_copy(const Eina_Value_Type *type EINA_UNUSED, const void *
|
|||
|
||||
if (!s->subtype->copy)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -3177,13 +3123,11 @@ _eina_value_type_hash_compare(const Eina_Value_Type *type EINA_UNUSED, const voi
|
|||
|
||||
if (eva_a->subtype != eva_b->subtype)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!eva_a->subtype->compare)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3309,7 +3253,6 @@ _eina_value_type_hash_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
|
||||
if (!ret)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
return EINA_TRUE;
|
||||
|
@ -3321,7 +3264,6 @@ _eina_value_type_hash_pset(const Eina_Value_Type *type, void *mem, const void *p
|
|||
Eina_Value_Hash *tmem = mem;
|
||||
const Eina_Value_Hash *desc = ptr;
|
||||
|
||||
eina_error_set(0);
|
||||
if ((!tmem->subtype) && (!desc->subtype))
|
||||
return EINA_TRUE;
|
||||
|
||||
|
@ -3439,8 +3381,6 @@ _eina_value_type_timeval_convert_to(const Eina_Value_Type *type EINA_UNUSED, con
|
|||
{
|
||||
struct timeval v = _eina_value_type_timeval_fix(type_mem);
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_UCHAR)
|
||||
{
|
||||
unsigned char other_mem = v.tv_sec;
|
||||
|
@ -3550,7 +3490,6 @@ _eina_value_type_timeval_convert_to(const Eina_Value_Type *type EINA_UNUSED, con
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -3649,7 +3588,6 @@ _eina_value_type_blob_compare(const Eina_Value_Type *type EINA_UNUSED, const voi
|
|||
size_t minsize;
|
||||
if (ta->ops != tb->ops)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return -1;
|
||||
}
|
||||
if ((ops) && (ops->compare))
|
||||
|
@ -3668,7 +3606,6 @@ _eina_value_type_blob_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const Eina_Value_Blob *tmem = type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
|
||||
convert == EINA_VALUE_TYPE_STRING)
|
||||
{
|
||||
|
@ -3726,7 +3663,6 @@ _eina_value_type_blob_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -3754,7 +3690,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value
|
|||
desc.memory = buf = malloc(desc.size);
|
||||
if (!desc.memory)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
memcpy(buf, str, desc.size);
|
||||
|
@ -3774,7 +3709,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value
|
|||
desc.memory = buf = malloc(desc.size);
|
||||
if (!desc.memory)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
memcpy(buf, a->array->members, desc.size);
|
||||
|
@ -3794,7 +3728,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value
|
|||
desc.memory = buf = malloc(desc.size);
|
||||
if (!desc.memory)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
memcpy(buf, b->memory, desc.size);
|
||||
|
@ -3806,7 +3739,6 @@ _eina_value_type_blob_convert_from(const Eina_Value_Type *type, const Eina_Value
|
|||
desc.memory = buf = malloc(convert->value_size);
|
||||
if (!desc.memory)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if (!eina_value_type_pget(convert, convert_mem, buf))
|
||||
|
@ -3825,7 +3757,6 @@ _eina_value_type_blob_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem, c
|
|||
Eina_Value_Blob *tmem = mem;
|
||||
const Eina_Value_Blob *desc = ptr;
|
||||
|
||||
eina_error_set(0);
|
||||
if ((tmem->memory) && (tmem->memory == desc->memory))
|
||||
{
|
||||
tmem->ops = desc->ops;
|
||||
|
@ -4101,7 +4032,6 @@ _eina_value_type_struct_copy(const Eina_Value_Type *type EINA_UNUSED, const void
|
|||
d->memory = malloc(s->desc->size);
|
||||
if (!d->memory)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -4156,12 +4086,10 @@ _eina_value_type_struct_compare(const Eina_Value_Type *type EINA_UNUSED, const v
|
|||
return 0;
|
||||
else if (ta->desc != tb->desc)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return -1;
|
||||
}
|
||||
if (ta->desc->ops != tb->desc->ops)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return -1;
|
||||
}
|
||||
if ((!ta->memory) && (!tb->memory))
|
||||
|
@ -4222,7 +4150,6 @@ _eina_value_type_struct_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
{
|
||||
const Eina_Value_Struct *tmem = type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
|
||||
convert == EINA_VALUE_TYPE_STRING)
|
||||
{
|
||||
|
@ -4262,7 +4189,6 @@ _eina_value_type_struct_convert_to(const Eina_Value_Type *type EINA_UNUSED, cons
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -4327,11 +4253,9 @@ _eina_value_type_struct_pset(const Eina_Value_Type *type, void *mem, const void
|
|||
|
||||
if (!_eina_value_type_struct_desc_check(desc->desc))
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
eina_error_set(0);
|
||||
if ((tmem->memory) && (tmem->memory == desc->memory))
|
||||
{
|
||||
tmem->desc = desc->desc;
|
||||
|
@ -4362,7 +4286,6 @@ _eina_value_type_struct_pset(const Eina_Value_Type *type, void *mem, const void
|
|||
|
||||
if (!tmem->memory)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -4478,8 +4401,6 @@ _eina_value_type_model_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
{
|
||||
const Eina_Model *v = *(const Eina_Model **)type_mem;
|
||||
|
||||
eina_error_set(0);
|
||||
|
||||
if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
|
||||
convert == EINA_VALUE_TYPE_STRING)
|
||||
{
|
||||
|
@ -4490,7 +4411,6 @@ _eina_value_type_model_convert_to(const Eina_Value_Type *type EINA_UNUSED, const
|
|||
}
|
||||
else
|
||||
{
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -4518,7 +4438,6 @@ _eina_value_type_model_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
|
|||
Eina_Model **tmem = mem;
|
||||
Eina_Model **p = (Eina_Model **)ptr;
|
||||
|
||||
eina_error_set(0);
|
||||
if (*tmem == *p) return EINA_TRUE;
|
||||
|
||||
if (*p) eina_model_ref(*p);
|
||||
|
@ -4783,11 +4702,7 @@ static void *
|
|||
_eina_value_blob_operations_malloc_copy(const Eina_Value_Blob_Operations *ops EINA_UNUSED, const void *memory, size_t size)
|
||||
{
|
||||
void *ret = malloc(size);
|
||||
if (!ret)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!ret) return NULL;
|
||||
memcpy(ret, memory, size);
|
||||
return ret;
|
||||
}
|
||||
|
@ -4811,8 +4726,6 @@ struct _Eina_Value_Inner_Mp
|
|||
* @endcond
|
||||
*/
|
||||
|
||||
static const char EINA_ERROR_VALUE_FAILED_STR[] = "Value check failed.";
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
|
@ -4968,9 +4881,6 @@ eina_value_init(void)
|
|||
goto on_init_fail_hash;
|
||||
}
|
||||
|
||||
EINA_ERROR_VALUE_FAILED = eina_error_msg_static_register(
|
||||
EINA_ERROR_VALUE_FAILED_STR);
|
||||
|
||||
EINA_VALUE_TYPE_UCHAR = _EINA_VALUE_TYPE_BASICS + 0;
|
||||
EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1;
|
||||
EINA_VALUE_TYPE_UINT = _EINA_VALUE_TYPE_BASICS + 2;
|
||||
|
@ -5106,11 +5016,7 @@ EAPI Eina_Value *
|
|||
eina_value_new(const Eina_Value_Type *type)
|
||||
{
|
||||
Eina_Value *value = eina_mempool_malloc(_eina_value_mp, sizeof(Eina_Value));
|
||||
if (!value)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!value) return NULL;
|
||||
if (!eina_value_setup(value, type))
|
||||
{
|
||||
free(value);
|
||||
|
|
|
@ -587,13 +587,7 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_BLOB;
|
|||
*/
|
||||
EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_STRUCT;
|
||||
|
||||
/**
|
||||
* @var EINA_ERROR_VALUE_FAILED
|
||||
* Error identifier corresponding to value check failure.
|
||||
*
|
||||
* @since 1.2
|
||||
*/
|
||||
EAPI extern int EINA_ERROR_VALUE_FAILED;
|
||||
EAPI extern Eina_Error EINA_ERROR_VALUE_FAILED;
|
||||
|
||||
/**
|
||||
* @defgroup Eina_Value_Value_Group Generic Value management
|
||||
|
@ -625,8 +619,7 @@ struct _Eina_Value
|
|||
* eg. #EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(),
|
||||
* eina_value_array_get() and so on.
|
||||
*
|
||||
* On failure, @c NULL is returned and either #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, @c NULL is returned.
|
||||
*
|
||||
* @note this calls creates from mempool and then uses
|
||||
* eina_value_setup(). Consider using eina_value_flush() and
|
||||
|
@ -664,8 +657,7 @@ EAPI void eina_value_free(Eina_Value *value) EINA_ARG_NONNULL(1);
|
|||
* @note Existing contents are ignored! If the value was previously used, then
|
||||
* use eina_value_flush() first.
|
||||
*
|
||||
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, #EINA_FALSE is returned.
|
||||
*
|
||||
* @see eina_value_flush()
|
||||
*
|
||||
|
@ -1103,8 +1095,7 @@ struct _Eina_Value_Array
|
|||
* Create a new generic value storage of type array. The members are
|
||||
* managed using the description specified by @a subtype.
|
||||
*
|
||||
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, @c NULL is returned.
|
||||
*
|
||||
* @note this creates from mempool and then uses
|
||||
* eina_value_array_setup(). @see eina_value_free() @see
|
||||
|
@ -1132,8 +1123,7 @@ EAPI Eina_Value *eina_value_array_new(const Eina_Value_Type *subtype,
|
|||
* @note Existing contents are ignored! If the value was previously used, then
|
||||
* use eina_value_flush() first.
|
||||
*
|
||||
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, #EINA_FALSE is returned.
|
||||
*
|
||||
* @see eina_value_flush()
|
||||
*
|
||||
|
@ -1753,8 +1743,7 @@ struct _Eina_Value_List
|
|||
* Create a new generic value storage of type list. The members are
|
||||
* managed using the description specified by @a subtype.
|
||||
*
|
||||
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, @c NULL is returned.
|
||||
*
|
||||
* @note this creates from mempool and then uses
|
||||
* eina_value_list_setup().
|
||||
|
@ -1782,8 +1771,7 @@ EAPI Eina_Value *eina_value_list_new(const Eina_Value_Type *subtype) EINA_ARG_NO
|
|||
* @note Existing contents are ignored! If the value was previously used, then
|
||||
* use eina_value_flush() first.
|
||||
*
|
||||
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, #EINA_FALSE is returned.
|
||||
*
|
||||
* @see eina_value_flush()
|
||||
*
|
||||
|
@ -2379,8 +2367,7 @@ struct _Eina_Value_Hash
|
|||
* Create a new generic value storage of type hash. The members are
|
||||
* managed using the description specified by @a subtype.
|
||||
*
|
||||
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, @c NULL is returned.
|
||||
*
|
||||
* @note this creates from mempool and then uses
|
||||
* eina_value_hash_setup().
|
||||
|
@ -2410,8 +2397,7 @@ EAPI Eina_Value *eina_value_hash_new(const Eina_Value_Type *subtype, unsigned in
|
|||
* @note Existing contents are ignored! If the value was previously used, then
|
||||
* use eina_value_flush() first.
|
||||
*
|
||||
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, #EINA_FALSE is returned.
|
||||
*
|
||||
* @see eina_value_flush()
|
||||
*
|
||||
|
@ -2942,8 +2928,7 @@ struct _Eina_Value_Struct
|
|||
* Create a new generic value storage of type struct. The members are
|
||||
* managed using the description specified by @a desc.
|
||||
*
|
||||
* On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, @c NULL is returned.
|
||||
*
|
||||
* @note this creates from mempool and then uses
|
||||
* eina_value_struct_setup().
|
||||
|
@ -2971,8 +2956,7 @@ EAPI Eina_Value *eina_value_struct_new(const Eina_Value_Struct_Desc *desc) EINA_
|
|||
* @note Existing contents are ignored! If the value was previously used, then
|
||||
* use eina_value_flush() first.
|
||||
*
|
||||
* On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
|
||||
* or #EINA_ERROR_VALUE_FAILED is set.
|
||||
* On failure, #EINA_FALSE is returned.
|
||||
*
|
||||
* @see eina_value_flush()
|
||||
*
|
||||
|
|
|
@ -826,8 +826,6 @@ _eo_dbg_info_convert_to(const Eina_Value_Type *type EINA_UNUSED, const Eina_Valu
|
|||
free(inner_val);
|
||||
return ret;
|
||||
}
|
||||
|
||||
eina_error_set(EINA_ERROR_VALUE_FAILED);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,34 +40,7 @@ evas_key_grab_new(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, const ch
|
|||
}
|
||||
}
|
||||
obj->grabs = eina_list_append(obj->grabs, g);
|
||||
if (eina_error_get())
|
||||
{
|
||||
MERR_BAD();
|
||||
evas_mem_free(sizeof(Eina_List));
|
||||
obj->grabs = eina_list_append(obj->grabs, g);
|
||||
if (eina_error_get())
|
||||
{
|
||||
MERR_FATAL();
|
||||
free(g->keyname);
|
||||
free(g);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g);
|
||||
if (eina_error_get())
|
||||
{
|
||||
MERR_BAD();
|
||||
evas_mem_free(sizeof(Eina_List));
|
||||
obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g);
|
||||
if (eina_error_get())
|
||||
{
|
||||
MERR_FATAL();
|
||||
obj->grabs = eina_list_remove(obj->grabs, g);
|
||||
free(g->keyname);
|
||||
free(g);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return g;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include "eina_config.h"
|
||||
#include "eina_inlist.h"
|
||||
#include "eina_error.h"
|
||||
#include "eina_module.h"
|
||||
#include "eina_mempool.h"
|
||||
#include "eina_trash.h"
|
||||
|
@ -123,13 +122,8 @@ _eina_chained_mp_pool_new(Chained_Mempool *pool)
|
|||
Chained_Pool *p;
|
||||
unsigned char *ptr;
|
||||
|
||||
eina_error_set(0);
|
||||
p = malloc(pool->alloc_size);
|
||||
if (!p)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
if (!p) return NULL;
|
||||
|
||||
#ifdef EINA_DEBUG_MALLOC
|
||||
{
|
||||
|
|
|
@ -100,11 +100,7 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size)
|
|||
if (!pool->base)
|
||||
{
|
||||
pool->base = malloc(pool->item_size * pool->max);
|
||||
if (!pool->base)
|
||||
{
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
goto retry_smaller;
|
||||
}
|
||||
if (!pool->base) goto retry_smaller;
|
||||
#ifndef NVALGRIND
|
||||
VALGRIND_MAKE_MEM_NOACCESS(pool->base, pool->item_size * pool->max);
|
||||
#endif
|
||||
|
@ -118,11 +114,8 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int size)
|
|||
}
|
||||
|
||||
retry_smaller:
|
||||
eina_error_set(0);
|
||||
mem = malloc(sizeof(Eina_Inlist) + pool->item_size);
|
||||
if (!mem)
|
||||
eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
|
||||
else
|
||||
if (mem)
|
||||
{
|
||||
pool->over++;
|
||||
/* Only need to zero list elements and not the payload here */
|
||||
|
|
|
@ -64,11 +64,6 @@ emotion_video_stream_new(Emotion_Gstreamer_Video *ev)
|
|||
if (!vstream) return NULL;
|
||||
|
||||
ev->video_streams = eina_list_append(ev->video_streams, vstream);
|
||||
if (eina_error_get())
|
||||
{
|
||||
free(vstream);
|
||||
return NULL;
|
||||
}
|
||||
return vstream;
|
||||
}
|
||||
|
||||
|
@ -1893,11 +1888,6 @@ _emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev,
|
|||
astream = calloc(1, sizeof(Emotion_Audio_Stream));
|
||||
if (!astream) continue;
|
||||
ev->audio_streams = eina_list_append(ev->audio_streams, astream);
|
||||
if (eina_error_get())
|
||||
{
|
||||
free(astream);
|
||||
continue;
|
||||
}
|
||||
|
||||
astream->length_time = length_time;
|
||||
astream->channels = channels;
|
||||
|
|
|
@ -91,19 +91,14 @@ START_TEST(eina_barrier_test_simple)
|
|||
eina_barrier_wait(&barrier);
|
||||
|
||||
eina_thread_join(wk1);
|
||||
ck_assert_int_eq(eina_error_get(), 0);
|
||||
|
||||
eina_thread_join(wk2);
|
||||
ck_assert_int_eq(eina_error_get(), 0);
|
||||
|
||||
eina_thread_join(wk3);
|
||||
ck_assert_int_eq(eina_error_get(), 0);
|
||||
|
||||
eina_thread_join(wk4);
|
||||
ck_assert_int_eq(eina_error_get(), 0);
|
||||
|
||||
eina_thread_join(wk5);
|
||||
ck_assert_int_eq(eina_error_get(), 0);
|
||||
|
||||
eina_barrier_free(&barrier);
|
||||
|
||||
|
|
|
@ -141,7 +141,6 @@ START_TEST(eina_counter_break)
|
|||
"safety check failed: name == NULL");
|
||||
cnt = eina_counter_new(NULL);
|
||||
fail_if(cnt);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -150,7 +149,6 @@ START_TEST(eina_counter_break)
|
|||
TEST_MAGIC_SAFETY("eina_counter_free",
|
||||
"safety check failed: counter == NULL");
|
||||
eina_counter_free(NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -159,7 +157,6 @@ START_TEST(eina_counter_break)
|
|||
TEST_MAGIC_SAFETY("eina_counter_start",
|
||||
"safety check failed: counter == NULL");
|
||||
eina_counter_start(NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -168,7 +165,6 @@ START_TEST(eina_counter_break)
|
|||
TEST_MAGIC_SAFETY("eina_counter_stop",
|
||||
"safety check failed: counter == NULL");
|
||||
eina_counter_stop(NULL, 0);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
|
||||
|
@ -179,7 +175,6 @@ START_TEST(eina_counter_break)
|
|||
"safety check failed: counter == NULL");
|
||||
dump = eina_counter_dump(NULL);
|
||||
fail_if(dump);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
|
||||
|
|
|
@ -94,7 +94,6 @@ START_TEST(eina_file_split_simple)
|
|||
TEST_MAGIC_SAFETY("eina_file_split", "safety check failed: path == NULL");
|
||||
ea = eina_file_split(NULL);
|
||||
fail_if(ea);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
|
||||
|
|
|
@ -167,7 +167,6 @@ START_TEST(eina_inlist_simple)
|
|||
|
||||
tmp2 = eina_inlist_remove(NULL, EINA_INLIST_GET(tmp));
|
||||
fail_if(tmp2 != NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
}
|
||||
|
||||
|
@ -177,7 +176,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_remove",
|
||||
"safety check failed: item == NULL");
|
||||
lst = eina_inlist_remove(lst, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -186,7 +184,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_append",
|
||||
"safety check failed: new_l == NULL");
|
||||
lst = eina_inlist_append(lst, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -195,7 +192,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_append_relative",
|
||||
"safety check failed: new_l == NULL");
|
||||
lst = eina_inlist_append_relative(lst, NULL, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -204,7 +200,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_prepend",
|
||||
"safety check failed: new_l == NULL");
|
||||
lst = eina_inlist_prepend(lst, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -213,7 +208,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_prepend_relative",
|
||||
"safety check failed: new_l == NULL");
|
||||
lst = eina_inlist_prepend_relative(lst, NULL, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -222,7 +216,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_find",
|
||||
"safety check failed: item == NULL");
|
||||
lst = eina_inlist_find(lst, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -231,7 +224,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_demote",
|
||||
"safety check failed: list == NULL");
|
||||
lst = eina_inlist_demote(NULL, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -240,7 +232,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_demote",
|
||||
"safety check failed: item == NULL");
|
||||
lst = eina_inlist_demote((void*)1L, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
lst = NULL;
|
||||
|
||||
|
@ -250,7 +241,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_promote",
|
||||
"safety check failed: list == NULL");
|
||||
lst = eina_inlist_promote(NULL, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -259,7 +249,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_promote",
|
||||
"safety check failed: item == NULL");
|
||||
lst = eina_inlist_promote((void*)1L, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
lst = NULL;
|
||||
|
||||
|
@ -269,7 +258,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_sorted_insert",
|
||||
"safety check failed: item == NULL");
|
||||
lst = eina_inlist_sorted_insert(NULL, NULL, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -278,7 +266,6 @@ START_TEST(eina_inlist_simple)
|
|||
TEST_MAGIC_SAFETY("eina_inlist_sorted_insert",
|
||||
"safety check failed: func == NULL");
|
||||
lst = eina_inlist_sorted_insert(NULL, (void*)1L, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
lst = NULL;
|
||||
|
||||
|
|
|
@ -121,7 +121,6 @@ START_TEST(eina_magic_simple)
|
|||
TEST_MAGIC_SAFETY("eina_magic_string_set",
|
||||
"safety check failed: magic_name == NULL");
|
||||
eina_magic_string_set(EINA_MAGIC_TEST2, NULL);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
fail_unless(ctx.did);
|
||||
|
||||
#ifdef SHOW_LOG
|
||||
|
@ -131,7 +130,6 @@ START_TEST(eina_magic_simple)
|
|||
"safety check failed: magic_name == NULL");
|
||||
eina_magic_string_set(EINA_MAGIC_TEST2, NULL);
|
||||
fail_unless(ctx.did);
|
||||
fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
|
||||
#endif
|
||||
|
||||
eina_magic_string_set(EINA_MAGIC_TEST2, EINA_MAGIC_STRING);
|
||||
|
|
Loading…
Reference in New Issue