summaryrefslogtreecommitdiff
path: root/src/benchmarks
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-23 11:23:39 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-23 11:23:39 +0300
commit3c61dc1dba323e23acba623be778dae29ee7e505 (patch)
treee8baa1046eedbc7d067016de335b4c4f381ef5c1 /src/benchmarks
parent026d7210c6764fd1bca6169484f24cbbea511712 (diff)
downloadefl-3c61dc1dba323e23acba623be778dae29ee7e505.tar.gz
Eo: adapt benchmarks to Eo2.
Diffstat (limited to 'src/benchmarks')
-rw-r--r--src/benchmarks/eo/class_simple.c28
-rw-r--r--src/benchmarks/eo/class_simple.h11
-rw-r--r--src/benchmarks/eo/eo_bench_eo_do.c20
3 files changed, 11 insertions, 48 deletions
diff --git a/src/benchmarks/eo/class_simple.c b/src/benchmarks/eo/class_simple.c
index 05d025ec97..ad5e631524 100644
--- a/src/benchmarks/eo/class_simple.c
+++ b/src/benchmarks/eo/class_simple.c
@@ -7,42 +7,28 @@
#define MY_CLASS SIMPLE_CLASS
-EAPI Eo_Op SIMPLE_BASE_ID = 0;
-
static void
-_a_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
+_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
{
Simple_Public_Data *pd = class_data;
- int a;
- a = va_arg(*list, int);
-
pd->a = a;
}
-static void
-_class_constructor(Eo_Class *klass)
-{
- const Eo_Op_Func_Description func_desc[] = {
- EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
- EO_OP_FUNC_SENTINEL
- };
+EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);
- eo_class_funcs_set(klass, func_desc);
-}
-
-static const Eo_Op_Description op_desc[] = {
- EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "Set property A"),
- EO_OP_DESCRIPTION_SENTINEL
+static Eo_Op_Description op_desc[] = {
+ EO_OP_FUNC(simple_a_set, _a_set, "Set property A"),
+ EO_OP_SENTINEL
};
static const Eo_Class_Description class_desc = {
EO_VERSION,
"Simple",
EO_CLASS_TYPE_REGULAR,
- EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST),
+ EO_CLASS_DESCRIPTION_OPS(op_desc),
NULL,
sizeof(Simple_Public_Data),
- _class_constructor,
+ NULL,
NULL
};
diff --git a/src/benchmarks/eo/class_simple.h b/src/benchmarks/eo/class_simple.h
index b29e7987c1..99f6b80c09 100644
--- a/src/benchmarks/eo/class_simple.h
+++ b/src/benchmarks/eo/class_simple.h
@@ -1,21 +1,12 @@
#ifndef SIMPLE_H
#define SIMPLE_H
-extern EAPI Eo_Op SIMPLE_BASE_ID;
-
-enum {
- SIMPLE_SUB_ID_A_SET,
- SIMPLE_SUB_ID_LAST
-};
-
typedef struct
{
int a;
} Simple_Public_Data;
-#define SIMPLE_ID(sub_id) (SIMPLE_BASE_ID + sub_id)
-
-#define simple_a_set(a) SIMPLE_ID(SIMPLE_SUB_ID_A_SET), EO_TYPECHECK(int, a)
+EAPI void simple_a_set(int a);
#define SIMPLE_CLASS simple_class_get()
const Eo_Class *simple_class_get(void);
diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c
index 601290e191..7210d01a8e 100644
--- a/src/benchmarks/eo/eo_bench_eo_do.c
+++ b/src/benchmarks/eo/eo_bench_eo_do.c
@@ -22,36 +22,22 @@ bench_eo_do_general(int request)
static const Eo_Class *cur_klass;
static void
-_a_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
+_a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
{
- int a;
- a = va_arg(*list, int);
-
eo_do_super(obj, cur_klass, simple_a_set(a));
}
static void
-_class_constructor(Eo_Class *klass)
-{
- const Eo_Op_Func_Description func_desc[] = {
- EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
- EO_OP_FUNC_SENTINEL
- };
-
- eo_class_funcs_set(klass, func_desc);
-}
-
-static void
bench_eo_do_super(int request)
{
static Eo_Class_Description class_desc = {
EO_VERSION,
"Simple2",
EO_CLASS_TYPE_REGULAR,
- EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
+ EO_CLASS_DESCRIPTION_NOOPS(),
NULL,
0,
- _class_constructor,
+ NULL,
NULL
};
cur_klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL);