static inline Eina_Bool eina_array_push (Eina_Array *array, const void *data) EINA_ARG_NONNULL(1, 2);
static inline void *eina_array_pop (Eina_Array *array) EINA_ARG_NONNULL(1);
-static inline void *eina_array_data_get (const Eina_Array *array, unsigned int index) EINA_ARG_NONNULL(1) EINA_PURE;
-static inline void eina_array_data_set (const Eina_Array *array, unsigned int index, const void *data) EINA_ARG_NONNULL(1, 3);
+static inline void *eina_array_data_get (const Eina_Array *array, unsigned int idx) EINA_ARG_NONNULL(1) EINA_PURE;
+static inline void eina_array_data_set (const Eina_Array *array, unsigned int idx, const void *data) EINA_ARG_NONNULL(1, 3);
static inline unsigned int eina_array_count_get (const Eina_Array *array) EINA_ARG_NONNULL(1) EINA_PURE;
EAPI Eina_Iterator *eina_array_iterator_new (const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
* @brief Return the data at a given position in an array.
*
* @param array The array.
- * @param index The potition of the data to retrieve.
+ * @param idx The potition of the data to retrieve.
* @return The retrieved data.
*
- * This function returns the data at the position @p index in @p
+ * This function returns the data at the position @p idx in @p
* array. For performance reasons, there is no check of @p array or @p
- * index. If it is @c NULL or invalid, the program may crash.
+ * idx. If it is @c NULL or invalid, the program may crash.
*/
static inline void *
-eina_array_data_get(const Eina_Array *array, unsigned int index)
+eina_array_data_get(const Eina_Array *array, unsigned int idx)
{
- return array->data[index];
+ return array->data[idx];
}
/**
* @brief Return the data at a given position in an array.
*
* @param array The array.
- * @param index The potition of the data to set.
+ * @param idx The potition of the data to set.
* @param data The data to set.
*
- * This function returns the data at the position @p index in @p
+ * This function returns the data at the position @p idx in @p
* array. For performance reasons, there is no check of @p array or @p
- * index. If it is @c NULL or invalid, the program may crash.
+ * idx. If it is @c NULL or invalid, the program may crash.
*/
static inline void
-eina_array_data_set(const Eina_Array *array, unsigned int index, const void *data)
+eina_array_data_set(const Eina_Array *array, unsigned int idx, const void *data)
{
- array->data[index] = (void*) data;
+ array->data[idx] = (void*) data;
}
/**
static Eina_Array *eina_array_iterator_get_container(Eina_Iterator_Array *it) EINA_ARG_NONNULL(1);
static Eina_Bool eina_array_iterator_next(Eina_Iterator_Array *it, void **data) EINA_ARG_NONNULL(1);
-static Eina_Bool eina_array_accessor_get_at(Eina_Accessor_Array *it, unsigned int index, void **data) EINA_ARG_NONNULL(1);
+static Eina_Bool eina_array_accessor_get_at(Eina_Accessor_Array *it, unsigned int idx, void **data) EINA_ARG_NONNULL(1);
static Eina_Array *eina_array_accessor_get_container(Eina_Accessor_Array *it) EINA_ARG_NONNULL(1);
static void eina_array_accessor_free(Eina_Accessor_Array *it) EINA_ARG_NONNULL(1);
}
static Eina_Bool
-eina_array_accessor_get_at(Eina_Accessor_Array *it, unsigned int index, void **data)
+eina_array_accessor_get_at(Eina_Accessor_Array *it, unsigned int idx, void **data)
{
EINA_MAGIC_CHECK_ARRAY_ACCESSOR(it, EINA_FALSE);
- if (!(index < eina_array_count_get(it->array)))
+ if (!(idx < eina_array_count_get(it->array)))
return EINA_FALSE;
if (data)
- *data = eina_array_data_get(it->array, index);
+ *data = eina_array_data_get(it->array, idx);
return EINA_TRUE;
}
while (counter->clocks)
{
- Eina_Clock *clock = (Eina_Clock *) counter->clocks;
+ Eina_Clock *clk = (Eina_Clock *) counter->clocks;
counter->clocks = eina_inlist_remove(counter->clocks, counter->clocks);
- free(clock);
+ free(clk);
}
free(counter);
: "cc");
}
+static
void _x86_simd(Eina_Cpu_Features *features)
{
int a, b, c, d;
}
static Eina_Bool
-eina_list_accessor_get_at(Eina_Accessor_List *it, unsigned int index, void **data)
+eina_list_accessor_get_at(Eina_Accessor_List *it, unsigned int idx, void **data)
{
const Eina_List *over;
unsigned int middle;
EINA_MAGIC_CHECK_LIST_ACCESSOR(it, EINA_FALSE);
- if (index >= eina_list_count(it->head)) return EINA_FALSE;
+ if (idx >= eina_list_count(it->head)) return EINA_FALSE;
- if (it->index == index)
+ if (it->index == idx)
{
over = it->current;
}
- else if (index > it->index)
+ else if (idx > it->index)
{
/* After current position. */
middle = ((eina_list_count(it->head) - it->index) >> 1) + it->index;
- if (index > middle)
+ if (idx > middle)
{
/* Go backward from the end. */
for (i = eina_list_count(it->head) - 1, over = eina_list_last(it->head);
- i > index && over != NULL;
+ i > idx && over != NULL;
--i, over = eina_list_prev(over))
;
}
{
/* Go forward from current. */
for (i = it->index, over = it->current;
- i < index && over != NULL;
+ i < idx && over != NULL;
++i, over = eina_list_next(over))
;
}
/* Before current position. */
middle = it->index >> 1;
- if (index > middle)
+ if (idx > middle)
{
/* Go backward from current. */
for (i = it->index, over = it->current;
- i > index && over != NULL;
+ i > idx && over != NULL;
--i, over = eina_list_prev(over))
;
}
{
/* Go forward from start. */
for (i = 0, over = it->head;
- i < index && over != NULL;
+ i < idx && over != NULL;
++i, over = eina_list_next(over))
;
}
if (over == NULL) return EINA_FALSE;
it->current = over;
- it->index = index;
+ it->index = idx;
*data = eina_list_data_get(it->current);
return EINA_TRUE;
{
char *file;
Eina_Module *m;
- size_t length;
length = strlen(path) + strlen(name) + 2;
}
static const char *
-_eina_stringshare_small_bucket_find(const Eina_Stringshare_Small_Bucket *bucket, const char *str, unsigned char length, int *index)
+_eina_stringshare_small_bucket_find(const Eina_Stringshare_Small_Bucket *bucket, const char *str, unsigned char length, int *idx)
{
const char *pstr = str + 1; /* skip first letter, it's always the same */
unsigned char plength = length - 1;
if (bucket->count == 0)
{
- *index = 0;
+ *idx = 0;
return NULL;
}
}
else
{
- *index = i;
+ *idx = i;
return bucket->strings[i];
}
}
- *index = low;
+ *idx = low;
return NULL;
}
}
static const char *
-_eina_stringshare_small_bucket_insert_at(Eina_Stringshare_Small_Bucket **p_bucket, const char *str, unsigned char length, int index)
+_eina_stringshare_small_bucket_insert_at(Eina_Stringshare_Small_Bucket **p_bucket, const char *str, unsigned char length, int idx)
{
Eina_Stringshare_Small_Bucket *bucket = *p_bucket;
int todo, off;
memcpy(snew, str, length);
snew[length] = '\0';
- off = index + 1;
- todo = bucket->count - index;
+ off = idx + 1;
+ todo = bucket->count - idx;
if (todo > 0)
{
- memmove((void *)(bucket->strings + off), bucket->strings + index,
+ memmove((void *)(bucket->strings + off), bucket->strings + idx,
todo * sizeof(bucket->strings[0]));
- memmove(bucket->lengths + off, bucket->lengths + index,
+ memmove(bucket->lengths + off, bucket->lengths + idx,
todo * sizeof(bucket->lengths[0]));
- memmove(bucket->references + off, bucket->references + index,
+ memmove(bucket->references + off, bucket->references + idx,
todo * sizeof(bucket->references[0]));
}
- bucket->strings[index] = snew;
- bucket->lengths[index] = length;
- bucket->references[index] = 1;
+ bucket->strings[idx] = snew;
+ bucket->lengths[idx] = length;
+ bucket->references[idx] = 1;
bucket->count++;
return snew;
}
static void
-_eina_stringshare_small_bucket_remove_at(Eina_Stringshare_Small_Bucket **p_bucket, int index)
+_eina_stringshare_small_bucket_remove_at(Eina_Stringshare_Small_Bucket **p_bucket, int idx)
{
Eina_Stringshare_Small_Bucket *bucket = *p_bucket;
int todo, off;
- if (bucket->references[index] > 1)
+ if (bucket->references[idx] > 1)
{
- bucket->references[index]--;
+ bucket->references[idx]--;
return;
}
- free((char *)bucket->strings[index]);
+ free((char *)bucket->strings[idx]);
if (bucket->count == 1)
{
}
bucket->count--;
- if (index == bucket->count)
+ if (idx == bucket->count)
goto end;
- off = index + 1;
- todo = bucket->count - index;
+ off = idx + 1;
+ todo = bucket->count - idx;
- memmove((void *)(bucket->strings + index), bucket->strings + off,
+ memmove((void *)(bucket->strings + idx), bucket->strings + off,
todo * sizeof(bucket->strings[0]));
- memmove(bucket->lengths + index, bucket->lengths + off,
+ memmove(bucket->lengths + idx, bucket->lengths + off,
todo * sizeof(bucket->lengths[0]));
- memmove(bucket->references + index, bucket->references + off,
+ memmove(bucket->references + idx, bucket->references + off,
todo * sizeof(bucket->references[0]));
end:
Eina_Fixed_Bitmap *mp = data;
Eina_Fixed_Bitmap_Pool *pool = NULL;
void *ptr;
- int index;
+ int idx;
if (mp->head)
{
mp->lookup = eina_rbtree_inline_insert(mp->lookup, EINA_RBTREE_GET(pool), EINA_RBTREE_CMP_NODE_CB(_eina_fixed_cmp), NULL);
}
- index = ffs(pool->bitmask) - 1;
- pool->bitmask &= ~(1 << index);
- ptr = (unsigned char*) (pool + 1) + index * mp->item_size;
+ idx = ffs(pool->bitmask) - 1;
+ pool->bitmask &= ~(1 << idx);
+ ptr = (unsigned char*) (pool + 1) + idx * mp->item_size;
if (pool->bitmask == 0)
mp->head = eina_inlist_demote(mp->head, EINA_INLIST_GET(pool));