static int
_a_get(Eo *obj, void *class_data EINA_UNUSED)
{
- int a;
+ int a = 0;
eo2_do_super(obj, MY_CLASS, a = simple_a_get());
return a;
fail_if(!eo_isa(obj, COMP_CLASS));
fail_if(!eo_isa(obj, SIMPLE_CLASS));
- int a;
+ int a = 0;
eo2_do(obj, simple_a_set(1));
fail_if(!cb_called);
fail_if(a != 1);
/* disable the callback forwarder, and fail if it's still called. */
- Eo *simple;
+ Eo *simple = NULL;
eo2_do(obj, simple = eo2_base_data_get("simple-obj"));
eo_ref(simple);
eo2_do(simple, eo2_event_callback_forwarder_del(EV_A_CHANGED, obj));
eo2_do(obj, simple_a_set(1), simple_b_set(2));
- int a, b;
+ int a = 0, b = 0;
eo2_do(obj, a = simple_a_get(), b = simple_b_get(), mixin_add_and_print(5));
+ fail_if(a != 1);
+ fail_if(b != 2);
eo_unref(obj);
static void
_add_and_print_set(Eo *obj, void *class_data EINA_UNUSED, int x)
{
- int a, b;
+ int a = 0, b = 0;
eo2_do(obj, a = simple_a_get(), b = simple_b_get());
printf("%s %d\n", __func__, a + b + x);
}
eo2_do(obj, simple_a_print());
eo2_do_super(obj, MY_CLASS, simple_a_set(a + 1));
- Eina_Bool called;
+ Eina_Bool called = EINA_FALSE;
eo2_do_super(obj, MY_CLASS, called = simple_a_print());
fail_if(!called);
}
static Eina_Bool
_print(Eo *obj, void *class_data EINA_UNUSED)
{
- Eina_Bool called;
+ Eina_Bool called = EINA_FALSE;
printf("Hey\n");
eo2_do_super(obj, MY_CLASS, called = inherit2_print());
fail_if(called);
static Eina_Bool
_class_print(Eo_Class *klass, void *data EINA_UNUSED)
{
- Eina_Bool called;
+ Eina_Bool called = EINA_FALSE;
printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
eo2_do_super(klass, MY_CLASS, called = simple_class_print());
fail_if(!called);
(void) argv;
eo_init();
- Eina_Bool called;
+ Eina_Bool called = EINA_FALSE;
Eo *obj = eo2_add(INHERIT2_CLASS, NULL);
eo2_do(obj, simple_a_set(1));
eo2_do(obj, simple_a_set(1), simple_b_set(2));
- int a, b, sum = 0;
+ int a = 0, b = 0, sum = 0;
eo2_do(obj, a = simple_a_get(), b = simple_b_get(), sum = interface_ab_sum_get());
fail_if(sum != a + b);
static int
_ab_sum_get(Eo *obj, void *class_data EINA_UNUSED)
{
- int a, b;
+ int a = 0, b = 0;
eo2_do(obj, a = simple_a_get(), b = simple_b_get());
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return a + b;
static int
_ab_sum_get2(Eo *obj, void *class_data EINA_UNUSED)
{
- int a, b;
+ int a = 0, b = 0;
eo2_do(obj, a = simple_a_get(), b = simple_b_get());
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return a + b + 1;
static int
_a_get(Eo *obj, void *class_data EINA_UNUSED)
{
- int ret;
+ int ret = 0;
eo2_do_super(obj, MY_CLASS, ret = simple_a_get());
printf("%s %d\n", __func__, ret);
eo2_do(obj, simple_a_set(1), simple_b_set(2));
- int a, b, sum = 0;
+ int a = 0, b = 0, sum = 0;
eo2_do(obj, a = simple_a_get(), b = simple_b_get(), sum = mixin_ab_sum_get());
fail_if(sum != a + b + 2); /* 2 for the two mixins... */
static int
_ab_sum_get(Eo *obj, void *class_data EINA_UNUSED)
{
- int a, b;
+ int a = 0, b = 0;
eo2_do(obj, a = simple_a_get(), b = simple_b_get());
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
return a + b;
{
/* This cast is a hack just for the tests... */
Mixin2_Public_Data *pd = (Mixin2_Public_Data *) class_data;
- int sum;
+ int sum = 0;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
eo2_do_super(obj, MY_CLASS, sum = mixin_ab_sum_get());
pd->count += 2;
{
- int _a, _b;
+ int _a = 0, _b = 0;
eo2_do(obj, _a = simple_a_get(), _b = simple_b_get());
fail_if(sum != _a + _b + 1);
}
{
/* This cast is just a hack for the test. */
Mixin3_Public_Data *pd = (Mixin3_Public_Data *) class_data;
- int sum;
+ int sum = 0;
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
eo2_do_super(obj, MY_CLASS, sum = mixin_ab_sum_get());
pd->count += 3;
{
- int _a, _b;
+ int _a = 0, _b = 0;
eo2_do(obj, _a = simple_a_get(), _b = simple_b_get());
fail_if(sum != _a + _b + 2);
}
obj = eo2_add(SIMPLE_CLASS, NULL);
obj2 = eo2_add(SIMPLE_CLASS, obj);
- Eo *wref;
+ Eo *wref = NULL;
eo2_do(obj2, eo2_wref_add(&wref));
fail_if(!wref);
Eo *obj = eo2_add(SIMPLE_CLASS, NULL);
Eo *obj2 = eo2_add(SIMPLE_CLASS, NULL);
- Eo *wref, *wref2, *wref3;
+ Eo *wref = NULL, *wref2 = NULL, *wref3 = NULL;
eo2_do(obj, eo2_wref_add(&wref));
fail_if(!wref);
{
eo_init();
Eo *obj = eo2_add(SIMPLE_CLASS, NULL);
- void *data;
+ void *data = NULL;
eo2_do(obj, eo2_base_data_set("test1", (void *) 1, NULL));
eo2_do(obj, data = eo2_base_data_get("test1"));
fail_if(eo_class_get(obj) != SIMPLE_CLASS);
fail_if(eo_class_get(SIMPLE_CLASS) != EO2_CLASS_CLASS);
eo_class_funcs_set((Eo_Class *) buf, NULL);
- eo2_do((Eo_Class *) buf, NULL);
+ eo2_do((Eo_Class *) buf,(void) NULL);
eo2_do_super((Eo_Class *) buf, SIMPLE_CLASS, simple_a_set(++i));
eo2_do_super(SIMPLE_CLASS, (Eo_Class *) buf, simple_a_set(++i));
fail_if(eo_class_new(NULL, (Eo_Class *) buf), NULL);