Fix dependencies.
[openwrt/svn-archive/archive.git] / libs / clearsilver / patches / 100-remove_warnings.patch
1 diff -pruN clearsilver-0.10.5.orig/cgi/cgi.c clearsilver-0.10.5/cgi/cgi.c
2 --- clearsilver-0.10.5.orig/cgi/cgi.c 2007-07-12 04:38:03.000000000 +0200
3 +++ clearsilver-0.10.5/cgi/cgi.c 2008-01-28 12:04:50.000000000 +0100
4 @@ -698,7 +700,7 @@ NEOERR *cgi_parse (CGI *cgi)
5 x = 0;
6 while (x < len)
7 {
8 - if (len-x > sizeof(buf))
9 + if (len-x > (int) sizeof(buf))
10 cgiwrap_read (buf, sizeof(buf), &r);
11 else
12 cgiwrap_read (buf, len - x, &r);
13 @@ -1363,6 +1365,8 @@ void cgi_neo_error (CGI *cgi, NEOERR *er
14 {
15 STRING str;
16
17 + UNUSED(cgi);
18 +
19 string_init(&str);
20 cgiwrap_writef("Status: 500\n");
21 cgiwrap_writef("Content-Type: text/html\n\n");
22 @@ -1377,6 +1381,8 @@ void cgi_error (CGI *cgi, const char *fm
23 {
24 va_list ap;
25
26 + UNUSED(cgi);
27 +
28 cgiwrap_writef("Status: 500\n");
29 cgiwrap_writef("Content-Type: text/html\n\n");
30 cgiwrap_writef("<html><body>\nAn error occured:<pre>");
31 @@ -1536,6 +1542,8 @@ NEOERR *cgi_cookie_set (CGI *cgi, const
32 STRING str;
33 char my_time[256];
34
35 + UNUSED(cgi);
36 +
37 if (path == NULL) path = "/";
38
39 string_init(&str);
40 @@ -1584,6 +1592,8 @@ NEOERR *cgi_cookie_set (CGI *cgi, const
41 NEOERR *cgi_cookie_clear (CGI *cgi, const char *name, const char *domain,
42 const char *path)
43 {
44 + UNUSED(cgi);
45 +
46 if (path == NULL) path = "/";
47 if (domain)
48 {
49 diff -pruN clearsilver-0.10.5.orig/cgi/cgiwrap.c clearsilver-0.10.5/cgi/cgiwrap.c
50 --- clearsilver-0.10.5.orig/cgi/cgiwrap.c 2006-12-19 05:36:20.000000000 +0100
51 +++ clearsilver-0.10.5/cgi/cgiwrap.c 2008-01-28 12:02:32.000000000 +0100
52 @@ -14,6 +14,9 @@
53 #if HAVE_FEATURES_H
54 #include <features.h>
55 #endif
56 +#ifdef __UCLIBC__
57 +#include <unistd.h>
58 +#endif
59 #include <stdarg.h>
60 #include <stdio.h>
61 #include <stdlib.h>
62 diff -pruN clearsilver-0.10.5.orig/cgi/date.c clearsilver-0.10.5/cgi/date.c
63 --- clearsilver-0.10.5.orig/cgi/date.c 2006-11-03 17:56:22.000000000 +0100
64 +++ clearsilver-0.10.5/cgi/date.c 2008-01-28 12:01:53.000000000 +0100
65 @@ -94,7 +94,7 @@ NEOERR *export_date_tm (HDF *data, const
66 if (err) return nerr_pass(err);
67 err = hdf_set_int_value (obj, "wday", ttm->tm_wday);
68 if (err) return nerr_pass(err);
69 - // neo_tz_offset() returns offset from GMT in seconds
70 + /* neo_tz_offset() returns offset from GMT in seconds */
71 tzoffset_seconds = neo_tz_offset(ttm);
72 tzoffset = tzoffset_seconds / 60;
73 if (tzoffset < 0)
74 @@ -109,12 +109,12 @@ NEOERR *export_date_tm (HDF *data, const
75 return STATUS_OK;
76 }
77
78 -NEOERR *export_date_time_t (HDF *data, const char *prefix, const char *timezone,
79 +NEOERR *export_date_time_t (HDF *data, const char *prefix, const char *tz,
80 time_t tt)
81 {
82 struct tm ttm;
83
84 - neo_time_expand (tt, timezone, &ttm);
85 + neo_time_expand (tt, tz, &ttm);
86 return nerr_pass (export_date_tm (data, prefix, &ttm));
87 }
88
89 diff -pruN clearsilver-0.10.5.orig/cgi/date.h clearsilver-0.10.5/cgi/date.h
90 --- clearsilver-0.10.5.orig/cgi/date.h 2005-07-01 03:21:30.000000000 +0200
91 +++ clearsilver-0.10.5/cgi/date.h 2008-01-28 11:36:10.000000000 +0100
92 @@ -17,7 +17,7 @@
93 __BEGIN_DECLS
94
95 NEOERR *export_date_tm (HDF *obj, const char *prefix, struct tm *ttm);
96 -NEOERR *export_date_time_t (HDF *obj, const char *prefix, const char *timezone,
97 +NEOERR *export_date_time_t (HDF *obj, const char *prefix, const char *tz,
98 time_t tt);
99
100 __END_DECLS
101 diff -pruN clearsilver-0.10.5.orig/cgi/html.c clearsilver-0.10.5/cgi/html.c
102 --- clearsilver-0.10.5.orig/cgi/html.c 2006-10-20 01:26:35.000000000 +0200
103 +++ clearsilver-0.10.5/cgi/html.c 2008-01-28 11:36:10.000000000 +0100
104 @@ -774,7 +774,7 @@ NEOERR *html_strip_alloc(const char *src
105 }
106 else
107 {
108 - if (ampl < sizeof(amp)-1)
109 + if (ampl < (int) sizeof(amp)-1)
110 amp[ampl++] = tolower(src[x]);
111 else
112 {
113 diff -pruN clearsilver-0.10.5.orig/cgi/rfc2388.c clearsilver-0.10.5/cgi/rfc2388.c
114 --- clearsilver-0.10.5.orig/cgi/rfc2388.c 2006-08-29 10:44:50.000000000 +0200
115 +++ clearsilver-0.10.5/cgi/rfc2388.c 2008-01-28 12:01:13.000000000 +0100
116 @@ -155,14 +155,14 @@ static NEOERR * _read_line (CGI *cgi, ch
117 ofs = cgi->readlen - cgi->nl;
118 memmove(cgi->buf, cgi->buf + cgi->nl, ofs);
119 }
120 - // Read either as much buffer space as we have left, or up to
121 - // the amount of data remaining according to Content-Length
122 - // If there is no Content-Length, just use the buffer space, but recognize
123 - // that it might not work on some servers or cgiwrap implementations.
124 - // Some servers will close their end of the stdin pipe, so cgiwrap_read
125 - // will return if we ask for too much. Techically, not including
126 - // Content-Length is against the HTTP spec, so we should consider failing
127 - // earlier if we don't have a length.
128 + /* Read either as much buffer space as we have left, or up to
129 + * the amount of data remaining according to Content-Length
130 + * If there is no Content-Length, just use the buffer space, but recognize
131 + * that it might not work on some servers or cgiwrap implementations.
132 + * Some servers will close their end of the stdin pipe, so cgiwrap_read
133 + * will return if we ask for too much. Techically, not including
134 + * Content-Length is against the HTTP spec, so we should consider failing
135 + * earlier if we don't have a length. */
136 to_read = cgi->buflen - ofs;
137 if (cgi->data_expected && (to_read > cgi->data_expected - cgi->data_read))
138 {
139 diff -pruN clearsilver-0.10.5.orig/cs/csparse.c clearsilver-0.10.5/cs/csparse.c
140 --- clearsilver-0.10.5.orig/cs/csparse.c 2007-07-12 04:37:34.000000000 +0200
141 +++ clearsilver-0.10.5/cs/csparse.c 2008-01-28 12:18:32.000000000 +0100
142 @@ -59,7 +59,7 @@ typedef enum
143 ST_DEF = 1<<6,
144 ST_LOOP = 1<<7,
145 ST_ALT = 1<<8,
146 - ST_ESCAPE = 1<<9,
147 + ST_ESCAPE = 1<<9
148 } CS_STATE;
149
150 #define ST_ANYWHERE (ST_EACH | ST_WITH | ST_ELSE | ST_IF | ST_GLOBAL | ST_DEF | ST_LOOP | ST_ALT | ST_ESCAPE)
151 @@ -178,7 +178,8 @@ CS_CMDS Commands[] = {
152 escape_parse, escape_eval, 1},
153 {"/escape", sizeof("/escape")-1, ST_ESCAPE, ST_POP,
154 end_parse, skip_eval, 1},
155 - {NULL},
156 + {NULL, 0, 0, 0,
157 + NULL, NULL, 0}
158 };
159
160 /* Possible Config.VarEscapeMode values */
161 @@ -193,7 +194,7 @@ CS_ESCAPE_MODES EscapeModes[] = {
162 {"html", NEOS_ESCAPE_HTML},
163 {"js", NEOS_ESCAPE_SCRIPT},
164 {"url", NEOS_ESCAPE_URL},
165 - {NULL},
166 + {NULL, 0}
167 };
168
169
170 @@ -1154,7 +1155,7 @@ static char *token_list (CSTOKEN *tokens
171 {
172 t = snprintf(p, buflen, "%s%d:%s", i ? " ":"", i, expand_token_type(tokens[i].type, 0));
173 }
174 - if (t == -1 || t >= buflen) return buf;
175 + if (t == -1 || t >= (int) buflen) return buf;
176 buflen -= t;
177 p += t;
178 }
179 @@ -2567,6 +2568,9 @@ static NEOERR *else_parse (CSPARSE *pars
180 NEOERR *err;
181 STACK_ENTRY *entry;
182
183 + UNUSED(cmd);
184 + UNUSED(arg);
185 +
186 /* ne_warn ("else"); */
187 err = uListGet (parse->stack, -1, (void *)&entry);
188 if (err != STATUS_OK) return nerr_pass(err);
189 @@ -2600,6 +2604,9 @@ static NEOERR *endif_parse (CSPARSE *par
190 NEOERR *err;
191 STACK_ENTRY *entry;
192
193 + UNUSED(cmd);
194 + UNUSED(arg);
195 +
196 /* ne_warn ("endif"); */
197 err = uListGet (parse->stack, -1, (void *)&entry);
198 if (err != STATUS_OK) return nerr_pass(err);
199 @@ -2781,6 +2788,9 @@ static NEOERR *end_parse (CSPARSE *parse
200 NEOERR *err;
201 STACK_ENTRY *entry;
202
203 + UNUSED(cmd);
204 + UNUSED(arg);
205 +
206 err = uListGet (parse->stack, -1, (void *)&entry);
207 if (err != STATUS_OK) return nerr_pass(err);
208
209 @@ -2796,6 +2806,8 @@ static NEOERR *include_parse (CSPARSE *p
210 int flags = 0;
211 CSARG arg1, val;
212
213 + UNUSED(cmd);
214 +
215 memset(&arg1, 0, sizeof(CSARG));
216 if (arg[0] == '!')
217 flags |= CSF_REQUIRED;
218 @@ -3511,6 +3523,8 @@ static NEOERR *loop_eval (CSPARSE *parse
219
220 static NEOERR *skip_eval (CSPARSE *parse, CSTREE *node, CSTREE **next)
221 {
222 + UNUSED(parse);
223 +
224 *next = node->next;
225 return STATUS_OK;
226 }
227 @@ -3651,6 +3665,8 @@ static NEOERR * _builtin_subcount(CSPARS
228 int count = 0;
229 CSARG val;
230
231 + UNUSED(csf);
232 +
233 memset(&val, 0, sizeof(val));
234 err = eval_expr(parse, args, &val);
235 if (err) return nerr_pass(err);
236 @@ -3683,6 +3699,8 @@ static NEOERR * _builtin_str_length(CSPA
237 NEOERR *err;
238 CSARG val;
239
240 + UNUSED(csf);
241 +
242 memset(&val, 0, sizeof(val));
243 err = eval_expr(parse, args, &val);
244 if (err) return nerr_pass(err);
245 @@ -3706,6 +3724,8 @@ static NEOERR * _builtin_str_crc(CSPARSE
246 NEOERR *err;
247 CSARG val;
248
249 + UNUSED(csf);
250 +
251 memset(&val, 0, sizeof(val));
252 err = eval_expr(parse, args, &val);
253 if (err) return nerr_pass(err);
254 @@ -3731,6 +3751,8 @@ static NEOERR * _builtin_str_find(CSPARS
255 char *substr = NULL;
256 char *pstr = NULL;
257
258 + UNUSED(csf);
259 +
260 result->op_type = CS_TYPE_NUM;
261 result->n = -1;
262
263 @@ -3758,6 +3780,8 @@ static NEOERR * _builtin_name(CSPARSE *p
264 HDF *obj;
265 CSARG val;
266
267 + UNUSED(csf);
268 +
269 memset(&val, 0, sizeof(val));
270 err = eval_expr(parse, args, &val);
271 if (err) return nerr_pass(err);
272 @@ -3790,6 +3814,8 @@ static NEOERR * _builtin_first(CSPARSE *
273 char *c;
274 CSARG val;
275
276 + UNUSED(csf);
277 +
278 memset(&val, 0, sizeof(val));
279 err = eval_expr(parse, args, &val);
280 if (err) return nerr_pass(err);
281 @@ -3819,6 +3845,8 @@ static NEOERR * _builtin_last(CSPARSE *p
282 char *c;
283 CSARG val;
284
285 + UNUSED(csf);
286 +
287 memset(&val, 0, sizeof(val));
288 err = eval_expr(parse, args, &val);
289 if (err) return nerr_pass(err);
290 @@ -3853,6 +3881,8 @@ static NEOERR * _builtin_abs (CSPARSE *p
291 int n1 = 0;
292 CSARG val;
293
294 + UNUSED(csf);
295 +
296 memset(&val, 0, sizeof(val));
297 err = eval_expr(parse, args, &val);
298 if (err) return nerr_pass(err);
299 @@ -3873,6 +3903,8 @@ static NEOERR * _builtin_max (CSPARSE *p
300 long int n1 = 0;
301 long int n2 = 0;
302
303 + UNUSED(csf);
304 +
305 result->op_type = CS_TYPE_NUM;
306 result->n = 0;
307
308 @@ -3891,6 +3923,8 @@ static NEOERR * _builtin_min (CSPARSE *p
309 long int n1 = 0;
310 long int n2 = 0;
311
312 + UNUSED(csf);
313 +
314 result->op_type = CS_TYPE_NUM;
315 result->n = 0;
316
317 @@ -3910,6 +3944,8 @@ static NEOERR * _builtin_str_slice (CSPA
318 long int e = 0;
319 size_t len;
320
321 + UNUSED(csf);
322 +
323 result->op_type = CS_TYPE_STRING;
324 result->s = "";
325
326 @@ -3921,9 +3957,9 @@ static NEOERR * _builtin_str_slice (CSPA
327 if (b < 0 && e == 0) e = len;
328 if (b < 0) b += len;
329 if (e < 0) e += len;
330 - if (e > len) e = len;
331 + if (e > (int) len) e = len;
332 /* Its the whole string */
333 - if (b == 0 && e == len)
334 + if (b == 0 && e == (int) len)
335 {
336 result->s = s;
337 result->alloc = 1;
338 @@ -4179,10 +4215,10 @@ static NEOERR *cs_init_internal (CSPARSE
339 my_parse->global_hdf = parent->global_hdf;
340 my_parse->fileload = parent->fileload;
341 my_parse->fileload_ctx = parent->fileload_ctx;
342 - // This should be safe since locals handling is done entirely local to the
343 - // eval functions, not globally by the parse handling. This should
344 - // pass the locals down to the new parse context to make locals work with
345 - // lvar
346 + /* This should be safe since locals handling is done entirely local to the
347 + * eval functions, not globally by the parse handling. This should
348 + * pass the locals down to the new parse context to make locals work with
349 + * lvar */
350 my_parse->locals = parent->locals;
351 my_parse->parent = parent;
352
353 diff -pruN clearsilver-0.10.5.orig/util/dict.c clearsilver-0.10.5/util/dict.c
354 --- clearsilver-0.10.5.orig/util/dict.c 2005-07-01 02:48:26.000000000 +0200
355 +++ clearsilver-0.10.5/util/dict.c 2008-01-28 12:16:35.000000000 +0100
356 @@ -87,6 +87,8 @@ static NEOERR *dictNewItem(dictCtx dict,
357 {
358 dictItemPtr my_item;
359
360 + UNUSED(dict);
361 +
362 if (item != NULL)
363 *item = NULL;
364
365 diff -pruN clearsilver-0.10.5.orig/util/neo_date.h clearsilver-0.10.5/util/neo_date.h
366 --- clearsilver-0.10.5.orig/util/neo_date.h 2005-06-30 20:58:48.000000000 +0200
367 +++ clearsilver-0.10.5/util/neo_date.h 2008-01-28 11:36:14.000000000 +0100
368 @@ -17,10 +17,10 @@
369 __BEGIN_DECLS
370
371 /* UTC time_t -> struct tm in local timezone */
372 -void neo_time_expand (const time_t tt, const char *timezone, struct tm *ttm);
373 +void neo_time_expand (const time_t tt, const char *tz, struct tm *ttm);
374
375 /* local timezone struct tm -> time_t UTC */
376 -time_t neo_time_compact (struct tm *ttm, const char *timezone);
377 +time_t neo_time_compact (struct tm *ttm, const char *tz);
378
379 /* To be portable... in seconds */
380 long neo_tz_offset(struct tm *ttm);
381 diff -pruN clearsilver-0.10.5.orig/util/neo_files.c clearsilver-0.10.5/util/neo_files.c
382 --- clearsilver-0.10.5.orig/util/neo_files.c 2007-07-12 04:14:23.000000000 +0200
383 +++ clearsilver-0.10.5/util/neo_files.c 2008-01-28 11:53:39.000000000 +0100
384 @@ -35,7 +35,7 @@ NEOERR *ne_mkdirs (const char *path, mod
385
386 strncpy (mypath, path, sizeof(mypath));
387 x = strlen(mypath);
388 - if ((x < sizeof(mypath)) && (mypath[x-1] != '/'))
389 + if ((x < (int) sizeof(mypath)) && (mypath[x-1] != '/'))
390 {
391 mypath[x] = '/';
392 mypath[x+1] = '\0';
393 diff -pruN clearsilver-0.10.5.orig/util/neo_hash.c clearsilver-0.10.5/util/neo_hash.c
394 --- clearsilver-0.10.5.orig/util/neo_hash.c 2006-10-19 01:57:24.000000000 +0200
395 +++ clearsilver-0.10.5/util/neo_hash.c 2008-01-28 11:53:09.000000000 +0100
396 @@ -57,7 +57,7 @@ void ne_hash_destroy (NE_HASH **hash)
397
398 my_hash = *hash;
399
400 - for (x = 0; x < my_hash->size; x++)
401 + for (x = 0; x < (int) my_hash->size; x++)
402 {
403 node = my_hash->nodes[x];
404 while (node)
405 @@ -111,16 +111,16 @@ void *ne_hash_lookup(NE_HASH *hash, void
406
407 void *ne_hash_remove(NE_HASH *hash, void *key)
408 {
409 - NE_HASHNODE **node, *remove;
410 + NE_HASHNODE **node, *rem;
411 void *value = NULL;
412
413 node = _hash_lookup_node(hash, key, NULL);
414 if (*node)
415 {
416 - remove = *node;
417 - *node = remove->next;
418 - value = remove->value;
419 - free(remove);
420 + rem = *node;
421 + *node = rem->next;
422 + value = rem->value;
423 + free(rem);
424 hash->num--;
425 }
426 return value;
427 @@ -233,7 +233,7 @@ static NEOERR *_hash_resize(NE_HASH *has
428 hash->size = hash->size*2;
429
430 /* Initialize new parts */
431 - for (x = orig_size; x < hash->size; x++)
432 + for (x = orig_size; x < (int) hash->size; x++)
433 {
434 hash->nodes[x] = NULL;
435 }
436 @@ -248,7 +248,7 @@ static NEOERR *_hash_resize(NE_HASH *has
437 entry;
438 entry = prev ? prev->next : hash->nodes[x])
439 {
440 - if ((entry->hashv & hash_mask) != x)
441 + if ((int) (entry->hashv & hash_mask) != x)
442 {
443 if (prev)
444 {
445 diff -pruN clearsilver-0.10.5.orig/util/neo_hdf.c clearsilver-0.10.5/util/neo_hdf.c
446 --- clearsilver-0.10.5.orig/util/neo_hdf.c 2007-07-12 03:52:37.000000000 +0200
447 +++ clearsilver-0.10.5/util/neo_hdf.c 2008-01-28 12:24:48.000000000 +0100
448 @@ -54,7 +54,7 @@ static UINT32 hash_hdf_hash(const void *
449 }
450
451 static NEOERR *_alloc_hdf (HDF **hdf, const char *name, size_t nlen,
452 - const char *value, int dup, int wf, HDF *top)
453 + const char *value, int dupl, int wf, HDF *top)
454 {
455 *hdf = calloc (1, sizeof (HDF));
456 if (*hdf == NULL)
457 @@ -80,7 +80,7 @@ static NEOERR *_alloc_hdf (HDF **hdf, co
458 }
459 if (value != NULL)
460 {
461 - if (dup)
462 + if (dupl)
463 {
464 (*hdf)->alloc_value = 1;
465 (*hdf)->value = strdup(value);
466 @@ -233,7 +233,7 @@ static int _walk_hdf (HDF *hdf, const ch
467
468 n = name;
469 s = strchr (n, '.');
470 - x = (s == NULL) ? strlen(n) : s - n;
471 + x = (s == NULL) ? (int) strlen(n) : s - n;
472
473 while (1)
474 {
475 @@ -279,7 +279,7 @@ static int _walk_hdf (HDF *hdf, const ch
476 }
477 n = s + 1;
478 s = strchr (n, '.');
479 - x = (s == NULL) ? strlen(n) : s - n;
480 + x = (s == NULL) ? (int) strlen(n) : s - n;
481 }
482 if (hp->link)
483 {
484 @@ -570,7 +570,7 @@ NEOERR* _hdf_hash_level(HDF *hdf)
485 }
486
487 static NEOERR* _set_value (HDF *hdf, const char *name, const char *value,
488 - int dup, int wf, int link, HDF_ATTR *attr,
489 + int dupl, int wf, int lnk, HDF_ATTR *attr,
490 HDF **set_node)
491 {
492 NEOERR *err;
493 @@ -615,7 +615,7 @@ static NEOERR* _set_value (HDF *hdf, con
494 hdf->alloc_value = 0;
495 hdf->value = NULL;
496 }
497 - else if (dup)
498 + else if (dupl)
499 {
500 hdf->alloc_value = 1;
501 hdf->value = strdup(value);
502 @@ -650,7 +650,7 @@ static NEOERR* _set_value (HDF *hdf, con
503 strcpy(new_name, hdf->value);
504 strcat(new_name, ".");
505 strcat(new_name, name);
506 - err = _set_value (hdf->top, new_name, value, dup, wf, link, attr, set_node);
507 + err = _set_value (hdf->top, new_name, value, dupl, wf, lnk, attr, set_node);
508 free(new_name);
509 return nerr_pass(err);
510 }
511 @@ -719,8 +719,8 @@ skip_search:
512 }
513 else
514 {
515 - err = _alloc_hdf (&hp, n, x, value, dup, wf, hdf->top);
516 - if (link) hp->link = 1;
517 + err = _alloc_hdf (&hp, n, x, value, dupl, wf, hdf->top);
518 + if (lnk) hp->link = 1;
519 else hp->link = 0;
520 hp->attr = attr;
521 }
522 @@ -770,7 +770,7 @@ skip_search:
523 hp->alloc_value = 0;
524 hp->value = NULL;
525 }
526 - else if (dup)
527 + else if (dupl)
528 {
529 hp->alloc_value = 1;
530 hp->value = strdup(value);
531 @@ -784,7 +784,7 @@ skip_search:
532 hp->value = (char *)value;
533 }
534 }
535 - if (link) hp->link = 1;
536 + if (lnk) hp->link = 1;
537 else hp->link = 0;
538 }
539 else if (hp->link)
540 @@ -796,7 +796,7 @@ skip_search:
541 }
542 strcpy(new_name, hp->value);
543 strcat(new_name, s);
544 - err = _set_value (hdf->top, new_name, value, dup, wf, link, attr, set_node);
545 + err = _set_value (hdf->top, new_name, value, dupl, wf, lnk, attr, set_node);
546 free(new_name);
547 return nerr_pass(err);
548 }
549 @@ -1267,6 +1267,8 @@ NEOERR* hdf_dump(HDF *hdf, const char *p
550
551 NEOERR* hdf_dump_format (HDF *hdf, int lvl, FILE *fp)
552 {
553 + UNUSED(lvl);
554 +
555 return nerr_pass(hdf_dump_cb(hdf, "", DUMP_TYPE_PRETTY, 0, fp, _fp_dump_cb));
556 }
557
558 @@ -1357,7 +1359,7 @@ static int _copy_line (const char **s, c
559 int x = 0;
560 const char *st = *s;
561
562 - while (*st && x < buf_len-1)
563 + while (*st && x < (int) buf_len-1)
564 {
565 buf[x++] = *st;
566 if (*st++ == '\n') break;
567 @@ -1398,17 +1400,17 @@ static NEOERR *_copy_line_advance(const
568
569 char *_strndup(const char *s, int len) {
570 int x;
571 - char *dup;
572 + char *t;
573 if (s == NULL) return NULL;
574 - dup = (char *) malloc(len+1);
575 - if (dup == NULL) return NULL;
576 + t = (char *) malloc(len+1);
577 + if (t == NULL) return NULL;
578 for (x = 0; x < len && s[x]; x++)
579 {
580 - dup[x] = s[x];
581 + t[x] = s[x];
582 }
583 - dup[x] = '\0';
584 - dup[len] = '\0';
585 - return dup;
586 + t[x] = '\0';
587 + t[len] = '\0';
588 + return t;
589 }
590
591 /* attributes are of the form [key1, key2, key3=value, key4="repr"] */
592 diff -pruN clearsilver-0.10.5.orig/util/neo_misc.c clearsilver-0.10.5/util/neo_misc.c
593 --- clearsilver-0.10.5.orig/util/neo_misc.c 2005-12-06 05:20:13.000000000 +0100
594 +++ clearsilver-0.10.5/util/neo_misc.c 2008-01-28 11:48:48.000000000 +0100
595 @@ -34,7 +34,7 @@ void ne_vwarn (const char *fmt, va_list
596
597 localtime_r(&now, &my_tm);
598
599 - strftime(tbuf, sizeof(tbuf), "%m/%d %T", &my_tm);
600 + strftime(tbuf, sizeof(tbuf), "%m/%d %H:%M:%S", &my_tm);
601
602 vsnprintf (buf, sizeof(buf), fmt, ap);
603 len = strlen(buf);
604 diff -pruN clearsilver-0.10.5.orig/util/neo_misc.h clearsilver-0.10.5/util/neo_misc.h
605 --- clearsilver-0.10.5.orig/util/neo_misc.h 2007-07-12 04:36:32.000000000 +0200
606 +++ clearsilver-0.10.5/util/neo_misc.h 2008-01-28 11:36:14.000000000 +0100
607 @@ -106,6 +106,10 @@ typedef char BOOL;
608 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
609 #endif
610
611 +#ifndef UNUSED
612 +#define UNUSED(x) ((void)(x))
613 +#endif
614 +
615 #ifndef TRUE
616 #define TRUE 1
617 #endif
618 diff -pruN clearsilver-0.10.5.orig/util/neo_net.c clearsilver-0.10.5/util/neo_net.c
619 --- clearsilver-0.10.5.orig/util/neo_net.c 2005-12-06 05:17:08.000000000 +0100
620 +++ clearsilver-0.10.5/util/neo_net.c 2008-01-28 11:46:42.000000000 +0100
621 @@ -489,7 +489,7 @@ static NEOERR *_ne_net_read_int(NSOCK *s
622 char buf[32];
623 char *ep = NULL;
624
625 - while (x < sizeof(buf))
626 + while (x < (int) sizeof(buf))
627 {
628 while (sock->il - sock->ib > 0)
629 {
630 diff -pruN clearsilver-0.10.5.orig/util/neo_server.c clearsilver-0.10.5/util/neo_server.c
631 --- clearsilver-0.10.5.orig/util/neo_server.c 2005-06-30 20:52:00.000000000 +0200
632 +++ clearsilver-0.10.5/util/neo_server.c 2008-01-28 11:45:38.000000000 +0100
633 @@ -104,6 +104,8 @@ static int ShutdownPending = 0;
634
635 static void sig_term(int sig)
636 {
637 + UNUSED(sig);
638 +
639 ShutdownPending = 1;
640 ne_net_shutdown();
641 }
642 diff -pruN clearsilver-0.10.5.orig/util/neo_str.c clearsilver-0.10.5/util/neo_str.c
643 --- clearsilver-0.10.5.orig/util/neo_str.c 2007-07-12 03:24:00.000000000 +0200
644 +++ clearsilver-0.10.5/util/neo_str.c 2008-01-28 12:21:31.000000000 +0100
645 @@ -592,11 +592,11 @@ char *repr_string_alloc (const char *s)
646 return rs;
647 }
648
649 -// List of all characters that must be escaped
650 -// List based on http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
651 +/* List of all characters that must be escaped
652 + * List based on http://www.blooberry.com/indexdot/html/topics/urlencoding.htm */
653 static char EscapedChars[] = "$&+,/:;=?@ \"<>#%{}|\\^~[]`'";
654
655 -// Check if a single character needs to be escaped
656 +/* Check if a single character needs to be escaped */
657 static BOOL is_reserved_char(char c)
658 {
659 int i = 0;
660 @@ -835,15 +835,15 @@ NEOERR *neos_url_validate (const char *i
661 colonpos = memchr(in, ':', i);
662
663 if (colonpos == NULL) {
664 - // no scheme in 'in': so this is a relative url
665 + /* no scheme in 'in': so this is a relative url */
666 valid = 1;
667 }
668 else {
669 - for (i = 0; i < num_protocols; i++)
670 + for (i = 0; (int) i < num_protocols; i++)
671 {
672 if ((inlen >= strlen(URL_PROTOCOLS[i])) &&
673 strncmp(in, URL_PROTOCOLS[i], strlen(URL_PROTOCOLS[i])) == 0) {
674 - // 'in' starts with one of the allowed protocols
675 + /* 'in' starts with one of the allowed protocols */
676 valid = 1;
677 break;
678 }
679 @@ -854,7 +854,7 @@ NEOERR *neos_url_validate (const char *i
680 if (valid)
681 return neos_html_escape(in, inlen, esc);
682
683 - // 'in' contains an unsupported scheme, replace with '#'
684 + /* 'in' contains an unsupported scheme, replace with '#' */
685 string_init(&out_s);
686 err = string_append (&out_s, "#");
687 if (err) return nerr_pass (err);
688 diff -pruN clearsilver-0.10.5.orig/util/skiplist.c clearsilver-0.10.5/util/skiplist.c
689 --- clearsilver-0.10.5.orig/util/skiplist.c 2005-06-30 20:52:10.000000000 +0200
690 +++ clearsilver-0.10.5/util/skiplist.c 2008-01-28 12:22:54.000000000 +0100
691 @@ -409,7 +409,7 @@ NEOERR *skipNewList(skipList *skip, int
692 if (err != STATUS_OK) break;
693
694 for(i = 0; /* init header and tail */
695 - i <= list->maxLevel;
696 + i <= (UINT32) list->maxLevel;
697 i++) {
698 list->tail->next[i] = NULL;
699 list->header->next[i] = list->tail;
700 @@ -444,7 +444,7 @@ static void skipFreeAllItems(skipList li
701 }
702 /* clear header pointers */
703 for(i = 0;
704 - i <= list->maxLevel;
705 + i <= (UINT32) list->maxLevel;
706 i++)
707 list->header->next[i] = list->tail;
708