--- Begin Message ---
Subject: |
Bug#286836: gnokii: FTBFS (amd64/gcc-4.0): |
Date: |
Wed, 22 Dec 2004 16:32:15 +0100 |
Package: gnokii
Severity: normal
Tags: patch
When building 'gnokii' on amd64 with gcc-4.0,
I get the following error:
gcc -g -O2 -I../../include -I/usr/X11R6/include -I/usr/X11R6/include -c
nk7110.c -fPIC -DPIC -o .libs/nk7110.o
nk7110.c:160: warning: pointer targets in initialization differ in signedness
nk7110.c: In function 'NK7110_Functions':
nk7110.c:187: error: invalid lvalue in assignment
nk7110.c: In function 'NK7110_Initialise':
nk7110.c:325: error: invalid lvalue in assignment
nk7110.c:353: error: invalid lvalue in assignment
nk7110.c:371: error: invalid lvalue in assignment
With the attached patch 'gnokii' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/gnokii-0.6.3/common/cfgreader.c ./common/cfgreader.c
--- ../tmp-orig/gnokii-0.6.3/common/cfgreader.c 2004-07-05 00:04:24.000000000
+0200
+++ ./common/cfgreader.c 2004-12-22 16:17:26.574635712 +0100
@@ -450,7 +450,7 @@
retval = gn_cfg_read_default();
- (char *)*bindir = gn_cfg_get(gn_cfg_info, "global", "bindir");
+ *bindir = gn_cfg_get(gn_cfg_info, "global", "bindir");
if (!*bindir) *bindir = gn_cfg_get(gn_cfg_info, "gnokiid", "bindir");
if (!*bindir) *bindir = "/usr/local/sbin";
diff -urN ../tmp-orig/gnokii-0.6.3/common/links/atbus.c ./common/links/atbus.c
--- ../tmp-orig/gnokii-0.6.3/common/links/atbus.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/links/atbus.c 2004-12-22 16:14:02.786616200 +0100
@@ -258,7 +258,7 @@
state->link.send_message = &at_send_message;
businst->rbuf_pos = 1;
businst->binlen = 1;
- AT_BUSINST(state) = businst;
+ state->driver.driver_instance = businst;
switch (state->config.connection_type) {
case GN_CT_Serial:
@@ -286,7 +286,7 @@
err:
dprintf("AT bus initialization failed (%d)\n", error);
free(AT_BUSINST(state));
- AT_BUSINST(state) = NULL;
+ state->driver.driver_instance = NULL;
out:
return error;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/links/fbus-3110.c
./common/links/fbus-3110.c
--- ../tmp-orig/gnokii-0.6.3/common/links/fbus-3110.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/links/fbus-3110.c 2004-12-22 16:16:07.857602520 +0100
@@ -351,7 +351,7 @@
state->config.init_length = 100;
/* Start up the link */
- if ((FBUSINST(state) = calloc(1, sizeof(fb3110_link))) == NULL)
+ if ((state->driver.driver_instance = calloc(1, sizeof(fb3110_link))) ==
NULL)
return GN_ERR_MEMORYFULL;
FBUSINST(state)->request_sequence_number = 0x10;
@@ -364,7 +364,7 @@
if (!fb3110_serial_open(state)) {
free(FBUSINST(state));
- FBUSINST(state) = NULL;
+ state->driver.driver_instance = NULL;
return GN_ERR_FAILED;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/links/fbus-phonet.c
./common/links/fbus-phonet.c
--- ../tmp-orig/gnokii-0.6.3/common/links/fbus-phonet.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/links/fbus-phonet.c 2004-12-22 16:15:53.387802264 +0100
@@ -286,7 +286,7 @@
state->link.loop = &phonet_loop;
state->link.send_message = &phonet_send_message;
- if ((FBUSINST(state) = calloc(1, sizeof(phonet_incoming_message))) ==
NULL)
+ if ((state->driver.driver_instance = calloc(1,
sizeof(phonet_incoming_message))) == NULL)
return GN_ERR_MEMORYFULL;
switch (state->config.connection_type) {
@@ -301,7 +301,7 @@
}
if (error != GN_ERR_NONE) {
free(FBUSINST(state));
- FBUSINST(state) = NULL;
+ state->driver.driver_instance = NULL;
return error;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/links/fbus.c ./common/links/fbus.c
--- ../tmp-orig/gnokii-0.6.3/common/links/fbus.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/links/fbus.c 2004-12-22 16:14:39.059101944 +0100
@@ -568,7 +568,7 @@
state->config.init_length = 250;
/* Start up the link */
- if ((FBUSINST(state) = calloc(1, sizeof(fbus_link))) == NULL)
+ if ((state->driver.driver_instance = calloc(1, sizeof(fbus_link))) ==
NULL)
return GN_ERR_MEMORYFULL;
FBUSINST(state)->request_sequence_number = 0;
@@ -617,7 +617,7 @@
}
if (!connection) {
free(FBUSINST(state));
- FBUSINST(state) = NULL;
+ state->driver.driver_instance = NULL;
return GN_ERR_FAILED;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/links/gnbus.c ./common/links/gnbus.c
--- ../tmp-orig/gnokii-0.6.3/common/links/gnbus.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/links/gnbus.c 2004-12-22 16:17:02.116353936 +0100
@@ -284,7 +284,7 @@
state->link.send_message = gnbus_send_message;
/* Start up the link */
- if ((GNBUSINST(state) = calloc(1, sizeof(gnbus_link))) == NULL)
+ if ((state->driver.driver_instance = calloc(1, sizeof(gnbus_link))) ==
NULL)
return GN_ERR_MEMORYFULL;
GNBUSINST(state)->i.state = GNBUS_RX_Sync;
@@ -294,7 +294,7 @@
if (!device_open(state->config.port_device, false, false, false,
conn_type, state)) {
perror(_("Couldn't open GNBUS device"));
free(GNBUSINST(state));
- GNBUSINST(state) = NULL;
+ state->driver.driver_instance = NULL;
return GN_ERR_FAILED;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/links/m2bus.c ./common/links/m2bus.c
--- ../tmp-orig/gnokii-0.6.3/common/links/m2bus.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/links/m2bus.c 2004-12-22 16:16:34.140606896 +0100
@@ -460,7 +460,7 @@
state->link.send_message = m2bus_send_message;
/* Start up the link */
- if ((M2BUSINST(state) = calloc(1, sizeof(m2bus_link))) == NULL)
+ if ((state->driver.driver_instance = calloc(1, sizeof(m2bus_link))) ==
NULL)
return GN_ERR_MEMORYFULL;
M2BUSINST(state)->request_sequence_number = 2;
@@ -473,7 +473,7 @@
}
if (err != GN_ERR_NONE) {
free(M2BUSINST(state));
- M2BUSINST(state) = NULL;
+ state->driver.driver_instance = NULL;
return err;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/phones/atgen.c ./common/phones/atgen.c
--- ../tmp-orig/gnokii-0.6.3/common/phones/atgen.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/phones/atgen.c 2004-12-22 16:12:30.099706752 +0100
@@ -1630,7 +1630,7 @@
return GN_ERR_MEMORYFULL;
state->driver.incoming_functions = drvinst->incoming_functions;
- AT_DRVINST(state) = drvinst;
+ state->driver.driver_instance = drvinst;
drvinst->manufacturer_error = NULL;
drvinst->memorytype = GN_MT_XX;
drvinst->memoryoffset = 0;
@@ -1703,8 +1703,8 @@
out:
if (ret) {
dprintf("Initialization failed (%d)\n", ret);
- free(AT_DRVINST(state));
- AT_DRVINST(state) = NULL;
+ free(state->driver.driver_instance);
+ state->driver.driver_instance = NULL;
}
return ret;
}
@@ -1712,8 +1712,8 @@
static gn_error Terminate(gn_data *data, struct gn_statemachine *state)
{
if (AT_DRVINST(state)) {
- free(AT_DRVINST(state));
- AT_DRVINST(state) = NULL;
+ free(state->driver.driver_instance);
+ state->driver.driver_instance = NULL;
}
return pgen_terminate(data, state);
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/phones/gnapplet.c
./common/phones/gnapplet.c
--- ../tmp-orig/gnokii-0.6.3/common/phones/gnapplet.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/phones/gnapplet.c 2004-12-22 16:13:23.234629016 +0100
@@ -398,7 +398,7 @@
if (DRVINSTANCE(state)) return GN_ERR_INTERNALERROR;
return gnapplet_initialise(state);
case GN_OP_Terminate:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return pgen_terminate(data, state);
case GN_OP_GetImei:
case GN_OP_GetModel:
@@ -453,7 +453,7 @@
/* Copy in the phone info */
memcpy(&(state->driver), &driver_gnapplet, sizeof(gn_driver));
- if (!(DRVINSTANCE(state) = calloc(1, sizeof(gnapplet_driver_instance))))
+ if (!(state->driver.driver_instance = calloc(1,
sizeof(gnapplet_driver_instance))))
return GN_ERR_MEMORYFULL;
switch (state->config.connection_type) {
@@ -465,13 +465,13 @@
err = gnbus_initialise(state);
break;
default:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return GN_ERR_NOTSUPPORTED;
}
if (err != GN_ERR_NONE) {
dprintf("Error in link initialisation\n");
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return GN_ERR_NOTSUPPORTED;
}
@@ -479,7 +479,7 @@
gn_data_clear(&d);
if ((err = gnapplet_identify(&d, state)) != GN_ERR_NONE) {
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return err;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/phones/nk3110.c
./common/phones/nk3110.c
--- ../tmp-orig/gnokii-0.6.3/common/phones/nk3110.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/phones/nk3110.c 2004-12-22 16:10:05.200734744 +0100
@@ -169,7 +169,7 @@
if (DRVINSTANCE(state)) return GN_ERR_INTERNALERROR;
return P3110_Initialise(state);
case GN_OP_Terminate:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return pgen_terminate(data, state);
case GN_OP_GetModel:
case GN_OP_GetRevision:
@@ -226,7 +226,7 @@
/* Copy in the phone info */
memcpy(&(state->driver), &driver_nokia_3110, sizeof(gn_driver));
- if (!(DRVINSTANCE(state) = calloc(1, sizeof(nk3110_driver_instance)))) {
+ if (!(state->driver.driver_instance = calloc(1,
sizeof(nk3110_driver_instance)))) {
error = GN_ERR_MEMORYFULL;
goto retval;
}
@@ -268,7 +268,7 @@
goto retval;
errcond:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
retval:
return error;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/phones/nk6100.c
./common/phones/nk6100.c
--- ../tmp-orig/gnokii-0.6.3/common/phones/nk6100.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/phones/nk6100.c 2004-12-22 15:50:57.585198824 +0100
@@ -238,7 +238,7 @@
if (DRVINSTANCE(state)) return GN_ERR_INTERNALERROR;
return Initialise(state);
case GN_OP_Terminate:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return pgen_terminate(data, state);
case GN_OP_GetSpeedDial:
return GetSpeedDial(data, state);
@@ -522,7 +522,7 @@
/* Copy in the phone info */
memcpy(&(state->driver), &driver_nokia_6100, sizeof(gn_driver));
- if (!(DRVINSTANCE(state) = calloc(1, sizeof(nk6100_driver_instance))))
+ if (!(state->driver.driver_instance = calloc(1,
sizeof(nk6100_driver_instance))))
return GN_ERR_MEMORYFULL;
switch (state->config.connection_type) {
@@ -541,13 +541,13 @@
err = m2bus_initialise(state);
break;
default:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return GN_ERR_NOTSUPPORTED;
}
if (err != GN_ERR_NONE) {
dprintf("Error in link initialisation\n");
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return GN_ERR_NOTSUPPORTED;
}
@@ -557,7 +557,7 @@
authorize or set keytable */
if ((err = IdentifyPhone(state)) != GN_ERR_NONE) {
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return err;
}
@@ -567,7 +567,7 @@
if (DRVINSTANCE(state)->pm->flags & PM_AUTHENTICATION) {
/* Now test the link and authenticate ourself */
if ((err = Authentication(state, DRVINSTANCE(state)->imei)) !=
GN_ERR_NONE) {
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return err;
}
}
@@ -577,7 +577,7 @@
/* FIXME: build a default table */
} else {
if (BuildKeytable(state) != GN_ERR_NONE) {
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return GN_ERR_NOTSUPPORTED;
}
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/phones/nk6160.c
./common/phones/nk6160.c
--- ../tmp-orig/gnokii-0.6.3/common/phones/nk6160.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/phones/nk6160.c 2004-12-22 15:41:04.361382552 +0100
@@ -188,8 +188,8 @@
out:
if (error) {
dprintf("Initialization failed (%d)\n", error);
- free(NK6160_DRVINST(state));
- NK6160_DRVINST(state) = NULL;
+ free(state->driver.driver_instance);
+ state->driver.driver_instance = NULL;
}
return error;
}
diff -urN ../tmp-orig/gnokii-0.6.3/common/phones/nk7110.c
./common/phones/nk7110.c
--- ../tmp-orig/gnokii-0.6.3/common/phones/nk7110.c 2004-07-05
00:04:24.000000000 +0200
+++ ./common/phones/nk7110.c 2004-12-22 15:39:59.346266352 +0100
@@ -184,7 +184,7 @@
case GN_OP_Init:
return NK7110_Initialise(state);
case GN_OP_Terminate:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return pgen_terminate(data, state);
case GN_OP_GetModel:
return NK7110_GetModel(data, state);
@@ -322,7 +322,7 @@
/* Copy in the phone info */
memcpy(&(state->driver), &driver_nokia_7110, sizeof(gn_driver));
- if (!(DRVINSTANCE(state) = calloc(1, sizeof(nk7110_driver_instance))))
+ if (!(state->driver.driver_instance = calloc(1,
sizeof(nk7110_driver_instance))))
return GN_ERR_INTERNALERROR;
dprintf("Connecting\n");
@@ -350,7 +350,7 @@
err = m2bus_initialise(state);
break;
default:
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return GN_ERR_NOTSUPPORTED;
}
@@ -368,7 +368,7 @@
connected = true;
}
if (!connected) {
- FREE(DRVINSTANCE(state));
+ FREE(state->driver.driver_instance);
return err;
}
--- End Message ---