aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdrv_D4D.c8
-rw-r--r--drv_EFN.c30
-rw-r--r--drv_FW8888.c12
-rw-r--r--drv_G15.c5
-rw-r--r--drv_MatrixOrbitalGX.c2
-rw-r--r--drv_PICGraphic.c14
-rw-r--r--drv_picoLCDGraphic.c2
-rw-r--r--evaluator.c2
-rw-r--r--plugin_asterisk.c3
-rw-r--r--plugin_cpuinfo.c4
-rw-r--r--plugin_huawei.c9
-rw-r--r--plugin_wireless.c4
-rw-r--r--thread.c4
13 files changed, 39 insertions, 60 deletions
diff --git a/drv_D4D.c b/drv_D4D.c
index 253ec2a..52d0e8f 100755
--- a/drv_D4D.c
+++ b/drv_D4D.c
@@ -533,12 +533,16 @@ int drv_D4D_bar_draw(WIDGET * W)
WIDGET_BAR *Bar = W->data;
int row, col, len, res, max, val1, val2;
DIRECTION dir;
- STYLE style;
+#if 0
+ STYLE style; /* Fixme: unused variable */
+#endif
row = W->row;
col = W->col;
dir = Bar->direction;
- style = Bar->style;
+#if 0
+ style = Bar->style; /* Fixme: unused variable */
+#endif
len = Bar->length;
res = dir & (DIR_EAST | DIR_WEST) ? XRES : YRES;
diff --git a/drv_EFN.c b/drv_EFN.c
index dca226c..790f3ea 100644
--- a/drv_EFN.c
+++ b/drv_EFN.c
@@ -83,7 +83,7 @@
static char Name[] = "EFN";
-char Host[256];
+char *Host;
int Port;
int DataSocket;
@@ -93,7 +93,7 @@ static void drv_EFN_clear(void);
/*** hardware dependant functions ***/
/****************************************/
-static int drv_EFN_open(const char *section)
+static int drv_EFN_open(const char __attribute__ ((unused)) * section)
{
int sockfd_conf, portno_conf, n;
struct sockaddr_in serv_addr;
@@ -176,23 +176,14 @@ static int drv_EFN_close(void)
/* dummy function that sends something to the display */
static void drv_EFN_send(const char *data, const unsigned int len)
{
- int n, i;
+ int n;
- // transport command stirng to EUG 100
+ // transport command string to EUG 100
n = write(DataSocket, data, len);
if (n < 0) {
error("%s:drv_EFN_send: Failed to write to data socket\n", Name);
- // return(-1);
}
- /*
- printf("EFN_send: ");
- for(i=0;i<n;i++)
- {
- printf("0x%02x ",data[i]);
- }
- printf("\n");
- */
}
@@ -257,7 +248,8 @@ static void drv_EFN_write(const int row, const int col, const char *data, int le
}
}
-static void drv_EFN_defchar(const int ascii, const unsigned char *matrix)
+static void drv_EFN_defchar(const int __attribute__ ((unused)) ascii, const unsigned char
+ __attribute__ ((unused)) * matrix)
{
error("%s:drv_EFN_defchar: Function not supported by EFN modules\n", Name);
}
@@ -268,19 +260,13 @@ static int drv_EFN_start(const char *section)
int rows = -1, cols = -1;
char *s;
- s = cfg_get(section, "Host", NULL);
+ Host = cfg_get(section, "Host", NULL);
- if (s == NULL || *s == '\0') {
+ if (Host == NULL || *Host == '\0') {
error("%s: no '%s.Host' entry from %s", Name, section, cfg_source());
return -1;
}
- if (sscanf(s, "%s", &Host) != 1) {
- error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source());
- free(s);
- return -1;
- }
-
if (cfg_number(section, "Port", 1000, 0, 65535, &Port) < 0)
return -1;
diff --git a/drv_FW8888.c b/drv_FW8888.c
index b950c01..e13051d 100644
--- a/drv_FW8888.c
+++ b/drv_FW8888.c
@@ -115,32 +115,32 @@ static void drv_FW8888_clear(void)
drv_FW8888_send_cmd(0x01);
}
-static void drv_FW8888_home(void)
+static void __attribute__ ((unused)) drv_FW8888_home(void)
{
drv_FW8888_send_cmd(0x02);
}
-static void drv_FW8888_display_off(void)
+static void __attribute__ ((unused)) drv_FW8888_display_off(void)
{
drv_FW8888_send_cmd(0x08);
}
-static void drv_FW8888_display_on_cursor_off(void)
+static void __attribute__ ((unused)) drv_FW8888_display_on_cursor_off(void)
{
drv_FW8888_send_cmd(0x0C);
}
-static void drv_FW8888_display_on_cursor_on(void)
+static void __attribute__ ((unused)) drv_FW8888_display_on_cursor_on(void)
{
drv_FW8888_send_cmd(0x0E);
}
-static void drv_FW8888_backlight_off(void)
+static void __attribute__ ((unused)) drv_FW8888_backlight_off(void)
{
drv_FW8888_send_cmd(0x38);
}
-static void drv_FW8888_backlight_on(void)
+static void __attribute__ ((unused)) drv_FW8888_backlight_on(void)
{
drv_FW8888_send_cmd(0x39);
}
diff --git a/drv_G15.c b/drv_G15.c
index d070b38..6bc6415 100644
--- a/drv_G15.c
+++ b/drv_G15.c
@@ -433,7 +433,6 @@ static void drv_G15_update_img()
{
int i, j, k;
unsigned char *output = malloc(DCOLS * DROWS * sizeof(unsigned char));
- int retval;
DEBUG("entered");
if (!output)
@@ -457,8 +456,8 @@ static void drv_G15_update_img()
DEBUG("output array prepared");
mutex_lock(kb_mutex);
- retval = usb_interrupt_write(g15_lcd, usb_endpoint, (char *) output, 992, 1000);
- //info("%s: Ret %i from usb_interrupt_write(endpoint %d)", Name, retval, usb_endpoint);
+ i = usb_interrupt_write(g15_lcd, usb_endpoint, (char *) output, 992, 1000);
+ //info("%s: Ret %i from usb_interrupt_write(endpoint %d)", Name, i, usb_endpoint);
mutex_unlock(kb_mutex);
usleep(300);
diff --git a/drv_MatrixOrbitalGX.c b/drv_MatrixOrbitalGX.c
index 5906f1f..20f082a 100644
--- a/drv_MatrixOrbitalGX.c
+++ b/drv_MatrixOrbitalGX.c
@@ -183,7 +183,7 @@ static int drv_MOGX_open(void)
static void drv_MOGX_send(const unsigned char *data, const unsigned int size)
{
- int ret;
+ int __attribute__ ((unused)) ret;
//unsigned char rcv_buffer[64] = "";
diff --git a/drv_PICGraphic.c b/drv_PICGraphic.c
index 8586eb6..5138ece 100644
--- a/drv_PICGraphic.c
+++ b/drv_PICGraphic.c
@@ -238,21 +238,21 @@ static void drv_PICGraphic_blit(const int row, const int col, const int height,
static int drv_PICGraphic_GPO(const int num, const int val)
{
- char cmd[3];
+ char __attribute__ ((unused)) cmd[3];
cmd[0] = 'g';
cmd[1] = val ? 's' : 'c';
cmd[2] = num;
// todo: fixme
-// drv_PICGraphic_send(cmd, 3);
+ // drv_PICGraphic_send(cmd, 3);
return 0;
}
static int drv_PICGraphic_GPI(const int num)
{
- char cmd[3];
+ char __attribute__ ((unused)) cmd[3];
int ret = 0;
cmd[0] = 'g';
@@ -260,8 +260,8 @@ static int drv_PICGraphic_GPI(const int num)
cmd[2] = num;
// todo: fixme
-// drv_PICGraphic_send(cmd, 3);
-// ret = drv_generic_serial_read(cmd, 1);
+ // drv_PICGraphic_send(cmd, 3);
+ // ret = drv_generic_serial_read(cmd, 1);
if (ret)
return -1;
@@ -272,7 +272,7 @@ static int drv_PICGraphic_GPI(const int num)
/* example function used in a plugin */
static int drv_PICGraphic_contrast(int contrast)
{
- char cmd[2];
+ char __attribute__ ((unused)) cmd[2];
/* adjust limits according to the display */
if (contrast < 0)
@@ -284,7 +284,7 @@ static int drv_PICGraphic_contrast(int contrast)
cmd[0] = 'c';
cmd[1] = contrast;
// todo: fixme
-// drv_PICGraphic_send(cmd, 2);
+ // drv_PICGraphic_send(cmd, 2);
return contrast;
}
diff --git a/drv_picoLCDGraphic.c b/drv_picoLCDGraphic.c
index e6889c8..f3a98c9 100644
--- a/drv_picoLCDGraphic.c
+++ b/drv_picoLCDGraphic.c
@@ -189,7 +189,7 @@ static int drv_pLG_read(unsigned char *data, int size)
static void drv_pLG_send(unsigned char *data, int size)
{
- int ret;
+ int __attribute__ ((unused)) ret;
ret = usb_interrupt_write(lcd, USB_ENDPOINT_OUT + 1, (char *) data, size, 1000);
//fprintf(stderr, "%s written %d bytes\n", __FUNCTION__, ret);
}
diff --git a/evaluator.c b/evaluator.c
index d0d4928..343eb7b 100644
--- a/evaluator.c
+++ b/evaluator.c
@@ -848,7 +848,7 @@ static NODE *Level12(void)
static NODE *Level11(void)
{
NODE *Root;
- TOKEN sign = T_UNDEF;
+ OPERATOR sign = O_UNDEF;
if (Token == T_OPERATOR && (Operator == O_ADD || Operator == O_SUB || Operator == O_NOT)) {
sign = Operator;
diff --git a/plugin_asterisk.c b/plugin_asterisk.c
index f4deb67..e1f83a8 100644
--- a/plugin_asterisk.c
+++ b/plugin_asterisk.c
@@ -66,7 +66,8 @@ static void zapstatus(RESULT * result, RESULT * arg1)
{
FILE *infile;
int skipline = 0; // Skip the first in the file, it throws off the detection
- char line[100], *SipLoc, Channel[25], Location[25], State[9], Application[25], EndPoint[8], Ret[50];
+ char line[100], *SipLoc, Channel[25], Location[25], __attribute__ ((unused)) State[9], Application[25], EndPoint[8],
+ Ret[50];
int i = 0, ChannelInt = 0, ZapLine = 0;
struct Line Lines[32]; // Setup 32 lines, ZAP 1-32 (memory is cheap)
diff --git a/plugin_cpuinfo.c b/plugin_cpuinfo.c
index 0669c7c..193fc21 100644
--- a/plugin_cpuinfo.c
+++ b/plugin_cpuinfo.c
@@ -53,7 +53,7 @@
static HASH CPUinfo;
static FILE *stream = NULL;
-static int parse_cpuinfo(char *oid)
+static int parse_cpuinfo(char __attribute__ ((unused)) * oid)
{
int age;
@@ -101,8 +101,6 @@ static int parse_cpuinfo(char *oid)
hash_put(&CPUinfo, key, val);
}
- /* to avoid compiler unused warning */
- oid = 0;
#else
diff --git a/plugin_huawei.c b/plugin_huawei.c
index fbe73b8..47ee7ec 100644
--- a/plugin_huawei.c
+++ b/plugin_huawei.c
@@ -502,7 +502,7 @@ static char *huawei_send_receive(const char *cmd)
static int huawei_configured(void)
{
- int port_exists, ret, bytes;
+ int port_exists, ret;
static int connected = -1, configured = 0;
char *buf;
@@ -560,7 +560,6 @@ static int huawei_configured(void)
/* modem initialization */
if (connected == 1 && configured != 1) {
buf = huawei_send_receive(INIT_STRING);
- bytes = strlen(buf);
if (strncmp(buf, "OK", 2) == 0) {
configured = 1;
@@ -576,11 +575,9 @@ static int huawei_configured(void)
static void huawei_read_quality(const char *cmd)
{
- int bytes;
char *buf;
buf = huawei_send_receive(cmd);
- bytes = strlen(buf);
if (strncmp(buf, "+CSQ: ", 6) == 0) {
@@ -609,11 +606,9 @@ static void huawei_read_quality(const char *cmd)
static void huawei_read_sysinfo(const char *cmd)
{
- int bytes;
char *buf;
buf = huawei_send_receive(cmd);
- bytes = strlen(buf);
if (strncmp(buf, "^SYSINFO:", 9) == 0) {
@@ -750,12 +745,10 @@ static void huawei_read_operator(const char *cmd)
static void huawei_read_flowreport(const char *cmd)
{
char *buf;
- int bytes;
static unsigned long long int prev_tx_flow = 0, prev_rx_flow = 0;
static unsigned long int prev_ds_time = 0;
buf = huawei_send_receive(cmd);
- bytes = strlen(buf);
if (strncmp(buf, "^DSFLOWQRY:", 11) == 0) {
diff --git a/plugin_wireless.c b/plugin_wireless.c
index 2eb5bc0..62188a9 100644
--- a/plugin_wireless.c
+++ b/plugin_wireless.c
@@ -355,7 +355,7 @@ static int get_sens(const char *dev, const char *key)
char key_buffer[32];
char buffer[64];
int age;
- int has_sens = 0;
+ int __attribute__ ((unused)) has_sens = 0;
int has_range = 0;
qprintf(key_buffer, sizeof(key_buffer), "%s.%s", dev, key);
@@ -404,7 +404,7 @@ static int get_sec_mode(const char *dev, const char *key)
int age;
int has_key = 0;
int key_flags = 0;
- int key_size = 0;
+ int __attribute__ ((unused)) key_size = 0;
qprintf(key_buffer, sizeof(key_buffer), "%s.%s", dev, key);
age = hash_age(&wireless, key);
diff --git a/thread.c b/thread.c
index c49f297..ddeea82 100644
--- a/thread.c
+++ b/thread.c
@@ -165,9 +165,7 @@ void shm_destroy(const int shmid, const void *buffer)
int thread_create(const char *name, void (*thread) (void *data), void *data)
{
- pid_t pid, ppid;
-
- ppid = getpid();
+ pid_t pid;
switch (pid = fork()) {
case -1: