gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 71/164: Fixed some ugly construct


From: gnunet
Subject: [gnunet] 71/164: Fixed some ugly construct
Date: Fri, 30 Jul 2021 15:32:17 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 4ac104770aad885929258e931ee11a0c35abfbe5
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Wed Apr 28 21:59:46 2021 +0200

    Fixed some ugly construct
---
 src/setu/ibf.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/setu/ibf.c b/src/setu/ibf.c
index 16a1d0147..68757ce61 100644
--- a/src/setu/ibf.c
+++ b/src/setu/ibf.c
@@ -312,6 +312,9 @@ ibf_get_max_counter (struct InvertibleBloomFilter *ibf)
             max_counter=ibf->count[i].count_val;
         }
     }
+        LOG (GNUNET_ERROR_TYPE_ERROR,
+             "max_counter: %016X OLD: %f NEW: %u NEW_INT %u \n", max_counter, 
floor(log2(max_counter)) + 1, 32 -__builtin_clz(max_counter));
+
     return floor(log2(max_counter)) + 1;
 
 }
@@ -352,14 +355,9 @@ ibf_write_slice (const struct InvertibleBloomFilter *ibf,
   key_hash_dst += count;
 
   /* pack and copy counter */
-  size_t buf_size = ceil((float) count/(8/(float)counter_max_length));
-  uint64_t *new_buf;
-  new_buf = (uint8_t*) GNUNET_malloc(buf_size);
-  pack_counter(ibf,start,count,new_buf,counter_max_length);
   count_dst = (uint8_t *) key_hash_dst;
-  GNUNET_memcpy (count_dst,
-                   new_buf,
-                   buf_size);
+  pack_counter(ibf,start,count,count_dst,counter_max_length);
+
 
 }
 
@@ -392,8 +390,8 @@ pack_counter(const struct InvertibleBloomFilter *ibf,
                  "NEW VAL: count_val_to_write: %d count_len_to_write:%u \n", 
count_val_to_write, count_len_to_write);
                  **/
         LOG (GNUNET_ERROR_TYPE_ERROR,
-             "SAVE VALUE: %X\n",
-             count_val_to_write);
+             "SAVE VALUE: %d\n",
+             ibf->count[i].count_val);
             while(count_len_to_write > 0) {
                 uint8_t byte_to_write=0;
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]