1 diff -Nru gnokii-0.6.4.orig/common/cfgreader.c gnokii-0.6.4/common/cfgreader.c
2 --- gnokii-0.6.4.orig/common/cfgreader.c 2004-10-17 21:44:20.000000000 +0200
3 +++ gnokii-0.6.4/common/cfgreader.c 2005-04-28 18:29:43.464741688 +0200
6 retval = gn_cfg_read_default();
8 - (char *)*bindir = gn_cfg_get(gn_cfg_info, "global", "bindir");
9 + *bindir = gn_cfg_get(gn_cfg_info, "global", "bindir");
10 if (!*bindir) *bindir = gn_cfg_get(gn_cfg_info, "gnokiid", "bindir");
11 if (!*bindir) *bindir = "/usr/local/sbin";
13 iff -Nru gnokii-0.6.4.orig/common/links/atbus.c gnokii-0.6.4/common/links/atbus.c
14 --- gnokii-0.6.4.orig/common/links/atbus.c 2004-10-17 21:44:21.000000000 +0200
15 +++ gnokii-0.6.4/common/links/atbus.c 2005-04-28 18:24:02.840524440 +0200
17 state->link.send_message = &at_send_message;
18 businst->rbuf_pos = 1;
20 - AT_BUSINST(state) = businst;
21 + (void *)AT_BUSINST(state) = businst;
23 switch (state->config.connection_type) {
27 dprintf("AT bus initialization failed (%d)\n", error);
28 free(AT_BUSINST(state));
29 - AT_BUSINST(state) = NULL;
30 + (void *)AT_BUSINST(state) = NULL;
34 diff -Nru gnokii-0.6.4.orig/common/links/fbus-3110.c gnokii-0.6.4/common/links/fbus-3110.c
35 --- gnokii-0.6.4.orig/common/links/fbus-3110.c 2004-10-17 21:44:21.000000000 +0200
36 +++ gnokii-0.6.4/common/links/fbus-3110.c 2005-04-28 18:26:36.984091056 +0200
38 state->config.init_length = 100;
40 /* Start up the link */
41 - if ((FBUSINST(state) = calloc(1, sizeof(fb3110_link))) == NULL)
42 + if (((void *)FBUSINST(state) = calloc(1, sizeof(fb3110_link))) == NULL)
43 return GN_ERR_MEMORYFULL;
45 FBUSINST(state)->request_sequence_number = 0x10;
48 if (!fb3110_serial_open(state)) {
49 free(FBUSINST(state));
50 - FBUSINST(state) = NULL;
51 + (void *)FBUSINST(state) = NULL;
55 diff -Nru gnokii-0.6.4.orig/common/links/fbus.c gnokii-0.6.4/common/links/fbus.c
56 --- gnokii-0.6.4.orig/common/links/fbus.c 2004-10-17 21:44:21.000000000 +0200
57 +++ gnokii-0.6.4/common/links/fbus.c 2005-04-28 18:25:10.309267632 +0200
59 state->config.init_length = 250;
61 /* Start up the link */
62 - if ((FBUSINST(state) = calloc(1, sizeof(fbus_link))) == NULL)
63 + if (((void *)FBUSINST(state) = calloc(1, sizeof(fbus_link))) == NULL)
64 return GN_ERR_MEMORYFULL;
66 FBUSINST(state)->request_sequence_number = 0;
70 free(FBUSINST(state));
71 - FBUSINST(state) = NULL;
72 + (void *)FBUSINST(state) = NULL;
76 diff -Nru gnokii-0.6.4.orig/common/links/fbus-phonet.c gnokii-0.6.4/common/links/fbus-phonet.c
77 --- gnokii-0.6.4.orig/common/links/fbus-phonet.c 2004-10-17 21:44:21.000000000 +0200
78 +++ gnokii-0.6.4/common/links/fbus-phonet.c 2005-04-28 18:26:01.852431880 +0200
80 state->link.loop = &phonet_loop;
81 state->link.send_message = &phonet_send_message;
83 - if ((FBUSINST(state) = calloc(1, sizeof(phonet_incoming_message))) == NULL)
84 + if (((void *)FBUSINST(state) = calloc(1, sizeof(phonet_incoming_message))) == NULL)
85 return GN_ERR_MEMORYFULL;
87 switch (state->config.connection_type) {
90 if (error != GN_ERR_NONE) {
91 free(FBUSINST(state));
92 - FBUSINST(state) = NULL;
93 + (void *)FBUSINST(state) = NULL;
97 diff -Nru gnokii-0.6.4.orig/common/links/gnbus.c gnokii-0.6.4/common/links/gnbus.c
98 --- gnokii-0.6.4.orig/common/links/gnbus.c 2004-10-17 21:44:21.000000000 +0200
99 +++ gnokii-0.6.4/common/links/gnbus.c 2005-04-28 18:28:01.787199024 +0200
101 state->link.send_message = gnbus_send_message;
103 /* Start up the link */
104 - if ((GNBUSINST(state) = calloc(1, sizeof(gnbus_link))) == NULL)
105 + if (((void *)GNBUSINST(state) = calloc(1, sizeof(gnbus_link))) == NULL)
106 return GN_ERR_MEMORYFULL;
108 GNBUSINST(state)->i.state = GNBUS_RX_Sync;
110 if (!device_open(state->config.port_device, false, false, false, conn_type, state)) {
111 perror(_("Couldn't open GNBUS device"));
112 free(GNBUSINST(state));
113 - GNBUSINST(state) = NULL;
114 + (void *)GNBUSINST(state) = NULL;
115 return GN_ERR_FAILED;
118 diff -Nru gnokii-0.6.4.orig/common/links/m2bus.c gnokii-0.6.4/common/links/m2bus.c
119 --- gnokii-0.6.4.orig/common/links/m2bus.c 2004-10-17 21:44:21.000000000 +0200
120 +++ gnokii-0.6.4/common/links/m2bus.c 2005-04-28 18:27:16.001159560 +0200
122 state->link.send_message = m2bus_send_message;
124 /* Start up the link */
125 - if ((M2BUSINST(state) = calloc(1, sizeof(m2bus_link))) == NULL)
126 + if (((void *)M2BUSINST(state) = calloc(1, sizeof(m2bus_link))) == NULL)
127 return GN_ERR_MEMORYFULL;
129 M2BUSINST(state)->request_sequence_number = 2;
132 if (err != GN_ERR_NONE) {
133 free(M2BUSINST(state));
134 - M2BUSINST(state) = NULL;
135 + (void *)M2BUSINST(state) = NULL;
139 diff -Nru gnokii-0.6.4.orig/common/phones/atgen.c gnokii-0.6.4/common/phones/atgen.c
140 --- gnokii-0.6.4.orig/common/phones/atgen.c 2004-10-17 21:44:21.000000000 +0200
141 +++ gnokii-0.6.4/common/phones/atgen.c 2005-04-28 18:21:12.280453512 +0200
142 @@ -1645,7 +1645,7 @@
143 return GN_ERR_MEMORYFULL;
145 state->driver.incoming_functions = drvinst->incoming_functions;
146 - AT_DRVINST(state) = drvinst;
147 + (void *)AT_DRVINST(state) = drvinst;
148 drvinst->manufacturer_error = NULL;
149 drvinst->memorytype = GN_MT_XX;
150 drvinst->memoryoffset = 0;
151 @@ -1720,7 +1720,7 @@
153 dprintf("Initialization failed (%d)\n", ret);
154 free(AT_DRVINST(state));
155 - AT_DRVINST(state) = NULL;
156 + (void *)AT_DRVINST(state) = NULL;
160 @@ -1729,7 +1729,7 @@
162 if (AT_DRVINST(state)) {
163 free(AT_DRVINST(state));
164 - AT_DRVINST(state) = NULL;
165 + (void *)AT_DRVINST(state) = NULL;
167 return pgen_terminate(data, state);
169 diff -Nru gnokii-0.6.4.orig/common/phones/gnapplet.c gnokii-0.6.4/common/phones/gnapplet.c
170 --- gnokii-0.6.4.orig/common/phones/gnapplet.c 2004-10-17 21:44:21.000000000 +0200
171 +++ gnokii-0.6.4/common/phones/gnapplet.c 2005-04-28 18:22:56.226651288 +0200
173 if (DRVINSTANCE(state)) return GN_ERR_INTERNALERROR;
174 return gnapplet_initialise(state);
175 case GN_OP_Terminate:
176 - FREE(DRVINSTANCE(state));
177 + FREE((void *)DRVINSTANCE(state));
178 return pgen_terminate(data, state);
182 /* Copy in the phone info */
183 memcpy(&(state->driver), &driver_gnapplet, sizeof(gn_driver));
185 - if (!(DRVINSTANCE(state) = calloc(1, sizeof(gnapplet_driver_instance))))
186 + if (!((void *)DRVINSTANCE(state) = calloc(1, sizeof(gnapplet_driver_instance))))
187 return GN_ERR_MEMORYFULL;
189 switch (state->config.connection_type) {
190 @@ -520,13 +520,13 @@
191 err = gnbus_initialise(state);
194 - FREE(DRVINSTANCE(state));
195 + FREE((void *)DRVINSTANCE(state));
196 return GN_ERR_NOTSUPPORTED;
199 if (err != GN_ERR_NONE) {
200 dprintf("Error in link initialisation\n");
201 - FREE(DRVINSTANCE(state));
202 + FREE((void *)DRVINSTANCE(state));
203 return GN_ERR_NOTSUPPORTED;
209 if ((err = gnapplet_identify(&d, state)) != GN_ERR_NONE) {
210 - FREE(DRVINSTANCE(state));
211 + FREE((void *)DRVINSTANCE(state));
215 diff -Nru gnokii-0.6.4.orig/common/phones/nk3110.c gnokii-0.6.4/common/phones/nk3110.c
216 --- gnokii-0.6.4.orig/common/phones/nk3110.c 2004-10-17 21:44:21.000000000 +0200
217 +++ gnokii-0.6.4/common/phones/nk3110.c 2005-04-28 18:19:17.935836536 +0200
219 if (DRVINSTANCE(state)) return GN_ERR_INTERNALERROR;
220 return P3110_Initialise(state);
221 case GN_OP_Terminate:
222 - FREE(DRVINSTANCE(state));
223 + FREE((void *)DRVINSTANCE(state));
224 return pgen_terminate(data, state);
226 case GN_OP_GetRevision:
228 /* Copy in the phone info */
229 memcpy(&(state->driver), &driver_nokia_3110, sizeof(gn_driver));
231 - if (!(DRVINSTANCE(state) = calloc(1, sizeof(nk3110_driver_instance)))) {
232 + if (!((void *)DRVINSTANCE(state) = calloc(1, sizeof(nk3110_driver_instance)))) {
233 error = GN_ERR_MEMORYFULL;
240 - FREE(DRVINSTANCE(state));
241 + FREE((void *)DRVINSTANCE(state));
245 diff -Nru gnokii-0.6.4.orig/common/phones/nk6100.c gnokii-0.6.4/common/phones/nk6100.c
246 --- gnokii-0.6.4.orig/common/phones/nk6100.c 2004-10-17 21:44:21.000000000 +0200
247 +++ gnokii-0.6.4/common/phones/nk6100.c 2005-04-28 18:17:38.371972544 +0200
249 if (DRVINSTANCE(state)) return GN_ERR_INTERNALERROR;
250 return Initialise(state);
251 case GN_OP_Terminate:
252 - FREE(DRVINSTANCE(state));
253 + FREE((void *)DRVINSTANCE(state));
254 return pgen_terminate(data, state);
255 case GN_OP_GetSpeedDial:
256 return GetSpeedDial(data, state);
258 /* Copy in the phone info */
259 memcpy(&(state->driver), &driver_nokia_6100, sizeof(gn_driver));
261 - if (!(DRVINSTANCE(state) = calloc(1, sizeof(nk6100_driver_instance))))
262 + if (!((void *)DRVINSTANCE(state) = calloc(1, sizeof(nk6100_driver_instance))))
263 return GN_ERR_MEMORYFULL;
265 switch (state->config.connection_type) {
266 @@ -541,13 +541,13 @@
267 err = m2bus_initialise(state);
270 - FREE(DRVINSTANCE(state));
271 + FREE((void *)DRVINSTANCE(state));
272 return GN_ERR_NOTSUPPORTED;
275 if (err != GN_ERR_NONE) {
276 dprintf("Error in link initialisation\n");
277 - FREE(DRVINSTANCE(state));
278 + FREE((void *)DRVINSTANCE(state));
279 return GN_ERR_NOTSUPPORTED;
283 authorize or set keytable */
285 if ((err = IdentifyPhone(state)) != GN_ERR_NONE) {
286 - FREE(DRVINSTANCE(state));
287 + FREE((void *)DRVINSTANCE(state));
292 if (DRVINSTANCE(state)->pm->flags & PM_AUTHENTICATION) {
293 /* Now test the link and authenticate ourself */
294 if ((err = Authentication(state, DRVINSTANCE(state)->imei)) != GN_ERR_NONE) {
295 - FREE(DRVINSTANCE(state));
296 + FREE((void *)DRVINSTANCE(state));
301 /* FIXME: build a default table */
303 if (BuildKeytable(state) != GN_ERR_NONE) {
304 - FREE(DRVINSTANCE(state));
305 + FREE((void *)DRVINSTANCE(state));
306 return GN_ERR_NOTSUPPORTED;
309 diff -Nru gnokii-0.6.4.orig/common/phones/nk6160.c gnokii-0.6.4/common/phones/nk6160.c
310 --- gnokii-0.6.4.orig/common/phones/nk6160.c 2004-10-17 21:44:21.000000000 +0200
311 +++ gnokii-0.6.4/common/phones/nk6160.c 2005-04-28 18:14:41.534855872 +0200
314 dprintf("Initialization failed (%d)\n", error);
315 free(NK6160_DRVINST(state));
316 - NK6160_DRVINST(state) = NULL;
317 + (void *)NK6160_DRVINST(state) = NULL;
321 diff -Nru gnokii-0.6.4.orig/common/phones/nk7110.c gnokii-0.6.4/common/phones/nk7110.c
322 --- gnokii-0.6.4.orig/common/phones/nk7110.c 2004-10-17 21:44:21.000000000 +0200
323 +++ gnokii-0.6.4/common/phones/nk7110.c 2005-04-28 18:13:52.087373032 +0200
326 return NK7110_Initialise(state);
327 case GN_OP_Terminate:
328 - FREE(DRVINSTANCE(state));
329 + FREE((void *)DRVINSTANCE(state));
330 return pgen_terminate(data, state);
332 return NK7110_GetModel(data, state);
334 /* Copy in the phone info */
335 memcpy(&(state->driver), &driver_nokia_7110, sizeof(gn_driver));
337 - if (!(DRVINSTANCE(state) = calloc(1, sizeof(nk7110_driver_instance))))
338 + if (!((void *)DRVINSTANCE(state) = calloc(1, sizeof(nk7110_driver_instance))))
339 return GN_ERR_INTERNALERROR;
341 dprintf("Connecting\n");
343 err = m2bus_initialise(state);
346 - FREE(DRVINSTANCE(state));
347 + FREE((void *)DRVINSTANCE(state));
348 return GN_ERR_NOTSUPPORTED;
355 - FREE(DRVINSTANCE(state));
356 + FREE((void *)DRVINSTANCE(state));