#include <stdio.h>
typedef unsigned char bool;
#define AFF_HOLD 64
#define AFF_CHARM 262144
#define IS_SET(flag, bit) ((flag) & (bit))
#define SET_BIT(var, bit) ((var) |= (bit))
#define IS_AFFECTED(ch, sn) (IS_SET((ch), (sn)))
bool ischarmed(int ch)
{
return IS_AFFECTED(ch, AFF_CHARM);
}
bool proper_ischarmed(int ch)
{
return IS_AFFECTED(ch, AFF_CHARM) ? 1 : 0;
}
int main(int argc, char **argv)
{
bool a, b;
int ch = 0;
SET_BIT(ch, AFF_HOLD);
SET_BIT(ch, AFF_CHARM);
a = ischarmed(ch);
b = proper_ischarmed(ch);
fprintf(stderr, "David Haley thinks that the char is %scharmed.\n", a ? "" : "not ");
fprintf(stderr, "The truth is that the char is %scharmed.\n", b ? "" : "not ");
return 0;
}
gcc -c -O -Wall -g3 act_comm.c
gcc -c -O -Wall -g3 act_info.c
gcc -c -O -Wall -g3 act_move.c
gcc -c -O -Wall -g3 act_obj.c
gcc -c -O -Wall -g3 act_wiz.c
gcc -c -O -Wall -g3 comm.c
gcc -c -O -Wall -g3 const.c
gcc -c -O -Wall -g3 db.c
gcc -c -O -Wall -g3 fight.c
gcc -c -O -Wall -g3 handler.c
gcc -c -O -Wall -g3 interp.c
gcc -c -O -Wall -g3 magic.c
gcc -c -O -Wall -g3 mob_commands.c
gcc -c -O -Wall -g3 mob_prog.c
mob_prog.c: In function mprog_do_ifchck:
mob_prog.c:373: warning: overflow in implicit constant conversion
mob_prog.c:375: warning: overflow in implicit constant conversion
mob_prog.c:378: warning: overflow in implicit constant conversion
mob_prog.c:381: warning: overflow in implicit constant conversion
gcc -c -O -Wall -g3 save.c
gcc -c -O -Wall -g3 special.c
gcc -c -O -Wall -g3 update.c
rm -f merc
gcc -o merc act_comm.o act_info.o act_move.o act_obj.o act_wiz.o comm.o const.o db.o fight.o handler.o interp.o magic.o mob_commands.o mob_prog.o save.o special.o update.o -O -g3 -lcrypt
:~/MUD/merc22sands/src$
I am looking forward to get this fixed. Any help would be appreciated!