[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#864358: ITP: bitfield -- bit array manipulation library



On Mon, 2017-08-14 at 01:41:43 +0900, Vitalie Ciubotaru wrote:
> On 08/06/2017 12:28 AM, Guillem Jover wrote:
> >
> > Well, obviously not entirely as complete but the BSDs (and libbsd
> > otherwise) do have something like <sys/bitstring.h>.
> > 
> 
> The difference between sys/bitstring.h and the package I propose is that
> bitstring.h implements a bit array within one unit of data storage (unsigned
> char, 1 byte, 8 bits), while my package uses an array of units (array of
> unsigned long integers, usually 32 or 64 bits EACH). This means that BSD's bit
> array can't be longer that 8 bits, while mine is limited by memory size only.

Nope, <sys/bitstring.h> does support an unlimited amount of bits by using
arrays of unsigned chars. You might want to recheck its implementation. :)

> > BTW, I noticed when I checked the implementation that you are using
> > HAVE_BITFIELD_H as the header macro protector, but that's actually a
> > bad idea, as with the typical autoconf based build-system that macro
> > will already be defined if the build-system does something like
> > AC_CHECK_HEADERS([bitfield.h]), which means the contents will be
> > secluded.
> 
> Oh, yes, you are right. I was able to reproduce this problem. The name of the
> header guard needs to be changed. Thank you very much for pointing it out.

No problem!

Regards,
Guillem


Reply to: