forked from enlightenment/enlightenment
Add UNUSED where needed.
Fix formatting. SVN revision: 51405
This commit is contained in:
parent
2547aeefe2
commit
2cd2f124dd
|
@ -170,7 +170,7 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
Evas_Object *otb, *ol, *ow;
|
Evas_Object *otb, *ol, *ow;
|
||||||
E_Radio_Group *rg;
|
E_Radio_Group *rg;
|
||||||
|
@ -255,7 +255,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
_basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
cfdata->inst->poll_interval = cfdata->poll.interval;
|
cfdata->inst->poll_interval = cfdata->poll.interval;
|
||||||
cfdata->inst->units = cfdata->unit_method;
|
cfdata->inst->units = cfdata->unit_method;
|
||||||
|
|
|
@ -157,20 +157,20 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
|
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
|
||||||
{
|
{
|
||||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
_gc_label(E_Gadcon_Client_Class *client_class)
|
_gc_label(E_Gadcon_Client_Class *client_class __UNUSED__)
|
||||||
{
|
{
|
||||||
return _("Temperature");
|
return _("Temperature");
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
|
_gc_icon(E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
|
||||||
{
|
{
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
@ -183,7 +183,7 @@ _gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
_gc_id_new(E_Gadcon_Client_Class *client_class)
|
_gc_id_new(E_Gadcon_Client_Class *client_class __UNUSED__)
|
||||||
{
|
{
|
||||||
Config_Face *inst;
|
Config_Face *inst;
|
||||||
char id[128];
|
char id[128];
|
||||||
|
@ -208,7 +208,7 @@ _gc_id_new(E_Gadcon_Client_Class *client_class)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_temperature_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_temperature_face_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||||
{
|
{
|
||||||
Config_Face *inst;
|
Config_Face *inst;
|
||||||
Evas_Event_Mouse_Down *ev;
|
Evas_Event_Mouse_Down *ev;
|
||||||
|
@ -242,7 +242,7 @@ _temperature_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *eve
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_temperature_face_cb_post_menu(void *data, E_Menu *m)
|
_temperature_face_cb_post_menu(void *data, E_Menu *m __UNUSED__)
|
||||||
{
|
{
|
||||||
Config_Face *inst;
|
Config_Face *inst;
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ _temperature_face_level_set(Config_Face *inst, double level)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_temperature_face_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi)
|
_temperature_face_cb_menu_configure(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||||
{
|
{
|
||||||
Config_Face *inst;
|
Config_Face *inst;
|
||||||
|
|
||||||
|
@ -464,7 +464,7 @@ e_modapi_init(E_Module *m)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m)
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
e_gadcon_provider_unregister(&_gadcon_class);
|
e_gadcon_provider_unregister(&_gadcon_class);
|
||||||
eina_hash_foreach(temperature_config->faces, _temperature_face_shutdown, NULL);
|
eina_hash_foreach(temperature_config->faces, _temperature_face_shutdown, NULL);
|
||||||
|
@ -477,7 +477,7 @@ e_modapi_shutdown(E_Module *m)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_save(E_Module *m)
|
e_modapi_save(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
e_config_domain_save("module.temperature", conf_edd, temperature_config);
|
e_config_domain_save("module.temperature", conf_edd, temperature_config);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -12,7 +12,7 @@ void
|
||||||
temperature_udev_update(void *data)
|
temperature_udev_update(void *data)
|
||||||
{
|
{
|
||||||
Config_Face *inst;
|
Config_Face *inst;
|
||||||
Eina_List *l, *l2;
|
Eina_List *l;
|
||||||
double cur, temp, cpus = 0;
|
double cur, temp, cpus = 0;
|
||||||
char *syspath;
|
char *syspath;
|
||||||
const char *test;
|
const char *test;
|
||||||
|
@ -23,7 +23,7 @@ temperature_udev_update(void *data)
|
||||||
temp = -999;
|
temp = -999;
|
||||||
|
|
||||||
if (!inst->tempdevs)
|
if (!inst->tempdevs)
|
||||||
inst->tempdevs = eeze_udev_find_by_type(EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR, NULL);
|
inst->tempdevs = eeze_udev_find_by_type(EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR, NULL);
|
||||||
if (eina_list_count(inst->tempdevs))
|
if (eina_list_count(inst->tempdevs))
|
||||||
{
|
{
|
||||||
temp = 0;
|
temp = 0;
|
||||||
|
@ -31,8 +31,7 @@ temperature_udev_update(void *data)
|
||||||
{
|
{
|
||||||
for (x = 1, y = 0;x < 15;x++)
|
for (x = 1, y = 0;x < 15;x++)
|
||||||
{
|
{
|
||||||
if (y >= 2)
|
if (y >= 2) break;
|
||||||
break;
|
|
||||||
sprintf(buf, "temp%d_input", x);
|
sprintf(buf, "temp%d_input", x);
|
||||||
if ((test = eeze_udev_syspath_get_sysattr(syspath, buf)))
|
if ((test = eeze_udev_syspath_get_sysattr(syspath, buf)))
|
||||||
{
|
{
|
||||||
|
@ -53,7 +52,7 @@ temperature_udev_update(void *data)
|
||||||
if (temp != -999)
|
if (temp != -999)
|
||||||
{
|
{
|
||||||
if (inst->units == FAHRENHEIT)
|
if (inst->units == FAHRENHEIT)
|
||||||
temp = (temp * 9.0 / 5.0) + 32;
|
temp = (temp * 9.0 / 5.0) + 32;
|
||||||
|
|
||||||
if (!inst->have_temp)
|
if (!inst->have_temp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#include <sys/types.h>
|
# include <sys/types.h>
|
||||||
#include <sys/sysctl.h>
|
# include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
#include "e_mod_main_private.h"
|
#include "e_mod_main_private.h"
|
||||||
|
|
||||||
|
|
||||||
static int sensor_type = SENSOR_TYPE_NONE;
|
static int sensor_type = SENSOR_TYPE_NONE;
|
||||||
static char *sensor_name = NULL;
|
static char *sensor_name = NULL;
|
||||||
static int poll_interval = 32;
|
static int poll_interval = 32;
|
||||||
|
@ -41,33 +40,33 @@ temperature_get_bus_files(const char* bus)
|
||||||
|
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
|
||||||
snprintf(busdir, sizeof(busdir), "/sys/bus/%s/devices", bus);
|
snprintf(busdir, sizeof(busdir), "/sys/bus/%s/devices", bus);
|
||||||
/* Look through all the devices for the given bus. */
|
/* Look through all the devices for the given bus. */
|
||||||
therms = ecore_file_ls(busdir);
|
therms = ecore_file_ls(busdir);
|
||||||
|
|
||||||
EINA_LIST_FREE(therms, name)
|
EINA_LIST_FREE(therms, name)
|
||||||
{
|
{
|
||||||
Eina_List *files;
|
Eina_List *files;
|
||||||
char *file;
|
char *file;
|
||||||
|
|
||||||
/* Search each device for temp*_input, these should be
|
/* Search each device for temp*_input, these should be
|
||||||
* temperature devices. */
|
* temperature devices. */
|
||||||
snprintf(path, sizeof(path),"%s/%s", busdir, name);
|
snprintf(path, sizeof(path),"%s/%s", busdir, name);
|
||||||
files = ecore_file_ls(path);
|
files = ecore_file_ls(path);
|
||||||
EINA_LIST_FREE(files, file)
|
EINA_LIST_FREE(files, file)
|
||||||
{
|
{
|
||||||
if ((!strncmp("temp", file, 4)) &&
|
if ((!strncmp("temp", file, 4)) &&
|
||||||
(!strcmp("_input", &file[strlen(file) - 6])))
|
(!strcmp("_input", &file[strlen(file) - 6])))
|
||||||
{
|
{
|
||||||
char *f;
|
char *f;
|
||||||
|
|
||||||
snprintf(path, sizeof(path),
|
snprintf(path, sizeof(path),
|
||||||
"%s/%s/%s", busdir, name, file);
|
"%s/%s/%s", busdir, name, file);
|
||||||
f = strdup(path);
|
f = strdup(path);
|
||||||
if (f) result = eina_list_append(result, f);
|
if (f) result = eina_list_append(result, f);
|
||||||
}
|
}
|
||||||
free(file);
|
free(file);
|
||||||
}
|
}
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -222,16 +221,16 @@ init(void)
|
||||||
therms = ecore_file_ls("/sys/bus/i2c/devices");
|
therms = ecore_file_ls("/sys/bus/i2c/devices");
|
||||||
|
|
||||||
EINA_LIST_FREE(therms, name)
|
EINA_LIST_FREE(therms, name)
|
||||||
{
|
{
|
||||||
snprintf(path, sizeof(path),
|
snprintf(path, sizeof(path),
|
||||||
"/sys/bus/i2c/devices/%s/%s_input",
|
"/sys/bus/i2c/devices/%s/%s_input",
|
||||||
name, sensor_name);
|
name, sensor_name);
|
||||||
if (ecore_file_exists(path))
|
if (ecore_file_exists(path))
|
||||||
{
|
{
|
||||||
sensor_path = strdup(path);
|
sensor_path = strdup(path);
|
||||||
/* We really only care about the first
|
/* We really only care about the first
|
||||||
* one for the default. */
|
* one for the default. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
|
@ -240,16 +239,16 @@ init(void)
|
||||||
therms = ecore_file_ls("/sys/bus/pci/devices");
|
therms = ecore_file_ls("/sys/bus/pci/devices");
|
||||||
|
|
||||||
EINA_LIST_FREE(therms, name)
|
EINA_LIST_FREE(therms, name)
|
||||||
{
|
{
|
||||||
snprintf(path, sizeof(path),
|
snprintf(path, sizeof(path),
|
||||||
"/sys/bus/pci/devices/%s/%s_input",
|
"/sys/bus/pci/devices/%s/%s_input",
|
||||||
name, sensor_name);
|
name, sensor_name);
|
||||||
if (ecore_file_exists(path))
|
if (ecore_file_exists(path))
|
||||||
{
|
{
|
||||||
sensor_path = strdup(path);
|
sensor_path = strdup(path);
|
||||||
/* We really only care about the first
|
/* We really only care about the first
|
||||||
* one for the default. */
|
* one for the default. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
|
@ -274,7 +273,7 @@ check(void)
|
||||||
int len;
|
int len;
|
||||||
size_t ftemp = 0;
|
size_t ftemp = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TODO: Make standard parser. Seems to be two types of temperature string:
|
/* TODO: Make standard parser. Seems to be two types of temperature string:
|
||||||
* - Somename: <temp> C
|
* - Somename: <temp> C
|
||||||
* - <temp>
|
* - <temp>
|
||||||
|
@ -398,7 +397,7 @@ check(void)
|
||||||
if (ret) return temp;
|
if (ret) return temp;
|
||||||
|
|
||||||
return -999;
|
return -999;
|
||||||
error:
|
error:
|
||||||
sensor_type = SENSOR_TYPE_NONE;
|
sensor_type = SENSOR_TYPE_NONE;
|
||||||
if (sensor_name) free(sensor_name);
|
if (sensor_name) free(sensor_name);
|
||||||
sensor_name = NULL;
|
sensor_name = NULL;
|
||||||
|
@ -410,8 +409,7 @@ check(void)
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
poll_cb(void *data)
|
poll_cb(void *data)
|
||||||
{
|
{
|
||||||
int t;
|
int t, pp;
|
||||||
int pp;
|
|
||||||
|
|
||||||
t = check();
|
t = check();
|
||||||
pp = cur_poll_interval;
|
pp = cur_poll_interval;
|
||||||
|
@ -431,7 +429,7 @@ poll_cb(void *data)
|
||||||
if (pp != cur_poll_interval)
|
if (pp != cur_poll_interval)
|
||||||
{
|
{
|
||||||
if (poller) ecore_poller_del(poller);
|
if (poller) ecore_poller_del(poller);
|
||||||
poller = ecore_poller_add(ECORE_POLLER_CORE, cur_poll_interval,
|
poller = ecore_poller_add(ECORE_POLLER_CORE, cur_poll_interval,
|
||||||
poll_cb, NULL);
|
poll_cb, NULL);
|
||||||
}
|
}
|
||||||
if (t != ptemp)
|
if (t != ptemp)
|
||||||
|
@ -457,7 +455,7 @@ main(int argc, char *argv[])
|
||||||
if (!strcmp(sensor_name, "-null-"))
|
if (!strcmp(sensor_name, "-null-"))
|
||||||
{
|
{
|
||||||
free(sensor_name);
|
free(sensor_name);
|
||||||
sensor_name = NULL;
|
sensor_name = NULL;
|
||||||
}
|
}
|
||||||
poll_interval = atoi(argv[3]);
|
poll_interval = atoi(argv[3]);
|
||||||
cur_poll_interval = poll_interval;
|
cur_poll_interval = poll_interval;
|
||||||
|
@ -467,7 +465,7 @@ main(int argc, char *argv[])
|
||||||
init();
|
init();
|
||||||
|
|
||||||
if (poller) ecore_poller_del(poller);
|
if (poller) ecore_poller_del(poller);
|
||||||
poller = ecore_poller_add(ECORE_POLLER_CORE, cur_poll_interval,
|
poller = ecore_poller_add(ECORE_POLLER_CORE, cur_poll_interval,
|
||||||
poll_cb, NULL);
|
poll_cb, NULL);
|
||||||
poll_cb(NULL);
|
poll_cb(NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue