From 9e7b78ffabf588c096ceba18a9069b1bd58ecaea Mon Sep 17 00:00:00 2001 From: Stephen 'Okra' Houston Date: Wed, 12 Jul 2017 16:03:06 -0500 Subject: [PATCH] Gadgets: Make sure to avoid conflicts with functions and globals. --- src/modules/backlight/gadget/backlight.h | 2 -- src/modules/backlight/gadget/mod.c | 3 --- src/modules/luncher/luncher.h | 4 +-- src/modules/mixer/gadget/mixer.c | 1 - src/modules/mixer/gadget/mixer.h | 3 +-- src/modules/mixer/gadget/mod.c | 3 --- src/modules/pager/gadget/mod.c | 3 --- src/modules/pager/gadget/pager.h | 7 +++--- src/modules/sysinfo/batman/batman.h | 28 ++++++++++----------- src/modules/sysinfo/batman/batman_sysctl.c | 4 +-- src/modules/sysinfo/batman/batman_udev.c | 6 ++--- src/modules/sysinfo/batman/batman_upower.c | 6 ++--- src/modules/sysinfo/cpuclock/cpuclock.h | 12 ++++----- src/modules/sysinfo/cpumonitor/cpumonitor.h | 12 ++++----- src/modules/sysinfo/memusage/memusage.h | 8 +++--- src/modules/sysinfo/netstatus/netstatus.h | 12 ++++----- src/modules/sysinfo/sysinfo.h | 4 +-- src/modules/sysinfo/thermal/thermal.h | 10 ++++---- src/modules/xkbswitch/gadget/xkbswitch.h | 2 +- 19 files changed, 58 insertions(+), 72 deletions(-) diff --git a/src/modules/backlight/gadget/backlight.h b/src/modules/backlight/gadget/backlight.h index 7b26537fc..a6cfd1aed 100644 --- a/src/modules/backlight/gadget/backlight.h +++ b/src/modules/backlight/gadget/backlight.h @@ -11,6 +11,4 @@ EINTERN Evas_Object *backlight_gadget_create(Evas_Object *parent, int *id EINA_U EINTERN void backlight_init(void); EINTERN void backlight_shutdown(void); -extern E_Module *gm; - #endif diff --git a/src/modules/backlight/gadget/mod.c b/src/modules/backlight/gadget/mod.c index 4e618250f..7025dfeb6 100644 --- a/src/modules/backlight/gadget/mod.c +++ b/src/modules/backlight/gadget/mod.c @@ -1,11 +1,8 @@ #include "backlight.h" -E_Module *gm; - EINTERN void * e_modapi_gadget_init(E_Module *m) { - gm = m; backlight_init(); e_gadget_type_add("Backlight", backlight_gadget_create, NULL); return m; diff --git a/src/modules/luncher/luncher.h b/src/modules/luncher/luncher.h index e64ce7f22..e79701522 100644 --- a/src/modules/luncher/luncher.h +++ b/src/modules/luncher/luncher.h @@ -112,7 +112,7 @@ EINTERN Evas_Object *grid_create(Evas_Object *parent, int *id, E_Gadget_Site_Ori EINTERN void grid_reorder(Instance *inst); EINTERN void grid_recalculate(Instance *inst); -extern Config *luncher_config; -extern Eina_List *luncher_instances; +EINTERN extern Config *luncher_config; +EINTERN extern Eina_List *luncher_instances; #endif diff --git a/src/modules/mixer/gadget/mixer.c b/src/modules/mixer/gadget/mixer.c index c68c0e197..04a8c5304 100644 --- a/src/modules/mixer/gadget/mixer.c +++ b/src/modules/mixer/gadget/mixer.c @@ -1269,7 +1269,6 @@ mixer_init(void) gmixer_context->desklock_handler = ecore_event_handler_add(E_EVENT_DESKLOCK, _desklock_cb, NULL); - gmixer_context->module = gm; snprintf(buf, sizeof(buf), "%s/mixer.edj", e_module_dir_get(gmixer_context->module)); gmixer_context->theme = strdup(buf); diff --git a/src/modules/mixer/gadget/mixer.h b/src/modules/mixer/gadget/mixer.h index 014a0e528..bb9ece15a 100644 --- a/src/modules/mixer/gadget/mixer.h +++ b/src/modules/mixer/gadget/mixer.h @@ -10,8 +10,7 @@ EINTERN void *e_modapi_gadget_init(E_Module *m); EINTERN int e_modapi_gadget_shutdown(E_Module *m); EINTERN int e_modapi_gadget_save(E_Module *m); -extern int _e_gemix_log_domain; -extern E_Module *gm; +EINTERN extern int _e_gemix_log_domain; #undef GDBG #undef GINF diff --git a/src/modules/mixer/gadget/mod.c b/src/modules/mixer/gadget/mod.c index 80daabf7c..52e685c39 100644 --- a/src/modules/mixer/gadget/mod.c +++ b/src/modules/mixer/gadget/mod.c @@ -1,7 +1,6 @@ #include "mixer.h" int _e_gemix_log_domain; -E_Module *gm; EINTERN void * e_modapi_gadget_init(E_Module *m) @@ -12,8 +11,6 @@ e_modapi_gadget_init(E_Module *m) EINA_SAFETY_ON_FALSE_RETURN_VAL(emix_init(), NULL); - gm = m; - loaded = mixer_init(); if (!loaded) goto err; diff --git a/src/modules/pager/gadget/mod.c b/src/modules/pager/gadget/mod.c index c593c54ba..cb7687d6d 100644 --- a/src/modules/pager/gadget/mod.c +++ b/src/modules/pager/gadget/mod.c @@ -1,7 +1,6 @@ #include "pager.h" static E_Config_DD *conf_edd = NULL; Config *pager_config; -E_Module *gmodule; Evas_Object *cfg_dialog; Eina_List *ginstances, *ghandlers; @@ -60,8 +59,6 @@ e_modapi_gadget_init(E_Module *m) E_CONFIG_LIMIT(pager_config->btn_noplace, 0, 32); E_CONFIG_LIMIT(pager_config->btn_desk, 0, 32); - gmodule = m; - pager_init(); e_gadget_type_add("Pager", pager_create, NULL); diff --git a/src/modules/pager/gadget/pager.h b/src/modules/pager/gadget/pager.h index 6d22be4ca..c24dfd662 100644 --- a/src/modules/pager/gadget/pager.h +++ b/src/modules/pager/gadget/pager.h @@ -32,10 +32,9 @@ EINTERN void pager_init(void); EINTERN void _pager_cb_config_gadget_updated(void); EINTERN void _pager_cb_config_updated(void); -extern Config *pager_config; -extern E_Module *gmodule; -extern Evas_Object *cfg_dialog; -extern Eina_List *ginstances, *ghandlers; +EINTERN extern Config *pager_config; +EINTERN extern Evas_Object *cfg_dialog; +EINTERN extern Eina_List *ginstances, *ghandlers; /** * @addtogroup Optional_Gadgets * @{ diff --git a/src/modules/sysinfo/batman/batman.h b/src/modules/sysinfo/batman/batman.h index a5525f90e..f40ce6036 100644 --- a/src/modules/sysinfo/batman/batman.h +++ b/src/modules/sysinfo/batman/batman.h @@ -90,32 +90,32 @@ struct _Batman_Config Evas_Object *power_page; }; -Eina_List *_batman_battery_find(const char *udi); -Eina_List *_batman_ac_adapter_find(const char *udi); -void _batman_update(Instance *inst, int full, int time_left, Eina_Bool have_battery, Eina_Bool have_power); -void _batman_device_update(Instance *inst); +EINTERN Eina_List *_batman_battery_find(const char *udi); +EINTERN Eina_List *_batman_ac_adapter_find(const char *udi); +EINTERN void _batman_update(Instance *inst, int full, int time_left, Eina_Bool have_battery, Eina_Bool have_power); +EINTERN void _batman_device_update(Instance *inst); /* in batman_fallback.c */ -int _batman_fallback_start(Instance *inst); -void _batman_fallback_stop(void); +EINTERN int _batman_fallback_start(Instance *inst); +EINTERN void _batman_fallback_stop(void); /* end batman_fallback.c */ #ifdef HAVE_EEZE /* in batman_udev.c */ -int _batman_udev_start(Instance *inst); -void _batman_udev_stop(Instance *inst); +EINTERN int _batman_udev_start(Instance *inst); +EINTERN void _batman_udev_stop(Instance *inst); /* end batman_udev.c */ #elif !defined __OpenBSD__ && !defined __DragonFly__ && !defined __FreeBSD__ && !defined __NetBSD__ /* in batman_upower.c */ -int _batman_upower_start(Instance *inst); -void _batman_upower_stop(void); +EINTERN int _batman_upower_start(Instance *inst); +EINTERNvoid _batman_upower_stop(void); /* end batman_upower.c */ #else /* in batman_sysctl.c */ -int _batman_sysctl_start(Instance *inst); -void _batman_sysctl_stop(void); +EINTERN int _batman_sysctl_start(Instance *inst); +EINTERN void _batman_sysctl_stop(void); /* end batman_sysctl.c */ #endif -Evas_Object *batman_configure(Instance *inst); -void _batman_config_updated(Instance *inst); +EINTERN Evas_Object *batman_configure(Instance *inst); +EINTERN void _batman_config_updated(Instance *inst); #endif diff --git a/src/modules/sysinfo/batman/batman_sysctl.c b/src/modules/sysinfo/batman/batman_sysctl.c index 0064f6fef..82f5b343f 100644 --- a/src/modules/sysinfo/batman/batman_sysctl.c +++ b/src/modules/sysinfo/batman/batman_sysctl.c @@ -8,8 +8,8 @@ # include #endif -extern Eina_List *batman_device_batteries; -extern Eina_List *batman_device_ac_adapters; +EINTERN extern Eina_List *batman_device_batteries; +EINTERN extern Eina_List *batman_device_ac_adapters; #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) static Eina_Bool _batman_sysctl_battery_update_poll(void *data); diff --git a/src/modules/sysinfo/batman/batman_udev.c b/src/modules/sysinfo/batman/batman_udev.c index 5789a9403..6699d0e5f 100644 --- a/src/modules/sysinfo/batman/batman_udev.c +++ b/src/modules/sysinfo/batman/batman_udev.c @@ -10,9 +10,9 @@ static Eina_Bool _batman_udev_battery_update_poll(void *data); static void _batman_udev_battery_update(const char *syspath, Battery *bat, Instance *inst); static void _batman_udev_ac_update(const char *syspath, Ac_Adapter *ac, Instance *inst); -extern Eina_List *batman_device_batteries; -extern Eina_List *batman_device_ac_adapters; -extern double batman_init_time; +EINTERN extern Eina_List *batman_device_batteries; +EINTERN extern Eina_List *batman_device_ac_adapters; +EINTERN extern double batman_init_time; int _batman_udev_start(Instance *inst) diff --git a/src/modules/sysinfo/batman/batman_upower.c b/src/modules/sysinfo/batman/batman_upower.c index 18cd71741..c86b335e7 100644 --- a/src/modules/sysinfo/batman/batman_upower.c +++ b/src/modules/sysinfo/batman/batman_upower.c @@ -4,9 +4,9 @@ #define PATH "/org/freedesktop/UPower" #define IFACE "org.freedesktop.UPower" -extern Eina_List *batman_device_batteries; -extern Eina_List *batman_device_ac_adapters; -extern double batman_init_time; +EINTERN extern Eina_List *batman_device_batteries; +EINTERN extern Eina_List *batman_device_ac_adapters; +EINTERN extern double batman_init_time; static Eldbus_Connection *conn; static Eldbus_Proxy *upower_proxy; diff --git a/src/modules/sysinfo/cpuclock/cpuclock.h b/src/modules/sysinfo/cpuclock/cpuclock.h index 9b912046b..0e5d2204e 100644 --- a/src/modules/sysinfo/cpuclock/cpuclock.h +++ b/src/modules/sysinfo/cpuclock/cpuclock.h @@ -21,13 +21,13 @@ struct _Cpuclock_Config }; -Evas_Object *cpuclock_configure(Instance *inst); -void _cpuclock_config_updated(Instance *inst); -void _cpuclock_set_governor(const char *governor); -void _cpuclock_set_frequency(int frequency); -void _cpuclock_set_pstate(int min, int max, int turbo); +EINTERN Evas_Object *cpuclock_configure(Instance *inst); +EINTERN void _cpuclock_config_updated(Instance *inst); +EINTERN void _cpuclock_set_governor(const char *governor); +EINTERN void _cpuclock_set_frequency(int frequency); +EINTERN void _cpuclock_set_pstate(int min, int max, int turbo); #if defined __OpenBSD__ || defined __FreeBSD__ -int _cpuclock_sysctl_frequency(int new_perf); +EINTERN int _cpuclock_sysctl_frequency(int new_perf); #endif #endif diff --git a/src/modules/sysinfo/cpumonitor/cpumonitor.h b/src/modules/sysinfo/cpumonitor/cpumonitor.h index 382114066..e25b5be3a 100644 --- a/src/modules/sysinfo/cpumonitor/cpumonitor.h +++ b/src/modules/sysinfo/cpumonitor/cpumonitor.h @@ -3,10 +3,10 @@ #include "../sysinfo.h" -void _cpumonitor_config_updated(Instance *inst); -int _cpumonitor_proc_getcores(void); -void _cpumonitor_proc_getusage(Instance *inst); -int _cpumonitor_sysctl_getcores(void); -void _cpumonitor_sysctl_getusage(Instance *inst); -Evas_Object *cpumonitor_configure(Instance *inst); +EINTERN void _cpumonitor_config_updated(Instance *inst); +EINTERN int _cpumonitor_proc_getcores(void); +EINTERN void _cpumonitor_proc_getusage(Instance *inst); +EINTERN int _cpumonitor_sysctl_getcores(void); +EINTERN void _cpumonitor_sysctl_getusage(Instance *inst); +EINTERN Evas_Object *cpumonitor_configure(Instance *inst); #endif diff --git a/src/modules/sysinfo/memusage/memusage.h b/src/modules/sysinfo/memusage/memusage.h index 4088daa21..31002f2b3 100644 --- a/src/modules/sysinfo/memusage/memusage.h +++ b/src/modules/sysinfo/memusage/memusage.h @@ -3,10 +3,10 @@ #include "../sysinfo.h" -void _memusage_config_updated(Instance *inst); -Evas_Object *memusage_configure(Instance *inst); +EINTERN void _memusage_config_updated(Instance *inst); +EINTERN Evas_Object *memusage_configure(Instance *inst); -void _memusage_proc_getusage(unsigned long *mem_total, +EINTERN void _memusage_proc_getusage(unsigned long *mem_total, unsigned long *mem_used, unsigned long *mem_cached, unsigned long *mem_buffers, @@ -14,7 +14,7 @@ void _memusage_proc_getusage(unsigned long *mem_total, unsigned long *swp_total, unsigned long *swp_used); -void _memusage_sysctl_getusage(unsigned long *mem_total, +EINTERN void _memusage_sysctl_getusage(unsigned long *mem_total, unsigned long *mem_used, unsigned long *mem_cached, unsigned long *mem_buffers, diff --git a/src/modules/sysinfo/netstatus/netstatus.h b/src/modules/sysinfo/netstatus/netstatus.h index 3b21ec4f3..87a729b6b 100644 --- a/src/modules/sysinfo/netstatus/netstatus.h +++ b/src/modules/sysinfo/netstatus/netstatus.h @@ -16,10 +16,10 @@ struct _Netstatus_Config int send_unit_adjust; }; -void _netstatus_config_updated(Instance *inst); -void _netstatus_proc_getrstatus(Instance *inst); -void _netstatus_proc_gettstatus(Instance *inst); -void _netstatus_sysctl_getrstatus(Instance *inst); -void _netstatus_sysctl_gettstatus(Instance *inst); -Evas_Object *netstatus_configure(Instance *inst); +EINTERN void _netstatus_config_updated(Instance *inst); +EINTERN void _netstatus_proc_getrstatus(Instance *inst); +EINTERN void _netstatus_proc_gettstatus(Instance *inst); +EINTERN void _netstatus_sysctl_getrstatus(Instance *inst); +EINTERN void _netstatus_sysctl_gettstatus(Instance *inst); +EINTERN Evas_Object *netstatus_configure(Instance *inst); #endif diff --git a/src/modules/sysinfo/sysinfo.h b/src/modules/sysinfo/sysinfo.h index ebdacf6ba..ad7c4426a 100644 --- a/src/modules/sysinfo/sysinfo.h +++ b/src/modules/sysinfo/sysinfo.h @@ -289,7 +289,7 @@ EINTERN void sysinfo_cpumonitor_remove(void *data, Evas *e EINA_UNUSED, Evas_Obj EINTERN void sysinfo_memusage_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_data EINA_UNUSED); EINTERN void sysinfo_netstatus_remove(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_data EINA_UNUSED); -extern Config *sysinfo_config; -extern Eina_List *sysinfo_instances; +EINTERN extern Config *sysinfo_config; +EINTERN extern Eina_List *sysinfo_instances; #endif diff --git a/src/modules/sysinfo/thermal/thermal.h b/src/modules/sysinfo/thermal/thermal.h index fd0ba5222..a5bc26a2a 100644 --- a/src/modules/sysinfo/thermal/thermal.h +++ b/src/modules/sysinfo/thermal/thermal.h @@ -14,15 +14,15 @@ struct _Thermal_Config #ifdef HAVE_EEZE -int thermal_udev_get(Tempthread *tth); +EINTERN int thermal_udev_get(Tempthread *tth); #endif #if defined __OpenBSD__ || defined __DragonFly__ || defined __FreeBSD__ -int thermal_sysctl_get(Tempthread *tth); +EINTERN int thermal_sysctl_get(Tempthread *tth); #endif -Evas_Object *thermal_configure(Instance *inst); -int thermal_fallback_get(Tempthread *tth); -void _thermal_config_updated(Instance *inst); +EINTERN Evas_Object *thermal_configure(Instance *inst); +EINTERN int thermal_fallback_get(Tempthread *tth); +EINTERN void _thermal_config_updated(Instance *inst); #endif diff --git a/src/modules/xkbswitch/gadget/xkbswitch.h b/src/modules/xkbswitch/gadget/xkbswitch.h index 698773dce..d708041f2 100644 --- a/src/modules/xkbswitch/gadget/xkbswitch.h +++ b/src/modules/xkbswitch/gadget/xkbswitch.h @@ -13,7 +13,7 @@ typedef struct _Xkbg void _xkbg_update_icon(int); E_Config_Dialog *_xkbg_cfg_dialog(Evas_Object *, const char *params); -extern Xkbg _xkbg; +EINTERN extern Xkbg _xkbg; EINTERN void *e_modapi_gadget_init(E_Module *m); EINTERN int e_modapi_gadget_shutdown(E_Module *m EINA_UNUSED);