~obeancomputer/bitter

870bf1ecf003062f13273775b712a169c07026fc — ocsmit 1 year, 2 months ago 357dfb2
unsigned int -> uint*_t
2 files changed, 5 insertions(+), 4 deletions(-)

M src/bitarr.c
M src/bitarr.h
M src/bitarr.c => src/bitarr.c +3 -2
@@ 1,7 1,8 @@
#include "bitarr.h"
#include "bitops.h"
#include <stdint.h>

BitArray* BitArray_calloc(unsigned int n, unsigned int l)
BitArray* BitArray_calloc(uint32_t n, uint8_t l)
{
    unsigned int n_entries = 1 + (((l * n) - 1) / WORD_SIZE);
    // space for bitarray + space needed for n_entries of word_size


@@ 23,7 24,7 @@ void BitArray_free(BitArray *bitarr) {
}


BitArray* BitArray_init(unsigned int A[], unsigned int n, unsigned int l)
BitArray* BitArray_init(unsigned int A[], uint32_t n, uint8_t l)
{
    BitArray* bit_arr = BitArray_calloc(n, l);
    // Compress values from A into BitArray

M src/bitarr.h => src/bitarr.h +2 -2
@@ 113,7 113,7 @@ typedef struct {
 * @param l             Size in bits of each item
 * @return              Pointer to BitArray
 */
BitArray* BitArray_calloc(unsigned int n, unsigned int l);
BitArray* BitArray_calloc(uint32_t n, uint8_t l);

/**
 * @brief Free BitArray allocated on the heap


@@ 130,7 130,7 @@ void BitArray_free(BitArray *bitarr);
 * @param l         Maximum number of bits for each element in A
 * @return          pointer to BitArray
 */
BitArray* BitArray_init(unsigned int A[], unsigned int length, unsigned int l);
BitArray* BitArray_init(unsigned int A[], uint32_t length, uint8_t l);


#endif // BITARR_H_