Eo: rename conflicting internal Eo_Base to Eo_Header

This name conflicts with the class Eo.Base and should have
been called Eo_Header from the start anyway.
This commit is contained in:
Tom Hacohen 2015-05-28 16:49:13 +01:00
parent 3aabb41d1d
commit 293d286977
4 changed files with 17 additions and 17 deletions

View File

@ -151,7 +151,7 @@ _eo_is_a_class(const Eo *eo_id)
#else #else
/* fortunately EO_OBJ_POINTER_RETURN* will handle NULL eo_id */ /* fortunately EO_OBJ_POINTER_RETURN* will handle NULL eo_id */
if (!eo_id) return EINA_FALSE; if (!eo_id) return EINA_FALSE;
oid = ((Eo_Base *) eo_id)->id; oid = ((Eo_Header *) eo_id)->id;
#endif #endif
return ((((oid >> REF_TAG_SHIFT) & 0x1) == 0x0) && return ((((oid >> REF_TAG_SHIFT) & 0x1) == 0x0) &&
(oid & MASK_CLASS_TAG)); (oid & MASK_CLASS_TAG));
@ -899,7 +899,7 @@ _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo
obj->klass = klass; obj->klass = klass;
#ifndef HAVE_EO_ID #ifndef HAVE_EO_ID
EINA_MAGIC_SET((Eo_Base *) obj, EO_EINA_MAGIC); EINA_MAGIC_SET((Eo_Header *) obj, EO_EINA_MAGIC);
#endif #endif
obj->header.id = _eo_id_allocate(obj); obj->header.id = _eo_id_allocate(obj);
Eo *eo_id = _eo_id_get(obj); Eo *eo_id = _eo_id_get(obj);
@ -1233,9 +1233,9 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
_Eo_Class *parent = _eo_class_pointer_get(parent_id); _Eo_Class *parent = _eo_class_pointer_get(parent_id);
#ifndef HAVE_EO_ID #ifndef HAVE_EO_ID
if (parent && !EINA_MAGIC_CHECK((Eo_Base *) parent, EO_CLASS_EINA_MAGIC)) if (parent && !EINA_MAGIC_CHECK((Eo_Header *) parent, EO_CLASS_EINA_MAGIC))
{ {
EINA_MAGIC_FAIL((Eo_Base *) parent, EO_CLASS_EINA_MAGIC); EINA_MAGIC_FAIL((Eo_Header *) parent, EO_CLASS_EINA_MAGIC);
return NULL; return NULL;
} }
#endif #endif
@ -1350,7 +1350,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
klass = calloc(1, _eo_class_sz + extn_sz + mro_sz + mixins_sz); klass = calloc(1, _eo_class_sz + extn_sz + mro_sz + mixins_sz);
#ifndef HAVE_EO_ID #ifndef HAVE_EO_ID
EINA_MAGIC_SET((Eo_Base *) klass, EO_CLASS_EINA_MAGIC); EINA_MAGIC_SET((Eo_Header *) klass, EO_CLASS_EINA_MAGIC);
#endif #endif
eina_spinlock_new(&klass->objects.trash_lock); eina_spinlock_new(&klass->objects.trash_lock);
eina_spinlock_new(&klass->iterators.trash_lock); eina_spinlock_new(&klass->iterators.trash_lock);

View File

