Keep EINA_MAGIC at the end of the structure (WHEN POSSIBLE! Watch out
flexible arrays like char str[] at the end!)
this way if parts use EINA_MAGIC and others do not, it will possible overflow and valgrind can help us.
WARNING: make uninstall before update! Then make clean and make install, check if everything is working with "make check".
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@37961
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
struct _Eina_Accessor
{
-#define EINA_MAGIC_ACCESSOR 0x98761232
- EINA_MAGIC;
-
Eina_Accessor_Get_At_Callback get_at;
Eina_Accessor_Get_Container_Callback get_container;
Eina_Accessor_Free_Callback free;
+
+#define EINA_MAGIC_ACCESSOR 0x98761232
+ EINA_MAGIC;
};
#define FUNC_ACCESSOR_GET_AT(Function) ((Eina_Accessor_Get_At_Callback)Function)
*/
struct _Eina_Array
{
- EINA_MAGIC;
-
void **data; /**< Pointer to a vector of pointer to payload */
unsigned int total; /**< Total number of slot in the vector */
unsigned int count; /**< Number of activ slot in the vector */
unsigned int step; /**< How much must we grow the vector when it is full */
+
+ EINA_MAGIC;
};
EAPI int eina_array_init (void);
struct _Eina_Iterator
{
-#define EINA_MAGIC_ITERATOR 0x98761233
- EINA_MAGIC;
-
Eina_Iterator_Next_Callback next;
Eina_Iterator_Get_Container_Callback get_container;
Eina_Iterator_Free_Callback free;
+
+#define EINA_MAGIC_ITERATOR 0x98761233
+ EINA_MAGIC;
};
*/
struct _Eina_List /** A linked list node */
{
- EINA_MAGIC;
-
void *data; /**< Pointer to list element payload */
Eina_List *next; /**< Next member in the list */
Eina_List *prev; /**< Previous member in the list */
struct _Eina_List_Accounting *accounting; /**< Private list accounting info - don't touch */
+
+ EINA_MAGIC;
};
struct _Eina_List_Accounting
{
- EINA_MAGIC;
-
Eina_List *last;
unsigned int count;
+ EINA_MAGIC;
};
{
Eina_Iterator iterator;
- EINA_MAGIC;
-
const Eina_Array *array;
unsigned int index;
+
+ EINA_MAGIC;
};
typedef struct _Eina_Accessor_Array Eina_Accessor_Array;
struct _Eina_Accessor_Array
{
Eina_Accessor accessor;
-
- EINA_MAGIC;
-
const Eina_Array *array;
+ EINA_MAGIC;
};
static int _eina_array_init_count = 0;
{
Eina_Iterator iterator;
- EINA_MAGIC;
-
const Eina_List *head;
const Eina_List *current;
+
+ EINA_MAGIC;
};
struct _Eina_Accessor_List
{
Eina_Accessor accessor;
- EINA_MAGIC;
-
const Eina_List *head;
const Eina_List *current;
unsigned int index;
+
+ EINA_MAGIC;
};
static int _eina_list_init_count = 0;
struct _Eina_Rectangle_Pool
{
- EINA_MAGIC;
-
Eina_Inlist *head;
void *data;
unsigned int references;
int w;
int h;
+ EINA_MAGIC;
};
struct _Eina_Rectangle_Alloc
{
EINA_INLIST;
- EINA_MAGIC;
-
Eina_Rectangle_Pool *pool;
+ EINA_MAGIC;
};
#define EINA_MAGIC_CHECK_RECTANGLE_POOL(d) \