From: "cron2 (Code Review)" Date: Sat, 20 Sep 2025 21:34:18 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="CgVNcgMfrck="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: list: Make types of hash elements consistent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --CgVNcgMfrck= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/11= 19?usp=3Demail ) Change subject: list: Make types of hash elements consistent ...................................................................... list: Make types of hash elements consistent Really no use in having the indices and limits in int. Change-Id: I3334465738fb1fbf508dfd719b6a238b500cc0ae Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1119 Message-Id: <20250919173838.28092-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33= 108.html Signed-off-by: Gert Doering --- M src/openvpn/integer.h M src/openvpn/list.c M src/openvpn/list.h M src/openvpn/multi.c M src/openvpn/multi.h M src/openvpn/options.c M src/openvpn/options.h M tests/unit_tests/openvpn/test_misc.c 8 files changed, 61 insertions(+), 48 deletions(-) diff --git a/src/openvpn/integer.h b/src/openvpn/integer.h index b82379e..2a6f14a 100644 --- a/src/openvpn/integer.h +++ b/src/openvpn/integer.h @@ -135,6 +135,27 @@ } } +static inline unsigned int +constrain_uint(unsigned int x, unsigned int min, unsigned int max) +{ + if (min > max) + { + return min; + } + if (x < min) + { + return min; + } + else if (x > max) + { + return max; + } + else + { + return x; + } +} + /* * Functions used for circular buffer index arithmetic. */ diff --git a/src/openvpn/list.c b/src/openvpn/list.c index f30d540..1b90d82 100644 --- a/src/openvpn/list.c +++ b/src/openvpn/list.c @@ -34,22 +34,21 @@ #include "memdbg.h" struct hash * -hash_init(const int n_buckets, const uint32_t iv, +hash_init(const uint32_t n_buckets, const uint32_t iv, uint32_t (*hash_function)(const void *key, uint32_t iv), bool (*compare_function)(const void *key1, const void *key2)) { struct hash *h; - int i; ASSERT(n_buckets > 0); ALLOC_OBJ_CLEAR(h, struct hash); - h->n_buckets =3D (int)adjust_power_of_2(n_buckets); + h->n_buckets =3D (uint32_t)adjust_power_of_2(n_buckets); h->mask =3D h->n_buckets - 1; h->hash_function =3D hash_function; h->compare_function =3D compare_function; h->iv =3D iv; ALLOC_ARRAY(h->buckets, struct hash_bucket, h->n_buckets); - for (i =3D 0; i < h->n_buckets; ++i) + for (uint32_t i =3D 0; i < h->n_buckets; ++i) { struct hash_bucket *b =3D &h->buckets[i]; b->list =3D NULL; @@ -60,8 +59,7 @@ void hash_free(struct hash *hash) { - int i; - for (i =3D 0; i < hash->n_buckets; ++i) + for (uint32_t i =3D 0; i < hash->n_buckets; ++i) { struct hash_bucket *b =3D &hash->buckets[i]; struct hash_element *he =3D b->list; @@ -212,15 +210,15 @@ } void -hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, int = start_bucket, - int end_bucket) +hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, uint= 32_t start_bucket, + uint32_t end_bucket) { if (end_bucket > hash->n_buckets) { end_bucket =3D hash->n_buckets; } - ASSERT(start_bucket >=3D 0 && start_bucket <=3D end_bucket); + ASSERT(start_bucket <=3D end_bucket); hi->hash =3D hash; hi->elem =3D NULL; @@ -325,6 +323,9 @@ * the return value. Every 1-bit and 2-bit delta achieves avalanche. * About 36+6len instructions. * + * #define hashsize(n) ((uint32_t)1<<(n)) + * #define hashmask(n) (hashsize(n)-1) + * * The best hash table sizes are powers of 2. There is no need to do * mod a prime (mod is sooo slow!). If you need less than 32 bits, * use a bitmask. For example, if you need only 10 bits, do diff --git a/src/openvpn/list.h b/src/openvpn/list.h index fb3302d..5702b95 100644 --- a/src/openvpn/list.h +++ b/src/openvpn/list.h @@ -36,14 +36,11 @@ #include "basic.h" #include "buffer.h" -#define hashsize(n) ((uint32_t)1 << (n)) -#define hashmask(n) (hashsize(n) - 1) - struct hash_element { void *value; const void *key; - unsigned int hash_value; + uint32_t hash_value; struct hash_element *next; }; @@ -54,16 +51,16 @@ struct hash { - int n_buckets; - int n_elements; - int mask; + uint32_t n_buckets; + uint32_t n_elements; + uint32_t mask; uint32_t iv; uint32_t (*hash_function)(const void *key, uint32_t iv); bool (*compare_function)(const void *key1, const void *key2); /* retur= n true if equal */ struct hash_bucket *buckets; }; -struct hash *hash_init(const int n_buckets, const uint32_t iv, +struct hash *hash_init(const uint32_t n_buckets, const uint32_t iv, uint32_t (*hash_function)(const void *key, uint32_t= iv), bool (*compare_function)(const void *key1, const vo= id *key2)); @@ -81,17 +78,17 @@ struct hash_iterator { struct hash *hash; - int bucket_index; + uint32_t bucket_index; struct hash_bucket *bucket; struct hash_element *elem; struct hash_element *last; bool bucket_marked; - int bucket_index_start; - int bucket_index_end; + uint32_t bucket_index_start; + uint32_t bucket_index_end; }; -void hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi,= int start_bucket, - int end_bucket); +void hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi,= uint32_t start_bucket, + uint32_t end_bucket); void hash_iterator_init(struct hash *hash, struct hash_iterator *iter); @@ -109,13 +106,13 @@ return (*hash->hash_function)(key, hash->iv); } -static inline int +static inline uint32_t hash_n_elements(const struct hash *hash) { return hash->n_elements; } -static inline int +static inline uint32_t hash_n_buckets(const struct hash *hash) { return hash->n_buckets; diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 8676a09..9256127 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -169,18 +169,12 @@ } =20 static void -multi_reap_range(const struct multi_context *m, int start_bucket, int end_= bucket) +multi_reap_range(const struct multi_context *m, uint32_t start_bucket, uin= t32_t end_bucket) { struct gc_arena gc =3D gc_new(); struct hash_iterator hi; struct hash_element *he; - if (start_bucket < 0) - { - start_bucket =3D 0; - end_bucket =3D hash_n_buckets(m->vhash); - } - dmsg(D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket, end_bu= cket); hash_iterator_init_range(m->vhash, &hi, start_bucket, end_bucket); while ((he =3D hash_iterator_next(&hi)) !=3D NULL) @@ -201,11 +195,11 @@ static void multi_reap_all(const struct multi_context *m) { - multi_reap_range(m, -1, 0); + multi_reap_range(m, 0, hash_n_buckets(m->vhash)); } static struct multi_reap * -multi_reap_new(int buckets_per_pass) +multi_reap_new(uint32_t buckets_per_pass) { struct multi_reap *mr; ALLOC_OBJ(mr, struct multi_reap); @@ -237,10 +231,10 @@ /* * How many buckets in vhash to reap per pass. */ -static int -reap_buckets_per_pass(int n_buckets) +static uint32_t +reap_buckets_per_pass(uint32_t n_buckets) { - return constrain_int(n_buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX); + return constrain_uint(n_buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX); } #ifdef ENABLE_MANAGEMENT diff --git a/src/openvpn/multi.h b/src/openvpn/multi.h index 087c0e6..b2b892b 100644 --- a/src/openvpn/multi.h +++ b/src/openvpn/multi.h @@ -51,8 +51,8 @@ */ struct multi_reap { - int bucket_base; - int buckets_per_pass; + uint32_t bucket_base; + uint32_t buckets_per_pass; time_t last_call; }; diff --git a/src/openvpn/options.c b/src/openvpn/options.c index f1f66b9..151a016 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -7956,8 +7956,8 @@ { goto err; } - options->real_hash_size =3D real; - options->virtual_hash_size =3D virtual; + options->real_hash_size =3D (uint32_t)real; + options->virtual_hash_size =3D (uint32_t)virtual; } else if (streq(p[0], "connect-freq") && p[1] && p[2] && !p[3]) { diff --git a/src/openvpn/options.h b/src/openvpn/options.h index a737711..b033068 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -499,8 +499,8 @@ struct in6_addr ifconfig_ipv6_pool_base; /* IPv6 */ int ifconfig_ipv6_pool_netbits; /* IPv6 */ - int real_hash_size; - int virtual_hash_size; + uint32_t real_hash_size; + uint32_t virtual_hash_size; const char *client_connect_script; const char *client_disconnect_script; const char *learn_address_script; diff --git a/tests/unit_tests/openvpn/test_misc.c b/tests/unit_tests/openvp= n/test_misc.c index dbfdd56..10bed1d 100644 --- a/tests/unit_tests/openvpn/test_misc.c +++ b/tests/unit_tests/openvpn/test_misc.c @@ -128,7 +128,7 @@ word_hash_function(const void *key, uint32_t iv) { const char *str =3D (const char *)key; - const int len =3D strlen(str); + const uint32_t len =3D (uint32_t)strlen(str); return hash_func((const uint8_t *)str, len, iv); } @@ -138,11 +138,11 @@ return strcmp((const char *)key1, (const char *)key2) =3D=3D 0; } -static unsigned long +static uint32_t get_random(void) { /* rand() is not very random, but it's C99 and this is just for testin= g */ - return rand(); + return (uint32_t)rand(); } static struct hash_element * @@ -176,7 +176,7 @@ struct hash *hash =3D hash_init(10000, get_random(), word_hash_functio= n, word_compare_function); struct hash *nhash =3D hash_init(256, get_random(), word_hash_function= , word_compare_function); - printf("hash_init n_buckets=3D%d mask=3D0x%08x\n", hash->n_buckets, ha= sh->mask); + printf("hash_init n_buckets=3D%u mask=3D0x%08x\n", hash->n_buckets, ha= sh->mask); char wordfile[PATH_MAX] =3D { 0 }; openvpn_test_get_srcdir_dir(wordfile, PATH_MAX, "/../../../COPYRIGHT.G= PL"); @@ -254,10 +254,10 @@ /* output contents of hash table */ { - ptr_type inc =3D 0; + uint32_t inc =3D 0; int count =3D 0; - for (ptr_type base =3D 0; base < hash_n_buckets(hash); base +=3D i= nc) + for (uint32_t base =3D 0; base < hash_n_buckets(hash); base +=3D i= nc) { struct hash_iterator hi; struct hash_element *he; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1119?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I3334465738fb1fbf508dfd719b6a238b500cc0ae Gerrit-Change-Number: 1119 Gerrit-PatchSet: 11 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --CgVNcgMfrck= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

list: Make types of hash elements consistent<=
br>
Really no use in having the indices and limits in int.

Change= -Id: I3334465738fb1fbf508dfd719b6a238b500cc0ae
Signed-off-by: Frank Lich= tenheld <frank@...2641...>
Acked-by: Gert Doering <gert@...1726...= ...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1119
Messa= ge-Id: <20250919173838.28092-1-gert@...1296...>
URL: https://www.m= ail-archive.com/openvpn-devel@lists.sourceforge.net/msg33108.html
Signed= -off-by: Gert Doering <gert@...1296...>
---
M src/openvpn/integ= er.h
M src/openvpn/list.c
M src/openvpn/list.h
M src/openvpn/multi= .c
M src/openvpn/multi.h
M src/openvpn/options.c
M src/openvpn/opt= ions.h
M tests/unit_tests/openvpn/test_misc.c
8 files changed, 61 ins= ertions(+), 48 deletions(-)

diff --git a/src/openvpn/integer.h b/src/openvpn/integer.h
index b82379e..2a6f14a 100644
--- a/src/openvpn/integer.= h
+++ b/src/openvpn/integer.h
@@ -135,6 +13= 5,27 @@
}
}
<= br>+static inline unsigned int<= /span>
+constrain_uint(unsig= ned int x, unsigned int min, unsigned int max)
+{
+ if (min > max)
+ {
+ = return min;
+ = }
+ if (x < mi= n)
+ {
<= span style=3D"color: hsl(120, 100%, 40%);">+ return min;

<= span style=3D"color: hsl(120, 100%, 40%);">+ }
+ else if (x > max)
+ {
+ return max;
+ }
+ else
+ = {
+ return x;<= /span>
+ }
+}

