X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhtable%2Fhtable.c;h=788e71895b183db45768fd0327572dcf5ccf4fd5;hp=bbd4fa96e587c64a04446756787bd163ad4dc3c8;hb=0473813acdfad62221ec9f2b9b41bc10d1f4586d;hpb=d3104024f71cf4f89195787add6c7ac381d62f40;ds=sidebyside diff --git a/ccan/htable/htable.c b/ccan/htable/htable.c index bbd4fa96..788e7189 100644 --- a/ccan/htable/htable.c +++ b/ccan/htable/htable.c @@ -66,8 +66,8 @@ struct htable *htable_new(size_t (*rehash)(const void *elem, void *priv), ht->priv = priv; ht->elems = 0; ht->deleted = 0; - ht->max = (1 << ht->bits) * 2 / 3; - ht->max_with_deleted = (1 << ht->bits) * 4 / 5; + ht->max = ((size_t)1 << ht->bits) * 3 / 4; + ht->max_with_deleted = ((size_t)1 << ht->bits) * 9 / 10; /* This guarantees we enter update_common first add. */ ht->common_mask = -1; ht->common_bits = 0;