diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-31 13:03:48 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-31 13:03:48 +0100 |
commit | 7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch) | |
tree | bdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/util | |
parent | 01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff) | |
download | gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip |
tighten formatting rules
Diffstat (limited to 'src/util')
87 files changed, 227 insertions, 74 deletions
diff --git a/src/util/client.c b/src/util/client.c index d431909cf..024f34b3a 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -45,7 +45,6 @@ | |||
45 | GNUNET_TIME_UNIT_SECONDS, 5) | 45 | GNUNET_TIME_UNIT_SECONDS, 5) |
46 | 46 | ||
47 | 47 | ||
48 | |||
49 | /** | 48 | /** |
50 | * Internal state for a client connected to a GNUnet service. | 49 | * Internal state for a client connected to a GNUnet service. |
51 | */ | 50 | */ |
@@ -1109,4 +1108,5 @@ GNUNET_CLIENT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1109 | return cstate->mq; | 1108 | return cstate->mq; |
1110 | } | 1109 | } |
1111 | 1110 | ||
1111 | |||
1112 | /* end of client.c */ | 1112 | /* end of client.c */ |
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index 358c09808..137af7b85 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -361,6 +361,8 @@ strnlen (const char *s, size_t n) | |||
361 | return n; | 361 | return n; |
362 | return e - s; | 362 | return e - s; |
363 | } | 363 | } |
364 | |||
365 | |||
364 | #endif | 366 | #endif |
365 | 367 | ||
366 | 368 | ||
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 3ff9bf18e..d13f3a7fa 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -401,6 +401,8 @@ setup_log_file (const struct tm *tm) | |||
401 | GNUNET_stderr = altlog; | 401 | GNUNET_stderr = altlog; |
402 | return GNUNET_OK; | 402 | return GNUNET_OK; |
403 | } | 403 | } |
404 | |||
405 | |||
404 | #endif | 406 | #endif |
405 | 407 | ||
406 | 408 | ||
@@ -504,7 +506,7 @@ GNUNET_get_log_call_status (int caller_level, | |||
504 | { | 506 | { |
505 | ld = &logdefs[i]; | 507 | ld = &logdefs[i]; |
506 | if (((! force_only) || ld->force) && | 508 | if (((! force_only) || ld->force) && |
507 | ((line >= ld->from_line) &&(line <= ld->to_line) ) && | 509 | ((line >= ld->from_line) && (line <= ld->to_line) ) && |
508 | (0 == regexec (&ld->component_regex, comp, 0, NULL, 0)) && | 510 | (0 == regexec (&ld->component_regex, comp, 0, NULL, 0)) && |
509 | (0 == regexec (&ld->file_regex, file, 0, NULL, 0)) && | 511 | (0 == regexec (&ld->file_regex, file, 0, NULL, 0)) && |
510 | (0 == regexec (&ld->function_regex, function, 0, NULL, 0))) | 512 | (0 == regexec (&ld->function_regex, function, 0, NULL, 0))) |
@@ -693,6 +695,8 @@ parse_all_definitions () | |||
693 | parse_definitions ("GNUNET_LOG", 0); | 695 | parse_definitions ("GNUNET_LOG", 0); |
694 | gnunet_log_parsed = GNUNET_YES; | 696 | gnunet_log_parsed = GNUNET_YES; |
695 | } | 697 | } |
698 | |||
699 | |||
696 | #endif | 700 | #endif |
697 | 701 | ||
698 | 702 | ||
@@ -823,8 +827,7 @@ output_message (enum GNUNET_ErrorType kind, | |||
823 | * interactively, yet the same message shouldn't look | 827 | * interactively, yet the same message shouldn't look |
824 | * this way if the output is going to logfiles or robots | 828 | * this way if the output is going to logfiles or robots |
825 | * instead. | 829 | * instead. |
826 | */ | 830 | */fprintf (GNUNET_stderr, "* %s", msg); |
827 | fprintf (GNUNET_stderr, "* %s", msg); | ||
828 | } | 831 | } |
829 | else if (GNUNET_YES == current_async_scope.have_scope) | 832 | else if (GNUNET_YES == current_async_scope.have_scope) |
830 | { | 833 | { |
@@ -1545,7 +1548,8 @@ GNUNET_async_scope_get (struct GNUNET_AsyncScopeSave *scope_ret) | |||
1545 | /** | 1548 | /** |
1546 | * Initializer | 1549 | * Initializer |
1547 | */ | 1550 | */ |
1548 | void __attribute__ ((constructor)) GNUNET_util_cl_init () | 1551 | void __attribute__ ((constructor)) |
1552 | GNUNET_util_cl_init () | ||
1549 | { | 1553 | { |
1550 | GNUNET_stderr = stderr; | 1554 | GNUNET_stderr = stderr; |
1551 | } | 1555 | } |
@@ -1554,9 +1558,11 @@ void __attribute__ ((constructor)) GNUNET_util_cl_init () | |||
1554 | /** | 1558 | /** |
1555 | * Destructor | 1559 | * Destructor |
1556 | */ | 1560 | */ |
1557 | void __attribute__ ((destructor)) GNUNET_util_cl_fini () | 1561 | void __attribute__ ((destructor)) |
1562 | GNUNET_util_cl_fini () | ||
1558 | { | 1563 | { |
1559 | 1564 | ||
1560 | } | 1565 | } |
1561 | 1566 | ||
1567 | |||
1562 | /* end of common_logging.c */ | 1568 | /* end of common_logging.c */ |
diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c index b043a2e12..b9e5cb67f 100644 --- a/src/util/configuration_loader.c +++ b/src/util/configuration_loader.c | |||
@@ -84,4 +84,5 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
84 | return GNUNET_OK; | 84 | return GNUNET_OK; |
85 | } | 85 | } |
86 | 86 | ||
87 | |||
87 | /* end of configuration_loader.c */ | 88 | /* end of configuration_loader.c */ |
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c index cb7984c3f..eca651862 100644 --- a/src/util/container_bloomfilter.c +++ b/src/util/container_bloomfilter.c | |||
@@ -149,6 +149,7 @@ setBit (char *bitArray, unsigned int bitIdx) | |||
149 | bitArray[arraySlot] |= targetBit; | 149 | bitArray[arraySlot] |= targetBit; |
150 | } | 150 | } |
151 | 151 | ||
152 | |||
152 | /** | 153 | /** |
153 | * Clears a bit from bitArray. Bit is cleared from the array | 154 | * Clears a bit from bitArray. Bit is cleared from the array |
154 | * only if the respective usage counter on the disk hits/is zero. | 155 | * only if the respective usage counter on the disk hits/is zero. |
@@ -167,6 +168,7 @@ clearBit (char *bitArray, unsigned int bitIdx) | |||
167 | bitArray[slot] = bitArray[slot] & (~targetBit); | 168 | bitArray[slot] = bitArray[slot] & (~targetBit); |
168 | } | 169 | } |
169 | 170 | ||
171 | |||
170 | /** | 172 | /** |
171 | * Checks if a bit is active in the bitArray | 173 | * Checks if a bit is active in the bitArray |
172 | * | 174 | * |
@@ -188,6 +190,7 @@ testBit (char *bitArray, unsigned int bitIdx) | |||
188 | return GNUNET_NO; | 190 | return GNUNET_NO; |
189 | } | 191 | } |
190 | 192 | ||
193 | |||
191 | /** | 194 | /** |
192 | * Sets a bit active in the bitArray and increments | 195 | * Sets a bit active in the bitArray and increments |
193 | * bit-specific usage counter on disk (but only if | 196 | * bit-specific usage counter on disk (but only if |
@@ -238,6 +241,7 @@ incrementBit (char *bitArray, | |||
238 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); | 241 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); |
239 | } | 242 | } |
240 | 243 | ||
244 | |||
241 | /** | 245 | /** |
242 | * Clears a bit from bitArray if the respective usage | 246 | * Clears a bit from bitArray if the respective usage |
243 | * counter on the disk hits/is zero. | 247 | * counter on the disk hits/is zero. |
@@ -302,6 +306,7 @@ decrementBit (char *bitArray, | |||
302 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); | 306 | GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); |
303 | } | 307 | } |
304 | 308 | ||
309 | |||
305 | #define BUFFSIZE 65536 | 310 | #define BUFFSIZE 65536 |
306 | 311 | ||
307 | /** | 312 | /** |
@@ -342,6 +347,7 @@ make_empty_file (const struct GNUNET_DISK_FileHandle *fh, size_t size) | |||
342 | return GNUNET_OK; | 347 | return GNUNET_OK; |
343 | } | 348 | } |
344 | 349 | ||
350 | |||
345 | /* ************** GNUNET_CONTAINER_BloomFilter iterator ********* */ | 351 | /* ************** GNUNET_CONTAINER_BloomFilter iterator ********* */ |
346 | 352 | ||
347 | /** | 353 | /** |
@@ -474,6 +480,7 @@ testBitCallback (void *cls, | |||
474 | return GNUNET_YES; | 480 | return GNUNET_YES; |
475 | } | 481 | } |
476 | 482 | ||
483 | |||
477 | /* *********************** INTERFACE **************** */ | 484 | /* *********************** INTERFACE **************** */ |
478 | 485 | ||
479 | /** | 486 | /** |
@@ -796,6 +803,7 @@ GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
796 | return GNUNET_OK; | 803 | return GNUNET_OK; |
797 | } | 804 | } |
798 | 805 | ||
806 | |||
799 | /** | 807 | /** |
800 | * Or the entries of the given raw data array with the | 808 | * Or the entries of the given raw data array with the |
801 | * data of the given bloom filter. Assumes that | 809 | * data of the given bloom filter. Assumes that |
@@ -854,6 +862,7 @@ GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
854 | iterateBits (bf, &decrementBitCallback, bf, e); | 862 | iterateBits (bf, &decrementBitCallback, bf, e); |
855 | } | 863 | } |
856 | 864 | ||
865 | |||
857 | /** | 866 | /** |
858 | * Resize a bloom filter. Note that this operation | 867 | * Resize a bloom filter. Note that this operation |
859 | * is pretty costly. Essentially, the bloom filter | 868 | * is pretty costly. Essentially, the bloom filter |
@@ -889,4 +898,5 @@ GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
889 | GNUNET_CONTAINER_bloomfilter_add (bf, &hc); | 898 | GNUNET_CONTAINER_bloomfilter_add (bf, &hc); |
890 | } | 899 | } |
891 | 900 | ||
901 | |||
892 | /* end of container_bloomfilter.c */ | 902 | /* end of container_bloomfilter.c */ |
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index 9cbd54f49..ad362408e 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c | |||
@@ -35,7 +35,6 @@ | |||
35 | __VA_ARGS__) | 35 | __VA_ARGS__) |
36 | 36 | ||
37 | 37 | ||
38 | |||
39 | /** | 38 | /** |
40 | * Try to compress the given block of data using libz. Only returns | 39 | * Try to compress the given block of data using libz. Only returns |
41 | * the compressed block if compression worked and the new block is | 40 | * the compressed block if compression worked and the new block is |
diff --git a/src/util/crypto_abe.c b/src/util/crypto_abe.c index 1fe648e5a..97ff01680 100644 --- a/src/util/crypto_abe.c +++ b/src/util/crypto_abe.c | |||
@@ -78,6 +78,7 @@ init_aes (element_t k, int enc, | |||
78 | return rc; | 78 | return rc; |
79 | } | 79 | } |
80 | 80 | ||
81 | |||
81 | static int | 82 | static int |
82 | aes_128_cbc_encrypt (char*pt, | 83 | aes_128_cbc_encrypt (char*pt, |
83 | int size, | 84 | int size, |
@@ -116,6 +117,7 @@ aes_128_cbc_encrypt (char*pt, | |||
116 | return buf_size; | 117 | return buf_size; |
117 | } | 118 | } |
118 | 119 | ||
120 | |||
119 | static int | 121 | static int |
120 | aes_128_cbc_decrypt (char*ct, | 122 | aes_128_cbc_decrypt (char*ct, |
121 | int size, | 123 | int size, |
@@ -149,6 +151,7 @@ aes_128_cbc_decrypt (char*ct, | |||
149 | return len; | 151 | return len; |
150 | } | 152 | } |
151 | 153 | ||
154 | |||
152 | struct GNUNET_CRYPTO_AbeMasterKey* | 155 | struct GNUNET_CRYPTO_AbeMasterKey* |
153 | GNUNET_CRYPTO_cpabe_create_master_key (void) | 156 | GNUNET_CRYPTO_cpabe_create_master_key (void) |
154 | { | 157 | { |
@@ -161,6 +164,7 @@ GNUNET_CRYPTO_cpabe_create_master_key (void) | |||
161 | return key; | 164 | return key; |
162 | } | 165 | } |
163 | 166 | ||
167 | |||
164 | void | 168 | void |
165 | GNUNET_CRYPTO_cpabe_delete_master_key (struct GNUNET_CRYPTO_AbeMasterKey *key) | 169 | GNUNET_CRYPTO_cpabe_delete_master_key (struct GNUNET_CRYPTO_AbeMasterKey *key) |
166 | { | 170 | { |
@@ -171,6 +175,7 @@ GNUNET_CRYPTO_cpabe_delete_master_key (struct GNUNET_CRYPTO_AbeMasterKey *key) | |||
171 | GNUNET_free (key); | 175 | GNUNET_free (key); |
172 | } | 176 | } |
173 | 177 | ||
178 | |||
174 | struct GNUNET_CRYPTO_AbeKey* | 179 | struct GNUNET_CRYPTO_AbeKey* |
175 | GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key, | 180 | GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key, |
176 | char **attrs) | 181 | char **attrs) |
@@ -188,6 +193,7 @@ GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key, | |||
188 | return prv_key; | 193 | return prv_key; |
189 | } | 194 | } |
190 | 195 | ||
196 | |||
191 | void | 197 | void |
192 | GNUNET_CRYPTO_cpabe_delete_key (struct GNUNET_CRYPTO_AbeKey *key, | 198 | GNUNET_CRYPTO_cpabe_delete_key (struct GNUNET_CRYPTO_AbeKey *key, |
193 | int delete_pub) | 199 | int delete_pub) |
@@ -199,6 +205,7 @@ GNUNET_CRYPTO_cpabe_delete_key (struct GNUNET_CRYPTO_AbeKey *key, | |||
199 | GNUNET_free (key); | 205 | GNUNET_free (key); |
200 | } | 206 | } |
201 | 207 | ||
208 | |||
202 | ssize_t | 209 | ssize_t |
203 | write_cpabe (void **result, | 210 | write_cpabe (void **result, |
204 | uint32_t file_len, | 211 | uint32_t file_len, |
@@ -227,6 +234,7 @@ write_cpabe (void **result, | |||
227 | return 12 + cph_buf_len + aes_buf_len; | 234 | return 12 + cph_buf_len + aes_buf_len; |
228 | } | 235 | } |
229 | 236 | ||
237 | |||
230 | ssize_t | 238 | ssize_t |
231 | read_cpabe (const void *data, | 239 | read_cpabe (const void *data, |
232 | char**cph_buf, | 240 | char**cph_buf, |
@@ -257,6 +265,7 @@ read_cpabe (const void *data, | |||
257 | return buf_len; | 265 | return buf_len; |
258 | } | 266 | } |
259 | 267 | ||
268 | |||
260 | ssize_t | 269 | ssize_t |
261 | GNUNET_CRYPTO_cpabe_encrypt (const void *block, | 270 | GNUNET_CRYPTO_cpabe_encrypt (const void *block, |
262 | size_t size, | 271 | size_t size, |
@@ -290,6 +299,7 @@ GNUNET_CRYPTO_cpabe_encrypt (const void *block, | |||
290 | return result_len; | 299 | return result_len; |
291 | } | 300 | } |
292 | 301 | ||
302 | |||
293 | ssize_t | 303 | ssize_t |
294 | GNUNET_CRYPTO_cpabe_decrypt (const void *block, | 304 | GNUNET_CRYPTO_cpabe_decrypt (const void *block, |
295 | size_t size, | 305 | size_t size, |
@@ -329,6 +339,7 @@ GNUNET_CRYPTO_cpabe_decrypt (const void *block, | |||
329 | return plt_len; | 339 | return plt_len; |
330 | } | 340 | } |
331 | 341 | ||
342 | |||
332 | ssize_t | 343 | ssize_t |
333 | GNUNET_CRYPTO_cpabe_serialize_key (const struct GNUNET_CRYPTO_AbeKey *key, | 344 | GNUNET_CRYPTO_cpabe_serialize_key (const struct GNUNET_CRYPTO_AbeKey *key, |
334 | void **result) | 345 | void **result) |
@@ -351,6 +362,7 @@ GNUNET_CRYPTO_cpabe_serialize_key (const struct GNUNET_CRYPTO_AbeKey *key, | |||
351 | return len; | 362 | return len; |
352 | } | 363 | } |
353 | 364 | ||
365 | |||
354 | struct GNUNET_CRYPTO_AbeKey* | 366 | struct GNUNET_CRYPTO_AbeKey* |
355 | GNUNET_CRYPTO_cpabe_deserialize_key (const void *data, | 367 | GNUNET_CRYPTO_cpabe_deserialize_key (const void *data, |
356 | size_t len) | 368 | size_t len) |
@@ -375,6 +387,7 @@ GNUNET_CRYPTO_cpabe_deserialize_key (const void *data, | |||
375 | return key; | 387 | return key; |
376 | } | 388 | } |
377 | 389 | ||
390 | |||
378 | ssize_t | 391 | ssize_t |
379 | GNUNET_CRYPTO_cpabe_serialize_master_key (const struct | 392 | GNUNET_CRYPTO_cpabe_serialize_master_key (const struct |
380 | GNUNET_CRYPTO_AbeMasterKey *key, | 393 | GNUNET_CRYPTO_AbeMasterKey *key, |
@@ -398,6 +411,7 @@ GNUNET_CRYPTO_cpabe_serialize_master_key (const struct | |||
398 | return len; | 411 | return len; |
399 | } | 412 | } |
400 | 413 | ||
414 | |||
401 | struct GNUNET_CRYPTO_AbeMasterKey* | 415 | struct GNUNET_CRYPTO_AbeMasterKey* |
402 | GNUNET_CRYPTO_cpabe_deserialize_master_key (const void *data, | 416 | GNUNET_CRYPTO_cpabe_deserialize_master_key (const void *data, |
403 | size_t len) | 417 | size_t len) |
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c index acc4a8ab4..5b01d5efe 100644 --- a/src/util/crypto_crc.c +++ b/src/util/crypto_crc.c | |||
@@ -72,6 +72,7 @@ crc_init () | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | |||
75 | /* | 76 | /* |
76 | * This computes the standard preset and inverted CRC, as used | 77 | * This computes the standard preset and inverted CRC, as used |
77 | * by most networking standards. Start by passing in an initial | 78 | * by most networking standards. Start by passing in an initial |
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index 6b11cdada..0e5c3d1ca 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c | |||
@@ -640,8 +640,7 @@ GNUNET_CRYPTO_ecdhe_key_create2 (struct GNUNET_CRYPTO_EcdhePrivateKey *pk) | |||
640 | but should also be harmless. For libgcrypt < 1.7, using 'eddsa' | 640 | but should also be harmless. For libgcrypt < 1.7, using 'eddsa' |
641 | disables an expensive key testing routine. We do not want to run | 641 | disables an expensive key testing routine. We do not want to run |
642 | the expensive check for ECDHE, as we generate TONS of keys to | 642 | the expensive check for ECDHE, as we generate TONS of keys to |
643 | use for a very short time. */ | 643 | use for a very short time. */if (0 != (rc = gcry_sexp_build (&s_keyparam, |
644 | if (0 != (rc = gcry_sexp_build (&s_keyparam, | ||
645 | NULL, | 644 | NULL, |
646 | "(genkey(ecc(curve \"" CURVE "\")" | 645 | "(genkey(ecc(curve \"" CURVE "\")" |
647 | "(flags eddsa no-keytest)))"))) | 646 | "(flags eddsa no-keytest)))"))) |
@@ -735,6 +734,7 @@ GNUNET_CRYPTO_ecdsa_key_create () | |||
735 | return priv; | 734 | return priv; |
736 | } | 735 | } |
737 | 736 | ||
737 | |||
738 | /** | 738 | /** |
739 | * Create a new private key. Caller must free return value. | 739 | * Create a new private key. Caller must free return value. |
740 | * | 740 | * |
@@ -1651,6 +1651,7 @@ GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | |||
1651 | return ret; | 1651 | return ret; |
1652 | } | 1652 | } |
1653 | 1653 | ||
1654 | |||
1654 | /** | 1655 | /** |
1655 | * @ingroup crypto | 1656 | * @ingroup crypto |
1656 | * Derive key material from a ECDSA public key and a private ECDH key. | 1657 | * Derive key material from a ECDSA public key and a private ECDH key. |
@@ -1672,4 +1673,5 @@ GNUNET_CRYPTO_ecdh_ecdsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, | |||
1672 | key_material); | 1673 | key_material); |
1673 | } | 1674 | } |
1674 | 1675 | ||
1676 | |||
1675 | /* end of crypto_ecc.c */ | 1677 | /* end of crypto_ecc.c */ |
diff --git a/src/util/crypto_ecc_setup.c b/src/util/crypto_ecc_setup.c index 0ce9f9d1e..b3d410b7a 100644 --- a/src/util/crypto_ecc_setup.c +++ b/src/util/crypto_ecc_setup.c | |||
@@ -497,4 +497,5 @@ GNUNET_CRYPTO_eddsa_setup_key (const char *cfg_name) | |||
497 | GNUNET_CONFIGURATION_destroy (cfg); | 497 | GNUNET_CONFIGURATION_destroy (cfg); |
498 | } | 498 | } |
499 | 499 | ||
500 | |||
500 | /* end of crypto_ecc_setup.c */ | 501 | /* end of crypto_ecc_setup.c */ |
diff --git a/src/util/crypto_hash_file.c b/src/util/crypto_hash_file.c index 0dff6326c..e070918d3 100644 --- a/src/util/crypto_hash_file.c +++ b/src/util/crypto_hash_file.c | |||
@@ -239,4 +239,5 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc) | |||
239 | GNUNET_free (fhc); | 239 | GNUNET_free (fhc); |
240 | } | 240 | } |
241 | 241 | ||
242 | |||
242 | /* end of crypto_hash_file.c */ | 243 | /* end of crypto_hash_file.c */ |
diff --git a/src/util/crypto_hkdf.c b/src/util/crypto_hkdf.c index fea4f9861..99a50a449 100644 --- a/src/util/crypto_hkdf.c +++ b/src/util/crypto_hkdf.c | |||
@@ -49,7 +49,6 @@ | |||
49 | #define DEBUG_HKDF 0 | 49 | #define DEBUG_HKDF 0 |
50 | 50 | ||
51 | 51 | ||
52 | |||
53 | #if GNUNET_BUILD | 52 | #if GNUNET_BUILD |
54 | #include "platform.h" | 53 | #include "platform.h" |
55 | #include "gnunet_crypto_lib.h" | 54 | #include "gnunet_crypto_lib.h" |
@@ -84,6 +83,7 @@ doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf, | |||
84 | return (const void *) gcry_md_read (mac, 0); | 83 | return (const void *) gcry_md_read (mac, 0); |
85 | } | 84 | } |
86 | 85 | ||
86 | |||
87 | /** | 87 | /** |
88 | * @brief Generate pseudo-random key | 88 | * @brief Generate pseudo-random key |
89 | * @param mac gcrypt HMAC handle | 89 | * @param mac gcrypt HMAC handle |
@@ -122,6 +122,8 @@ dump (const char *src, const void *p, unsigned int l) | |||
122 | } | 122 | } |
123 | printf ("\n"); | 123 | printf ("\n"); |
124 | } | 124 | } |
125 | |||
126 | |||
125 | #endif | 127 | #endif |
126 | 128 | ||
127 | 129 | ||
@@ -302,4 +304,5 @@ GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo, | |||
302 | return ret; | 304 | return ret; |
303 | } | 305 | } |
304 | 306 | ||
307 | |||
305 | /* end of crypto_hkdf.c */ | 308 | /* end of crypto_hkdf.c */ |
diff --git a/src/util/crypto_kdf.c b/src/util/crypto_kdf.c index ac881b055..43a9731ff 100644 --- a/src/util/crypto_kdf.c +++ b/src/util/crypto_kdf.c | |||
@@ -62,9 +62,7 @@ GNUNET_CRYPTO_kdf_v (void *result, | |||
62 | * hash function." | 62 | * hash function." |
63 | * | 63 | * |
64 | * http://eprint.iacr.org/2010/264 | 64 | * http://eprint.iacr.org/2010/264 |
65 | */ | 65 | */return GNUNET_CRYPTO_hkdf_v (result, |
66 | |||
67 | return GNUNET_CRYPTO_hkdf_v (result, | ||
68 | out_len, | 66 | out_len, |
69 | GCRY_MD_SHA512, | 67 | GCRY_MD_SHA512, |
70 | GCRY_MD_SHA256, | 68 | GCRY_MD_SHA256, |
@@ -171,4 +169,5 @@ GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r, | |||
171 | } | 169 | } |
172 | } | 170 | } |
173 | 171 | ||
172 | |||
174 | /* end of crypto_kdf.c */ | 173 | /* end of crypto_kdf.c */ |
diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c index 5f1b456a5..51a29ac7c 100644 --- a/src/util/crypto_mpi.c +++ b/src/util/crypto_mpi.c | |||
@@ -145,4 +145,5 @@ GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result, | |||
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | |||
148 | /* end of crypto_mpi.c */ | 149 | /* end of crypto_mpi.c */ |
diff --git a/src/util/crypto_paillier.c b/src/util/crypto_paillier.c index 75d607706..0a08509ba 100644 --- a/src/util/crypto_paillier.c +++ b/src/util/crypto_paillier.c | |||
@@ -246,8 +246,7 @@ GNUNET_CRYPTO_paillier_encrypt (const struct | |||
246 | number has the same length (or is smaller), by counting the | 246 | number has the same length (or is smaller), by counting the |
247 | number of possible operations. We essentially divide max_num by | 247 | number of possible operations. We essentially divide max_num by |
248 | 2 until the result is no longer larger than 'm', incrementing the | 248 | 2 until the result is no longer larger than 'm', incrementing the |
249 | maximum number of operations in each round, starting at -2 */ | 249 | maximum number of operations in each round, starting at -2 */for (possible_opts = -2; gcry_mpi_cmp (max_num, m) > 0; possible_opts++) |
250 | for (possible_opts = -2; gcry_mpi_cmp (max_num, m) > 0; possible_opts++) | ||
251 | gcry_mpi_div (max_num, | 250 | gcry_mpi_div (max_num, |
252 | NULL, | 251 | NULL, |
253 | max_num, | 252 | max_num, |
@@ -481,4 +480,5 @@ GNUNET_CRYPTO_paillier_hom_get_remaining (const struct | |||
481 | return ntohl (c->remaining_ops); | 480 | return ntohl (c->remaining_ops); |
482 | } | 481 | } |
483 | 482 | ||
483 | |||
484 | /* end of crypto_paillier.c */ | 484 | /* end of crypto_paillier.c */ |
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c index f70763757..ffcabd0df 100644 --- a/src/util/crypto_random.c +++ b/src/util/crypto_random.c | |||
@@ -70,6 +70,8 @@ glibc_weak_rand32 () | |||
70 | glibc_weak_rand32_state = val; | 70 | glibc_weak_rand32_state = val; |
71 | return val; | 71 | return val; |
72 | } | 72 | } |
73 | |||
74 | |||
73 | #endif | 75 | #endif |
74 | 76 | ||
75 | /** | 77 | /** |
@@ -331,7 +333,8 @@ w_check (const void *p) | |||
331 | /** | 333 | /** |
332 | * Initialize libgcrypt. | 334 | * Initialize libgcrypt. |
333 | */ | 335 | */ |
334 | void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init () | 336 | void __attribute__ ((constructor)) |
337 | GNUNET_CRYPTO_random_init () | ||
335 | { | 338 | { |
336 | gcry_error_t rc; | 339 | gcry_error_t rc; |
337 | 340 | ||
@@ -369,7 +372,8 @@ void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init () | |||
369 | /** | 372 | /** |
370 | * Nicely shut down libgcrypt. | 373 | * Nicely shut down libgcrypt. |
371 | */ | 374 | */ |
372 | void __attribute__ ((destructor)) GNUNET_CRYPTO_random_fini () | 375 | void __attribute__ ((destructor)) |
376 | GNUNET_CRYPTO_random_fini () | ||
373 | { | 377 | { |
374 | gcry_set_progress_handler (NULL, NULL); | 378 | gcry_set_progress_handler (NULL, NULL); |
375 | #ifdef GCRYCTL_CLOSE_RANDOM_DEVICE | 379 | #ifdef GCRYCTL_CLOSE_RANDOM_DEVICE |
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index edabcd6d5..5c18e0b15 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c | |||
@@ -1181,8 +1181,7 @@ GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash, | |||
1181 | * so the exchange is being malicious in an unfamilair way, maybe | 1181 | * so the exchange is being malicious in an unfamilair way, maybe |
1182 | * just trying to crash us. Arguably, we've only an internal error | 1182 | * just trying to crash us. Arguably, we've only an internal error |
1183 | * though because we should've detected this in our previous call | 1183 | * though because we should've detected this in our previous call |
1184 | * to GNUNET_CRYPTO_rsa_unblind. */ | 1184 | * to GNUNET_CRYPTO_rsa_unblind. */return GNUNET_NO; |
1185 | return GNUNET_NO; | ||
1186 | } | 1185 | } |
1187 | 1186 | ||
1188 | data = mpi_to_sexp (r); | 1187 | data = mpi_to_sexp (r); |
diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c index a6e22521a..51414b00e 100644 --- a/src/util/crypto_symmetric.c +++ b/src/util/crypto_symmetric.c | |||
@@ -258,4 +258,5 @@ GNUNET_CRYPTO_symmetric_derive_iv_v (struct | |||
258 | argp); | 258 | argp); |
259 | } | 259 | } |
260 | 260 | ||
261 | |||
261 | /* end of crypto_symmetric.c */ | 262 | /* end of crypto_symmetric.c */ |
diff --git a/src/util/disk.c b/src/util/disk.c index 32667d554..47a0ed5c9 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -194,6 +194,7 @@ GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h) | |||
194 | return ((! h) || (h->fd == -1)) ? GNUNET_YES : GNUNET_NO; | 194 | return ((! h) || (h->fd == -1)) ? GNUNET_YES : GNUNET_NO; |
195 | } | 195 | } |
196 | 196 | ||
197 | |||
197 | /** | 198 | /** |
198 | * Get the size of an open file. | 199 | * Get the size of an open file. |
199 | * | 200 | * |
@@ -1145,10 +1146,11 @@ GNUNET_DISK_filename_canonicalize (char *fn) | |||
1145 | { | 1146 | { |
1146 | c = *idx; | 1147 | c = *idx; |
1147 | 1148 | ||
1148 | if ((c == '/') ||(c == '\\') ||(c == ':') ||(c == '*') ||(c == '?') ||(c == | 1149 | if ((c == '/') || (c == '\\') || (c == ':') || (c == '*') || (c == '?') || |
1149 | '"') | 1150 | (c == |
1151 | '"') | ||
1150 | || | 1152 | || |
1151 | (c == '<') ||(c == '>') ||(c == '|') ) | 1153 | (c == '<') || (c == '>') || (c == '|') ) |
1152 | { | 1154 | { |
1153 | *idx = '_'; | 1155 | *idx = '_'; |
1154 | } | 1156 | } |
@@ -1465,6 +1467,7 @@ GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | |||
1465 | return (*m)->addr; | 1467 | return (*m)->addr; |
1466 | } | 1468 | } |
1467 | 1469 | ||
1470 | |||
1468 | /** | 1471 | /** |
1469 | * Unmap a file | 1472 | * Unmap a file |
1470 | * @param h mapping handle | 1473 | * @param h mapping handle |
@@ -1662,6 +1665,7 @@ GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
1662 | return ret; | 1665 | return ret; |
1663 | } | 1666 | } |
1664 | 1667 | ||
1668 | |||
1665 | /** | 1669 | /** |
1666 | * Detaches one of the ends from the pipe. | 1670 | * Detaches one of the ends from the pipe. |
1667 | * Detached end is a fully-functional FileHandle, it will | 1671 | * Detached end is a fully-functional FileHandle, it will |
diff --git a/src/util/getopt.c b/src/util/getopt.c index 8ec148e15..acc1b6535 100644 --- a/src/util/getopt.c +++ b/src/util/getopt.c | |||
@@ -203,6 +203,7 @@ my_index (const char *str, int chr) | |||
203 | return 0; | 203 | return 0; |
204 | } | 204 | } |
205 | 205 | ||
206 | |||
206 | /* If using GCC, we can safely declare strlen this way. | 207 | /* If using GCC, we can safely declare strlen this way. |
207 | If not using GCC, it is ok not to declare it. */ | 208 | If not using GCC, it is ok not to declare it. */ |
208 | #ifdef __GNUC__ | 209 | #ifdef __GNUC__ |
@@ -213,6 +214,7 @@ my_index (const char *str, int chr) | |||
213 | and has done so at least since version 2.4.5. -- rms. */ | 214 | and has done so at least since version 2.4.5. -- rms. */ |
214 | extern int | 215 | extern int |
215 | strlen (const char *); | 216 | strlen (const char *); |
217 | |||
216 | #endif /* not __STDC__ */ | 218 | #endif /* not __STDC__ */ |
217 | #endif /* __GNUC__ */ | 219 | #endif /* __GNUC__ */ |
218 | 220 | ||
@@ -241,6 +243,7 @@ static int last_nonopt; | |||
241 | #if defined(__STDC__) && __STDC__ | 243 | #if defined(__STDC__) && __STDC__ |
242 | static void | 244 | static void |
243 | exchange (char **); | 245 | exchange (char **); |
246 | |||
244 | #endif | 247 | #endif |
245 | 248 | ||
246 | static void | 249 | static void |
@@ -300,11 +303,13 @@ exchange (char **argv) | |||
300 | last_nonopt = GNoptind; | 303 | last_nonopt = GNoptind; |
301 | } | 304 | } |
302 | 305 | ||
306 | |||
303 | /* Initialize the internal data when the first call is made. */ | 307 | /* Initialize the internal data when the first call is made. */ |
304 | 308 | ||
305 | #if defined(__STDC__) && __STDC__ | 309 | #if defined(__STDC__) && __STDC__ |
306 | static const char * | 310 | static const char * |
307 | _getopt_initialize (int, char *const *, const char *); | 311 | _getopt_initialize (int, char *const *, const char *); |
312 | |||
308 | #endif | 313 | #endif |
309 | static const char * | 314 | static const char * |
310 | _getopt_initialize (int argc, char *const *argv, const char *optstring) | 315 | _getopt_initialize (int argc, char *const *argv, const char *optstring) |
@@ -339,6 +344,7 @@ _getopt_initialize (int argc, char *const *argv, const char *optstring) | |||
339 | return optstring; | 344 | return optstring; |
340 | } | 345 | } |
341 | 346 | ||
347 | |||
342 | /* Scan elements of ARGV (whose length is ARGC) for option characters | 348 | /* Scan elements of ARGV (whose length is ARGC) for option characters |
343 | given in OPTSTRING. | 349 | given in OPTSTRING. |
344 | 350 | ||
@@ -408,7 +414,7 @@ GN_getopt_internal (int argc, | |||
408 | 414 | ||
409 | GNoptarg = NULL; | 415 | GNoptarg = NULL; |
410 | 416 | ||
411 | if ((GNoptind == 0)|| ! __getopt_initialized) | 417 | if ((GNoptind == 0) || ! __getopt_initialized) |
412 | { | 418 | { |
413 | if (GNoptind == 0) | 419 | if (GNoptind == 0) |
414 | GNoptind = 1; /* Don't scan ARGV[0], the program name. */ | 420 | GNoptind = 1; /* Don't scan ARGV[0], the program name. */ |
@@ -422,7 +428,7 @@ GN_getopt_internal (int argc, | |||
422 | * is only used when the used in the GNU libc. */ | 428 | * is only used when the used in the GNU libc. */ |
423 | #define NONOPTION_P (argv[GNoptind][0] != '-' || argv[GNoptind][1] == '\0') | 429 | #define NONOPTION_P (argv[GNoptind][0] != '-' || argv[GNoptind][1] == '\0') |
424 | 430 | ||
425 | if ((nextchar == NULL)||(*nextchar == '\0')) | 431 | if ((nextchar == NULL) || (*nextchar == '\0')) |
426 | { | 432 | { |
427 | /* Advance to the next ARGV-element. */ | 433 | /* Advance to the next ARGV-element. */ |
428 | 434 | ||
@@ -438,7 +444,7 @@ GN_getopt_internal (int argc, | |||
438 | /* If we have just processed some options following some non-options, | 444 | /* If we have just processed some options following some non-options, |
439 | * exchange them so that the options come first. */ | 445 | * exchange them so that the options come first. */ |
440 | 446 | ||
441 | if ((first_nonopt != last_nonopt) &&(last_nonopt != GNoptind) ) | 447 | if ((first_nonopt != last_nonopt) && (last_nonopt != GNoptind) ) |
442 | exchange ((char **) argv); | 448 | exchange ((char **) argv); |
443 | else if (last_nonopt != GNoptind) | 449 | else if (last_nonopt != GNoptind) |
444 | first_nonopt = GNoptind; | 450 | first_nonopt = GNoptind; |
@@ -459,7 +465,7 @@ GN_getopt_internal (int argc, | |||
459 | { | 465 | { |
460 | GNoptind++; | 466 | GNoptind++; |
461 | 467 | ||
462 | if ((first_nonopt != last_nonopt) &&(last_nonopt != GNoptind) ) | 468 | if ((first_nonopt != last_nonopt) && (last_nonopt != GNoptind) ) |
463 | exchange ((char **) argv); | 469 | exchange ((char **) argv); |
464 | else if (first_nonopt == last_nonopt) | 470 | else if (first_nonopt == last_nonopt) |
465 | first_nonopt = GNoptind; | 471 | first_nonopt = GNoptind; |
@@ -511,10 +517,8 @@ GN_getopt_internal (int argc, | |||
511 | * the ARGV-element is "-fu", do consider that an abbreviation of | 517 | * the ARGV-element is "-fu", do consider that an abbreviation of |
512 | * the long option, just like "--fu", and not "-f" with arg "u". | 518 | * the long option, just like "--fu", and not "-f" with arg "u". |
513 | * | 519 | * |
514 | * This distinction seems to be the most useful approach. */ | 520 | * This distinction seems to be the most useful approach. */if ((longopts != NULL) && |
515 | 521 | ((argv[GNoptind][1] == '-') || | |
516 | if ((longopts != NULL)&& | ||
517 | ((argv[GNoptind][1] == '-')|| | ||
518 | (long_only && | 522 | (long_only && |
519 | (argv[GNoptind][2] || ! my_index (optstring, argv[GNoptind][1]))))) | 523 | (argv[GNoptind][2] || ! my_index (optstring, argv[GNoptind][1]))))) |
520 | { | 524 | { |
@@ -632,7 +636,7 @@ GN_getopt_internal (int argc, | |||
632 | * or the option starts with '--' or is not a valid short | 636 | * or the option starts with '--' or is not a valid short |
633 | * option, then it's an error. | 637 | * option, then it's an error. |
634 | * Otherwise interpret it as a short option. */ | 638 | * Otherwise interpret it as a short option. */ |
635 | if (! long_only ||(argv[GNoptind][1] == '-') || | 639 | if (! long_only || (argv[GNoptind][1] == '-') || |
636 | (my_index (optstring, *nextchar) == NULL) ) | 640 | (my_index (optstring, *nextchar) == NULL) ) |
637 | { | 641 | { |
638 | if (GNopterr) | 642 | if (GNopterr) |
@@ -667,7 +671,7 @@ GN_getopt_internal (int argc, | |||
667 | if (*nextchar == '\0') | 671 | if (*nextchar == '\0') |
668 | ++GNoptind; | 672 | ++GNoptind; |
669 | 673 | ||
670 | if ((temp == NULL)||(c == ':')) | 674 | if ((temp == NULL) || (c == ':')) |
671 | { | 675 | { |
672 | if (GNopterr) | 676 | if (GNopterr) |
673 | { | 677 | { |
@@ -680,7 +684,7 @@ GN_getopt_internal (int argc, | |||
680 | return '?'; | 684 | return '?'; |
681 | } | 685 | } |
682 | /* Convenience. Treat POSIX -W foo same as long option --foo */ | 686 | /* Convenience. Treat POSIX -W foo same as long option --foo */ |
683 | if ((temp[0] == 'W')&&(temp[1] == ';')) | 687 | if ((temp[0] == 'W') && (temp[1] == ';')) |
684 | { | 688 | { |
685 | char *nameend; | 689 | char *nameend; |
686 | const struct GNoption *p; | 690 | const struct GNoption *p; |
@@ -871,6 +875,7 @@ GNgetopt_long (int argc, | |||
871 | return GN_getopt_internal (argc, argv, options, long_options, opt_index, 0); | 875 | return GN_getopt_internal (argc, argv, options, long_options, opt_index, 0); |
872 | } | 876 | } |
873 | 877 | ||
878 | |||
874 | /* ******************** now the GNUnet specific modifications... ********************* */ | 879 | /* ******************** now the GNUnet specific modifications... ********************* */ |
875 | 880 | ||
876 | /** | 881 | /** |
@@ -1008,4 +1013,5 @@ GNUNET_GETOPT_run (const char *binaryOptions, | |||
1008 | return GNoptind; | 1013 | return GNoptind; |
1009 | } | 1014 | } |
1010 | 1015 | ||
1016 | |||
1011 | /* end of getopt.c */ | 1017 | /* end of getopt.c */ |
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index c225f8f1f..f101e8b61 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -337,4 +337,5 @@ main (int argc, char *const *argv) | |||
337 | return ret; | 337 | return ret; |
338 | } | 338 | } |
339 | 339 | ||
340 | |||
340 | /* end of gnunet-config.c */ | 341 | /* end of gnunet-config.c */ |
diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c index 72e50b2a8..02d2020ad 100644 --- a/src/util/gnunet-ecc.c +++ b/src/util/gnunet-ecc.c | |||
@@ -115,8 +115,7 @@ create_keys (const char *fn, const char *prefix) | |||
115 | * n = 5/8 = 0 (bytes) | 115 | * n = 5/8 = 0 (bytes) |
116 | * rest = 5%8 = 5 (bits) | 116 | * rest = 5%8 = 5 (bits) |
117 | * mask = ~(2**(8 - 5) - 1) = ~(2**3 - 1) = ~(8 - 1) = ~b111 = b11111000 | 117 | * mask = ~(2**(8 - 5) - 1) = ~(2**3 - 1) = ~(8 - 1) = ~b111 = b11111000 |
118 | */ | 118 | */mask = ~((int) pow (2, 8 - rest) - 1); |
119 | mask = ~((int) pow (2, 8 - rest) - 1); | ||
120 | target_byte = ((unsigned char *) &target_pub)[n] & mask; | 119 | target_byte = ((unsigned char *) &target_pub)[n] & mask; |
121 | } | 120 | } |
122 | else | 121 | else |
@@ -480,4 +479,5 @@ main (int argc, char *const *argv) | |||
480 | return ret; | 479 | return ret; |
481 | } | 480 | } |
482 | 481 | ||
482 | |||
483 | /* end of gnunet-ecc.c */ | 483 | /* end of gnunet-ecc.c */ |
diff --git a/src/util/gnunet-resolver.c b/src/util/gnunet-resolver.c index 83329635a..d2f3acd45 100644 --- a/src/util/gnunet-resolver.c +++ b/src/util/gnunet-resolver.c | |||
@@ -182,4 +182,5 @@ main (int argc, char *const *argv) | |||
182 | return ret; | 182 | return ret; |
183 | } | 183 | } |
184 | 184 | ||
185 | |||
185 | /* end of gnunet-resolver.c */ | 186 | /* end of gnunet-resolver.c */ |
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c index e5de0ba73..8d8451950 100644 --- a/src/util/gnunet-scrypt.c +++ b/src/util/gnunet-scrypt.c | |||
@@ -344,4 +344,5 @@ main (int argc, char *const *argv) | |||
344 | return ret; | 344 | return ret; |
345 | } | 345 | } |
346 | 346 | ||
347 | |||
347 | /* end of gnunet-scrypt.c */ | 348 | /* end of gnunet-scrypt.c */ |
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index d7d456fba..c82a18ab8 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c | |||
@@ -704,6 +704,7 @@ pack (const char *hostname, | |||
704 | return GNUNET_OK; | 704 | return GNUNET_OK; |
705 | } | 705 | } |
706 | 706 | ||
707 | |||
707 | static void | 708 | static void |
708 | cache_answers (const char *name, | 709 | cache_answers (const char *name, |
709 | struct GNUNET_DNSPARSER_Record *records, | 710 | struct GNUNET_DNSPARSER_Record *records, |
@@ -738,6 +739,7 @@ cache_answers (const char *name, | |||
738 | } | 739 | } |
739 | } | 740 | } |
740 | 741 | ||
742 | |||
741 | /** | 743 | /** |
742 | * We got a result from DNS. Add it to the cache and | 744 | * We got a result from DNS. Add it to the cache and |
743 | * see if we can make our client happy... | 745 | * see if we can make our client happy... |
@@ -1366,12 +1368,15 @@ GNUNET_SERVICE_MAIN ( | |||
1366 | /** | 1368 | /** |
1367 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. | 1369 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. |
1368 | */ | 1370 | */ |
1369 | void __attribute__ ((constructor)) GNUNET_RESOLVER_memory_init () | 1371 | void __attribute__ ((constructor)) |
1372 | GNUNET_RESOLVER_memory_init () | ||
1370 | { | 1373 | { |
1371 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); | 1374 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); |
1372 | mallopt (M_TOP_PAD, 1 * 1024); | 1375 | mallopt (M_TOP_PAD, 1 * 1024); |
1373 | malloc_trim (0); | 1376 | malloc_trim (0); |
1374 | } | 1377 | } |
1378 | |||
1379 | |||
1375 | #endif | 1380 | #endif |
1376 | 1381 | ||
1377 | 1382 | ||
diff --git a/src/util/gnunet-timeout.c b/src/util/gnunet-timeout.c index cd6707db8..f650475cb 100644 --- a/src/util/gnunet-timeout.c +++ b/src/util/gnunet-timeout.c | |||
@@ -116,4 +116,5 @@ main (int argc, char *argv[]) | |||
116 | exit (-1); | 116 | exit (-1); |
117 | } | 117 | } |
118 | 118 | ||
119 | |||
119 | /* end of timeout_watchdog.c */ | 120 | /* end of timeout_watchdog.c */ |
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index a80ac0997..84100ff56 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c | |||
@@ -188,4 +188,5 @@ main (int argc, char *const *argv) | |||
188 | return ((GNUNET_OK == ret) && (0 == exit_code)) ? 0 : 1; | 188 | return ((GNUNET_OK == ret) && (0 == exit_code)) ? 0 : 1; |
189 | } | 189 | } |
190 | 190 | ||
191 | |||
191 | /* end of gnunet-uri.c */ | 192 | /* end of gnunet-uri.c */ |
diff --git a/src/util/helper.c b/src/util/helper.c index 9ebbdb188..8c8fb7b6a 100644 --- a/src/util/helper.c +++ b/src/util/helper.c | |||
@@ -683,6 +683,7 @@ GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, | |||
683 | return sh; | 683 | return sh; |
684 | } | 684 | } |
685 | 685 | ||
686 | |||
686 | /** | 687 | /** |
687 | * Cancel a #GNUNET_HELPER_send operation. If possible, transmitting the | 688 | * Cancel a #GNUNET_HELPER_send operation. If possible, transmitting the |
688 | * message is also aborted, but at least 'cont' won't be | 689 | * message is also aborted, but at least 'cont' won't be |
diff --git a/src/util/load.c b/src/util/load.c index bab2f375e..cfbfa36d6 100644 --- a/src/util/load.c +++ b/src/util/load.c | |||
@@ -169,8 +169,7 @@ calculate_load (struct GNUNET_LOAD_Value *load) | |||
169 | * stddev = (sum (val_i - avg)^2) / (n-1) | 169 | * stddev = (sum (val_i - avg)^2) / (n-1) |
170 | * = (sum (val_i^2 - 2 avg val_i + avg^2) / (n-1) | 170 | * = (sum (val_i^2 - 2 avg val_i + avg^2) / (n-1) |
171 | * = (sum (val_i^2) - 2 avg sum (val_i) + n * avg^2) / (n-1) | 171 | * = (sum (val_i^2) - 2 avg sum (val_i) + n * avg^2) / (n-1) |
172 | */ | 172 | */sum_val_i = (double) load->cummulative_delay; |
173 | sum_val_i = (double) load->cummulative_delay; | ||
174 | n = ((double) load->cummulative_request_count); | 173 | n = ((double) load->cummulative_request_count); |
175 | nm1 = n - 1.0; | 174 | nm1 = n - 1.0; |
176 | avgdel = sum_val_i / n; | 175 | avgdel = sum_val_i / n; |
@@ -254,5 +253,4 @@ GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data) | |||
254 | } | 253 | } |
255 | 254 | ||
256 | 255 | ||
257 | |||
258 | /* end of load.c */ | 256 | /* end of load.c */ |
diff --git a/src/util/mst.c b/src/util/mst.c index a3f1368e4..7fe93c55c 100644 --- a/src/util/mst.c +++ b/src/util/mst.c | |||
@@ -415,5 +415,4 @@ GNUNET_MST_destroy (struct GNUNET_MessageStreamTokenizer *mst) | |||
415 | } | 415 | } |
416 | 416 | ||
417 | 417 | ||
418 | |||
419 | /* end of server_mst.c */ | 418 | /* end of server_mst.c */ |
diff --git a/src/util/nc.c b/src/util/nc.c index 9db321b8c..49c95c14e 100644 --- a/src/util/nc.c +++ b/src/util/nc.c | |||
@@ -223,4 +223,5 @@ GNUNET_notification_context_get_size (struct GNUNET_NotificationContext *nc) | |||
223 | return num; | 223 | return num; |
224 | } | 224 | } |
225 | 225 | ||
226 | |||
226 | /* end of nc.c */ | 227 | /* end of nc.c */ |
diff --git a/src/util/network.c b/src/util/network.c index ce4f2f896..99de5a7aa 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -323,6 +323,8 @@ socket_set_nosigpipe (const struct GNUNET_NETWORK_Handle *h) | |||
323 | return GNUNET_SYSERR; | 323 | return GNUNET_SYSERR; |
324 | return GNUNET_OK; | 324 | return GNUNET_OK; |
325 | } | 325 | } |
326 | |||
327 | |||
326 | #endif | 328 | #endif |
327 | 329 | ||
328 | 330 | ||
@@ -1385,4 +1387,5 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
1385 | GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) ? NULL : &tv); | 1387 | GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) ? NULL : &tv); |
1386 | } | 1388 | } |
1387 | 1389 | ||
1390 | |||
1388 | /* end of network.c */ | 1391 | /* end of network.c */ |
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index a4ef199cc..7aa4d1254 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -207,6 +207,8 @@ get_path_from_proc_exe () | |||
207 | lnk[size] = '\0'; | 207 | lnk[size] = '\0'; |
208 | return GNUNET_strdup (lnk); | 208 | return GNUNET_strdup (lnk); |
209 | } | 209 | } |
210 | |||
211 | |||
210 | #endif | 212 | #endif |
211 | 213 | ||
212 | 214 | ||
@@ -292,6 +294,8 @@ get_path_from_dyld_image () | |||
292 | } | 294 | } |
293 | return NULL; | 295 | return NULL; |
294 | } | 296 | } |
297 | |||
298 | |||
295 | #endif | 299 | #endif |
296 | 300 | ||
297 | 301 | ||
diff --git a/src/util/os_network.c b/src/util/os_network.c index e310455e0..9ee26f0a9 100644 --- a/src/util/os_network.c +++ b/src/util/os_network.c | |||
@@ -381,6 +381,8 @@ try_ip (GNUNET_OS_NetworkInterfaceProcessor proc, | |||
381 | pclose (f); | 381 | pclose (f); |
382 | return GNUNET_OK; | 382 | return GNUNET_OK; |
383 | } | 383 | } |
384 | |||
385 | |||
384 | #endif | 386 | #endif |
385 | 387 | ||
386 | 388 | ||
@@ -403,7 +405,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, | |||
403 | { | 405 | { |
404 | for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next) | 406 | for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next) |
405 | { | 407 | { |
406 | if ((ifa_ptr->ifa_name != NULL) &&(ifa_ptr->ifa_addr != NULL) && | 408 | if ((ifa_ptr->ifa_name != NULL) && (ifa_ptr->ifa_addr != NULL) && |
407 | ( (ifa_ptr->ifa_flags & IFF_UP) != 0) ) | 409 | ( (ifa_ptr->ifa_flags & IFF_UP) != 0) ) |
408 | { | 410 | { |
409 | if ((ifa_ptr->ifa_addr->sa_family != AF_INET) && | 411 | if ((ifa_ptr->ifa_addr->sa_family != AF_INET) && |
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index ad510a9b3..3b4858ca4 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -293,7 +293,6 @@ GNUNET_OS_process_destroy (struct GNUNET_OS_Process *proc) | |||
293 | } | 293 | } |
294 | 294 | ||
295 | 295 | ||
296 | |||
297 | /** | 296 | /** |
298 | * Open '/dev/null' and make the result the given | 297 | * Open '/dev/null' and make the result the given |
299 | * file descriptor. | 298 | * file descriptor. |
diff --git a/src/util/peer.c b/src/util/peer.c index 3216f1a57..257922f36 100644 --- a/src/util/peer.c +++ b/src/util/peer.c | |||
@@ -250,5 +250,4 @@ GNUNET_PEER_resolve2 (GNUNET_PEER_Id id) | |||
250 | } | 250 | } |
251 | 251 | ||
252 | 252 | ||
253 | |||
254 | /* end of peer.c */ | 253 | /* end of peer.c */ |
diff --git a/src/util/perf_crypto_asymmetric.c b/src/util/perf_crypto_asymmetric.c index 1f2182909..7594733b0 100644 --- a/src/util/perf_crypto_asymmetric.c +++ b/src/util/perf_crypto_asymmetric.c | |||
@@ -128,4 +128,5 @@ main (int argc, char *argv[]) | |||
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
130 | 130 | ||
131 | |||
131 | /* end of perf_crypto_asymmetric.c */ | 132 | /* end of perf_crypto_asymmetric.c */ |
diff --git a/src/util/perf_crypto_ecc_dlog.c b/src/util/perf_crypto_ecc_dlog.c index 106b07026..8a0e4676b 100644 --- a/src/util/perf_crypto_ecc_dlog.c +++ b/src/util/perf_crypto_ecc_dlog.c | |||
@@ -173,4 +173,5 @@ main (int argc, char *argv[]) | |||
173 | return 0; | 173 | return 0; |
174 | } | 174 | } |
175 | 175 | ||
176 | |||
176 | /* end of perf_crypto_ecc_dlog.c */ | 177 | /* end of perf_crypto_ecc_dlog.c */ |
diff --git a/src/util/perf_crypto_hash.c b/src/util/perf_crypto_hash.c index 95eca8e7a..3bd483639 100644 --- a/src/util/perf_crypto_hash.c +++ b/src/util/perf_crypto_hash.c | |||
@@ -110,4 +110,5 @@ main (int argc, char *argv[]) | |||
110 | return 0; | 110 | return 0; |
111 | } | 111 | } |
112 | 112 | ||
113 | |||
113 | /* end of perf_crypto_hash.c */ | 114 | /* end of perf_crypto_hash.c */ |
diff --git a/src/util/perf_crypto_paillier.c b/src/util/perf_crypto_paillier.c index dd5622108..35e6cce16 100644 --- a/src/util/perf_crypto_paillier.c +++ b/src/util/perf_crypto_paillier.c | |||
@@ -91,4 +91,5 @@ main (int argc, char *argv[]) | |||
91 | return 0; | 91 | return 0; |
92 | } | 92 | } |
93 | 93 | ||
94 | |||
94 | /* end of perf_crypto_paillier.c */ | 95 | /* end of perf_crypto_paillier.c */ |
diff --git a/src/util/perf_crypto_rsa.c b/src/util/perf_crypto_rsa.c index c65739f1f..d652e8d4e 100644 --- a/src/util/perf_crypto_rsa.c +++ b/src/util/perf_crypto_rsa.c | |||
@@ -88,8 +88,7 @@ eval (unsigned int len) | |||
88 | 64 * 1024 / (1 + | 88 | 64 * 1024 / (1 + |
89 | GNUNET_TIME_absolute_get_duration | 89 | GNUNET_TIME_absolute_get_duration |
90 | (start).rel_value_us / 1000LL), "keys/ms"); | 90 | (start).rel_value_us / 1000LL), "keys/ms"); |
91 | */ | 91 | */start = GNUNET_TIME_absolute_get (); |
92 | start = GNUNET_TIME_absolute_get (); | ||
93 | GNUNET_CRYPTO_hash ("test", 4, &hc); | 92 | GNUNET_CRYPTO_hash ("test", 4, &hc); |
94 | for (i = 0; i < 10; i++) | 93 | for (i = 0; i < 10; i++) |
95 | { | 94 | { |
diff --git a/src/util/perf_crypto_symmetric.c b/src/util/perf_crypto_symmetric.c index c05700155..8176361ba 100644 --- a/src/util/perf_crypto_symmetric.c +++ b/src/util/perf_crypto_symmetric.c | |||
@@ -73,4 +73,5 @@ main (int argc, char *argv[]) | |||
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
75 | 75 | ||
76 | |||
76 | /* end of perf_crypto_aes.c */ | 77 | /* end of perf_crypto_aes.c */ |
diff --git a/src/util/perf_malloc.c b/src/util/perf_malloc.c index 3682777bd..727e15979 100644 --- a/src/util/perf_malloc.c +++ b/src/util/perf_malloc.c | |||
@@ -62,4 +62,5 @@ main (int argc, char *argv[]) | |||
62 | return 0; | 62 | return 0; |
63 | } | 63 | } |
64 | 64 | ||
65 | |||
65 | /* end of perf_malloc.c */ | 66 | /* end of perf_malloc.c */ |
diff --git a/src/util/program.c b/src/util/program.c index 630ec6205..5ad069edd 100644 --- a/src/util/program.c +++ b/src/util/program.c | |||
@@ -318,8 +318,7 @@ GNUNET_PROGRAM_run2 (int argc, | |||
318 | specified in the configuration, remember the command-line option | 318 | specified in the configuration, remember the command-line option |
319 | in "cfg". This is typically really only having an effect if we | 319 | in "cfg". This is typically really only having an effect if we |
320 | are running code in src/arm/, as obviously the rest of the code | 320 | are running code in src/arm/, as obviously the rest of the code |
321 | has little business with ARM-specific options. */ | 321 | has little business with ARM-specific options. */if (GNUNET_YES != GNUNET_CONFIGURATION_have_value (cfg, "arm", "CONFIG")) |
322 | if (GNUNET_YES != GNUNET_CONFIGURATION_have_value (cfg, "arm", "CONFIG")) | ||
323 | { | 322 | { |
324 | if (NULL != cc.cfgfile) | 323 | if (NULL != cc.cfgfile) |
325 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", cc.cfgfile); | 324 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", cc.cfgfile); |
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 89dba3799..48a3f04ce 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -1380,6 +1380,8 @@ check_fd (struct GNUNET_SCHEDULER_Task *t, int raw_fd) | |||
1380 | } | 1380 | } |
1381 | } | 1381 | } |
1382 | } | 1382 | } |
1383 | |||
1384 | |||
1383 | #endif | 1385 | #endif |
1384 | 1386 | ||
1385 | 1387 | ||
@@ -1564,6 +1566,7 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | |||
1564 | task, task_cls); | 1566 | task, task_cls); |
1565 | } | 1567 | } |
1566 | 1568 | ||
1569 | |||
1567 | /** | 1570 | /** |
1568 | * Schedule a new task to be run with a specified delay or when the | 1571 | * Schedule a new task to be run with a specified delay or when the |
1569 | * specified file descriptor is ready. The delay can be | 1572 | * specified file descriptor is ready. The delay can be |
@@ -1857,8 +1860,7 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | |||
1857 | * this case gracefully because some libraries such as libmicrohttpd | 1860 | * this case gracefully because some libraries such as libmicrohttpd |
1858 | * only provide a hint what the maximum FD number in an FD set might be | 1861 | * only provide a hint what the maximum FD number in an FD set might be |
1859 | * and not the exact FD number (see e.g. gnunet-rest-service.c) | 1862 | * and not the exact FD number (see e.g. gnunet-rest-service.c) |
1860 | */ | 1863 | */int no_fds_extracted = (0 == read_nhandles_len) && |
1861 | int no_fds_extracted = (0 == read_nhandles_len) && | ||
1862 | (0 == read_fhandles_len) && | 1864 | (0 == read_fhandles_len) && |
1863 | (0 == write_nhandles_len) && | 1865 | (0 == write_nhandles_len) && |
1864 | (0 == write_fhandles_len); | 1866 | (0 == write_fhandles_len); |
@@ -2024,8 +2026,7 @@ GNUNET_SCHEDULER_do_work (struct GNUNET_SCHEDULER_Handle *sh) | |||
2024 | * | 2026 | * |
2025 | * It might also mean we are busy-waiting because of a programming | 2027 | * It might also mean we are busy-waiting because of a programming |
2026 | * error in the external event loop. | 2028 | * error in the external event loop. |
2027 | */ | 2029 | */LOG (GNUNET_ERROR_TYPE_DEBUG, |
2028 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2029 | "GNUNET_SCHEDULER_do_work did not find any ready " | 2030 | "GNUNET_SCHEDULER_do_work did not find any ready " |
2030 | "tasks and timeout has not been reached yet.\n"); | 2031 | "tasks and timeout has not been reached yet.\n"); |
2031 | } | 2032 | } |
diff --git a/src/util/signal.c b/src/util/signal.c index fd7eecdd3..8b9a9a291 100644 --- a/src/util/signal.c +++ b/src/util/signal.c | |||
@@ -72,6 +72,7 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler) | |||
72 | return ret; | 72 | return ret; |
73 | } | 73 | } |
74 | 74 | ||
75 | |||
75 | void | 76 | void |
76 | GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx) | 77 | GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx) |
77 | { | 78 | { |
diff --git a/src/util/socks.c b/src/util/socks.c index c2e012f1c..756be753a 100644 --- a/src/util/socks.c +++ b/src/util/socks.c | |||
@@ -387,8 +387,7 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
387 | * connection.c tells us nothing itself, but mostly its timouts. | 387 | * connection.c tells us nothing itself, but mostly its timouts. |
388 | * Initially, we'll simply ignore this and leave massive timeouts, but | 388 | * Initially, we'll simply ignore this and leave massive timeouts, but |
389 | * maybe that should change for error handling pruposes. It appears that | 389 | * maybe that should change for error handling pruposes. It appears that |
390 | * successful operations, including DNS resolution, do not use this. */ | 390 | * successful operations, including DNS resolution, do not use this. */if (NULL == buf) |
391 | if (NULL == buf) | ||
392 | { | 391 | { |
393 | if (0 == ih->step) | 392 | if (0 == ih->step) |
394 | { | 393 | { |
@@ -629,7 +628,7 @@ GNUNET_SOCKS_do_connect (const char *service_name, | |||
629 | port0 = 9050; | 628 | port0 = 9050; |
630 | /* A typical Tor client should usually try port 9150 for the TBB too, but | 629 | /* A typical Tor client should usually try port 9150 for the TBB too, but |
631 | * GNUnet can probably assume a system Tor installation. */ | 630 | * GNUnet can probably assume a system Tor installation. */ |
632 | if ((port0 > 65535)||(port0 <= 0)) | 631 | if ((port0 > 65535) || (port0 <= 0)) |
633 | { | 632 | { |
634 | LOG (GNUNET_ERROR_TYPE_WARNING, | 633 | LOG (GNUNET_ERROR_TYPE_WARNING, |
635 | _ ( | 634 | _ ( |
@@ -686,4 +685,5 @@ GNUNET_SOCKS_do_connect (const char *service_name, | |||
686 | return GNUNET_SOCKS_run_handshake (ih, socks5); | 685 | return GNUNET_SOCKS_run_handshake (ih, socks5); |
687 | } | 686 | } |
688 | 687 | ||
688 | |||
689 | /* socks.c */ | 689 | /* socks.c */ |
diff --git a/src/util/speedup.c b/src/util/speedup.c index 81fdab48a..3d9e82319 100644 --- a/src/util/speedup.c +++ b/src/util/speedup.c | |||
@@ -115,4 +115,5 @@ GNUNET_SPEEDUP_stop_ () | |||
115 | "Stopped execution speed up\n"); | 115 | "Stopped execution speed up\n"); |
116 | } | 116 | } |
117 | 117 | ||
118 | |||
118 | /* end of speedup.c */ | 119 | /* end of speedup.c */ |
diff --git a/src/util/strings.c b/src/util/strings.c index 3442a6bf7..4e7451283 100644 --- a/src/util/strings.c +++ b/src/util/strings.c | |||
@@ -754,9 +754,7 @@ GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t) | |||
754 | * As for msvcrt, use the wide variant, which always returns utf16 | 754 | * As for msvcrt, use the wide variant, which always returns utf16 |
755 | * (otherwise we'd have to detect current codepage or use W32API character | 755 | * (otherwise we'd have to detect current codepage or use W32API character |
756 | * set conversion routines to convert to UTF8). | 756 | * set conversion routines to convert to UTF8). |
757 | */ | 757 | */strftime (buf, sizeof(buf), "%a %b %d %H:%M:%S %Y", tp); |
758 | |||
759 | strftime (buf, sizeof(buf), "%a %b %d %H:%M:%S %Y", tp); | ||
760 | 758 | ||
761 | return buf; | 759 | return buf; |
762 | } | 760 | } |
@@ -1052,9 +1050,9 @@ GNUNET_STRINGS_parse_uri (const char *path, | |||
1052 | pp_state += 1; | 1050 | pp_state += 1; |
1053 | continue; | 1051 | continue; |
1054 | } | 1052 | } |
1055 | if (! (((path[i] >= 'A') &&(path[i] <= 'Z') ) || | 1053 | if (! (((path[i] >= 'A') && (path[i] <= 'Z') ) || |
1056 | ((path[i] >= 'a') &&(path[i] <= 'z') ) || | 1054 | ((path[i] >= 'a') && (path[i] <= 'z') ) || |
1057 | ((path[i] >= '0') &&(path[i] <= '9') ) ||(path[i] == '+') || | 1055 | ((path[i] >= '0') && (path[i] <= '9') ) || (path[i] == '+') || |
1058 | (path[i] == '-') || (path[i] == '.'))) | 1056 | (path[i] == '-') || (path[i] == '.'))) |
1059 | end = 1; | 1057 | end = 1; |
1060 | break; | 1058 | break; |
@@ -1898,6 +1896,7 @@ GNUNET_STRINGS_base64_encode (const void *in, size_t len, char **output) | |||
1898 | return ret; | 1896 | return ret; |
1899 | } | 1897 | } |
1900 | 1898 | ||
1899 | |||
1901 | #define cvtfind(a) \ | 1900 | #define cvtfind(a) \ |
1902 | ((((a) >= 'A') && ((a) <= 'Z')) \ | 1901 | ((((a) >= 'A') && ((a) <= 'Z')) \ |
1903 | ? (a) - 'A' \ | 1902 | ? (a) - 'A' \ |
diff --git a/src/util/test_bio.c b/src/util/test_bio.c index 180cada76..8ff93c168 100644 --- a/src/util/test_bio.c +++ b/src/util/test_bio.c | |||
@@ -76,6 +76,7 @@ test_normal_rw () | |||
76 | return 0; | 76 | return 0; |
77 | } | 77 | } |
78 | 78 | ||
79 | |||
79 | static int | 80 | static int |
80 | test_nullstring_rw () | 81 | test_nullstring_rw () |
81 | { | 82 | { |
@@ -103,6 +104,7 @@ test_nullstring_rw () | |||
103 | return 0; | 104 | return 0; |
104 | } | 105 | } |
105 | 106 | ||
107 | |||
106 | static int | 108 | static int |
107 | test_emptystring_rw () | 109 | test_emptystring_rw () |
108 | { | 110 | { |
@@ -130,6 +132,7 @@ test_emptystring_rw () | |||
130 | return 0; | 132 | return 0; |
131 | } | 133 | } |
132 | 134 | ||
135 | |||
133 | static int | 136 | static int |
134 | test_bigstring_rw () | 137 | test_bigstring_rw () |
135 | { | 138 | { |
@@ -159,6 +162,7 @@ test_bigstring_rw () | |||
159 | return 0; | 162 | return 0; |
160 | } | 163 | } |
161 | 164 | ||
165 | |||
162 | static int | 166 | static int |
163 | test_bigmeta_rw () | 167 | test_bigmeta_rw () |
164 | { | 168 | { |
@@ -192,6 +196,7 @@ test_bigmeta_rw () | |||
192 | return 0; | 196 | return 0; |
193 | } | 197 | } |
194 | 198 | ||
199 | |||
195 | static int | 200 | static int |
196 | test_directory_r () | 201 | test_directory_r () |
197 | { | 202 | { |
@@ -212,6 +217,7 @@ test_directory_r () | |||
212 | return 0; | 217 | return 0; |
213 | } | 218 | } |
214 | 219 | ||
220 | |||
215 | static int | 221 | static int |
216 | test_nullfile_rw () | 222 | test_nullfile_rw () |
217 | { | 223 | { |
@@ -287,6 +293,7 @@ test_fullfile_rw () | |||
287 | return 0; | 293 | return 0; |
288 | } | 294 | } |
289 | 295 | ||
296 | |||
290 | static int | 297 | static int |
291 | test_fakestring_rw () | 298 | test_fakestring_rw () |
292 | { | 299 | { |
@@ -315,6 +322,7 @@ test_fakestring_rw () | |||
315 | return 0; | 322 | return 0; |
316 | } | 323 | } |
317 | 324 | ||
325 | |||
318 | static int | 326 | static int |
319 | test_fakemeta_rw () | 327 | test_fakemeta_rw () |
320 | { | 328 | { |
@@ -345,6 +353,7 @@ test_fakemeta_rw () | |||
345 | return 0; | 353 | return 0; |
346 | } | 354 | } |
347 | 355 | ||
356 | |||
348 | static int | 357 | static int |
349 | test_fakebigmeta_rw () | 358 | test_fakebigmeta_rw () |
350 | { | 359 | { |
@@ -375,6 +384,7 @@ test_fakebigmeta_rw () | |||
375 | return 0; | 384 | return 0; |
376 | } | 385 | } |
377 | 386 | ||
387 | |||
378 | static int | 388 | static int |
379 | check_string_rw () | 389 | check_string_rw () |
380 | { | 390 | { |
@@ -385,6 +395,7 @@ check_string_rw () | |||
385 | return 0; | 395 | return 0; |
386 | } | 396 | } |
387 | 397 | ||
398 | |||
388 | static int | 399 | static int |
389 | check_metadata_rw () | 400 | check_metadata_rw () |
390 | { | 401 | { |
@@ -394,6 +405,7 @@ check_metadata_rw () | |||
394 | return 0; | 405 | return 0; |
395 | } | 406 | } |
396 | 407 | ||
408 | |||
397 | static int | 409 | static int |
398 | check_file_rw () | 410 | check_file_rw () |
399 | { | 411 | { |
@@ -404,6 +416,7 @@ check_file_rw () | |||
404 | return 0; | 416 | return 0; |
405 | } | 417 | } |
406 | 418 | ||
419 | |||
407 | int | 420 | int |
408 | main (int argc, char *argv[]) | 421 | main (int argc, char *argv[]) |
409 | { | 422 | { |
@@ -414,4 +427,5 @@ main (int argc, char *argv[]) | |||
414 | return 0; | 427 | return 0; |
415 | } | 428 | } |
416 | 429 | ||
430 | |||
417 | /* end of test_bio.c */ | 431 | /* end of test_bio.c */ |
diff --git a/src/util/test_client.c b/src/util/test_client.c index fafb967b4..ef5765fff 100644 --- a/src/util/test_client.c +++ b/src/util/test_client.c | |||
@@ -192,4 +192,5 @@ main (int argc, | |||
192 | return global_ret; | 192 | return global_ret; |
193 | } | 193 | } |
194 | 194 | ||
195 | |||
195 | /* end of test_client.c */ | 196 | /* end of test_client.c */ |
diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c index 1c41a10bc..e2fc29e82 100644 --- a/src/util/test_common_allocation.c +++ b/src/util/test_common_allocation.c | |||
@@ -150,4 +150,5 @@ main (int argc, char *argv[]) | |||
150 | return ret; | 150 | return ret; |
151 | } | 151 | } |
152 | 152 | ||
153 | |||
153 | /* end of test_common_allocation.c */ | 154 | /* end of test_common_allocation.c */ |
diff --git a/src/util/test_common_endian.c b/src/util/test_common_endian.c index 0fc23fb44..10a85a1bb 100644 --- a/src/util/test_common_endian.c +++ b/src/util/test_common_endian.c | |||
@@ -39,4 +39,5 @@ main (int argc, char *argv[]) | |||
39 | return 0; | 39 | return 0; |
40 | } | 40 | } |
41 | 41 | ||
42 | |||
42 | /* end of test_common_endian.c */ | 43 | /* end of test_common_endian.c */ |
diff --git a/src/util/test_common_logging.c b/src/util/test_common_logging.c index d905a3bf3..7d7656ed8 100644 --- a/src/util/test_common_logging.c +++ b/src/util/test_common_logging.c | |||
@@ -36,7 +36,6 @@ my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component, | |||
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | |||
40 | int | 39 | int |
41 | main (int argc, char *argv[]) | 40 | main (int argc, char *argv[]) |
42 | { | 41 | { |
@@ -96,4 +95,5 @@ main (int argc, char *argv[]) | |||
96 | return 0; | 95 | return 0; |
97 | } /* end of main */ | 96 | } /* end of main */ |
98 | 97 | ||
98 | |||
99 | /* end of test_common_logging.c */ | 99 | /* end of test_common_logging.c */ |
diff --git a/src/util/test_common_logging_dummy.c b/src/util/test_common_logging_dummy.c index 9a08714ec..ffcad888e 100644 --- a/src/util/test_common_logging_dummy.c +++ b/src/util/test_common_logging_dummy.c | |||
@@ -62,6 +62,8 @@ expensive_func () | |||
62 | { | 62 | { |
63 | return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY); | 63 | return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY); |
64 | } | 64 | } |
65 | |||
66 | |||
65 | #endif | 67 | #endif |
66 | 68 | ||
67 | 69 | ||
@@ -116,4 +118,5 @@ main (int argc, char *argv[]) | |||
116 | return 0; | 118 | return 0; |
117 | } /* end of main */ | 119 | } /* end of main */ |
118 | 120 | ||
121 | |||
119 | /* end of test_common_logging_dummy.c */ | 122 | /* end of test_common_logging_dummy.c */ |
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index b82138492..2f5efa198 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c | |||
@@ -113,8 +113,8 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2, | |||
113 | j = 0; | 113 | j = 0; |
114 | int stage = 0; | 114 | int stage = 0; |
115 | 115 | ||
116 | if (! ((phase >= phase_from1)&&(phase <= phase_to1)) && | 116 | if (! ((phase >= phase_from1) && (phase <= phase_to1)) && |
117 | ! ((phase >= phase_from2)&&(phase <= phase_to2))) | 117 | ! ((phase >= phase_from2) && (phase <= phase_to2))) |
118 | return p; | 118 | return p; |
119 | #if 0 | 119 | #if 0 |
120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -196,6 +196,7 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2, | |||
196 | return &r[i]; | 196 | return &r[i]; |
197 | } | 197 | } |
198 | 198 | ||
199 | |||
199 | /** | 200 | /** |
200 | * Up to 8 non-skipped GNUNET_log() calls | 201 | * Up to 8 non-skipped GNUNET_log() calls |
201 | * + extra line with delay for each one | 202 | * + extra line with delay for each one |
@@ -259,10 +260,9 @@ read_call (void *cls) | |||
259 | * | 7D * * * * * * * * | 260 | * | 7D * * * * * * * * |
260 | * | 8 * * * * | 261 | * | 8 * * * * |
261 | * | 9 * * * * | 262 | * | 9 * * * * |
262 | */ | 263 | */char *p = buf; |
263 | char *p = buf; | ||
264 | 264 | ||
265 | if ((bytes == LOG_BUFFER_SIZE)|| | 265 | if ((bytes == LOG_BUFFER_SIZE) || |
266 | ! (p = | 266 | ! (p = |
267 | read_output_line (0, 3, 4, 9, 'L', "ERROR", -1, | 267 | read_output_line (0, 3, 4, 9, 'L', "ERROR", -1, |
268 | 1, phase, p, | 268 | 1, phase, p, |
@@ -453,4 +453,5 @@ main (int argc, char *argv[]) | |||
453 | return ok; | 453 | return ok; |
454 | } | 454 | } |
455 | 455 | ||
456 | |||
456 | /* end of test_common_logging_runtime_loglevels.c */ | 457 | /* end of test_common_logging_runtime_loglevels.c */ |
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c index c3a773ab6..6227a28db 100644 --- a/src/util/test_configuration.c +++ b/src/util/test_configuration.c | |||
@@ -123,7 +123,7 @@ diffsCallBack (void *cls, const char *section, const char *option, | |||
123 | option, &diffValue); | 123 | option, &diffValue); |
124 | if (NULL != diffValue) | 124 | if (NULL != diffValue) |
125 | { | 125 | { |
126 | if ((ret == GNUNET_SYSERR) ||(strcmp (diffValue, value) != 0) ) | 126 | if ((ret == GNUNET_SYSERR) || (strcmp (diffValue, value) != 0) ) |
127 | cbData->status = 1; | 127 | cbData->status = 1; |
128 | } | 128 | } |
129 | else | 129 | else |
@@ -204,6 +204,7 @@ editConfiguration (struct GNUNET_CONFIGURATION_Handle *cfg, int option) | |||
204 | return diffsCB.cfgDiffs; | 204 | return diffsCB.cfgDiffs; |
205 | } | 205 | } |
206 | 206 | ||
207 | |||
207 | /** | 208 | /** |
208 | * Checking configuration diffs | 209 | * Checking configuration diffs |
209 | */ | 210 | */ |
@@ -349,6 +350,7 @@ testConfig () | |||
349 | return 0; | 350 | return 0; |
350 | } | 351 | } |
351 | 352 | ||
353 | |||
352 | static const char *want[] = { | 354 | static const char *want[] = { |
353 | "/Hello", | 355 | "/Hello", |
354 | "/File Name", | 356 | "/File Name", |
@@ -371,6 +373,7 @@ check (void *data, const char *fn) | |||
371 | return GNUNET_SYSERR; | 373 | return GNUNET_SYSERR; |
372 | } | 374 | } |
373 | 375 | ||
376 | |||
374 | static int | 377 | static int |
375 | testConfigFilenames () | 378 | testConfigFilenames () |
376 | { | 379 | { |
diff --git a/src/util/test_container_bloomfilter.c b/src/util/test_container_bloomfilter.c index 0217bad44..67fbaf38b 100644 --- a/src/util/test_container_bloomfilter.c +++ b/src/util/test_container_bloomfilter.c | |||
@@ -40,6 +40,7 @@ nextHC (struct GNUNET_HashCode *hc) | |||
40 | GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, hc); | 40 | GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, hc); |
41 | } | 41 | } |
42 | 42 | ||
43 | |||
43 | static int | 44 | static int |
44 | add_iterator (void *cls, struct GNUNET_HashCode *next) | 45 | add_iterator (void *cls, struct GNUNET_HashCode *next) |
45 | { | 46 | { |
@@ -53,6 +54,7 @@ add_iterator (void *cls, struct GNUNET_HashCode *next) | |||
53 | return GNUNET_YES; | 54 | return GNUNET_YES; |
54 | } | 55 | } |
55 | 56 | ||
57 | |||
56 | int | 58 | int |
57 | main (int argc, char *argv[]) | 59 | main (int argc, char *argv[]) |
58 | { | 60 | { |
diff --git a/src/util/test_container_dll.c b/src/util/test_container_dll.c index b5c238511..33671d00b 100644 --- a/src/util/test_container_dll.c +++ b/src/util/test_container_dll.c | |||
@@ -109,4 +109,5 @@ main (int argc, char **argv) | |||
109 | return 0; | 109 | return 0; |
110 | } | 110 | } |
111 | 111 | ||
112 | |||
112 | /* end of test_container_heap.c */ | 113 | /* end of test_container_heap.c */ |
diff --git a/src/util/test_container_heap.c b/src/util/test_container_heap.c index 2530f3dbc..c83c7810f 100644 --- a/src/util/test_container_heap.c +++ b/src/util/test_container_heap.c | |||
@@ -35,6 +35,7 @@ iterator_callback (void *cls, | |||
35 | return GNUNET_OK; | 35 | return GNUNET_OK; |
36 | } | 36 | } |
37 | 37 | ||
38 | |||
38 | static int | 39 | static int |
39 | nstrcmp (const char *a, const char *b) | 40 | nstrcmp (const char *a, const char *b) |
40 | { | 41 | { |
@@ -43,6 +44,7 @@ nstrcmp (const char *a, const char *b) | |||
43 | return strcmp (a, b); | 44 | return strcmp (a, b); |
44 | } | 45 | } |
45 | 46 | ||
47 | |||
46 | static int | 48 | static int |
47 | check () | 49 | check () |
48 | { | 50 | { |
@@ -287,4 +289,5 @@ main (int argc, char **argv) | |||
287 | return check (); | 289 | return check (); |
288 | } | 290 | } |
289 | 291 | ||
292 | |||
290 | /* end of test_container_heap.c */ | 293 | /* end of test_container_heap.c */ |
diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c index 1d82bd701..bd9e7af31 100644 --- a/src/util/test_container_multihashmap.c +++ b/src/util/test_container_multihashmap.c | |||
@@ -120,6 +120,7 @@ testMap (int i) | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | |||
123 | int | 124 | int |
124 | main (int argc, char *argv[]) | 125 | main (int argc, char *argv[]) |
125 | { | 126 | { |
@@ -134,4 +135,5 @@ main (int argc, char *argv[]) | |||
134 | return 0; | 135 | return 0; |
135 | } | 136 | } |
136 | 137 | ||
138 | |||
137 | /* end of test_container_multihashmap.c */ | 139 | /* end of test_container_multihashmap.c */ |
diff --git a/src/util/test_container_multihashmap32.c b/src/util/test_container_multihashmap32.c index 81b941d5e..92aac6eeb 100644 --- a/src/util/test_container_multihashmap32.c +++ b/src/util/test_container_multihashmap32.c | |||
@@ -90,6 +90,7 @@ testMap (int i) | |||
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | |||
93 | int | 94 | int |
94 | main (int argc, char *argv[]) | 95 | main (int argc, char *argv[]) |
95 | { | 96 | { |
@@ -104,4 +105,5 @@ main (int argc, char *argv[]) | |||
104 | return 0; | 105 | return 0; |
105 | } | 106 | } |
106 | 107 | ||
108 | |||
107 | /* end of test_container_multihashmap.c */ | 109 | /* end of test_container_multihashmap.c */ |
diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c index 19cd67080..9aeead56c 100644 --- a/src/util/test_container_multipeermap.c +++ b/src/util/test_container_multipeermap.c | |||
@@ -120,6 +120,7 @@ testMap (int i) | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | |||
123 | int | 124 | int |
124 | main (int argc, char *argv[]) | 125 | main (int argc, char *argv[]) |
125 | { | 126 | { |
@@ -134,4 +135,5 @@ main (int argc, char *argv[]) | |||
134 | return 0; | 135 | return 0; |
135 | } | 136 | } |
136 | 137 | ||
138 | |||
137 | /* end of test_container_multipeermap.c */ | 139 | /* end of test_container_multipeermap.c */ |
diff --git a/src/util/test_crypto_ecc_dlog.c b/src/util/test_crypto_ecc_dlog.c index b3b2a7480..a2c02a94e 100644 --- a/src/util/test_crypto_ecc_dlog.c +++ b/src/util/test_crypto_ecc_dlog.c | |||
@@ -164,7 +164,6 @@ test_math (struct GNUNET_CRYPTO_EccDlogContext *edc) | |||
164 | } | 164 | } |
165 | 165 | ||
166 | 166 | ||
167 | |||
168 | int | 167 | int |
169 | main (int argc, char *argv[]) | 168 | main (int argc, char *argv[]) |
170 | { | 169 | { |
@@ -192,4 +191,5 @@ main (int argc, char *argv[]) | |||
192 | return 0; | 191 | return 0; |
193 | } | 192 | } |
194 | 193 | ||
194 | |||
195 | /* end of test_crypto_ecc_dlog.c */ | 195 | /* end of test_crypto_ecc_dlog.c */ |
diff --git a/src/util/test_crypto_ecdhe.c b/src/util/test_crypto_ecdhe.c index 5e5b34c43..6f91be746 100644 --- a/src/util/test_crypto_ecdhe.c +++ b/src/util/test_crypto_ecdhe.c | |||
@@ -69,4 +69,5 @@ main (int argc, char *argv[]) | |||
69 | return 0; | 69 | return 0; |
70 | } | 70 | } |
71 | 71 | ||
72 | |||
72 | /* end of test_crypto_ecdhe.c */ | 73 | /* end of test_crypto_ecdhe.c */ |
diff --git a/src/util/test_crypto_ecdsa.c b/src/util/test_crypto_ecdsa.c index d6f406b47..826097d52 100644 --- a/src/util/test_crypto_ecdsa.c +++ b/src/util/test_crypto_ecdsa.c | |||
@@ -174,6 +174,8 @@ testSignPerformance () | |||
174 | GNUNET_YES)); | 174 | GNUNET_YES)); |
175 | return ok; | 175 | return ok; |
176 | } | 176 | } |
177 | |||
178 | |||
177 | #endif | 179 | #endif |
178 | 180 | ||
179 | 181 | ||
@@ -245,4 +247,5 @@ main (int argc, char *argv[]) | |||
245 | return 0; | 247 | return 0; |
246 | } | 248 | } |
247 | 249 | ||
250 | |||
248 | /* end of test_crypto_ecdsa.c */ | 251 | /* end of test_crypto_ecdsa.c */ |
diff --git a/src/util/test_crypto_eddsa.c b/src/util/test_crypto_eddsa.c index f51316463..ac991cef5 100644 --- a/src/util/test_crypto_eddsa.c +++ b/src/util/test_crypto_eddsa.c | |||
@@ -119,6 +119,8 @@ testSignPerformance () | |||
119 | GNUNET_YES)); | 119 | GNUNET_YES)); |
120 | return ok; | 120 | return ok; |
121 | } | 121 | } |
122 | |||
123 | |||
122 | #endif | 124 | #endif |
123 | 125 | ||
124 | 126 | ||
@@ -210,4 +212,5 @@ main (int argc, char *argv[]) | |||
210 | return 0; | 212 | return 0; |
211 | } | 213 | } |
212 | 214 | ||
215 | |||
213 | /* end of test_crypto_eddsa.c */ | 216 | /* end of test_crypto_eddsa.c */ |
diff --git a/src/util/test_crypto_hash.c b/src/util/test_crypto_hash.c index 0118dd754..12e1324dd 100644 --- a/src/util/test_crypto_hash.c +++ b/src/util/test_crypto_hash.c | |||
@@ -49,6 +49,7 @@ test (int number) | |||
49 | return 0; | 49 | return 0; |
50 | } | 50 | } |
51 | 51 | ||
52 | |||
52 | static int | 53 | static int |
53 | testEncoding () | 54 | testEncoding () |
54 | { | 55 | { |
@@ -60,6 +61,7 @@ testEncoding () | |||
60 | return 0; | 61 | return 0; |
61 | } | 62 | } |
62 | 63 | ||
64 | |||
63 | static int | 65 | static int |
64 | testArithmetic () | 66 | testArithmetic () |
65 | { | 67 | { |
@@ -99,6 +101,7 @@ testArithmetic () | |||
99 | return 0; | 101 | return 0; |
100 | } | 102 | } |
101 | 103 | ||
104 | |||
102 | static void | 105 | static void |
103 | finished_task (void *cls, const struct GNUNET_HashCode *res) | 106 | finished_task (void *cls, const struct GNUNET_HashCode *res) |
104 | { | 107 | { |
@@ -156,4 +159,5 @@ main (int argc, char *argv[]) | |||
156 | return 0; | 159 | return 0; |
157 | } | 160 | } |
158 | 161 | ||
162 | |||
159 | /* end of hashingtest.c */ | 163 | /* end of hashingtest.c */ |
diff --git a/src/util/test_crypto_hash_context.c b/src/util/test_crypto_hash_context.c index d744b52b4..8c652595f 100644 --- a/src/util/test_crypto_hash_context.c +++ b/src/util/test_crypto_hash_context.c | |||
@@ -27,7 +27,8 @@ | |||
27 | 27 | ||
28 | #define LEN 1234 | 28 | #define LEN 1234 |
29 | 29 | ||
30 | int main () | 30 | int |
31 | main () | ||
31 | { | 32 | { |
32 | char data[1234]; | 33 | char data[1234]; |
33 | struct GNUNET_HashCode hc1; | 34 | struct GNUNET_HashCode hc1; |
diff --git a/src/util/test_crypto_hkdf.c b/src/util/test_crypto_hkdf.c index c41c3362b..85be5bb80 100644 --- a/src/util/test_crypto_hkdf.c +++ b/src/util/test_crypto_hkdf.c | |||
@@ -60,6 +60,7 @@ tc1 () | |||
60 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 60 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
61 | } | 61 | } |
62 | 62 | ||
63 | |||
63 | void | 64 | void |
64 | tc2 () | 65 | tc2 () |
65 | { | 66 | { |
@@ -107,6 +108,7 @@ tc2 () | |||
107 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 108 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
108 | } | 109 | } |
109 | 110 | ||
111 | |||
110 | void | 112 | void |
111 | tc3 () | 113 | tc3 () |
112 | { | 114 | { |
@@ -129,6 +131,7 @@ tc3 () | |||
129 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 131 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
130 | } | 132 | } |
131 | 133 | ||
134 | |||
132 | void | 135 | void |
133 | tc4 () | 136 | tc4 () |
134 | { | 137 | { |
@@ -156,6 +159,7 @@ tc4 () | |||
156 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 159 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
157 | } | 160 | } |
158 | 161 | ||
162 | |||
159 | void | 163 | void |
160 | tc5 () | 164 | tc5 () |
161 | { | 165 | { |
@@ -202,6 +206,7 @@ tc5 () | |||
202 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 206 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
203 | } | 207 | } |
204 | 208 | ||
209 | |||
205 | void | 210 | void |
206 | tc6 () | 211 | tc6 () |
207 | { | 212 | { |
@@ -224,6 +229,7 @@ tc6 () | |||
224 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 229 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
225 | } | 230 | } |
226 | 231 | ||
232 | |||
227 | void | 233 | void |
228 | tc7 () | 234 | tc7 () |
229 | { | 235 | { |
@@ -277,6 +283,7 @@ tc7 () | |||
277 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 283 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
278 | } | 284 | } |
279 | 285 | ||
286 | |||
280 | void | 287 | void |
281 | tc8 () | 288 | tc8 () |
282 | { | 289 | { |
@@ -309,6 +316,7 @@ tc8 () | |||
309 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); | 316 | GNUNET_assert (memcmp (result + l, "\0", 2) == 0); |
310 | } | 317 | } |
311 | 318 | ||
319 | |||
312 | int | 320 | int |
313 | main () | 321 | main () |
314 | { | 322 | { |
diff --git a/src/util/test_crypto_paillier.c b/src/util/test_crypto_paillier.c index 755d0ff38..64c9569cb 100644 --- a/src/util/test_crypto_paillier.c +++ b/src/util/test_crypto_paillier.c | |||
@@ -243,4 +243,5 @@ main (int argc, | |||
243 | return ret; | 243 | return ret; |
244 | } | 244 | } |
245 | 245 | ||
246 | |||
246 | /* end of test_crypto_paillier.c */ | 247 | /* end of test_crypto_paillier.c */ |
diff --git a/src/util/test_crypto_random.c b/src/util/test_crypto_random.c index e0a8fb72a..5e159d949 100644 --- a/src/util/test_crypto_random.c +++ b/src/util/test_crypto_random.c | |||
@@ -56,6 +56,7 @@ test (enum GNUNET_CRYPTO_Quality mode) | |||
56 | return 0; | 56 | return 0; |
57 | } | 57 | } |
58 | 58 | ||
59 | |||
59 | int | 60 | int |
60 | main (int argc, char *argv[]) | 61 | main (int argc, char *argv[]) |
61 | { | 62 | { |
diff --git a/src/util/test_crypto_symmetric.c b/src/util/test_crypto_symmetric.c index 0d83d5aa1..9f6cd5ed0 100644 --- a/src/util/test_crypto_symmetric.c +++ b/src/util/test_crypto_symmetric.c | |||
@@ -171,4 +171,5 @@ main (int argc, char *argv[]) | |||
171 | return 0; | 171 | return 0; |
172 | } | 172 | } |
173 | 173 | ||
174 | |||
174 | /* end of test_crypto_aes.c */ | 175 | /* end of test_crypto_aes.c */ |
diff --git a/src/util/test_disk.c b/src/util/test_disk.c index 7ed61c332..6969e49e6 100644 --- a/src/util/test_disk.c +++ b/src/util/test_disk.c | |||
@@ -105,6 +105,7 @@ testOpenClose () | |||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | |||
108 | static int ok; | 109 | static int ok; |
109 | 110 | ||
110 | 111 | ||
diff --git a/src/util/test_os_network.c b/src/util/test_os_network.c index 8e4e31f2e..cca29df0f 100644 --- a/src/util/test_os_network.c +++ b/src/util/test_os_network.c | |||
@@ -87,4 +87,5 @@ main (int argc, char *argv[]) | |||
87 | return ret; | 87 | return ret; |
88 | } | 88 | } |
89 | 89 | ||
90 | |||
90 | /* end of test_os_network.c */ | 91 | /* end of test_os_network.c */ |
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index fbcfa6729..2bdca5c9d 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c | |||
@@ -296,4 +296,5 @@ main (int argc, char *argv[]) | |||
296 | return ret; | 296 | return ret; |
297 | } | 297 | } |
298 | 298 | ||
299 | |||
299 | /* end of test_os_start_process.c */ | 300 | /* end of test_os_start_process.c */ |
diff --git a/src/util/test_peer.c b/src/util/test_peer.c index 5a7203507..320746c76 100644 --- a/src/util/test_peer.c +++ b/src/util/test_peer.c | |||
@@ -104,8 +104,7 @@ check () | |||
104 | * Attempt to convert pid = 0 (which is reserved) | 104 | * Attempt to convert pid = 0 (which is reserved) |
105 | * into a peer identity object, the peer identity memory | 105 | * into a peer identity object, the peer identity memory |
106 | * is expected to be set to zero | 106 | * is expected to be set to zero |
107 | */ | 107 | */GNUNET_log_skip (1, GNUNET_YES); |
108 | GNUNET_log_skip (1, GNUNET_YES); | ||
109 | GNUNET_PEER_resolve (0, &res); | 108 | GNUNET_PEER_resolve (0, &res); |
110 | GNUNET_assert (0 == | 109 | GNUNET_assert (0 == |
111 | GNUNET_is_zero (&res)); | 110 | GNUNET_is_zero (&res)); |
@@ -137,4 +136,5 @@ main () | |||
137 | return 0; | 136 | return 0; |
138 | } | 137 | } |
139 | 138 | ||
139 | |||
140 | /* end of test_peer.c */ | 140 | /* end of test_peer.c */ |
diff --git a/src/util/test_plugin.c b/src/util/test_plugin.c index d93af8db1..c0eb717d6 100644 --- a/src/util/test_plugin.c +++ b/src/util/test_plugin.c | |||
@@ -65,4 +65,5 @@ main (int argc, char *argv[]) | |||
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
67 | 67 | ||
68 | |||
68 | /* end of test_plugin.c */ | 69 | /* end of test_plugin.c */ |
diff --git a/src/util/test_plugin_plug.c b/src/util/test_plugin_plug.c index b754c4c4d..39c8774b1 100644 --- a/src/util/test_plugin_plug.c +++ b/src/util/test_plugin_plug.c | |||
@@ -31,6 +31,7 @@ libgnunet_plugin_test_init (void *arg) | |||
31 | return NULL; | 31 | return NULL; |
32 | } | 32 | } |
33 | 33 | ||
34 | |||
34 | void * | 35 | void * |
35 | libgnunet_plugin_test_done (void *arg) | 36 | libgnunet_plugin_test_done (void *arg) |
36 | { | 37 | { |
@@ -39,4 +40,5 @@ libgnunet_plugin_test_done (void *arg) | |||
39 | return NULL; | 40 | return NULL; |
40 | } | 41 | } |
41 | 42 | ||
43 | |||
42 | /* end of test_plugin_plug.c */ | 44 | /* end of test_plugin_plug.c */ |
diff --git a/src/util/test_program.c b/src/util/test_program.c index 5362c61cc..912a581a5 100644 --- a/src/util/test_program.c +++ b/src/util/test_program.c | |||
@@ -134,4 +134,5 @@ main (int argc, char *argv[]) | |||
134 | return ok; | 134 | return ok; |
135 | } | 135 | } |
136 | 136 | ||
137 | |||
137 | /* end of test_program.c */ | 138 | /* end of test_program.c */ |
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c index 2fe8f6f5c..02a70a560 100644 --- a/src/util/test_scheduler.c +++ b/src/util/test_scheduler.c | |||
@@ -289,4 +289,5 @@ main (int argc, char *argv[]) | |||
289 | return ret; | 289 | return ret; |
290 | } | 290 | } |
291 | 291 | ||
292 | |||
292 | /* end of test_scheduler.c */ | 293 | /* end of test_scheduler.c */ |
diff --git a/src/util/test_scheduler_delay.c b/src/util/test_scheduler_delay.c index 7dfb36291..003fac196 100644 --- a/src/util/test_scheduler_delay.c +++ b/src/util/test_scheduler_delay.c | |||
@@ -91,4 +91,5 @@ main (int argc, char *argv[]) | |||
91 | return 0; | 91 | return 0; |
92 | } | 92 | } |
93 | 93 | ||
94 | |||
94 | /* end of test_scheduler_delay.c */ | 95 | /* end of test_scheduler_delay.c */ |
diff --git a/src/util/test_service.c b/src/util/test_service.c index 6db8471bd..61afc0cc5 100644 --- a/src/util/test_service.c +++ b/src/util/test_service.c | |||
@@ -234,4 +234,5 @@ main (int argc, | |||
234 | return ret; | 234 | return ret; |
235 | } | 235 | } |
236 | 236 | ||
237 | |||
237 | /* end of test_service.c */ | 238 | /* end of test_service.c */ |
diff --git a/src/util/test_socks.c b/src/util/test_socks.c index b813937c2..f7e0596eb 100644 --- a/src/util/test_socks.c +++ b/src/util/test_socks.c | |||
@@ -253,4 +253,5 @@ main (int argc, char *argv[]) | |||
253 | return ok; | 253 | return ok; |
254 | } | 254 | } |
255 | 255 | ||
256 | |||
256 | /* end of test_socks.c */ | 257 | /* end of test_socks.c */ |
diff --git a/src/util/test_speedup.c b/src/util/test_speedup.c index dfb8db915..bca6886aa 100644 --- a/src/util/test_speedup.c +++ b/src/util/test_speedup.c | |||
@@ -122,4 +122,5 @@ main (int argc, char *argv[]) | |||
122 | return 1; | 122 | return 1; |
123 | } | 123 | } |
124 | 124 | ||
125 | |||
125 | /* end of test_speedup.c */ | 126 | /* end of test_speedup.c */ |
diff --git a/src/util/test_tun.c b/src/util/test_tun.c index ecb3dd664..ad4a5c19e 100644 --- a/src/util/test_tun.c +++ b/src/util/test_tun.c | |||
@@ -63,8 +63,10 @@ test_udp (size_t pll, | |||
63 | } | 63 | } |
64 | } | 64 | } |
65 | 65 | ||
66 | int main (int argc, | 66 | |
67 | char **argv) | 67 | int |
68 | main (int argc, | ||
69 | char **argv) | ||
68 | { | 70 | { |
69 | test_udp (4, 3, 22439); | 71 | test_udp (4, 3, 22439); |
70 | test_udp (4, 1, 23467); | 72 | test_udp (4, 1, 23467); |
diff --git a/src/util/time.c b/src/util/time.c index 5b4833511..a07801922 100644 --- a/src/util/time.c +++ b/src/util/time.c | |||
@@ -342,6 +342,7 @@ GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future) | |||
342 | return ret; | 342 | return ret; |
343 | } | 343 | } |
344 | 344 | ||
345 | |||
345 | /** | 346 | /** |
346 | * Compute the time difference between the given start and end times. | 347 | * Compute the time difference between the given start and end times. |
347 | * Use this function instead of actual subtraction to ensure that | 348 | * Use this function instead of actual subtraction to ensure that |
@@ -363,6 +364,7 @@ GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, | |||
363 | return ret; | 364 | return ret; |
364 | } | 365 | } |
365 | 366 | ||
367 | |||
366 | /** | 368 | /** |
367 | * Get the duration of an operation as the | 369 | * Get the duration of an operation as the |
368 | * difference of the current time and the given start time "whence". | 370 | * difference of the current time and the given start time "whence". |
@@ -926,9 +928,11 @@ GNUNET_TIME_absolute_get_monotonic ( | |||
926 | /** | 928 | /** |
927 | * Destructor | 929 | * Destructor |
928 | */ | 930 | */ |
929 | void __attribute__ ((destructor)) GNUNET_util_time_fini () | 931 | void __attribute__ ((destructor)) |
932 | GNUNET_util_time_fini () | ||
930 | { | 933 | { |
931 | (void) GNUNET_TIME_absolute_get_monotonic (NULL); | 934 | (void) GNUNET_TIME_absolute_get_monotonic (NULL); |
932 | } | 935 | } |
933 | 936 | ||
937 | |||
934 | /* end of time.c */ | 938 | /* end of time.c */ |