Re: bitvectors issues?

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 07/11/02


On Wed, Jul 10, 2002 at 11:30:16PM -0700, Mathew Earle Reuther wrote:
>I'm not sure what changes I need to make in order to use bitvector_t
>fully though.  I changed all the references where it was commented out in
>structs.h and I added a different asciiflag converter which I located in
>the archives to deal with the increased number of flags available, but I
>also saw a lot of references to %ull replacing %d in some locations . . .
>yet I don't think I managed to generate any errors which regarded this at
>all.  Also, all entries for #define FLAG (1 << 0) etc where changed to
>(1ull << 0) . . . I hope this is correct.

One note (still like this in bpl21) is that in do_gen_tog,
    long result;
should be
    bitvector_t result;

If you have more than 32 PRF flags, it'll mess up on 'em.

Also, I found it a little easier just to define a macro in utils.h
#define BIT(x) (1LL << x)
just for readability mostly, but it does look better, ie:

#define PRF_ONETHING BIT(32)
#define PRF_TWOTHING BIT(33)

-me

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT