Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
5c77530d
Commit
5c77530d
authored
10 years ago
by
Cenk Gündoğan
Browse files
Options
Downloads
Patches
Plain Diff
sys/bloom: changed doc from bytes -> bits
parent
6715bccf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sys/include/bloom.h
+2
-2
2 additions, 2 deletions
sys/include/bloom.h
tests/unittests/tests-bloom/tests-bloom.c
+3
-3
3 additions, 3 deletions
tests/unittests/tests-bloom/tests-bloom.c
with
5 additions
and
5 deletions
sys/include/bloom.h
+
2
−
2
View file @
5c77530d
...
@@ -140,7 +140,7 @@ typedef uint32_t (*hashfp_t)(const uint8_t *, int len);
...
@@ -140,7 +140,7 @@ typedef uint32_t (*hashfp_t)(const uint8_t *, int len);
* @brief bloom_t bloom filter object
* @brief bloom_t bloom filter object
*/
*/
typedef
struct
{
typedef
struct
{
/** number of b
yte
s in the bloom array */
/** number of b
it
s in the bloom array */
size_t
m
;
size_t
m
;
/** number of hash functions */
/** number of hash functions */
size_t
k
;
size_t
k
;
...
@@ -155,7 +155,7 @@ typedef struct {
...
@@ -155,7 +155,7 @@ typedef struct {
*
*
* For best results, make 'size' a power of 2.
* For best results, make 'size' a power of 2.
*
*
* @param size size of the bit array
in
the filter
* @param size size of the bit array
of
the filter
in bits
* @param num_hashes the number of hash functions
* @param num_hashes the number of hash functions
* @param ... varg function pointers, use hashfp_t
* @param ... varg function pointers, use hashfp_t
*
*
...
...
This diff is collapsed.
Click to expand it.
tests/unittests/tests-bloom/tests-bloom.c
+
3
−
3
View file @
5c77530d
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include
"tests-bloom-sets.h"
#include
"tests-bloom-sets.h"
#define TESTS_BLOOM_B
YTE
S (128)
#define TESTS_BLOOM_B
IT
S (128)
#define TESTS_BLOOM_HASHF (6)
#define TESTS_BLOOM_HASHF (6)
#define TESTS_BLOOM_PROB_IN_FILTER (4)
#define TESTS_BLOOM_PROB_IN_FILTER (4)
#define TESTS_BLOOM_NOT_IN_FILTER (996)
#define TESTS_BLOOM_NOT_IN_FILTER (996)
...
@@ -35,7 +35,7 @@ static void load_dictionary_fixture(void)
...
@@ -35,7 +35,7 @@ static void load_dictionary_fixture(void)
static
void
set_up_bloom
(
void
)
static
void
set_up_bloom
(
void
)
{
{
bloom
=
bloom_new
(
TESTS_BLOOM_B
YTE
S
,
TESTS_BLOOM_HASHF
,
fnv_hash
,
sax_hash
,
bloom
=
bloom_new
(
TESTS_BLOOM_B
IT
S
,
TESTS_BLOOM_HASHF
,
fnv_hash
,
sax_hash
,
sdbm_hash
,
djb2_hash
,
kr_hash
,
dek_hash
,
rotating_hash
,
sdbm_hash
,
djb2_hash
,
kr_hash
,
dek_hash
,
rotating_hash
,
one_at_a_time_hash
);
one_at_a_time_hash
);
}
}
...
@@ -47,7 +47,7 @@ static void tear_down_bloom(void)
...
@@ -47,7 +47,7 @@ static void tear_down_bloom(void)
static
void
test_bloom_parameters_bytes_hashf
(
void
)
static
void
test_bloom_parameters_bytes_hashf
(
void
)
{
{
TEST_ASSERT_EQUAL_INT
(
TESTS_BLOOM_B
YTE
S
,
bloom
->
m
);
TEST_ASSERT_EQUAL_INT
(
TESTS_BLOOM_B
IT
S
,
bloom
->
m
);
TEST_ASSERT_EQUAL_INT
(
TESTS_BLOOM_HASHF
,
bloom
->
k
);
TEST_ASSERT_EQUAL_INT
(
TESTS_BLOOM_HASHF
,
bloom
->
k
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment