forked from enlightenment/efl
parent
ddc6ba2c2a
commit
bed21c315d
|
@ -136,7 +136,14 @@ EINA_ARG_NONNULL(1, 2);
|
||||||
#define EINA_ACCESSOR_FOREACH(accessor, counter, data) for ((counter) = 0; \
|
#define EINA_ACCESSOR_FOREACH(accessor, counter, data) for ((counter) = 0; \
|
||||||
eina_accessor_data_get(( \
|
eina_accessor_data_get(( \
|
||||||
accessor), \
|
accessor), \
|
||||||
(counter), (void **)&(data)); (counter)++)
|
( \
|
||||||
|
counter), \
|
||||||
|
( \
|
||||||
|
void \
|
||||||
|
* \
|
||||||
|
*) \
|
||||||
|
&(data)); \
|
||||||
|
(counter)++)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
|
|
@ -110,18 +110,24 @@ EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
||||||
#define EINA_INLIST_FOREACH(list, l) for (l = NULL, \
|
#define EINA_INLIST_FOREACH(list, l) for (l = NULL, \
|
||||||
l = \
|
l = \
|
||||||
(list ? _EINA_INLIST_CONTAINER(l, \
|
(list ? _EINA_INLIST_CONTAINER(l, \
|
||||||
list) : NULL); \
|
list) \
|
||||||
|
: NULL); \
|
||||||
l; \
|
l; \
|
||||||
l = \
|
l = \
|
||||||
(EINA_INLIST_GET(l)->next ? \
|
(EINA_INLIST_GET(l)->next ? \
|
||||||
_EINA_INLIST_CONTAINER(l, \
|
_EINA_INLIST_CONTAINER(l, \
|
||||||
EINA_INLIST_GET( \
|
EINA_INLIST_GET( \
|
||||||
l)-> \
|
l)-> \
|
||||||
next) : NULL))
|
next) : \
|
||||||
|
NULL))
|
||||||
#define EINA_INLIST_REVERSE_FOREACH(list, l) for (l = NULL, \
|
#define EINA_INLIST_REVERSE_FOREACH(list, l) for (l = NULL, \
|
||||||
l = \
|
l = \
|
||||||
(list ? \
|
(list ? \
|
||||||
_EINA_INLIST_CONTAINER(l, list->last) : NULL); \
|
_EINA_INLIST_CONTAINER(l, \
|
||||||
|
list \
|
||||||
|
-> \
|
||||||
|
last) \
|
||||||
|
: NULL); \
|
||||||
l; \
|
l; \
|
||||||
l = \
|
l = \
|
||||||
(EINA_INLIST_GET(l)->prev \
|
(EINA_INLIST_GET(l)->prev \
|
||||||
|
|
|
@ -333,7 +333,8 @@ EINA_WARN_UNUSED_RESULT;
|
||||||
eina_list_data_get(l); \
|
eina_list_data_get(l); \
|
||||||
l; \
|
l; \
|
||||||
l = eina_list_prev(l), \
|
l = eina_list_prev(l), \
|
||||||
data = eina_list_data_get(l))
|
data = \
|
||||||
|
eina_list_data_get(l))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def EINA_LIST_FOREACH_SAFE
|
* @def EINA_LIST_FOREACH_SAFE
|
||||||
|
@ -373,10 +374,15 @@ EINA_WARN_UNUSED_RESULT;
|
||||||
#define EINA_LIST_FOREACH_SAFE(list, l, l_next, data) for (l = list, \
|
#define EINA_LIST_FOREACH_SAFE(list, l, l_next, data) for (l = list, \
|
||||||
l_next = \
|
l_next = \
|
||||||
eina_list_next(l), \
|
eina_list_next(l), \
|
||||||
data = eina_list_data_get(l); \
|
data = \
|
||||||
|
eina_list_data_get( \
|
||||||
|
l); \
|
||||||
l; \
|
l; \
|
||||||
l = l_next, l_next = \
|
l = l_next, l_next = \
|
||||||
eina_list_next(l), data = eina_list_data_get(l))
|
eina_list_next(l), \
|
||||||
|
data = \
|
||||||
|
eina_list_data_get( \
|
||||||
|
l))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def EINA_LIST_REVERSE_FOREACH_SAFE
|
* @def EINA_LIST_REVERSE_FOREACH_SAFE
|
||||||
|
@ -418,10 +424,20 @@ EINA_WARN_UNUSED_RESULT;
|
||||||
#define EINA_LIST_REVERSE_FOREACH_SAFE(list, l, l_prev, data) for (l = \
|
#define EINA_LIST_REVERSE_FOREACH_SAFE(list, l, l_prev, data) for (l = \
|
||||||
eina_list_last( \
|
eina_list_last( \
|
||||||
list), \
|
list), \
|
||||||
l_prev = eina_list_prev(l), data = eina_list_data_get(l); \
|
l_prev = \
|
||||||
|
eina_list_prev( \
|
||||||
|
l), \
|
||||||
|
data = \
|
||||||
|
eina_list_data_get( \
|
||||||
|
l); \
|
||||||
l; \
|
l; \
|
||||||
l = l_prev, \
|
l = l_prev, \
|
||||||
l_prev = eina_list_prev(l), data = eina_list_data_get(l))
|
l_prev = \
|
||||||
|
eina_list_prev( \
|
||||||
|
l), \
|
||||||
|
data = \
|
||||||
|
eina_list_data_get( \
|
||||||
|
l))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def EINA_LIST_FREE
|
* @def EINA_LIST_FREE
|
||||||
|
@ -451,7 +467,8 @@ EINA_WARN_UNUSED_RESULT;
|
||||||
#define EINA_LIST_FREE(list, data) for (data = eina_list_data_get(list); list; \
|
#define EINA_LIST_FREE(list, data) for (data = eina_list_data_get(list); list; \
|
||||||
list = \
|
list = \
|
||||||
eina_list_remove_list(list, \
|
eina_list_remove_list(list, \
|
||||||
list), data = eina_list_data_get(list))
|
list), data = \
|
||||||
|
eina_list_data_get(list))
|
||||||
|
|
||||||
#include "eina_inline_list.x"
|
#include "eina_inline_list.x"
|
||||||
|
|
||||||
|
|
|
@ -642,13 +642,14 @@ eina_convert_fptoa(Eina_F32p32 fp, char *des)
|
||||||
|
|
||||||
/* fp >= 1 */
|
/* fp >= 1 */
|
||||||
if (fp >= 0x0000000100000000LL)
|
if (fp >= 0x0000000100000000LL)
|
||||||
while (fp >= 0x0000000100000000LL)
|
{
|
||||||
{
|
while (fp >= 0x0000000100000000LL)
|
||||||
p++;
|
{
|
||||||
/* fp /= 2 */
|
p++;
|
||||||
fp >>= 1;
|
/* fp /= 2 */
|
||||||
}
|
fp >>= 1;
|
||||||
/* fp < 0.5 */
|
} /* fp < 0.5 */
|
||||||
|
}
|
||||||
else if (fp < 0x80000000)
|
else if (fp < 0x80000000)
|
||||||
while (fp < 0x80000000)
|
while (fp < 0x80000000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -100,7 +100,6 @@ eina_inlist_accessor_get_at(Eina_Accessor_Inlist *it,
|
||||||
i < idx && over != NULL;
|
i < idx && over != NULL;
|
||||||
++i, over = over->next)
|
++i, over = over->next)
|
||||||
;
|
;
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
middle = it->index >> 1;
|
middle = it->index >> 1;
|
||||||
|
|
|
@ -1067,7 +1067,7 @@ eina_list_promote_list(Eina_List *list, Eina_List *move_list)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!move_list)
|
if (!move_list)
|
||||||
return list; /* Promoting head to be head. */
|
return list; /* Promoting head to be head. */
|
||||||
|
|
||||||
if (move_list == list)
|
if (move_list == list)
|
||||||
return list;
|
return list;
|
||||||
|
@ -1136,7 +1136,7 @@ eina_list_demote_list(Eina_List *list, Eina_List *move_list)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!move_list)
|
if (!move_list)
|
||||||
return list; /* Demoting tail to be tail. */
|
return list; /* Demoting tail to be tail. */
|
||||||
|
|
||||||
if (move_list == list->accounting->last)
|
if (move_list == list->accounting->last)
|
||||||
return list;
|
return list;
|
||||||
|
@ -1146,7 +1146,7 @@ eina_list_demote_list(Eina_List *list, Eina_List *move_list)
|
||||||
|
|
||||||
/* Update pointer list if necessary. */
|
/* Update pointer list if necessary. */
|
||||||
if (list == move_list)
|
if (list == move_list)
|
||||||
list = move_list->next; /* Remove the demoted item from the list. */
|
list = move_list->next; /* Remove the demoted item from the list. */
|
||||||
|
|
||||||
if (move_list->prev)
|
if (move_list->prev)
|
||||||
move_list->prev->next = move_list->next;
|
move_list->prev->next = move_list->next;
|
||||||
|
|
|
@ -153,7 +153,7 @@ static void _dir_list_cb(const char *name, const char *path, void *data)
|
||||||
snprintf(file, length, "%s/%s", path, name);
|
snprintf(file, length, "%s/%s", path, name);
|
||||||
m = eina_module_new(file);
|
m = eina_module_new(file);
|
||||||
if (!m)
|
if (!m)
|
||||||
return; /* call the user provided cb on this module */
|
return; /* call the user provided cb on this module */
|
||||||
|
|
||||||
if (!cb_data->cb(m, cb_data->data))
|
if (!cb_data->cb(m, cb_data->data))
|
||||||
eina_module_free(m);
|
eina_module_free(m);
|
||||||
|
@ -488,7 +488,6 @@ EAPI char *eina_module_symbol_path_get(const void *symbol, const char *sub_dir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* ! HAVE_DLADDR */
|
#endif /* ! HAVE_DLADDR */
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -228,7 +228,7 @@ _eina_rectangle_empty_space_find(Eina_List *empty, int w, int h, int *x, int *y)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r)
|
if (r)
|
||||||
empty = _eina_rectangle_merge_list(empty, r); /* Return empty */
|
empty = _eina_rectangle_merge_list(empty, r); /* Return empty */
|
||||||
|
|
||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,10 +252,10 @@ _eina_share_common_population_stats(Eina_Share *share)
|
||||||
fprintf(stderr, "eina share_common statistic:\n");
|
fprintf(stderr, "eina share_common statistic:\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" * maximum shared strings : %i\n",
|
" * maximum shared strings : %i\n",
|
||||||
share->population.max);
|
share->population.max);
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" * maximum shared strings per node : %i\n",
|
" * maximum shared strings per node : %i\n",
|
||||||
share->max_node_population);
|
share->max_node_population);
|
||||||
|
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < sizeof (share->population_group) /
|
i < sizeof (share->population_group) /
|
||||||
|
@ -924,7 +924,7 @@ eina_share_common_dump(Eina_Share *share, void (*additional_dump)(
|
||||||
for (i = 0; i < EINA_SHARE_COMMON_BUCKETS; i++)
|
for (i = 0; i < EINA_SHARE_COMMON_BUCKETS; i++)
|
||||||
{
|
{
|
||||||
if (!share->share->buckets[i])
|
if (!share->share->buckets[i])
|
||||||
continue; // printf("DDD: BUCKET # %i (HEAD=%i, NODE=%i)\n", i,
|
continue; // printf("DDD: BUCKET # %i (HEAD=%i, NODE=%i)\n", i,
|
||||||
|
|
||||||
// sizeof(Eina_Share_Common_Head), sizeof(Eina_Share_Common_Node));
|
// sizeof(Eina_Share_Common_Head), sizeof(Eina_Share_Common_Node));
|
||||||
it = eina_rbtree_iterator_prefix(
|
it = eina_rbtree_iterator_prefix(
|
||||||
|
|
|
@ -229,6 +229,7 @@ eina_strlcpy(char *dst, const char *src, size_t siz)
|
||||||
if (siz != 0)
|
if (siz != 0)
|
||||||
{
|
{
|
||||||
*d = '\0'; /* NUL-terminate dst */
|
*d = '\0'; /* NUL-terminate dst */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*s++)
|
while (*s++)
|
||||||
|
|
|
@ -746,7 +746,7 @@ eina_strbuf_replace(Eina_Strbuf *buf,
|
||||||
/* resize the buffer if necessary */
|
/* resize the buffer if necessary */
|
||||||
if (EINA_UNLIKELY(!_eina_strbuf_common_grow(_STRBUF_CSIZE, buf,
|
if (EINA_UNLIKELY(!_eina_strbuf_common_grow(_STRBUF_CSIZE, buf,
|
||||||
buf->len - len1 + len2)))
|
buf->len - len1 + len2)))
|
||||||
return EINA_FALSE; /* move the existing text */
|
return EINA_FALSE; /* move the existing text */
|
||||||
|
|
||||||
memmove(buf->buf + pos + len2, buf->buf + pos + len1,
|
memmove(buf->buf + pos + len2, buf->buf + pos + len1,
|
||||||
buf->len - pos - len1);
|
buf->len - pos - len1);
|
||||||
|
|
|
@ -286,29 +286,35 @@ static inline void _split_strict(list_t *dirty, const rect_t current, rect_t r)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w_1 > 0)
|
if (w_1 > 0)
|
||||||
/* (b) r .----.cur (a)
|
{
|
||||||
* .--|-. | .--.r2 .-.r
|
/* (b) r .----.cur (a)
|
||||||
* | | | | -> | | + | |
|
* .--|-. | .--.r2 .-.r
|
||||||
* `--|-' | `--' `-'
|
* | | | | -> | | + | |
|
||||||
* `----'
|
* `--|-' | `--' `-'
|
||||||
*/
|
* `----'
|
||||||
rect_list_append_xywh(dirty, r.left, r.top, w_1, r.height);
|
*/
|
||||||
/* not necessary to keep these, r (b) will be destroyed */
|
rect_list_append_xywh(dirty, r.left, r.top, w_1, r.height); /* not necessary to keep these, r (b) will be destroyed */
|
||||||
/* r.width -= w_1; */
|
|
||||||
/* r.left = current.left; */
|
}
|
||||||
|
|
||||||
|
/* r.width -= w_1; */
|
||||||
|
/* r.left = current.left; */
|
||||||
|
|
||||||
if (w_2 > 0)
|
if (w_2 > 0)
|
||||||
/* .----.cur (a)
|
{
|
||||||
* | |
|
/* .----.cur (a)
|
||||||
* | .-|--.r (b) .-.r .--.r2
|
* | |
|
||||||
* | | | | -> | | + | |
|
* | .-|--.r (b) .-.r .--.r2
|
||||||
* | `-|--' `-' `--'
|
* | | | | -> | | + | |
|
||||||
* `----'
|
* | `-|--' `-' `--'
|
||||||
*/
|
* `----'
|
||||||
|
*/
|
||||||
rect_list_append_xywh(dirty, current.right, r.top, w_2,
|
rect_list_append_xywh(dirty, current.right, r.top, w_2,
|
||||||
r.height);
|
r.height); /* not necessary to keep this, r (b) will be destroyed */
|
||||||
/* not necessary to keep this, r (b) will be destroyed */
|
|
||||||
/* r.width -= w_2; */
|
}
|
||||||
|
|
||||||
|
/* r.width -= w_2; */
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void _calc_intra_outer_rect_area(const rect_t a, const rect_t b,
|
static inline void _calc_intra_outer_rect_area(const rect_t a, const rect_t b,
|
||||||
|
@ -849,7 +855,7 @@ rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error)
|
||||||
* this rect check was totally useless,
|
* this rect check was totally useless,
|
||||||
* should never happen
|
* should never happen
|
||||||
*/
|
*/
|
||||||
/* prev_cur_node = cur_node; */
|
/* prev_cur_node = cur_node; */
|
||||||
/* cur_node = cur_node->next; */
|
/* cur_node = cur_node->next; */
|
||||||
printf("Should not get here!\n");
|
printf("Should not get here!\n");
|
||||||
abort();
|
abort();
|
||||||
|
|
|
@ -155,7 +155,8 @@ eina_ustringshare_add_length(const Eina_Unicode *str, unsigned int slen)
|
||||||
return (const Eina_Unicode *)eina_share_common_add_length(ustringshare_share,
|
return (const Eina_Unicode *)eina_share_common_add_length(ustringshare_share,
|
||||||
(const char *)str,
|
(const char *)str,
|
||||||
slen *
|
slen *
|
||||||
sizeof(Eina_Unicode),
|
sizeof(
|
||||||
|
Eina_Unicode),
|
||||||
sizeof(
|
sizeof(
|
||||||
Eina_Unicode));
|
Eina_Unicode));
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,11 +165,11 @@ static void _free(void *data, void *element)
|
||||||
check:
|
check:
|
||||||
/* already on the last order */
|
/* already on the last order */
|
||||||
if (block->order + b->min_order == b->max_order)
|
if (block->order + b->min_order == b->max_order)
|
||||||
goto end; /* get the buddy */
|
goto end; /* get the buddy */
|
||||||
|
|
||||||
buddy = &b->blocks[index ^ (1 << block->order)];
|
buddy = &b->blocks[index ^ (1 << block->order)];
|
||||||
if (!buddy->available)
|
if (!buddy->available)
|
||||||
goto end; /* merge two blocks */
|
goto end; /* merge two blocks */
|
||||||
|
|
||||||
b->areas[block->order] = eina_inlist_remove(b->areas[block->order],
|
b->areas[block->order] = eina_inlist_remove(b->areas[block->order],
|
||||||
EINA_INLIST_GET(buddy));
|
EINA_INLIST_GET(buddy));
|
||||||
|
|
|
@ -218,8 +218,8 @@ eina_one_big_shutdown(void *data)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (pool->usage > 0)
|
if (pool->usage > 0)
|
||||||
INF(
|
INF(
|
||||||
"Bad news we are destroying memory still referenced in mempool [%s]\n",
|
"Bad news we are destroying memory still referenced in mempool [%s]\n",
|
||||||
pool->name);
|
pool->name);
|
||||||
|
|
||||||
if (pool->over > 0)
|
if (pool->over > 0)
|
||||||
INF("Bad news we are loosing track of pointer from mempool [%s]\n",
|
INF("Bad news we are loosing track of pointer from mempool [%s]\n",
|
||||||
|
|
|
@ -192,7 +192,7 @@ evas_stringshare_add(const char *str)
|
||||||
Evas_Stringshare_El *el, *pel = NULL;
|
Evas_Stringshare_El *el, *pel = NULL;
|
||||||
|
|
||||||
if (!str)
|
if (!str)
|
||||||
return NULL; // if (!f)
|
return NULL; // if (!f)
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// char bf[256];
|
// char bf[256];
|
||||||
|
|
Loading…
Reference in New Issue