]> git.pld-linux.org Git - packages/gnokii.git/blob - gnokii-gcc4.patch
- compilation fixes for gcc-4
[packages/gnokii.git] / gnokii-gcc4.patch
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
4 @@ -450,7 +450,7 @@
5  
6         retval = gn_cfg_read_default();
7  
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";
12  
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
16 @@ -258,7 +258,7 @@
17         state->link.send_message = &at_send_message;
18         businst->rbuf_pos = 1;
19         businst->binlen = 1;
20 -       AT_BUSINST(state) = businst;
21 +       (void *)AT_BUSINST(state) = businst;
22  
23         switch (state->config.connection_type) {
24         case GN_CT_Serial:
25 @@ -286,7 +286,7 @@
26  err:
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;
31  out:
32         return error;
33  }
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
37 @@ -351,7 +351,7 @@
38                 state->config.init_length = 100;
39  
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;
44  
45         FBUSINST(state)->request_sequence_number = 0x10;
46 @@ -364,7 +364,7 @@
47  
48         if (!fb3110_serial_open(state)) {
49                 free(FBUSINST(state));
50 -               FBUSINST(state) = NULL;
51 +               (void *)FBUSINST(state) = NULL;
52                 return GN_ERR_FAILED;
53         }
54  
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
58 @@ -623,7 +623,7 @@
59                 state->config.init_length = 250;
60  
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;
65  
66         FBUSINST(state)->request_sequence_number = 0;
67 @@ -672,7 +672,7 @@
68         }
69         if (!connection) {
70                 free(FBUSINST(state));
71 -               FBUSINST(state) = NULL;
72 +               (void *)FBUSINST(state) = NULL;
73                 return GN_ERR_FAILED;
74         }
75  
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
79 @@ -286,7 +286,7 @@
80         state->link.loop = &phonet_loop;
81         state->link.send_message = &phonet_send_message;
82  
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;
86  
87         switch (state->config.connection_type) {
88 @@ -301,7 +301,7 @@
89         }
90         if (error != GN_ERR_NONE) {
91                 free(FBUSINST(state));
92 -               FBUSINST(state) = NULL;
93 +               (void *)FBUSINST(state) = NULL;
94                 return error;
95         }
96  
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
100 @@ -284,7 +284,7 @@
101         state->link.send_message = gnbus_send_message;
102  
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;
107  
108         GNBUSINST(state)->i.state = GNBUS_RX_Sync;
109 @@ -294,7 +294,7 @@
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;
116         }
117  
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
121 @@ -460,7 +460,7 @@
122         state->link.send_message = m2bus_send_message;
123  
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;
128  
129         M2BUSINST(state)->request_sequence_number = 2;
130 @@ -473,7 +473,7 @@
131         }
132         if (err != GN_ERR_NONE) {
133                 free(M2BUSINST(state));
134 -               M2BUSINST(state) = NULL;
135 +               (void *)M2BUSINST(state) = NULL;
136                 return err;
137         }
138  
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;
144  
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 @@
152         if (ret) {
153                 dprintf("Initialization failed (%d)\n", ret);
154                 free(AT_DRVINST(state));
155 -               AT_DRVINST(state) = NULL;
156 +               (void *)AT_DRVINST(state) = NULL;
157         }
158         return ret;
159  }
160 @@ -1729,7 +1729,7 @@
161  {
162         if (AT_DRVINST(state)) {
163                 free(AT_DRVINST(state));
164 -               AT_DRVINST(state) = NULL;
165 +               (void *)AT_DRVINST(state) = NULL;
166         }
167         return pgen_terminate(data, state);
168  }
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
172 @@ -419,7 +419,7 @@
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);
179         case GN_OP_GetImei:
180         case GN_OP_GetModel:
181 @@ -508,7 +508,7 @@
182         /* Copy in the phone info */
183         memcpy(&(state->driver), &driver_gnapplet, sizeof(gn_driver));
184  
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;
188  
189         switch (state->config.connection_type) {
190 @@ -520,13 +520,13 @@
191                 err = gnbus_initialise(state);
192                 break;
193         default:
194 -               FREE(DRVINSTANCE(state));
195 +               FREE((void *)DRVINSTANCE(state));
196                 return GN_ERR_NOTSUPPORTED;
197         }
198  
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;
204         }
205  
206 @@ -534,7 +534,7 @@
207  
208         gn_data_clear(&d);
209         if ((err = gnapplet_identify(&d, state)) != GN_ERR_NONE) {
210 -               FREE(DRVINSTANCE(state));
211 +               FREE((void *)DRVINSTANCE(state));
212                 return err;
213         }
214  
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
218 @@ -169,7 +169,7 @@
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);
225         case GN_OP_GetModel:
226         case GN_OP_GetRevision:
227 @@ -226,7 +226,7 @@
228         /* Copy in the phone info */
229         memcpy(&(state->driver), &driver_nokia_3110, sizeof(gn_driver));
230  
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;
234                 goto retval;
235         }
236 @@ -268,7 +268,7 @@
237  
238         goto retval;
239  errcond:
240 -       FREE(DRVINSTANCE(state));
241 +       FREE((void *)DRVINSTANCE(state));
242  retval:
243         return error;
244  }
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
248 @@ -238,7 +238,7 @@
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);
257 @@ -522,7 +522,7 @@
258         /* Copy in the phone info */
259         memcpy(&(state->driver), &driver_nokia_6100, sizeof(gn_driver));
260  
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;
264  
265         switch (state->config.connection_type) {
266 @@ -541,13 +541,13 @@
267                 err = m2bus_initialise(state);
268                 break;
269         default:
270 -               FREE(DRVINSTANCE(state));
271 +               FREE((void *)DRVINSTANCE(state));
272                 return GN_ERR_NOTSUPPORTED;
273         }
274  
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;
280         }
281  
282 @@ -557,7 +557,7 @@
283            authorize or set keytable */
284  
285         if ((err = IdentifyPhone(state)) != GN_ERR_NONE) {
286 -               FREE(DRVINSTANCE(state));
287 +               FREE((void *)DRVINSTANCE(state));
288                 return err;
289         }
290  
291 @@ -567,7 +567,7 @@
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));
297                         return err;
298                 }
299         }
300 @@ -577,7 +577,7 @@
301                         /* FIXME: build a default table */
302                 } else {
303                         if (BuildKeytable(state) != GN_ERR_NONE) {
304 -                               FREE(DRVINSTANCE(state));
305 +                               FREE((void *)DRVINSTANCE(state));
306                                 return GN_ERR_NOTSUPPORTED;
307                         }
308                 }
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
312 @@ -189,7 +189,7 @@
313         if (error) {
314                 dprintf("Initialization failed (%d)\n", error);
315                 free(NK6160_DRVINST(state));
316 -               NK6160_DRVINST(state) = NULL;
317 +               (void *)NK6160_DRVINST(state) = NULL;
318         }
319         return error;
320  }
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
324 @@ -184,7 +184,7 @@
325         case GN_OP_Init:
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);
331         case GN_OP_GetModel:
332                 return NK7110_GetModel(data, state);
333 @@ -322,7 +322,7 @@
334         /* Copy in the phone info */
335         memcpy(&(state->driver), &driver_nokia_7110, sizeof(gn_driver));
336  
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;
340  
341         dprintf("Connecting\n");
342 @@ -350,7 +350,7 @@
343                         err = m2bus_initialise(state);
344                         break;
345                 default:
346 -                       FREE(DRVINSTANCE(state));
347 +                       FREE((void *)DRVINSTANCE(state));
348                         return GN_ERR_NOTSUPPORTED;
349                 }
350  
351 @@ -368,7 +368,7 @@
352                         connected = true;
353         }
354         if (!connected) {
355 -               FREE(DRVINSTANCE(state));
356 +               FREE((void *)DRVINSTANCE(state));
357                 return err;
358         }
359  
This page took 0.793477 seconds and 3 git commands to generate.