summaryrefslogtreecommitdiff
path: root/legacy/eobj
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2012-07-10 14:01:54 +0000
committerTom Hacohen <tom@stosb.com>2012-07-10 14:01:54 +0000
commit3018a6a4c497dd20a0192c35af13e942434c2655 (patch)
tree47038688f800570f9e43bfa70174d4b6637b8e04 /legacy/eobj
parentb2adf3424baf6c58bea38ec854fe6fccb4c54c53 (diff)
Eo: Cosmetic changes.
SVN revision: 73529
Diffstat (limited to 'legacy/eobj')
-rw-r--r--legacy/eobj/src/lib/eo.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/legacy/eobj/src/lib/eo.c b/legacy/eobj/src/lib/eo.c
index c1fdc1d317..ad195a9186 100644
--- a/legacy/eobj/src/lib/eo.c
+++ b/legacy/eobj/src/lib/eo.c
@@ -53,8 +53,8 @@ struct _Eo {
53}; 53};
54 54
55/* Start of Dich */ 55/* Start of Dich */
56/* Dich search, split to 0xff 0xff 0xffff */
57 56
57/* How we search and store the implementations in classes. */
58#define DICH_CHAIN_LAST_BITS 5 58#define DICH_CHAIN_LAST_BITS 5
59#define DICH_CHAIN_LAST_SIZE (1 << DICH_CHAIN_LAST_BITS) 59#define DICH_CHAIN_LAST_SIZE (1 << DICH_CHAIN_LAST_BITS)
60#define DICH_CHAIN1(x) ((x) / DICH_CHAIN_LAST_SIZE) 60#define DICH_CHAIN1(x) ((x) / DICH_CHAIN_LAST_SIZE)
@@ -70,11 +70,6 @@ struct _Eo {
70#define EO_ALIGN_SIZE(size) \ 70#define EO_ALIGN_SIZE(size) \
71 ((size) + (sizeof(void *) - ((size) % sizeof(void *)))) 71 ((size) + (sizeof(void *) - ((size) % sizeof(void *))))
72 72
73/* Structure of Eo_Op is:
74 * 16bit: class
75 * 16bit: op.
76 */
77
78typedef struct _Dich_Chain1 Dich_Chain1; 73typedef struct _Dich_Chain1 Dich_Chain1;
79 74
80typedef struct 75typedef struct
@@ -90,8 +85,8 @@ struct _Dich_Chain1
90 85
91typedef struct 86typedef struct
92{ 87{
93 const Eo_Class *klass; 88 const Eo_Class *klass;
94 size_t offset; 89 size_t offset;
95} Eo_Extension_Data_Offset; 90} Eo_Extension_Data_Offset;
96 91
97struct _Eo_Class 92struct _Eo_Class
@@ -1404,14 +1399,14 @@ _eo_data_get(const Eo *obj, const Eo_Class *klass)
1404 { 1399 {
1405 if (doff_itr->klass == klass) 1400 if (doff_itr->klass == klass)
1406 return ((char *) obj) + EO_ALIGN_SIZE(sizeof(*obj)) + 1401 return ((char *) obj) + EO_ALIGN_SIZE(sizeof(*obj)) +
1407 doff_itr->offset; 1402 doff_itr->offset;
1408 doff_itr++; 1403 doff_itr++;
1409 } 1404 }
1410 } 1405 }
1411 else 1406 else
1412 { 1407 {
1413 return ((char *) obj) + EO_ALIGN_SIZE(sizeof(*obj)) + 1408 return ((char *) obj) + EO_ALIGN_SIZE(sizeof(*obj)) +
1414 klass->data_offset; 1409 klass->data_offset;
1415 } 1410 }
1416 } 1411 }
1417 1412
@@ -1476,6 +1471,12 @@ eo_init(void)
1476 eina_magic_string_static_set(EO_CLASS_EINA_MAGIC, 1471 eina_magic_string_static_set(EO_CLASS_EINA_MAGIC,
1477 EO_CLASS_EINA_MAGIC_STR); 1472 EO_CLASS_EINA_MAGIC_STR);
1478 1473
1474#ifndef NDEBUG
1475 /* Call it just for coverage purposes. Ugly I know, but I like it better than
1476 * casting everywhere else. */
1477 _eo_class_isa_func(NULL, NULL, NULL);
1478#endif
1479
1479 return EINA_TRUE; 1480 return EINA_TRUE;
1480} 1481}
1481 1482