warning: left shift count >= width of type

From: Marcelo Valle Moreira (pira@dcc.unicamp.br)
Date: 05/10/96


Well, I have no idea why but I'm getting this damned message when compiling,
and asa I log the mud crashes, All I was trying to do is to code a fourth attack =o)
sorry gurus can anyone gimme some light?
thanks. 
WidowMaker 

act.offensive.c: In function `do_fourth':
act.offensive.c:687: warning: left shift count >= width of type
act.offensive.c:690: warning: left shift count >= width of type
act.offensive.c:694: warning: left shift count >= width of type

ACMD(do_fourth)
{
  if (GET_CLASS(ch) != CLASS_WARRIOR) {
      send_to_char("You are not able to do it!", ch);
      return;
   }
   
/* line 687 */   if ( IS_AFFECTED(ch, AFF_F_ATTACK) ){
      send_to_char("You no longer use your ability.", ch);
      REMOVE_BIT(AFF_FLAGS(ch), AFF_F_ATTACK);
/* line 690 */      return;
   } else {
       send_to_char("Your ability is now ON! Let's FIGHT!!!!", ch);
       SET_BIT(AFF_FLAGS(ch), AFF_F_ATTACK);
/* line 694 */       return;
      }
}

I've defined the flag as:
#define AFF_F_ATTACK	      (1 << 35)

other problem is:
fight.c: In function `perform_violence':
fight.c:952: warning: left shift count >= width of type
fight.c:942: warning: `ch' might be used uninitialized in this function
void perform_violence(void)
{
/* line 942 */  struct char_data *ch;
  extern struct index_data *mob_index;
  int times,a;

  if (GET_MOVE(ch) <= 0) {
      send_to_char("You are too exausted to fight!!!!", ch);
      return;
}
  times = 1;
  if (GET_MOVE(ch) >= 4)
/* line 952 */     if IS_AFFECTED(ch, AFF_F_ATTACK)
        if (GET_SKILL(ch, SKILL_F_ATTACK) >= 80)
           times = 4;
        else 
            if (GET_SKILL(ch, SKILL_F_ATTACK) >= 60)
         	times = 3;
            else if (GET_SKILL(ch, SKILL_F_ATTACK) >= 45)
        		times =2;

    for (ch = combat_list; ch; ch = next_combat_list) {
    next_combat_list = ch->next_fighting;

    if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
      stop_fighting(ch);
      continue;
    }

    if (IS_NPC(ch)) {
      if (GET_MOB_WAIT(ch) > 0) {
	GET_MOB_WAIT(ch) -= PULSE_VIOLENCE;
	continue;
      }
      GET_MOB_WAIT(ch) = 0;
      if (GET_POS(ch) < POS_FIGHTING) {
	GET_POS(ch) = POS_FIGHTING;
	act("$n scrambles to $s feet!", TRUE, ch, 0, 0, TO_ROOM);
      }
    }

    if (GET_POS(ch) < POS_FIGHTING) {
      send_to_char("You can't fight while sitting!!\r\n", ch);
      continue;
    }

    for (a=times; a >= 1; a --){
       hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
       GET_MOVE(ch) --;
}
    if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != NULL)
      (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
  }
}



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