@ -62,7 +62,7 @@ extern int _eo_log_dom;
typedef uintptr_t Eo_Id; typedef uintptr_t Eo_Id;
typedef struct _Eo_Class _Eo_Class; typedef struct _Eo_Class _Eo_Class;
typedef struct _Eo_Object _Eo_Object; typedef struct _Eo_Object _Eo_Object;
typedef struct _Eo_Base Eo_Base; typedef struct _Eo_Header Eo_Header;
/* Retrieves the pointer to the object from the id */ /* Retrieves the pointer to the object from the id */
static inline _Eo_Object *_eo_obj_pointer_get(const Eo_Id obj_id); static inline _Eo_Object *_eo_obj_pointer_get(const Eo_Id obj_id);
@ -78,7 +78,7 @@ static inline void _eo_free_ids_tables(void);
void _eo_condtor_done(Eo *obj); void _eo_condtor_done(Eo *obj);
struct _Eo_Base struct _Eo_Header
{ {
#ifndef HAVE_EO_ID #ifndef HAVE_EO_ID
EINA_MAGIC EINA_MAGIC
@ -88,7 +88,7 @@ struct _Eo_Base
struct _Eo_Object struct _Eo_Object
{ {
Eo_Base header; Eo_Header header;
const _Eo_Class *klass; const _Eo_Class *klass;
#ifdef EO_DEBUG #ifdef EO_DEBUG
Eina_Inlist *xrefs; Eina_Inlist *xrefs;
@ -133,7 +133,7 @@ typedef struct
struct _Eo_Class struct _Eo_Class
{ {
Eo_Base header; Eo_Header header;
const _Eo_Class *parent; const _Eo_Class *parent;
const Eo_Class_Description *desc; const Eo_Class_Description *desc;
@ -179,7 +179,7 @@ typedef struct
} Eo_Xref_Node; } Eo_Xref_Node;
static inline static inline
Eo *_eo_header_id_get(const Eo_Base *header) Eo *_eo_header_id_get(const Eo_Header *header)
{ {
#ifdef HAVE_EO_ID #ifdef HAVE_EO_ID
return (Eo *) header->id; return (Eo *) header->id;
@ -191,13 +191,13 @@ Eo *_eo_header_id_get(const Eo_Base *header)
static inline static inline
Eo_Class *_eo_class_id_get(const _Eo_Class *klass) Eo_Class *_eo_class_id_get(const _Eo_Class *klass)
{ {
return _eo_header_id_get((Eo_Base *) klass); return _eo_header_id_get((Eo_Header *) klass);
} }
static inline static inline
Eo *_eo_id_get(const _Eo_Object *obj) Eo *_eo_id_get(const _Eo_Object *obj)
{ {
return _eo_header_id_get((Eo_Base *) obj); return _eo_header_id_get((Eo_Header *) obj);
} }
static inline void static inline void

View File

@ -60,28 +60,28 @@
_Eo_Object *obj; \ _Eo_Object *obj; \
do { \ do { \
obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ obj = _eo_obj_pointer_get((Eo_Id)obj_id); \
EO_MAGIC_RETURN_VAL((Eo_Base *) obj, EO_EINA_MAGIC, ret); \ EO_MAGIC_RETURN_VAL((Eo_Header *) obj, EO_EINA_MAGIC, ret); \
} while (0) } while (0)
#define EO_OBJ_POINTER_RETURN(obj_id, obj) \ #define EO_OBJ_POINTER_RETURN(obj_id, obj) \
_Eo_Object *obj; \ _Eo_Object *obj; \
do { \ do { \
obj = _eo_obj_pointer_get((Eo_Id)obj_id); \ obj = _eo_obj_pointer_get((Eo_Id)obj_id); \
EO_MAGIC_RETURN((Eo_Base *) obj, EO_EINA_MAGIC); \ EO_MAGIC_RETURN((Eo_Header *) obj, EO_EINA_MAGIC); \
} while (0) } while (0)
#define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \ #define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \
_Eo_Class *klass; \ _Eo_Class *klass; \
do { \ do { \
klass = _eo_class_pointer_get(klass_id); \ klass = _eo_class_pointer_get(klass_id); \
EO_MAGIC_RETURN_VAL((Eo_Base *) klass, EO_CLASS_EINA_MAGIC, ret); \ EO_MAGIC_RETURN_VAL((Eo_Header *) klass, EO_CLASS_EINA_MAGIC, ret); \
} while (0) } while (0)
#define EO_CLASS_POINTER_RETURN(klass_id, klass) \ #define EO_CLASS_POINTER_RETURN(klass_id, klass) \
_Eo_Class *klass; \ _Eo_Class *klass; \
do { \ do { \
klass = _eo_class_pointer_get(klass_id); \ klass = _eo_class_pointer_get(klass_id); \
EO_MAGIC_RETURN((Eo_Base *) klass, EO_CLASS_EINA_MAGIC); \ EO_MAGIC_RETURN((Eo_Header *) klass, EO_CLASS_EINA_MAGIC); \
} while (0) } while (0)
#endif #endif

View File

@ -474,7 +474,7 @@ _eo_id_release(const Eo_Id obj_id)
ERR("obj_id %p is not pointing to a valid object. Maybe it has already been freed.", (void *)obj_id); ERR("obj_id %p is not pointing to a valid object. Maybe it has already been freed.", (void *)obj_id);
#else #else
EINA_MAGIC_SET((Eo_Base *) obj_id, EO_FREED_EINA_MAGIC); EINA_MAGIC_SET((Eo_Header *) obj_id, EO_FREED_EINA_MAGIC);
#endif #endif
} }