Change limb from unsigned char to unsigned int.

Should be faster for some operations, and we won't lose a lot of space anyway.
This commit is contained in:
Patrick Pelissier committed 2017-03-04 18:55:29 +01:00
1 parent dd6f52e3a1
commit 9f15637461
1 file changed
+2 -2
+2 -2
View File
@@ -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);
}