Assistance with unsigned long long's

From: Cris Jacobin (jacobinc@rcn.com)
Date: 06/05/01


Hello all,

  Am looking for some guidance on using gcc's long long support
as an easy way to get 64 bitflags. Here is how I have currently
have things set up.

typedef unsigned long long int bitvector_t;
bitvector_t bit_v = 1;

#define AFF_WATERLUNG         (bit_v << 26)
#define AFF_TEST              (bit_v << 27)
#define AFF_TEST1             (bit_v << 28)  and so on...

  The issue I am struggling with is that SET_BIT doesn't seem to
know about anything above bit 31.  Setting on bit 32 results in the
following.

Object permanent flags: Test3 Test4
Enter object perm flag (0 to quit) : 32

Object permanent flags: Test3 Test4 Test5 Test6 Test7 Test8 Test9
UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED
UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED
UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED
UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED UNDEFINED

  Setting individual bits above 32 leads me to believe that the game
just isn't aware of the extra bytes.  If I set on bit 33, bit 1 is set
on.

  According to /usr/include/limits.h the lib I am currently using
supports the long long type.  I'm not quite sure if it's an issue with
the compiler or something I'm doing incorrectly.  Any help will be
appreciated.

-jac 'using gcc, latest RH on a PIII'

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST