NEWBIE: warning: left shift count >= width of type (fwd)

From: Billy H. Chan (bhchan@po.EECS.Berkeley.EDU)
Date: 05/10/96

Naved points out:
  On a 32 bit machine the maximum shift is 31.    (0 - 31)

I've noted that, strangely enough, on some machines, (1 << 31) will
screw up the sprintbit function.  This, I'm pretty sure, is because of
the sign of the int.  Sprintbit checks if the number is less than zero,
and most machines have the sign bit in slot 31.
Mind you, this was in pl8, and I haven't checked pl11 (haven't had to
drop down that far yet... plus, added a few extra flags to seperate things
out.. ie: instead of PRF_NOGOSS in prefs, I have a int channel that holds
your channel bitvectors... this allows more PRFs with less need to add
a PRF2 as was suggested before.)

Also, someone asked something like "What do I do if I need more than 32
AFFS".  A question that should be added to the FAQ (it it isn't there)...

Adding another set of 32 affs normally entails a nice pwipe, so it is
suggested that you add as many as you think you'll need all in one fell
swoop (this would be an opportunity to add more PLR/PRF etc. flags too,
if you plan on needing more).
   Let <blah> be the set containing AFF,PLR,PRF,MOB,etc.
Simply add another long int <blah>2, <blah>3 in char_data, and in utils.h, 
where macros for <blah> are defined, add one for <blah>2, etc.
The problem with this is you have to remember which <blah># set a giving
flag is in, but that's not hard to remember (just leave structs.h up on
a split emacs *wink*)
That's the easy way, and less processor intensive.  Another way was to do
some funky math and force the program to translate between sets, but it's
much more complicated to do, let alone explain in one paragraph.
yet another way suggested is probably better, using bitfields, but then, 
you'd have to compile with c++ (whihc imho is a better language, but I'm 
too lazy to rewrite into C++, esp. since there may be porting problems 
between different c++ compilers).
-- Billy  H. Chan
   CogSci/CompSci     ResumeInside

This archive was generated by hypermail 2b30 : 12/18/00 PST