+
/*
* Functions u= sed for circular buffer index arithmetic.
*/
diff --git a/src/openvpn/list.c b/src/openvpn/list.c
in= dex f30d540..1b90d82 100644
--- a/src/openvpn/list.c=
+++ b/src/openvpn/list.c
@@ -34,22 +34,21 @@
#include "memdbg.h"

struct hash *

-hash_= init(const int n_buckets, const uint32_t iv,
+hash_init(const uint32_t n_buckets, const uint32_t= iv,
uint32_t (*hash_function)(const void *key, = uint32_t iv),
bool (*compare_function)(const voi= d *key1, const void *key2))
{
struct = hash *h;
- int i;


ASSERT(n_buckets > 0);
ALLOC_OBJ_CLEAR(h, struct hash);
- h->n_buckets =3D (int)adjust_power_of_2(n_bucket= s);
+ h->n_buck= ets =3D (uint32_t)adjust_power_of_2(n_buckets);
h->= mask =3D h->n_buckets - 1;
h->hash_function =3D = hash_function;
h->compare_function =3D compare_func= tion;
h->iv =3D iv;
ALLOC_ARRA= Y(h->buckets, struct hash_bucket, h->n_buckets);
- for (i =3D 0; i < h->n_buckets; = ++i)
+ for (uint32= _t i =3D 0; i < h->n_buckets; ++i)
{
<= span> struct hash_bucket *b =3D &h->buckets[i];
b->list =3D NULL;
@@ -60,8 +59,7 @@<= br> void
hash_free(struct hash *hash)
{
- int i;=
- for (i =3D 0; i < has= h->n_buckets; ++i)
+ for (uint32_t i =3D 0; i < hash->n_buckets; ++i)
{
struct hash_bucket *b =3D &hash->b= uckets[i];
struct hash_element *he =3D b->list;=
@@ -212,15 +210,15 @@
}
=
void
= -hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, int = start_bucket,
- = int end_bucket)
+hash_iterator_init_range(struct hash *hash, struct hash_iterat= or *hi, uint32_t start_bucket,
+ uint32_t end_bucket)
{=
if (end_bucket > hash->n_buckets)
{
end_bucket =3D hash->n_buckets;
}

- ASSERT(start_bucket >=3D 0 && start_bucket <= ;=3D end_bucket);
+ = ASSERT(start_bucket <=3D end_bucket);

hi->hash =3D hash;

hi->elem =3D NULL;

@@ -325,6 +323,9 @@
* the return value. Eve= ry 1-bit and 2-bit delta achieves avalanche.
* About 36+6= len instructions.
*
+ * #define hashsize(n) ((uint32_t)1<<(n))+ * #define hashmask(n) (hashs= ize(n)-1)
+ *<= br> * The best hash table sizes are powers of 2. There is no need t= o do
* mod a prime (mod is sooo slow!). If you need less= than 32 bits,
* use a bitmask. For example, if you need= only 10 bits, do
diff --git a/src/openvpn/list.h b/src/ope= nvpn/list.h
index fb3302d..5702b95 100644
-= -- a/src/openvpn/list.h
+++ b/src/openvpn/list.h
= @@ -36,14 +36,11 @@
#include "basic.h"

#include "buffer.h"

-#define hashsize(n) ((uint32_t)1 &l= t;< (n))
-#define ha= shmask(n) (hashsize(n) - 1)
-
struct hash_element
{
void *value;
const void *key;
- unsigned int hash_value;+ uint32_t hash_value;

struct hash_element *next;
};
=
@@ -54,16 +51,16 @@

struct hash
{
- int n_buckets;
- int n_elements;
- int mask;
+ uint32_t n_buckets;
+ uint32_t n_elements;
+ uint32_t mask;
uint32_t iv;
<= span> uint32_t (*hash_function)(const void *key, uint32_t iv); bool (*compare_function)(const void *key1, const void *key2); = /* return true if equal */
struct hash_bucket *buckets= ;
};

-struct hash *hash_init(const int n_buckets, const uint32_= t iv,
+struct hash *h= ash_init(const uint32_t n_buckets, const uint32_t iv,
= uint32_t (*hash_function)(const void *key, uint32_t iv),=
bool (*compare_function)(const voi= d *key1, const void *key2));

@@ -81,17 +7= 8,17 @@
struct hash_iterator
{
= struct hash *hash;
- int bucket_index;
+ uint32_t bucket_index;
struct hash_bucke= t *bucket;
struct hash_element *elem;
= struct hash_element *last;
bool bucket_marked;
- int bucket_index_sta= rt;
- int bucket_ind= ex_end;
+ uint32_t= bucket_index_start;
= + uint32_t bucket_index_end;
};

-void hash_iterator_init_ran= ge(struct hash *hash, struct hash_iterator *hi, int start_bucket,- i= nt end_bucket);
+void= hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, uint= 32_t start_bucket,
+ = uint32_t end_bucket);
=
void hash_iterator_init(struct hash *hash, struct hash_iterator = *iter);

@@ -109,13 +106,13 @@
<= span> return (*hash->hash_function)(key, hash->iv);

}


-static inline int
+= static inline uint32_t
hash_n_elements(const struct hash *= hash)
{
return hash->n_elements;
}

-static inline int
+static inline uint32_t
hash_n_buckets(const st= ruct hash *hash)
{
return hash->n_= buckets;
diff --git a/src/openvpn/multi.c b/src/openvpn/mul= ti.c
index 8676a09..9256127 100644
--- a/sr= c/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -169,18 +169,12 @@

}

static void
-multi_re= ap_range(const struct multi_context *m, int start_bucket, int end_bucket)
+multi_reap_range(cons= t struct multi_context *m, uint32_t start_bucket, uint32_t end_bucket)
{
struct gc_arena gc =3D gc_new();=
struct hash_iterator hi;
struct hash_el= ement *he;

- if (start_bucket < 0)
- {
- = start_bucket =3D 0;
- end_bucket =3D hash_n_buckets(m->vhash);
- }
-
dmsg(D_MULTI_DEBUG, "MULTI: RE= AP range %d -> %d", start_bucket, end_bucket);
= hash_iterator_init_range(m->vhash, &hi, start_bucket, end_bucket);<= /span>
while ((he =3D hash_iterator_next(&hi)) !=3D NULL)=
@@ -201,11 +195,11 @@
static void<= br> multi_reap_all(const struct multi_context *m)
{<= /span>
- multi_reap_range(m= , -1, 0);
+ multi_= reap_range(m, 0, hash_n_buckets(m->vhash));
}
static struct multi_reap *
-multi_reap_new(int buckets_per_pass)=
+multi_reap_new(uint32_t bu= ckets_per_pass)
{
struct multi_reap *= mr;
ALLOC_OBJ(mr, struct multi_reap);
= @@ -237,10 +231,10 @@
/*
* How many buck= ets in vhash to reap per pass.
*/
-static int
-reap_buckets_per_pass(int n_buckets)
+static uint32_t
+reap_buckets_per_pass(uint32_t n_buckets)=
{
- = return constrain_int(n_buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX);

+ return constrain_uint= (n_buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX);
}
#ifdef ENABLE_MANAGEMENT
diff --= git a/src/openvpn/multi.h b/src/openvpn/multi.h
index 087c0= e6..b2b892b 100644
--- a/src/openvpn/multi.h
+++ b/src/openvpn/multi.h
@@ -51,8 +51,8 @@
*/
struct multi_reap
{
- int bucket_base;
- int buckets_per_pass;
= + uint32_t bucket_base;

+ uint32_t buckets_per= _pass;
time_t last_call;
};
diff --git a/src/openvpn/options.c b/src/openvpn/o= ptions.c
index f1f66b9..151a016 100644
--- = a/src/openvpn/options.c
+++ b/src/openvpn/options.c<= br>@@ -7956,8 +7956,8 @@
{
= goto err;
}
- options->real_hash_size =3D real;

- options->virtu= al_hash_size =3D virtual;
+ options->real_hash_size =3D (uint32_t)real;
+ options->virtual_hash_s= ize =3D (uint32_t)virtual;
}
else= if (streq(p[0], "connect-freq") && p[1] && p[2] = && !p[3])
{
diff --git a/src/o= penvpn/options.h b/src/openvpn/options.h
index a737711..b03= 3068 100644
--- a/src/openvpn/options.h
+++= b/src/openvpn/options.h
@@ -499,8 +499,8 @@
struct in6_addr ifconfig_ipv6_pool_base; /* IPv6 */
= int ifconfig_ipv6_pool_netbits; /* IPv6 */
<= /span>
- int real_hash_size= ;
- int virtual_hash= _size;
+ uint32_t = real_hash_size;
+ = uint32_t virtual_hash_size;
const char *client_connect= _script;
const char *client_disconnect_script;<= br> const char *learn_address_script;
diff --git = a/tests/unit_tests/openvpn/test_misc.c b/tests/unit_tests/openvpn/test_misc= .c
index dbfdd56..10bed1d 100644
--- a/test= s/unit_tests/openvpn/test_misc.c
+++ b/tests/unit_tests/ope= nvpn/test_misc.c
@@ -128,7 +128,7 @@
word_= hash_function(const void *key, uint32_t iv)
{
const char *str =3D (const char *)key;

- const int len =3D strlen(str);
+ const uint32_t len =3D (uint32= _t)strlen(str);
return hash_func((const uint8_t *)str,= len, iv);
}

@@ -138,11 = +138,11 @@
return strcmp((const char *)key1, (const ch= ar *)key2) =3D=3D 0;
}

-static unsigned long
+static uint32_t
get_r= andom(void)
{
/* rand() is not very r= andom, but it's C99 and this is just for testing */
- return rand();
+ return (uint32_t)rand();
}

static struct hash_element *

@@ -176,7 +176,7 @@
struct hash *hash =3D = hash_init(10000, get_random(), word_hash_function, word_compare_function);<= /span>
struct hash *nhash =3D hash_init(256, get_random(), wo= rd_hash_function, word_compare_function);

- printf("hash_init n_buckets= =3D%d mask=3D0x%08x\n", hash->n_buckets, hash->mask);

= + printf("hash_init n_b= uckets=3D%u mask=3D0x%08x\n", hash->n_buckets, hash->mask);


char wordfile[PATH_MAX] =3D { 0 };
openvpn_test_get_srcdir_dir(wordfile, PATH_MAX, "/../.= ./../COPYRIGHT.GPL");
@@ -254,10 +254,10 @@
=
/* output contents of hash table */
= {
- p= tr_type inc =3D 0;
+ = uint32_t inc =3D 0;
int count =3D 0;=

- fo= r (ptr_type base =3D 0; base < hash_n_buckets(hash); base +=3D inc)

+ for (uint32_t ba= se =3D 0; base < hash_n_buckets(hash); base +=3D inc)
= {
struct hash_iterator hi;
struct hash_element *he;

=

To view, visit change 1119. To unsubscribe, or for help writing mail filters= , visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I3334465738fb1fbf508dfd719b6= a238b500cc0ae
Gerrit-Change-Number: 1119
Gerrit-PatchSet: 11
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--CgVNcgMfrck=--