Modules: Fix compilation and remove warnings for BSD

This commit is contained in:
Al 'netstar' Poole 2017-07-15 10:58:24 -05:00 committed by Stephen 'Okra' Houston
parent e130557be7
commit d7538011ec
7 changed files with 25 additions and 10 deletions

View File

@ -30,7 +30,6 @@ _battery_sysctl_start(void)
struct sensordev snsrdev; struct sensordev snsrdev;
size_t sdlen = sizeof(struct sensordev); size_t sdlen = sizeof(struct sensordev);
#elif defined(__FreeBSD__) || defined(__DragonFly__) #elif defined(__FreeBSD__) || defined(__DragonFly__)
int result;
size_t len; size_t len;
#endif #endif
@ -169,8 +168,9 @@ _battery_sysctl_battery_update_poll(void *data EINA_UNUSED)
static int static int
_battery_sysctl_battery_update() _battery_sysctl_battery_update()
{ {
double _time, charge; double _time;
#if defined(__OpenBSD__) || defined(__NetBSD__) #if defined(__OpenBSD__) || defined(__NetBSD__)
double charge;
struct sensor s; struct sensor s;
size_t slen = sizeof(struct sensor); size_t slen = sizeof(struct sensor);
#elif defined(__FreeBSD__) || defined(__DragonFly__) #elif defined(__FreeBSD__) || defined(__DragonFly__)

View File

@ -687,7 +687,7 @@ _cpufreq_status_check_available(Cpu_Status *s)
*q = '\0'; *q = '\0';
freq = atoi(pos); freq = atoi(pos);
freq *= 1000; freq *= 1000;
s->frequencies = eina_list_append(s->frequencies, (void *)freq); s->frequencies = eina_list_append(s->frequencies, (void *)(long)freq);
pos = q + 1; pos = q + 1;
pos = strchr(pos, ' '); pos = strchr(pos, ' ');

View File

@ -15,6 +15,11 @@
#include <time.h> #include <time.h>
#include <sys/mman.h> #include <sys/mman.h>
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
static E_Module *shot_module = NULL; static E_Module *shot_module = NULL;
static E_Action *border_act = NULL, *act = NULL; static E_Action *border_act = NULL, *act = NULL;
@ -1091,7 +1096,7 @@ _x_shot_now(E_Zone *zone, E_Client *ec, const char *params)
} }
fclose(f); fclose(f);
} }
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #elif defined(__FreeBSD__) || defined(__DragonFly__)
int max; int max;
size_t len = sizeof(max); size_t len = sizeof(max);

View File

@ -354,7 +354,11 @@ _batman_device_update(Instance *inst)
static Eina_Bool static Eina_Bool
_screensaver_on(void *data) _screensaver_on(void *data)
{ {
#if defined(HAVE_EEZE)
Instance *inst = data; Instance *inst = data;
#else
(void) data;
#endif
#if defined(HAVE_EEZE) #if defined(HAVE_EEZE)
_batman_udev_stop(inst); _batman_udev_stop(inst);

View File

@ -4,6 +4,11 @@
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
EINTERN void _cpuclock_poll_interval_update(Instance *inst); EINTERN void _cpuclock_poll_interval_update(Instance *inst);
typedef struct _Thread_Config Thread_Config; typedef struct _Thread_Config Thread_Config;
@ -102,9 +107,8 @@ void
_cpuclock_set_frequency(int frequency) _cpuclock_set_frequency(int frequency)
{ {
char buf[4096]; char buf[4096];
struct stat st;
#ifdef __FreeBSD__ #if defined(__FreeBSD__)
frequency /= 1000; frequency /= 1000;
#endif #endif
@ -114,6 +118,7 @@ _cpuclock_set_frequency(int frequency)
freq = eina_stringshare_add(buf); freq = eina_stringshare_add(buf);
ecore_thread_run(_cpuclock_set_thread_frequency, _cpuclock_set_thread_done, NULL, freq); ecore_thread_run(_cpuclock_set_thread_frequency, _cpuclock_set_thread_done, NULL, freq);
#else #else
struct stat st;
char exe[4096]; char exe[4096];
snprintf(exe, 4096, "%s/%s/cpuclock_sysfs", snprintf(exe, 4096, "%s/%s/cpuclock_sysfs",
e_module_dir_get(sysinfo_config->module), MODULE_ARCH); e_module_dir_get(sysinfo_config->module), MODULE_ARCH);
@ -482,7 +487,7 @@ _cpuclock_status_check_available(Cpu_Status *s)
*q = '\0'; *q = '\0';
freq = atoi(pos); freq = atoi(pos);
freq *= 1000; freq *= 1000;
s->frequencies = eina_list_append(s->frequencies, (void *)freq); s->frequencies = eina_list_append(s->frequencies, (void *)(long)freq);
pos = q + 1; pos = q + 1;
pos = strchr(pos, ' '); pos = strchr(pos, ' ');

View File

@ -143,7 +143,7 @@ _thermal_check_notify(void *data, Ecore_Thread *th, void *msg)
static void static void
_thermal_check_done(void *data, Ecore_Thread *th EINA_UNUSED) _thermal_check_done(void *data, Ecore_Thread *th EINA_UNUSED)
{ {
TempThread *tth = data; Tempthread *tth = data;
Instance *inst = tth->inst; Instance *inst = tth->inst;
if (inst->cfg->thermal.defer) if (inst->cfg->thermal.defer)

View File

@ -50,11 +50,12 @@ static Config *temperature_config = NULL;
static void static void
_temperature_thread_free(Tempthread *tth) _temperature_thread_free(Tempthread *tth)
{ {
#if defined(HAVE_EEZE)
const char *s; const char *s;
#endif
eina_stringshare_del(tth->sensor_name); eina_stringshare_del(tth->sensor_name);
eina_stringshare_del(tth->sensor_path); eina_stringshare_del(tth->sensor_path);
#ifdef HAVE_EEZE #if defined(HAVE_EEZE)
EINA_LIST_FREE(tth->tempdevs, s) eina_stringshare_del(s); EINA_LIST_FREE(tth->tempdevs, s) eina_stringshare_del(s);
#endif #endif
e_powersave_sleeper_free(tth->sleeper); e_powersave_sleeper_free(tth->sleeper);