diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-01-04 19:18:32 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-01-04 19:18:40 +0100 |
commit | 0baf3c103e55a8227de32a6d43afd749538bb1a5 (patch) | |
tree | 01492d52158eea25e42b505a08a124f633813d33 /src/util | |
parent | e7e3572182bf2a0d51ae449abeee0fabbb18a0b4 (diff) | |
download | gnunet-0baf3c103e55a8227de32a6d43afd749538bb1a5.tar.gz gnunet-0baf3c103e55a8227de32a6d43afd749538bb1a5.zip |
fix misc compiler warnings
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/gnunet-config.c | 61 | ||||
-rw-r--r-- | src/util/gnunet-ecc.c | 35 | ||||
-rw-r--r-- | src/util/gnunet-resolver.c | 30 | ||||
-rw-r--r-- | src/util/gnunet-service-resolver.c | 10 | ||||
-rw-r--r-- | src/util/os_installation.c | 23 | ||||
-rw-r--r-- | src/util/os_priority.c | 1 | ||||
-rw-r--r-- | src/util/peer.c | 3 | ||||
-rw-r--r-- | src/util/program.c | 1 | ||||
-rw-r--r-- | src/util/resolver_api.c | 15 | ||||
-rw-r--r-- | src/util/scheduler.c | 25 | ||||
-rw-r--r-- | src/util/service.c | 4 | ||||
-rw-r--r-- | src/util/speedup.c | 1 | ||||
-rw-r--r-- | src/util/strings.c | 10 |
13 files changed, 153 insertions, 66 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index fb3b9ebf9..5f7d9fc0d 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -72,12 +72,17 @@ static int rewrite; | |||
72 | * @param value value of the option | 72 | * @param value value of the option |
73 | */ | 73 | */ |
74 | static void | 74 | static void |
75 | print_option (void *cls, const char *section, | 75 | print_option (void *cls, |
76 | const char *section, | ||
76 | const char *option, | 77 | const char *option, |
77 | const char *value) | 78 | const char *value) |
78 | { | 79 | { |
80 | (void) cls; | ||
81 | (void) section; | ||
79 | fprintf (stdout, | 82 | fprintf (stdout, |
80 | "%s = %s\n", option, value); | 83 | "%s = %s\n", |
84 | option, | ||
85 | value); | ||
81 | } | 86 | } |
82 | 87 | ||
83 | 88 | ||
@@ -91,7 +96,10 @@ static void | |||
91 | print_section_name (void *cls, | 96 | print_section_name (void *cls, |
92 | const char *section) | 97 | const char *section) |
93 | { | 98 | { |
94 | fprintf (stdout, "%s\n", section); | 99 | (void) cls; |
100 | fprintf (stdout, | ||
101 | "%s\n", | ||
102 | section); | ||
95 | } | 103 | } |
96 | 104 | ||
97 | 105 | ||
@@ -112,6 +120,8 @@ run (void *cls, | |||
112 | struct GNUNET_CONFIGURATION_Handle *out = NULL; | 120 | struct GNUNET_CONFIGURATION_Handle *out = NULL; |
113 | struct GNUNET_CONFIGURATION_Handle *diff = NULL; | 121 | struct GNUNET_CONFIGURATION_Handle *diff = NULL; |
114 | 122 | ||
123 | (void) cls; | ||
124 | (void) args; | ||
115 | if (rewrite) | 125 | if (rewrite) |
116 | { | 126 | { |
117 | struct GNUNET_CONFIGURATION_Handle *def; | 127 | struct GNUNET_CONFIGURATION_Handle *def; |
@@ -221,36 +231,37 @@ run (void *cls, | |||
221 | * @return 0 ok, 1 on error | 231 | * @return 0 ok, 1 on error |
222 | */ | 232 | */ |
223 | int | 233 | int |
224 | main (int argc, char *const *argv) | 234 | main (int argc, |
235 | char *const *argv) | ||
225 | { | 236 | { |
226 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 237 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
227 | GNUNET_GETOPT_option_flag ('f', | 238 | GNUNET_GETOPT_option_flag ('f', |
228 | "filename", | 239 | "filename", |
229 | gettext_noop ("obtain option of value as a filename (with $-expansion)"), | 240 | gettext_noop ("obtain option of value as a filename (with $-expansion)"), |
230 | &is_filename), | 241 | &is_filename), |
231 | GNUNET_GETOPT_option_string ('s', | 242 | GNUNET_GETOPT_option_string ('s', |
232 | "section", | 243 | "section", |
233 | "SECTION", | 244 | "SECTION", |
234 | gettext_noop ("name of the section to access"), | 245 | gettext_noop ("name of the section to access"), |
235 | §ion), | 246 | §ion), |
236 | GNUNET_GETOPT_option_string ('o', | 247 | GNUNET_GETOPT_option_string ('o', |
237 | "option", | 248 | "option", |
238 | "OPTION", | 249 | "OPTION", |
239 | gettext_noop ("name of the option to access"), | 250 | gettext_noop ("name of the option to access"), |
240 | &option), | 251 | &option), |
241 | GNUNET_GETOPT_option_string ('V', | 252 | GNUNET_GETOPT_option_string ('V', |
242 | "value", | 253 | "value", |
243 | "VALUE", | 254 | "VALUE", |
244 | gettext_noop ("value to set"), | 255 | gettext_noop ("value to set"), |
245 | &value), | 256 | &value), |
246 | GNUNET_GETOPT_option_flag ('S', | 257 | GNUNET_GETOPT_option_flag ('S', |
247 | "list-sections", | 258 | "list-sections", |
248 | gettext_noop ("print available configuration sections"), | 259 | gettext_noop ("print available configuration sections"), |
249 | &list_sections), | 260 | &list_sections), |
250 | GNUNET_GETOPT_option_flag ('w', | 261 | GNUNET_GETOPT_option_flag ('w', |
251 | "rewrite", | 262 | "rewrite", |
252 | gettext_noop ("write configuration file that only contains delta to defaults"), | 263 | gettext_noop ("write configuration file that only contains delta to defaults"), |
253 | &rewrite), | 264 | &rewrite), |
254 | GNUNET_GETOPT_OPTION_END | 265 | GNUNET_GETOPT_OPTION_END |
255 | }; | 266 | }; |
256 | if (GNUNET_OK != | 267 | if (GNUNET_OK != |
diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c index 66a4bd3e9..59a100a8c 100644 --- a/src/util/gnunet-ecc.c +++ b/src/util/gnunet-ecc.c | |||
@@ -281,8 +281,10 @@ print_key (const char *filename) | |||
281 | uint64_t fs; | 281 | uint64_t fs; |
282 | unsigned int total_hostkeys; | 282 | unsigned int total_hostkeys; |
283 | unsigned int c; | 283 | unsigned int c; |
284 | ssize_t sret; | ||
284 | 285 | ||
285 | if (GNUNET_YES != GNUNET_DISK_file_test (filename)) | 286 | if (GNUNET_YES != |
287 | GNUNET_DISK_file_test (filename)) | ||
286 | { | 288 | { |
287 | fprintf (stderr, | 289 | fprintf (stderr, |
288 | _("Hostkeys file `%s' not found\n"), | 290 | _("Hostkeys file `%s' not found\n"), |
@@ -291,7 +293,11 @@ print_key (const char *filename) | |||
291 | } | 293 | } |
292 | 294 | ||
293 | /* Check hostkey file size, read entire thing into memory */ | 295 | /* Check hostkey file size, read entire thing into memory */ |
294 | if (GNUNET_OK != GNUNET_DISK_file_size (filename, &fs, GNUNET_YES, GNUNET_YES)) | 296 | if (GNUNET_OK != |
297 | GNUNET_DISK_file_size (filename, | ||
298 | &fs, | ||
299 | GNUNET_YES, | ||
300 | GNUNET_YES)) | ||
295 | fs = 0; | 301 | fs = 0; |
296 | if (0 == fs) | 302 | if (0 == fs) |
297 | { | 303 | { |
@@ -307,15 +313,22 @@ print_key (const char *filename) | |||
307 | filename); | 313 | filename); |
308 | return; | 314 | return; |
309 | } | 315 | } |
310 | fd = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READ, | 316 | fd = GNUNET_DISK_file_open (filename, |
311 | GNUNET_DISK_PERM_NONE); | 317 | GNUNET_DISK_OPEN_READ, |
318 | GNUNET_DISK_PERM_NONE); | ||
312 | if (NULL == fd) | 319 | if (NULL == fd) |
313 | { | 320 | { |
314 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", filename); | 321 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, |
322 | "open", | ||
323 | filename); | ||
315 | return; | 324 | return; |
316 | } | 325 | } |
317 | hostkeys_data = GNUNET_malloc (fs); | 326 | hostkeys_data = GNUNET_malloc (fs); |
318 | if (fs != GNUNET_DISK_file_read (fd, hostkeys_data, fs)) | 327 | sret = GNUNET_DISK_file_read (fd, |
328 | hostkeys_data, | ||
329 | fs); | ||
330 | if ( (sret < 0) || | ||
331 | (fs != (size_t) sret) ) | ||
319 | { | 332 | { |
320 | fprintf (stderr, | 333 | fprintf (stderr, |
321 | _("Could not read hostkey file: %s\n"), | 334 | _("Could not read hostkey file: %s\n"), |
@@ -351,15 +364,21 @@ print_key (const char *filename) | |||
351 | /** | 364 | /** |
352 | * Main function that will be run by the scheduler. | 365 | * Main function that will be run by the scheduler. |
353 | * | 366 | * |
354 | * @param cls closure | 367 | * @param cls closure, NULL |
355 | * @param args remaining command-line arguments | 368 | * @param args remaining command-line arguments |
356 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) | 369 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) |
357 | * @param cfg configuration | 370 | * @param cfg configuration |
358 | */ | 371 | */ |
359 | static void | 372 | static void |
360 | run (void *cls, char *const *args, const char *cfgfile, | 373 | run (void *cls, |
374 | char *const *args, | ||
375 | const char *cfgfile, | ||
361 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 376 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
362 | { | 377 | { |
378 | (void) cls; | ||
379 | (void) cfgfile; | ||
380 | (void) cfg; | ||
381 | |||
363 | if (print_examples_flag) | 382 | if (print_examples_flag) |
364 | { | 383 | { |
365 | print_examples (); | 384 | print_examples (); |
diff --git a/src/util/gnunet-resolver.c b/src/util/gnunet-resolver.c index 7ffafee32..4954e0398 100644 --- a/src/util/gnunet-resolver.c +++ b/src/util/gnunet-resolver.c | |||
@@ -46,9 +46,12 @@ static void | |||
46 | print_hostname (void *cls, | 46 | print_hostname (void *cls, |
47 | const char *hostname) | 47 | const char *hostname) |
48 | { | 48 | { |
49 | (void) cls; | ||
49 | if (NULL == hostname) | 50 | if (NULL == hostname) |
50 | return; | 51 | return; |
51 | FPRINTF (stdout, "%s\n", hostname); | 52 | FPRINTF (stdout, |
53 | "%s\n", | ||
54 | hostname); | ||
52 | } | 55 | } |
53 | 56 | ||
54 | 57 | ||
@@ -60,11 +63,17 @@ print_hostname (void *cls, | |||
60 | * @param addrlen length of the address | 63 | * @param addrlen length of the address |
61 | */ | 64 | */ |
62 | static void | 65 | static void |
63 | print_sockaddr (void *cls, const struct sockaddr *addr, socklen_t addrlen) | 66 | print_sockaddr (void *cls, |
67 | const struct sockaddr *addr, | ||
68 | socklen_t addrlen) | ||
64 | { | 69 | { |
70 | (void) cls; | ||
65 | if (NULL == addr) | 71 | if (NULL == addr) |
66 | return; | 72 | return; |
67 | FPRINTF (stdout, "%s\n", GNUNET_a2s (addr, addrlen)); | 73 | FPRINTF (stdout, |
74 | "%s\n", | ||
75 | GNUNET_a2s (addr, | ||
76 | addrlen)); | ||
68 | } | 77 | } |
69 | 78 | ||
70 | 79 | ||
@@ -77,7 +86,9 @@ print_sockaddr (void *cls, const struct sockaddr *addr, socklen_t addrlen) | |||
77 | * @param cfg configuration | 86 | * @param cfg configuration |
78 | */ | 87 | */ |
79 | static void | 88 | static void |
80 | run (void *cls, char *const *args, const char *cfgfile, | 89 | run (void *cls, |
90 | char *const *args, | ||
91 | const char *cfgfile, | ||
81 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 92 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
82 | { | 93 | { |
83 | const struct sockaddr *sa; | 94 | const struct sockaddr *sa; |
@@ -85,11 +96,18 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
85 | struct sockaddr_in v4; | 96 | struct sockaddr_in v4; |
86 | struct sockaddr_in6 v6; | 97 | struct sockaddr_in6 v6; |
87 | 98 | ||
88 | if (args[0] == NULL) | 99 | (void) cls; |
100 | (void) cfgfile; | ||
101 | (void) cfg; | ||
102 | if (NULL == args[0]) | ||
89 | return; | 103 | return; |
90 | if (! reverse) | 104 | if (! reverse) |
91 | { | 105 | { |
92 | GNUNET_RESOLVER_ip_get (args[0], AF_UNSPEC, GET_TIMEOUT, &print_sockaddr, NULL); | 106 | GNUNET_RESOLVER_ip_get (args[0], |
107 | AF_UNSPEC, | ||
108 | GET_TIMEOUT, | ||
109 | &print_sockaddr, | ||
110 | NULL); | ||
93 | return; | 111 | return; |
94 | } | 112 | } |
95 | 113 | ||
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index d26bdd212..ccb592349 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c | |||
@@ -582,7 +582,7 @@ get_ip_from_hostname (struct GNUNET_SERVICE_Client *client, | |||
582 | /** | 582 | /** |
583 | * Verify well-formedness of GET-message. | 583 | * Verify well-formedness of GET-message. |
584 | * | 584 | * |
585 | * @param cls closure | 585 | * @param cls closure, unused |
586 | * @param get the actual message | 586 | * @param get the actual message |
587 | * @return #GNUNET_OK if @a get is well-formed | 587 | * @return #GNUNET_OK if @a get is well-formed |
588 | */ | 588 | */ |
@@ -594,6 +594,7 @@ check_get (void *cls, | |||
594 | int direction; | 594 | int direction; |
595 | int af; | 595 | int af; |
596 | 596 | ||
597 | (void) cls; | ||
597 | size = ntohs (get->header.size) - sizeof (*get); | 598 | size = ntohs (get->header.size) - sizeof (*get); |
598 | direction = ntohl (get->direction); | 599 | direction = ntohl (get->direction); |
599 | if (GNUNET_NO == direction) | 600 | if (GNUNET_NO == direction) |
@@ -688,7 +689,7 @@ handle_get (void *cls, | |||
688 | /** | 689 | /** |
689 | * Callback called when a client connects to the service. | 690 | * Callback called when a client connects to the service. |
690 | * | 691 | * |
691 | * @param cls closure for the service | 692 | * @param cls closure for the service, unused |
692 | * @param c the new client that connected to the service | 693 | * @param c the new client that connected to the service |
693 | * @param mq the message queue used to send messages to the client | 694 | * @param mq the message queue used to send messages to the client |
694 | * @return @a c | 695 | * @return @a c |
@@ -698,6 +699,9 @@ connect_cb (void *cls, | |||
698 | struct GNUNET_SERVICE_Client *c, | 699 | struct GNUNET_SERVICE_Client *c, |
699 | struct GNUNET_MQ_Handle *mq) | 700 | struct GNUNET_MQ_Handle *mq) |
700 | { | 701 | { |
702 | (void) cls; | ||
703 | (void) mq; | ||
704 | |||
701 | return c; | 705 | return c; |
702 | } | 706 | } |
703 | 707 | ||
@@ -714,6 +718,8 @@ disconnect_cb (void *cls, | |||
714 | struct GNUNET_SERVICE_Client *c, | 718 | struct GNUNET_SERVICE_Client *c, |
715 | void *internal_cls) | 719 | void *internal_cls) |
716 | { | 720 | { |
721 | (void) cls; | ||
722 | |||
717 | GNUNET_assert (c == internal_cls); | 723 | GNUNET_assert (c == internal_cls); |
718 | } | 724 | } |
719 | 725 | ||
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 1226c5966..2e35de681 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2006-2016 GNUnet e.V. | 3 | Copyright (C) 2006-2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -152,14 +152,21 @@ get_path_from_proc_exe () | |||
152 | ssize_t size; | 152 | ssize_t size; |
153 | char *lep; | 153 | char *lep; |
154 | 154 | ||
155 | GNUNET_snprintf (fn, sizeof (fn), "/proc/%u/exe", getpid ()); | 155 | GNUNET_snprintf (fn, |
156 | size = readlink (fn, lnk, sizeof (lnk) - 1); | 156 | sizeof (fn), |
157 | "/proc/%u/exe", | ||
158 | getpid ()); | ||
159 | size = readlink (fn, | ||
160 | lnk, | ||
161 | sizeof (lnk) - 1); | ||
157 | if (size <= 0) | 162 | if (size <= 0) |
158 | { | 163 | { |
159 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "readlink", fn); | 164 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, |
165 | "readlink", | ||
166 | fn); | ||
160 | return NULL; | 167 | return NULL; |
161 | } | 168 | } |
162 | GNUNET_assert (size < sizeof (lnk)); | 169 | GNUNET_assert ( ((size_t) size) < sizeof (lnk)); |
163 | lnk[size] = '\0'; | 170 | lnk[size] = '\0'; |
164 | while ((lnk[size] != '/') && (size > 0)) | 171 | while ((lnk[size] != '/') && (size > 0)) |
165 | size--; | 172 | size--; |
@@ -167,12 +174,13 @@ get_path_from_proc_exe () | |||
167 | "/%s/libexec/", | 174 | "/%s/libexec/", |
168 | current_pd->project_dirname); | 175 | current_pd->project_dirname); |
169 | /* test for being in lib/gnunet/libexec/ or lib/MULTIARCH/gnunet/libexec */ | 176 | /* test for being in lib/gnunet/libexec/ or lib/MULTIARCH/gnunet/libexec */ |
170 | if ( (size > strlen (lep)) && | 177 | if ( (((size_t) size) > strlen (lep)) && |
171 | (0 == strcmp (lep, | 178 | (0 == strcmp (lep, |
172 | &lnk[size - strlen (lep)])) ) | 179 | &lnk[size - strlen (lep)])) ) |
173 | size -= strlen (lep) - 1; | 180 | size -= strlen (lep) - 1; |
174 | GNUNET_free (lep); | 181 | GNUNET_free (lep); |
175 | if ((size < 4) || (lnk[size - 4] != '/')) | 182 | if ( (size < 4) || |
183 | (lnk[size - 4] != '/') ) | ||
176 | { | 184 | { |
177 | /* not installed in "/bin/" -- binary path probably useless */ | 185 | /* not installed in "/bin/" -- binary path probably useless */ |
178 | return NULL; | 186 | return NULL; |
@@ -903,6 +911,7 @@ GNUNET_OS_check_helper_binary (const char *binary, | |||
903 | if (check_suid) | 911 | if (check_suid) |
904 | { | 912 | { |
905 | #ifndef MINGW | 913 | #ifndef MINGW |
914 | (void) params; | ||
906 | if ( (0 != (statbuf.st_mode & S_ISUID)) && | 915 | if ( (0 != (statbuf.st_mode & S_ISUID)) && |
907 | (0 == statbuf.st_uid) ) | 916 | (0 == statbuf.st_uid) ) |
908 | { | 917 | { |
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 2c4f7ca09..98998b520 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -154,6 +154,7 @@ GNUNET_OS_install_parent_control_handler (void *cls) | |||
154 | struct GNUNET_DISK_FileHandle *control_pipe; | 154 | struct GNUNET_DISK_FileHandle *control_pipe; |
155 | uint64_t pipe_fd; | 155 | uint64_t pipe_fd; |
156 | 156 | ||
157 | (void) cls; | ||
157 | if (NULL != pch) | 158 | if (NULL != pch) |
158 | { | 159 | { |
159 | /* already done, we've been called twice... */ | 160 | /* already done, we've been called twice... */ |
diff --git a/src/util/peer.c b/src/util/peer.c index b637dc229..b1c65fbcf 100644 --- a/src/util/peer.c +++ b/src/util/peer.c | |||
@@ -201,7 +201,8 @@ GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta) | |||
201 | return; | 201 | return; |
202 | GNUNET_assert (id < size); | 202 | GNUNET_assert (id < size); |
203 | GNUNET_assert (table[id]->rc > 0); | 203 | GNUNET_assert (table[id]->rc > 0); |
204 | GNUNET_assert ((delta >= 0) || (table[id]->rc >= -delta)); | 204 | GNUNET_assert ( (delta >= 0) || |
205 | (table[id]->rc >= (unsigned int) (-delta)) ); | ||
205 | table[id]->rc += delta; | 206 | table[id]->rc += delta; |
206 | if (0 == table[id]->rc) | 207 | if (0 == table[id]->rc) |
207 | { | 208 | { |
diff --git a/src/util/program.c b/src/util/program.c index 233792387..9e3037b8b 100644 --- a/src/util/program.c +++ b/src/util/program.c | |||
@@ -74,6 +74,7 @@ struct CommandContext | |||
74 | static void | 74 | static void |
75 | shutdown_task (void *cls) | 75 | shutdown_task (void *cls) |
76 | { | 76 | { |
77 | (void) cls; | ||
77 | GNUNET_SPEEDUP_stop_ (); | 78 | GNUNET_SPEEDUP_stop_ (); |
78 | } | 79 | } |
79 | 80 | ||
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index 84f541ba0..bd46b4fbb 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2009-2016 GNUnet e.V. | 3 | Copyright (C) 2009-2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -214,7 +214,8 @@ check_config () | |||
214 | for (unsigned int i = 0; | 214 | for (unsigned int i = 0; |
215 | NULL != loopback[i]; | 215 | NULL != loopback[i]; |
216 | i++) | 216 | i++) |
217 | if (0 == strcasecmp (loopback[i], hostname)) | 217 | if (0 == strcasecmp (loopback[i], |
218 | hostname)) | ||
218 | { | 219 | { |
219 | GNUNET_free (hostname); | 220 | GNUNET_free (hostname); |
220 | return GNUNET_OK; | 221 | return GNUNET_OK; |
@@ -285,6 +286,7 @@ GNUNET_RESOLVER_disconnect () | |||
285 | static void | 286 | static void |
286 | shutdown_task (void *cls) | 287 | shutdown_task (void *cls) |
287 | { | 288 | { |
289 | (void) cls; | ||
288 | s_task = NULL; | 290 | s_task = NULL; |
289 | GNUNET_RESOLVER_disconnect (); | 291 | GNUNET_RESOLVER_disconnect (); |
290 | backoff = GNUNET_TIME_UNIT_MILLISECONDS; | 292 | backoff = GNUNET_TIME_UNIT_MILLISECONDS; |
@@ -387,10 +389,12 @@ static void | |||
387 | mq_error_handler (void *cls, | 389 | mq_error_handler (void *cls, |
388 | enum GNUNET_MQ_Error error) | 390 | enum GNUNET_MQ_Error error) |
389 | { | 391 | { |
392 | (void) cls; | ||
390 | GNUNET_MQ_destroy (mq); | 393 | GNUNET_MQ_destroy (mq); |
391 | mq = NULL; | 394 | mq = NULL; |
392 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 395 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
393 | "MQ error, reconnecting\n"); | 396 | "MQ error %d, reconnecting\n", |
397 | error); | ||
394 | reconnect (); | 398 | reconnect (); |
395 | } | 399 | } |
396 | 400 | ||
@@ -449,6 +453,9 @@ static int | |||
449 | check_response (void *cls, | 453 | check_response (void *cls, |
450 | const struct GNUNET_MessageHeader *msg) | 454 | const struct GNUNET_MessageHeader *msg) |
451 | { | 455 | { |
456 | (void) cls; | ||
457 | (void) msg; | ||
458 | |||
452 | /* implemented in #handle_response() for now */ | 459 | /* implemented in #handle_response() for now */ |
453 | return GNUNET_OK; | 460 | return GNUNET_OK; |
454 | } | 461 | } |
@@ -470,6 +477,7 @@ handle_response (void *cls, | |||
470 | uint16_t size; | 477 | uint16_t size; |
471 | char *nret; | 478 | char *nret; |
472 | 479 | ||
480 | (void) cls; | ||
473 | GNUNET_assert (NULL != rh); | 481 | GNUNET_assert (NULL != rh); |
474 | size = ntohs (msg->size); | 482 | size = ntohs (msg->size); |
475 | if (size == sizeof (struct GNUNET_MessageHeader)) | 483 | if (size == sizeof (struct GNUNET_MessageHeader)) |
@@ -743,6 +751,7 @@ reconnect_task (void *cls) | |||
743 | GNUNET_MQ_handler_end () | 751 | GNUNET_MQ_handler_end () |
744 | }; | 752 | }; |
745 | 753 | ||
754 | (void) cls; | ||
746 | r_task = NULL; | 755 | r_task = NULL; |
747 | if (NULL == req_head) | 756 | if (NULL == req_head) |
748 | return; /* no work pending */ | 757 | return; /* no work pending */ |
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 992f8fdff..7bd19df7a 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -847,16 +847,19 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
847 | * @param et the event type to be set in each FdInfo after calling | 847 | * @param et the event type to be set in each FdInfo after calling |
848 | * @a driver_func on it, or -1 if no updating not desired. | 848 | * @a driver_func on it, or -1 if no updating not desired. |
849 | */ | 849 | */ |
850 | void driver_add_multiple (struct GNUNET_SCHEDULER_Task *t, | 850 | static void |
851 | enum GNUNET_SCHEDULER_EventType et) | 851 | driver_add_multiple (struct GNUNET_SCHEDULER_Task *t, |
852 | enum GNUNET_SCHEDULER_EventType et) | ||
852 | { | 853 | { |
853 | struct GNUNET_SCHEDULER_FdInfo *fdi; | 854 | struct GNUNET_SCHEDULER_FdInfo *fdi; |
854 | int success = GNUNET_YES; | 855 | int success = GNUNET_YES; |
855 | 856 | ||
856 | for (int i = 0; i != t->fds_len; ++i) | 857 | for (unsigned int i = 0; i != t->fds_len; ++i) |
857 | { | 858 | { |
858 | fdi = &t->fds[i]; | 859 | fdi = &t->fds[i]; |
859 | success = scheduler_driver->add (scheduler_driver->cls, t, fdi) && success; | 860 | success = scheduler_driver->add (scheduler_driver->cls, |
861 | t, | ||
862 | fdi) && success; | ||
860 | if (et != -1) | 863 | if (et != -1) |
861 | { | 864 | { |
862 | fdi->et = et; | 865 | fdi->et = et; |
@@ -870,12 +873,13 @@ void driver_add_multiple (struct GNUNET_SCHEDULER_Task *t, | |||
870 | } | 873 | } |
871 | 874 | ||
872 | 875 | ||
873 | void | 876 | static void |
874 | shutdown_cb (void *cls) | 877 | shutdown_cb (void *cls) |
875 | { | 878 | { |
876 | char c; | 879 | char c; |
877 | const struct GNUNET_DISK_FileHandle *pr; | 880 | const struct GNUNET_DISK_FileHandle *pr; |
878 | 881 | ||
882 | (void) cls; | ||
879 | pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle, | 883 | pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle, |
880 | GNUNET_DISK_PIPE_END_READ); | 884 | GNUNET_DISK_PIPE_END_READ); |
881 | GNUNET_assert (! GNUNET_DISK_handle_invalid (pr)); | 885 | GNUNET_assert (! GNUNET_DISK_handle_invalid (pr)); |
@@ -975,6 +979,8 @@ init_backtrace (struct GNUNET_SCHEDULER_Task *t) | |||
975 | backtrace_symbols (backtrace_array, | 979 | backtrace_symbols (backtrace_array, |
976 | t->num_backtrace_strings); | 980 | t->num_backtrace_strings); |
977 | dump_backtrace (t); | 981 | dump_backtrace (t); |
982 | #else | ||
983 | (void) t; | ||
978 | #endif | 984 | #endif |
979 | } | 985 | } |
980 | 986 | ||
@@ -1664,14 +1670,15 @@ extract_handles (struct GNUNET_SCHEDULER_Task *t, | |||
1664 | // in fdset must be handled separately | 1670 | // in fdset must be handled separately |
1665 | const struct GNUNET_NETWORK_Handle **nhandles; | 1671 | const struct GNUNET_NETWORK_Handle **nhandles; |
1666 | const struct GNUNET_DISK_FileHandle **fhandles; | 1672 | const struct GNUNET_DISK_FileHandle **fhandles; |
1667 | unsigned int nhandles_len, fhandles_len; | 1673 | unsigned int nhandles_len; |
1668 | int sock; | 1674 | unsigned int fhandles_len; |
1669 | 1675 | ||
1676 | (void) t; | ||
1670 | nhandles = NULL; | 1677 | nhandles = NULL; |
1671 | fhandles = NULL; | 1678 | fhandles = NULL; |
1672 | nhandles_len = 0; | 1679 | nhandles_len = 0; |
1673 | fhandles_len = 0; | 1680 | fhandles_len = 0; |
1674 | for (sock = 0; sock != fdset->nsds; ++sock) | 1681 | for (int sock = 0; sock != fdset->nsds; ++sock) |
1675 | { | 1682 | { |
1676 | if (GNUNET_YES == GNUNET_NETWORK_fdset_test_native (fdset, sock)) | 1683 | if (GNUNET_YES == GNUNET_NETWORK_fdset_test_native (fdset, sock)) |
1677 | { | 1684 | { |
@@ -1969,7 +1976,7 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh) | |||
1969 | // FIXME: do we have to remove FdInfos from fds if they are not ready? | 1976 | // FIXME: do we have to remove FdInfos from fds if they are not ready? |
1970 | tc.fds_len = pos->fds_len; | 1977 | tc.fds_len = pos->fds_len; |
1971 | tc.fds = pos->fds; | 1978 | tc.fds = pos->fds; |
1972 | for (int i = 0; i != pos->fds_len; ++i) | 1979 | for (unsigned int i = 0; i != pos->fds_len; ++i) |
1973 | { | 1980 | { |
1974 | struct GNUNET_SCHEDULER_FdInfo *fdi = &pos->fds[i]; | 1981 | struct GNUNET_SCHEDULER_FdInfo *fdi = &pos->fds[i]; |
1975 | if (0 != (GNUNET_SCHEDULER_ET_IN & fdi->et)) | 1982 | if (0 != (GNUNET_SCHEDULER_ET_IN & fdi->et)) |
diff --git a/src/util/service.c b/src/util/service.c index b4eb33caa..1156093f4 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -1978,7 +1978,7 @@ do_send (void *cls) | |||
1978 | GNUNET_MQ_impl_send_in_flight (client->mq); | 1978 | GNUNET_MQ_impl_send_in_flight (client->mq); |
1979 | } | 1979 | } |
1980 | client->msg_pos += ret; | 1980 | client->msg_pos += ret; |
1981 | if (left > ret) | 1981 | if (left > (size_t) ret) |
1982 | { | 1982 | { |
1983 | GNUNET_assert (NULL == client->drop_task); | 1983 | GNUNET_assert (NULL == client->drop_task); |
1984 | client->send_task | 1984 | client->send_task |
@@ -2007,6 +2007,7 @@ service_mq_send (struct GNUNET_MQ_Handle *mq, | |||
2007 | { | 2007 | { |
2008 | struct GNUNET_SERVICE_Client *client = impl_state; | 2008 | struct GNUNET_SERVICE_Client *client = impl_state; |
2009 | 2009 | ||
2010 | (void) mq; | ||
2010 | if (NULL != client->drop_task) | 2011 | if (NULL != client->drop_task) |
2011 | return; /* we're going down right now, do not try to send */ | 2012 | return; /* we're going down right now, do not try to send */ |
2012 | GNUNET_assert (NULL == client->send_task); | 2013 | GNUNET_assert (NULL == client->send_task); |
@@ -2036,6 +2037,7 @@ service_mq_cancel (struct GNUNET_MQ_Handle *mq, | |||
2036 | { | 2037 | { |
2037 | struct GNUNET_SERVICE_Client *client = impl_state; | 2038 | struct GNUNET_SERVICE_Client *client = impl_state; |
2038 | 2039 | ||
2040 | (void) mq; | ||
2039 | GNUNET_assert (0 == client->msg_pos); | 2041 | GNUNET_assert (0 == client->msg_pos); |
2040 | client->msg = NULL; | 2042 | client->msg = NULL; |
2041 | GNUNET_SCHEDULER_cancel (client->send_task); | 2043 | GNUNET_SCHEDULER_cancel (client->send_task); |
diff --git a/src/util/speedup.c b/src/util/speedup.c index c6a4cf678..f5e81f16b 100644 --- a/src/util/speedup.c +++ b/src/util/speedup.c | |||
@@ -42,6 +42,7 @@ do_speedup (void *cls) | |||
42 | { | 42 | { |
43 | static long long current_offset; | 43 | static long long current_offset; |
44 | 44 | ||
45 | (void) cls; | ||
45 | speedup_task = NULL; | 46 | speedup_task = NULL; |
46 | current_offset += delta.rel_value_us; | 47 | current_offset += delta.rel_value_us; |
47 | GNUNET_TIME_set_offset (current_offset); | 48 | GNUNET_TIME_set_offset (current_offset); |
diff --git a/src/util/strings.c b/src/util/strings.c index f554a9e83..4cfcd63b3 100644 --- a/src/util/strings.c +++ b/src/util/strings.c | |||
@@ -1069,11 +1069,13 @@ GNUNET_STRINGS_string_to_data (const char *enc, size_t enclen, | |||
1069 | * (if they weren't NULL). | 1069 | * (if they weren't NULL). |
1070 | */ | 1070 | */ |
1071 | int | 1071 | int |
1072 | GNUNET_STRINGS_parse_uri (const char *path, char **scheme_part, | 1072 | GNUNET_STRINGS_parse_uri (const char *path, |
1073 | const char **path_part) | 1073 | char **scheme_part, |
1074 | const char **path_part) | ||
1074 | { | 1075 | { |
1075 | size_t len; | 1076 | size_t len; |
1076 | int i, end; | 1077 | size_t i; |
1078 | int end; | ||
1077 | int pp_state = 0; | 1079 | int pp_state = 0; |
1078 | const char *post_scheme_part = NULL; | 1080 | const char *post_scheme_part = NULL; |
1079 | len = strlen (path); | 1081 | len = strlen (path); |
@@ -1082,7 +1084,7 @@ GNUNET_STRINGS_parse_uri (const char *path, char **scheme_part, | |||
1082 | switch (pp_state) | 1084 | switch (pp_state) |
1083 | { | 1085 | { |
1084 | case 0: | 1086 | case 0: |
1085 | if (path[i] == ':' && i > 0) | 1087 | if ( (path[i] == ':') && (i > 0) ) |
1086 | { | 1088 | { |
1087 | pp_state += 1; | 1089 | pp_state += 1; |
1088 | continue; | 1090 | continue; |