[CODE]Classes Errors

From: Peter Hartman (hartman@kuntrynet.com)
Date: 12/04/96


Ok I am still a newbie at memory allocation and c stuff and have
implemented classes into my MUD after already having races implemented
for a while.  I get this error when it compiles:

class.c In function invalid_class
882: Warning left shift count <= width of type
883: warning left shift count <= width of type
885: ditto
885: called object is not a function
886: warning left shift count <= width of type
886: called object is not a function
887: warning left shift count <= width of type

Ok i have a somewhat vague idea as to why it is doing it:
here is a look at my struct.h
/* Extra object flags: used by obj_data.obj_flags.extra_flags */
#define ITEM_GLOW          (1 << 0)	
#define ITEM_HUM           (1 << 1)	
#define ITEM_NORENT        (1 << 2)	
#define ITEM_NODONATE      (1 << 3)	
#define ITEM_NOINVIS	   (1 << 4)	
#define ITEM_INVISIBLE     (1 << 5)	
#define ITEM_MAGIC         (1 << 6)	
#define ITEM_NODROP        (1 << 7)	
#define ITEM_BLESS         (1 << 8)	
#define ITEM_ANTI_GOOD     (1 << 9)	
#define ITEM_ANTI_EVIL     (1 << 10)	
#define ITEM_ANTI_NEUTRAL  (1 << 11)	
#define ITEM_ANTI_MAGIC_USER (1 << 12)	
#define ITEM_ANTI_CLERIC   (1 << 13)	
#define ITEM_ANTI_THIEF	   (1 << 14)	
#define ITEM_ANTI_WARRIOR  (1 << 15)	
#define ITEM_NOSELL	   (1 << 16)	
#define ITEM_ANTI_BARD	   (1 << 17)    
#define ITEM_ANTI_HUMAN    (1 << 18)    /* [WART] */
#define ITEM_ANTI_ELF      (1 << 19)    
#define ITEM_ANTI_GNOME    (1 << 20)  
#define ITEM_ANTI_FAIRY    (1 << 21)
#define ITEM_ANTI_YETI     (1 << 22)
#define ITEM_ANTI_HOBBIT   (1 << 23)
#define ITEM_ANTI_DWARF    (1 << 24)
#define ITEM_ANTI_GOBLIN   (1 << 25)
#define ITEM_ANTI_HALFELF  (1 << 26)
#define ITEM_ANTI_BULLYWUG (1 << 27)
#define ITEM_ANTI_CENTAUR  (1 << 28)
#define ITEM_ANTI_MINOTAUR (1 << 29)
#define ITEM_ANTI_SATYR    (1 << 30)
#define ITEM_ANTI_OOPA     (1 << 31)
#define ITEM_ANTI_RANGER   (1 << 32)
#define ITEM_ANTI_PALADIN  (1 << 33)
#define ITEM_ANTI_ANT_PALADIN (1 << 34)
#define ITEM_ANTI_DRUID    (1 << 35)
#define ITEM_ANTI_MONK	   (1 << 36)


Right up there at 1 << 32 is where i think is the error in accordance to
a cross reference to class.c line 883:

int invalid_class(struct char_data *ch, struct obj_data *obj) {
  if ((IS_OBJ_STAT(obj, ITEM_ANTI_MAGIC_USER) && IS_MAGIC_USER(ch)) ||
      (IS_OBJ_STAT(obj, ITEM_ANTI_CLERIC) && IS_CLERIC(ch)) ||
      (IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR) && IS_WARRIOR(ch)) ||
882:      (IS_OBJ_STAT(obj, ITEM_ANTI_ANT_PALADIN) &&
IS_ANT_PALADIN(ch)) ||
883:      (IS_OBJ_STAT(obj, ITEM_ANTI_PALADIN) && IS_PALADIN(ch)) ||
      (IS_OBJ_STAT(obj, ITEM_ANTI_BARD) && IS_BARD(ch)) ||
885:      (IS_OBJ_STAT(obj, ITEM_ANTI_DRUID) && IS_DRUID(ch)) ||
886:      (IS_OBJ_STAT(obj, ITEM_ANTI_MONK) && IS_MONK(ch)) ||
887:      (IS_OBJ_STAT(obj, ITEM_ANTI_RANGER) && IS_RANGER(ch)) ||
      (IS_OBJ_STAT(obj, ITEM_ANTI_THIEF) && IS_THIEF(ch)))
	return 1;
  else
	return 0;
}

My guess in my uneducated way is that the definition wherever that may
be of how high ITEM_ANTI_x is in struct.h is limited to 32 bits. 
BAsically beyond that i am stumped on how to fix it :>.  Please if you
ahve any ideas how i can fix it to allow me to do it right or if you
want more information let me know.

wart

thanks for any help.

PS if i was incoherent up there let me know and I'll GLADLY restate the
question :>
-- 
*-=-=-=-=-=-=-=* w0nderful *-=-* w0rld *-=-* 0f *-=-* wart *-=-=-=-=-*
hartman@kuntrynet.com
wart@trilidun.kuntrynet.com
http://trilidun.kuntrynet.com
Eudaemonia Mud: 207.40.85.11 Port 4000
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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