various compiler warnings fixed

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1153 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
michael
2011-07-27 05:12:30 +00:00
parent 616665a32d
commit 7318d07f89
13 changed files with 39 additions and 60 deletions

View File

@@ -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;

View File

@@ -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;

View 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);
}

View File

@@ -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);

View 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] = "";

View 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;
}

View 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);
}

View 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;

View 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)

View 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

View 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) {

View 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);

View File

@@ -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: