From 9f156374615e7fa611fae117e3e2a10fdbb89fd5 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 4 Mar 2017 18:55:29 +0100 Subject: [PATCH] Change limb from unsigned char to unsigned int. Should be faster for some operations, and we won't lose a lot of space anyway. --- m-bitset.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m-bitset.h b/m-bitset.h index cc96bf56..6ecbec6b 100644 --- a/m-bitset.h +++ b/m-bitset.h @@ -35,7 +35,7 @@ #include "m-string.h" // Only for bitset_get_str function // Define a limb of a bitset -typedef unsigned char bitset_limb; +typedef unsigned int bitset_limb; #define BITSET_LIMB_BIT (sizeof(bitset_limb) * CHAR_BIT) typedef struct bitset_s { @@ -101,7 +101,7 @@ bitset_set(bitset_t d, const bitset_t s) d->ptr = ptr; d->alloc = needAlloc; } - memcpy (d->ptr, s->ptr, needAlloc); + memcpy (d->ptr, s->ptr, needAlloc * sizeof(bitset_limb) ); d->size = s->size; BITSETI_CONTRACT(d); }