[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r28751 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r28751 - gnunet/src/util |
Date: |
Wed, 21 Aug 2013 17:17:49 +0200 |
Author: grothoff
Date: 2013-08-21 17:17:49 +0200 (Wed, 21 Aug 2013)
New Revision: 28751
Modified:
gnunet/src/util/container_bloomfilter.c
Log:
simplified OR2 API
Modified: gnunet/src/util/container_bloomfilter.c
===================================================================
--- gnunet/src/util/container_bloomfilter.c 2013-08-21 15:17:23 UTC (rev
28750)
+++ gnunet/src/util/container_bloomfilter.c 2013-08-21 15:17:49 UTC (rev
28751)
@@ -774,22 +774,27 @@
*
* @param bf the filter
* @param to_or the bloomfilter to or-in
- * @param size number of bytes in data
+ * @return #GNUNET_OK on success
*/
int
GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf,
const struct GNUNET_CONTAINER_BloomFilter
- *to_or, size_t size)
+ *to_or)
{
unsigned int i;
unsigned int n;
unsigned long long *fc;
const unsigned long long *dc;
+ size_t size;
if (NULL == bf)
- return GNUNET_YES;
- if (bf->bitArraySize != size)
+ return GNUNET_OK;
+ if (bf->bitArraySize != to_or->bitArraySize)
+ {
+ GNUNET_break (0);
return GNUNET_SYSERR;
+ }
+ size = bf->bitArraySize;
fc = (unsigned long long *) bf->bitArray;
dc = (const unsigned long long *) to_or->bitArray;
n = size / sizeof (unsigned long long);
@@ -801,6 +806,7 @@
return GNUNET_OK;
}
+
/**
* Remove an element from the filter.
*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r28751 - gnunet/src/util,
gnunet <=