]> git.webhop.me Git - lcd4linux.git/commitdiff
various compiler warnings fixed
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 27 Jul 2011 05:12:30 +0000 (05:12 +0000)
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 27 Jul 2011 05:12:30 +0000 (05:12 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1153 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

13 files changed:
drv_D4D.c
drv_EFN.c
drv_FW8888.c
drv_G15.c
drv_MatrixOrbitalGX.c
drv_PICGraphic.c
drv_picoLCDGraphic.c
evaluator.c
plugin_asterisk.c
plugin_cpuinfo.c
plugin_huawei.c
plugin_wireless.c
thread.c

index 253ec2acdf1bfc93aadd3349b2bc5c44ab767b51..52d0e8ff4036d070b0e5c618958e15ee16bf8662 100755 (executable)
--- 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;
index dca226c8218bcf1a42d9b497fc17a77457d7ee57..790f3eade06d060619056299bc1d18ef598a973c 100644 (file)
--- 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;
 
index b950c016ad5da3ef7c1173a28b64bdce94fe178b..e13051dcfac4f99a4e9ddb4c9164c229c1d82342 100644 (file)
@@ -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);
 }
index d070b3831234bafd100e7bf28bd72c141065f0c0..6bc64159d3484d8bdc255bd593f7017f8cb00ce2 100644 (file)
--- 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);
 
index 5906f1feeff9249493a2a5bfeefebf57e43fc833..20f082a4758a849e39782e6bd409c9e767cbe5e4 100644 (file)
@@ -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] = "";
 
index 8586eb60ed145209952052370c79d0293db1b041..5138ecef48495303c96d186e5198104948158b4b 100644 (file)
@@ -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;
 }
index e6889c8082cd3b6d5f7d96aef4eee08bad7d6a03..f3a98c936c408488ebb89ca342ac546a97a29145 100644 (file)
@@ -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);
 }
index d0d4928804bf97b65d86ccfa6ecf3f8c10f5e6b2..343eb7b5b7fdd03a878904ada18c9dd944130e2d 100644 (file)
@@ -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;
index f4deb670393ad8abe0e504fabdeb36c60b6f0345..e1f83a8607fd7825f674457be74b65b7be2a7595 100644 (file)
@@ -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)
 
index 0669c7cef51499bd8d744d726637eece3afc990d..193fc21611dbcdf09b94909e7b25dfda90f5fb46 100644 (file)
@@ -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
 
index fbe73b8b06f2d9af0fd8d61147fcfd302491b56c..47ee7ec0a1f0e950250a027d8f9f0eace122dd46 100644 (file)
@@ -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) {
 
index 2eb5bc022263a8173a22ed13847813e4546b4424..62188a97c9d5b8ce0fada0c0b1c00061ac113cbd 100644 (file)
@@ -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);
index c49f297df92359c6b3edd5f8be64de35ee837aad..ddeea82fd23903e404e94de2c11d07f647482174 100644 (file)
--- 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: