From 131a686c782ae95e6f57a8915cddfe270adae989 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sun, 9 Nov 2014 21:53:30 +0000 Subject: [PATCH] Fix the types of Eo Events - addresses lots of compiler warnings --- elm_code/bin/Makefile.am | 1 + elm_code/lib/Elm_Code.h | 4 ++-- elm_code/lib/Makefile.am | 1 + elm_code/lib/elm_code.c | 8 +++++--- elm_code/lib/elm_code_common.h | 6 ++---- elm_code/lib/elm_code_file.c | 4 ++-- elm_code/lib/elm_code_widget.c | 4 +--- src/bin/Makefile.am | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/elm_code/bin/Makefile.am b/elm_code/bin/Makefile.am index d2a4d25..363beb8 100644 --- a/elm_code/bin/Makefile.am +++ b/elm_code/bin/Makefile.am @@ -7,6 +7,7 @@ AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -I$(top_srcdir)/elm_code/bin/ \ -I$(top_builddir)/elm_code/lib/ \ -I$(top_srcdir)/elm_code/lib/ \ +-DEFL_BETA_API_SUPPORT \ @EFL_CFLAGS@ elm_code_test_SOURCES = elm_code_test_main.c diff --git a/elm_code/lib/Elm_Code.h b/elm_code/lib/Elm_Code.h index 8e0528d..fbc0a4b 100644 --- a/elm_code/lib/Elm_Code.h +++ b/elm_code/lib/Elm_Code.h @@ -2,7 +2,7 @@ # define ELM_CODE_H_ #include - +#include #include #include @@ -119,7 +119,7 @@ EAPI void elm_code_free(Elm_Code *code); */ -EAPI void elm_code_callback_fire(Elm_Code *code, const char *signal, void *data); +EAPI void elm_code_callback_fire(Elm_Code *code, const Eo_Event_Description *signal, void *data); /** diff --git a/elm_code/lib/Makefile.am b/elm_code/lib/Makefile.am index 98a15f6..8329e65 100644 --- a/elm_code/lib/Makefile.am +++ b/elm_code/lib/Makefile.am @@ -5,6 +5,7 @@ AM_CPPFLAGS = \ -I$(top_builddir)/elm_code/lib \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +-DEFL_BETA_API_SUPPORT \ @EFL_CFLAGS@ \ -DEFL_EFL_BUILD diff --git a/elm_code/lib/elm_code.c b/elm_code/lib/elm_code.c index 0186f83..9ae1ade 100644 --- a/elm_code/lib/elm_code.c +++ b/elm_code/lib/elm_code.c @@ -2,7 +2,6 @@ # include "config.h" #endif -#define EFL_BETA_API_SUPPORT #include #include "Elm_Code.h" @@ -12,6 +11,9 @@ static int _elm_code_init = 0; int _elm_code_lib_log_dom = -1; +const Eo_Event_Description ELM_CODE_EVENT_LINE_SET_DONE = + EO_EVENT_DESCRIPTION("line,set,done", ""); + EAPI int elm_code_init(void) { @@ -91,14 +93,14 @@ elm_code_free(Elm_Code *code) } EAPI void -elm_code_callback_fire(Elm_Code *code, const char *signal, void *data) +elm_code_callback_fire(Elm_Code *code, const Eo_Event_Description *signal, void *data) { Eina_List *item; Evas_Object *widget; EINA_LIST_FOREACH(code->widgets, item, widget) { - eo_do(widget, eo_event_callback_call((Eo_Event_Description *)signal, data)); + eo_do(widget, eo_event_callback_call(signal, data)); } } diff --git a/elm_code/lib/elm_code_common.h b/elm_code/lib/elm_code_common.h index 436bd45..11149fe 100644 --- a/elm_code/lib/elm_code_common.h +++ b/elm_code/lib/elm_code_common.h @@ -1,12 +1,10 @@ #ifndef ELM_CODE_COMMON_H_ # define ELM_CODE_COMMON_H_ +#include #include -// TODO figure out how this can be fixed -#define ELM_CODE_EVENT_LINE_SET_DONE "line,set,done" -//EAPI const Eo_Event_Description ELM_CODE_EVENT_LINE_SET_DONE = -// EO_EVENT_DESCRIPTION("line,set,done", ""); +EAPI extern const Eo_Event_Description ELM_CODE_EVENT_LINE_SET_DONE; typedef enum { ELM_CODE_STATUS_TYPE_DEFAULT = 0, diff --git a/elm_code/lib/elm_code_file.c b/elm_code/lib/elm_code_file.c index 585465e..1f5f8a8 100644 --- a/elm_code/lib/elm_code_file.c +++ b/elm_code/lib/elm_code_file.c @@ -33,7 +33,7 @@ static void _elm_code_file_line_append_data(Elm_Code_File *file, const char *con file->lines = eina_list_append(file->lines, line); if (file->parent) - elm_code_callback_fire(file->parent, ELM_CODE_EVENT_LINE_SET_DONE, line); + elm_code_callback_fire(file->parent, &ELM_CODE_EVENT_LINE_SET_DONE, line); } EAPI Elm_Code_File *elm_code_file_new() @@ -152,5 +152,5 @@ EAPI void elm_code_file_line_status_set(Elm_Code_File *file, unsigned int number line->status = status; if (file->parent) - elm_code_callback_fire(file->parent, ELM_CODE_EVENT_LINE_SET_DONE, line); + elm_code_callback_fire(file->parent, &ELM_CODE_EVENT_LINE_SET_DONE, line); } diff --git a/elm_code/lib/elm_code_widget.c b/elm_code/lib/elm_code_widget.c index 02a4f87..ba25461 100644 --- a/elm_code/lib/elm_code_widget.c +++ b/elm_code/lib/elm_code_widget.c @@ -2,9 +2,7 @@ # include "config.h" #endif -#define EFL_BETA_API_SUPPORT #include - #include #include "elm_code_widget.h" @@ -131,7 +129,7 @@ EAPI Evas_Object *elm_code_widget_add(Evas_Object *parent, Elm_Code *code) evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, _elm_code_widget_resize_cb, code); - eo_do(o,eo_event_callback_add((Eo_Event_Description *)ELM_CODE_EVENT_LINE_SET_DONE, _elm_code_widget_line_cb, code)); + eo_do(o,eo_event_callback_add(&ELM_CODE_EVENT_LINE_SET_DONE, _elm_code_widget_line_cb, code)); code->widgets = eina_list_append(code->widgets, o); return o; diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 1cc9b90..35bc17f 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -I$(top_srcdir)/src/bin/ \ -I$(top_srcdir)/elm_code/lib \ -I$(top_builddir)/src/lib/ \ --I$(top_srcdir)/src/lib/ \ +-DEFL_BETA_API_SUPPORT \ @EFL_CFLAGS@ edi_SOURCES = \