aboutsummaryrefslogtreecommitdiff
path: root/src/rps/rps-test_util.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
commit7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch)
treebdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/rps/rps-test_util.c
parent01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff)
downloadgnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz
gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip
tighten formatting rules
Diffstat (limited to 'src/rps/rps-test_util.c')
-rw-r--r--src/rps/rps-test_util.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c
index 66f93d86f..d2cdd3aa7 100644
--- a/src/rps/rps-test_util.c
+++ b/src/rps/rps-test_util.c
@@ -61,7 +61,6 @@ static unsigned num_bits_buf_unaligned;
61static struct GNUNET_CONTAINER_MultiHashMap *open_files; 61static struct GNUNET_CONTAINER_MultiHashMap *open_files;
62 62
63 63
64
65/** 64/**
66 * @brief Get file handle 65 * @brief Get file handle
67 * 66 *
@@ -162,7 +161,6 @@ close_all_files ()
162} 161}
163 162
164 163
165
166void 164void
167to_file_raw (const char *file_name, const char *buf, size_t size_buf) 165to_file_raw (const char *file_name, const char *buf, size_t size_buf)
168{ 166{
@@ -206,6 +204,7 @@ to_file_raw (const char *file_name, const char *buf, size_t size_buf)
206 "Unable to close file\n"); 204 "Unable to close file\n");
207} 205}
208 206
207
209void 208void
210to_file_raw_unaligned (const char *file_name, 209to_file_raw_unaligned (const char *file_name,
211 const char *buf, 210 const char *buf,
@@ -372,6 +371,7 @@ to_file_raw_unaligned (const char *file_name,
372 LOG (GNUNET_ERROR_TYPE_DEBUG, "\n"); 371 LOG (GNUNET_ERROR_TYPE_DEBUG, "\n");
373} 372}
374 373
374
375char * 375char *
376auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key) 376auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key)
377{ 377{
@@ -414,6 +414,7 @@ auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key)
414 return name_buf; 414 return name_buf;
415} 415}
416 416
417
417#endif /* TO_FILE */ 418#endif /* TO_FILE */
418 419
419 420
@@ -470,7 +471,7 @@ store_prefix_file_name (const unsigned int index,
470 64, 471 64,
471 "%u", 472 "%u",
472 index); 473 index);
473 if ((64 < out_size)|| 474 if ((64 < out_size) ||
474 (0 > out_size) ) 475 (0 > out_size) )
475 { 476 {
476 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 477 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -488,7 +489,7 @@ store_prefix_file_name (const unsigned int index,
488 "/tmp/rps/%s-%s", 489 "/tmp/rps/%s-%s",
489 prefix, 490 prefix,
490 index_str); 491 index_str);
491 if ((len_file_name < out_size)|| 492 if ((len_file_name < out_size) ||
492 (0 > out_size) ) 493 (0 > out_size) )
493 { 494 {
494 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 495 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -507,7 +508,8 @@ store_prefix_file_name (const unsigned int index,
507 * 508 *
508 * @return Factorial of @a x 509 * @return Factorial of @a x
509 */ 510 */
510uint32_t fac (uint32_t x) 511uint32_t
512fac (uint32_t x)
511{ 513{
512 if (1 >= x) 514 if (1 >= x)
513 { 515 {
@@ -516,6 +518,7 @@ uint32_t fac (uint32_t x)
516 return x * fac (x - 1); 518 return x * fac (x - 1);
517} 519}
518 520
521
519/** 522/**
520 * @brief Binomial coefficient (n choose k) 523 * @brief Binomial coefficient (n choose k)
521 * 524 *
@@ -524,7 +527,8 @@ uint32_t fac (uint32_t x)
524 * 527 *
525 * @return Binomial coefficient of @a n and @a k 528 * @return Binomial coefficient of @a n and @a k
526 */ 529 */
527uint32_t binom (uint32_t n, uint32_t k) 530uint32_t
531binom (uint32_t n, uint32_t k)
528{ 532{
529 // GNUNET_assert (n >= k); 533 // GNUNET_assert (n >= k);
530 if (k > n) 534 if (k > n)