diff -abPru Rom24/HACKLOG fixup_081006/HACKLOG --- Rom24/HACKLOG 1969-12-31 19:00:00.000000000 -0500 +++ fixup_081006/HACKLOG 2008-10-03 23:18:38.000000000 -0400 @@ -0,0 +1,177 @@ +081004 Quixadhal + 2031 Started this HACKLOG file! + + Removed the multiple Makefiles and merged their diffrences into + a single Makefile. The user can simply comment and uncomment + the correct lines for their platform. + + Removed the "make" rule from "make clean", since many times + we just want to get rid of the object files and not rebuild. + + Replaced the old .c.o suffix rule with a modern one, and + removed the generic "merc.h" prerequisite. Instead, I've + had gcc generate dependancy information and appended that + to the Makefile. This could be automated, but for simplicity + I won't do so. + 2107 Changed the function name weapon_type() to be weapon_type_lookup(). + + merc.h:2194: warning: 'int weapon_type(const char*)' hides + constructor for 'struct weapon_type' + + Fixed a variable scope issue in act_obj.c. + + act_obj.c: In function 'void do_buy(CHAR_DATA*, char*)': + act_obj.c:2518: warning: declaration of 'buf' shadows a previous local + act_obj.c:2506: warning: shadowed declaration is here + + Same thing here. + + act_wiz.c: In function 'void do_mset(CHAR_DATA*, char*)': + act_wiz.c:3466: warning: declaration of 'buf' shadows a previous local + act_wiz.c:3329: warning: shadowed declaration is here + + This is a local re-declarations of a global variable. + + comm.c: In function 'void bust_a_prompt(CHAR_DATA*)': + comm.c:1328: warning: declaration of 'dir_name' shadows a global declaration + merc.h:1904: warning: shadowed declaration is here + + In this case, I think the correct answer is to move the local + declaration up to act_move.c, and rename it to be dir_abbrev[], + since it really needs to always stay in sync with dir_name[]. + + And this is just another shadowed global. + + comm.c: In function 'void nanny(DESCRIPTOR_DATA*, char*)': + comm.c:1546: warning: declaration of 'd_next' shadows a global declaration + comm.c:301: warning: shadowed declaration is here + + Let's try commenting out the global and see if it's really used + anywhere. Hmmmm, mostly just as a local loop variable, only one + place seems to want it global, and that doesn't appear to have any + effect. + + /* if ( d_next == dclose ) + d_next = d_next->next; */ + + That keeps d_next set, but it isn't ever used anywhere else. + + 2133 Another shadow... + + db.c: In function 'void load_old_obj(FILE*)': + db.c:655: warning: declaration of 'letter' shadows a previous local + db.c:595: warning: shadowed declaration is here + + A quick change to is_name() to make it also const char *, and this + is fine. + + db.c: In function 'char* get_extra_descr(const char*, EXTRA_DESCR_DATA*)': + db.c:2055: warning: cast from type 'const char*' to type 'char*' casts away constness + + This one is a bit ugly. str_dup() accepts a const char *, but + returns a char *. Normally, not a big deal, but because of the + shared string space, it wants to return the source pointer sometimes. + THAT now has to be declared without the const, because we won't know + ahead of time if it IS const or not. + + db.c: In function 'char* str_dup(const char*)': + db.c:2693: warning: cast from type 'const char*' to type 'char*' casts away constness + + Another local shadow... + + db2.c: In function 'void load_objects(FILE*)': + db2.c:458: warning: declaration of 'letter' shadows a previous local + db2.c:354: warning: shadowed declaration is here + + 2159 Meeeeee, and my shaaaaadow! + + You'd think -Wshadow would be part of -Wall by now.... *sigh* + + fight.c: In function 'void one_hit(CHAR_DATA*, CHAR_DATA*, int)': + fight.c:587: warning: declaration of 'dam' shadows a previous local + fight.c:392: warning: shadowed declaration is here + + fight.c: In function 'void check_killer(CHAR_DATA*, CHAR_DATA*)': + fight.c:1218: warning: declaration of 'buf' shadows a previous local + fight.c:1194: warning: shadowed declaration is here + + Wheeeee! handler.c is unhappy! + + handler.c: In function 'bool is_name(const char*, char*)': + handler.c:822: error: invalid conversion from 'const char*' to 'char*' + handler.c:826: error: invalid conversion from 'const char*' to 'char*' + handler.c:826: error: initializing argument 1 of 'char* one_argument(char*, char*)' + cc1plus: warnings being treated as errors + + handler.c: In function 'char* affect_bit_name(int)': + handler.c:2614: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* extra_bit_name(int)': + handler.c:2622: warning: declaration of 'extra_flags' shadows a global declaration + tables.h:74: warning: shadowed declaration is here + handler.c:2648: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* act_bit_name(int)': + handler.c:2652: warning: declaration of 'act_flags' shadows a global declaration + tables.h:66: warning: shadowed declaration is here + handler.c:2698: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* comm_bit_name(int)': + handler.c:2701: warning: declaration of 'comm_flags' shadows a global declaration + tables.h:73: warning: shadowed declaration is here + handler.c:2725: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* imm_bit_name(int)': + handler.c:2728: warning: declaration of 'imm_flags' shadows a global declaration + tables.h:70: warning: shadowed declaration is here + handler.c:2757: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* wear_bit_name(int)': + handler.c:2760: warning: declaration of 'wear_flags' shadows a global declaration + tables.h:75: warning: shadowed declaration is here + handler.c:2783: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* form_bit_name(int)': + handler.c:2786: warning: declaration of 'form_flags' shadows a global declaration + tables.h:71: warning: shadowed declaration is here + handler.c:2818: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* part_bit_name(int)': + handler.c:2821: warning: declaration of 'part_flags' shadows a global declaration + tables.h:72: warning: shadowed declaration is here + handler.c:2848: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* weapon_bit_name(int)': + handler.c:2851: warning: declaration of 'weapon_flags' shadows a global declaration + tables.h:76: warning: shadowed declaration is here + handler.c:2865: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* cont_bit_name(int)': + handler.c:2879: warning: cast from type 'const char*' to type 'char*' casts away constness + + handler.c: In function 'char* off_bit_name(int)': + handler.c:2883: warning: declaration of 'off_flags' shadows a global declaration + tables.h:69: warning: shadowed declaration is here + handler.c:2911: warning: cast from type 'const char*' to type 'char*' casts away constness + + These were all fixed by redoing the return values so it always + returns the buffer, but copies "none" into it where there were no + flags. Also, renamed all the local variables to "vector", since it + made sense and eliminated the conflicts. + + 2312 Undid the change to is_name(), and also removed the const modifier + from get_extra_descr(). Adding proper const flags will need some + more carful work. + + save.c: In function 'void fread_char(CHAR_DATA*, FILE*)': + save.c:743: warning: cast from type 'const char*' to type 'char*' casts away constness + save.c: In function 'void fread_pet(CHAR_DATA*, FILE*)': + save.c:1140: warning: cast from type 'const char*' to type 'char*' casts away constness + save.c:1162: warning: cast from type 'const char*' to type 'char*' casts away constness + save.c: In function 'void fread_obj(CHAR_DATA*, FILE*)': + save.c:1364: warning: cast from type 'const char*' to type 'char*' casts away constness + save.c:1400: warning: cast from type 'const char*' to type 'char*' casts away constness + + Fixed those by adding a static char buffer which is set to + "End" or "END" and returned instead of a constant string. + diff -abPru Rom24/HACKLOG_1 fixup_081006/HACKLOG_1 --- Rom24/HACKLOG_1 1969-12-31 19:00:00.000000000 -0500 +++ fixup_081006/HACKLOG_1 2008-10-06 15:18:27.000000000 -0400 @@ -0,0 +1,115 @@ +081006 MacGregor/Nibios + +Taking Quixadhal's fixup_081004 src and adapting to compile with g++ 3.4.6. +First pass: compile dies with these errors and fixes: +comm.c: In function `void act_new(const char*, CHAR_DATA*, const void*, const void*, int, int)': +comm.c:2443: warning: cast from `const void*' to `CHAR_DATA*' discards qualifiers from pointer target type +comm.c:2444: warning: cast from `const void*' to `OBJ_DATA*' discards qualifiers from pointer target type +comm.c:2445: warning: cast from `const void*' to `OBJ_DATA*' discards qualifiers from pointer target type +comm.c:2512: warning: cast from `const void*' to `char*' discards qualifiers from pointer target type +comm.c:2513: warning: cast from `const void*' to `char*' discards qualifiers from pointer target type +comm.c:2536: warning: cast from `const void*' to `char*' discards qualifiers from pointer target type +comm.c:2542: warning: cast from `const void*' to `char*' discards qualifiers from pointer target type + +The offending lines: +2443: CHAR_DATA *vch = (CHAR_DATA *) arg2; +2444: OBJ_DATA *obj1 = (OBJ_DATA *) arg1; +2445: OBJ_DATA *obj2 = (OBJ_DATA *) arg2; +2512: case 't': i = (char *) arg1; break; +2513: case 'T': i = (char *) arg2; break; +2536: if ( arg2 == NULL || ((char *) arg2)[0] == '\0' ) +2542: one_argument( (char *) arg2, fname ); + + +The first six were pretty straightforward to fix, changing them respectively to: +2443: const CHAR_DATA *vch = (const CHAR_DATA *) arg2; +2444: const OBJ_DATA *obj1 = (const OBJ_DATA *) arg1; +2445: const OBJ_DATA *obj2 = (const OBJ_DATA *) arg2; +2512: case 't': i = (const char *) arg1; break; +2513: case 'T': i = (const char *) arg2; break; +2536: if ( arg2 == NULL || ((const char *) arg2)[0] == '\0' ) + +We'll defer fixing line 2542 for now, and just recompile with what we have. +We now get: +comm.c: In function `void act_new(const char*, CHAR_DATA*, const void*, const void*, int, int)': +comm.c:2515: error: invalid conversion from `const CHAR_DATA*' to `CHAR_DATA*' +comm.c:2515: error: initializing argument 2 of `bool can_see(CHAR_DATA*, CHAR_DATA*)' +comm.c:2524: error: invalid conversion from `const OBJ_DATA*' to `OBJ_DATA*' +comm.c:2524: error: initializing argument 2 of `bool can_see_obj(CHAR_DATA*, OBJ_DATA*)' +comm.c:2530: error: invalid conversion from `const OBJ_DATA*' to `OBJ_DATA*' +comm.c:2530: error: initializing argument 2 of `bool can_see_obj(CHAR_DATA*, OBJ_DATA*)' +comm.c:2542: warning: cast from `const void*' to `char*' discards qualifiers from pointer target type + +The offending lines: +2515: case 'N': i = PERS( vch, to ); break; +2524: i = can_see_obj( to, obj1 ) +2530: i = can_see_obj( to, obj2 ) +2542: one_argument( (char *) arg2, fname ); + +The PERS macro takes us to the can_see() function in handler.c. +We change it from +bool can_see( CHAR_DATA *ch, CHAR_DATA *victim ) +to +bool can_see( const CHAR_DATA *ch, const CHAR_DATA *victim ) + +This in turn requires changing get_trust(), get_skill() and get_curr_stat() +all to take const CHAR_DATA * arguments instead of CHAR_DATA *. + +Fixing can_see_obj() is a bit more straightforward since we only have to change +its own arguments to const CHAR_DATA * and const OBJ_DATA *. + +So now the only problem left is line 2542 and its call to one_argument(). + +Changing one_argument() to take a const char * as its first argument, and +returning a const char *, is going to open up a huge can of worms. The +Right Thing To Do at this point would be to make the function take a const +char * for its first argument, and return a const char *. This would mean, +among other things, that every do_fun would have to take a const char * for +their second argument. + +However this would definitely break about 95% of the existing ROM snippets, +and we'd agreed we didn't want to do that. Furthermore, it already compiles +just fine with gcc 4.1.x. So pretty much against my better judgement, I +copied one_argument() to a new function get_argument(), with get_argument() +taking and returning const char *'s, and changed line 2542 to call the new +get_argument() function. + +Okay, it compiles cleanly now! Let's try compiling as gcc instead of g++. + +Whoops! act_comm.c blows up big time, referencing incomplete data types. +The problem is that g++ has its own bool data type and gcc doesn't. So we +add a couple lines in merc.h like so: + +/* + * Accomodate both gcc and g++ + */ +#if !defined __cplusplus +typedef unsigned char bool; +#endif + +g++ is still happy, and so is gcc until it gets to act_wiz.c: +act_wiz.c: In function `do_clone': +act_wiz.c:2386: warning: declaration of 'new_obj' shadows a global declaration +recycle.h:81: warning: shadowed declaration is here + +Hmm, wonder why this didn't show up earlier? Seems to me it should have. +Anyway, change the local variable new_obj to cloned_obj and continue. + +Uh oh, comm.c blows up again, this time over those declarations of system +calls at the top of comm.c. Let's extend the comment around the +declarations for accept, bind et al to include the declarations for read, +select, etc too. I think it would be safe to just remove them but I'll do +it conservatively. + +Okay, another shadow problem in db.c, the variable 'exit' in the function +do_dump(). Let's change it to pExit. + +Now we're getting, of all things, this error: +handler.c: In function `unequip_char': +handler.c:1646: warning: suggest explicit braces to avoid ambiguous `else' +We add curley braces around the for loop inside the 'if', and also around +the for-loop itself. Either set resolves the problem, but good practice +requires both. + +Now, finally, it compikes with both g++ and gcc. + diff -abPru Rom24/src/Makefile fixup_081006/src/Makefile --- Rom24/src/Makefile 2007-03-05 17:32:46.000000000 -0500 +++ fixup_081006/src/Makefile 2008-10-06 15:19:44.000000000 -0400 @@ -1,22 +1,71 @@ CC = g++ -PROF = -O -g -NOCRYPT = -C_FLAGS = -Wall $(PROF) $(NOCRYPT) -L_FLAGS = $(PROF) + +W_FORMAT = -Wformat -Wformat-security -Wmissing-format-attribute +W_NITPICK = -Wpointer-arith -Winline +W_MESSY = -Wmissing-braces -Wparentheses -Wshadow #-Wredundant-decls +W_TYPE = -Wcast-qual -Wcast-align -Wchar-subscripts -Wreturn-type -Wswitch #-Wwrite-strings +W_EXTRA = -Wunused #-Wunreachable-code +W_ANSI = #-pedantic +W_UBER = -Wall #-W +W_ERROR = -Werror + +WARN = $(W_ANSI) $(W_UBER) $(W_FORMAT) $(W_MESSY) $(W_FUNC) $(W_TYPE) $(W_EXTRA) $(W_NITPICK) $(W_ERROR) +OPT = -O +DEBUG = -g + +C_FLAGS = $(WARN) $(OPT) $(DEBUG) +L_FLAGS = $(DEBUG) +SOLARIS_LIBS = -lsocket -lresolv -lnsl +LINUX_LIBS = -lcrypt + +LIBS = $(LINUX_LIBS) O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \ alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \ handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \ music.o recycle.o save.o scan.o skills.o special.o tables.o \ - update.o -lcrypt + update.o rom: $(O_FILES) rm -f rom - $(CC) $(L_FLAGS) -o rom $(O_FILES) + $(CC) $(L_FLAGS) -o rom $(O_FILES) $(LIBS) -.c.o: merc.h - $(CC) -c $(C_FLAGS) $< +%o : %c + $(CC) $(C_FLAGS) -c $< -o $@ clean: @rm -f *.o - make + +# find . -name \*.c -a -type f -print0 | xargs -0 -P 1 -r g++ -O -g -MM + +act_enter.o: act_enter.c merc.h interp.h +effects.o: effects.c merc.h recycle.h +act_obj.o: act_obj.c merc.h interp.h +scan.o: scan.c merc.h +note.o: note.c merc.h recycle.h tables.h +update.o: update.c merc.h interp.h music.h +alias.o: alias.c merc.h +music.o: music.c merc.h music.h recycle.h +db2.o: db2.c merc.h db.h lookup.h +db.o: db.c merc.h db.h recycle.h music.h lookup.h +recycle.o: recycle.c merc.h recycle.h +magic.o: magic.c merc.h interp.h magic.h recycle.h +act_comm.o: act_comm.c merc.h interp.h recycle.h tables.h +tables.o: tables.c merc.h tables.h +lookup.o: lookup.c merc.h tables.h +magic2.o: magic2.c merc.h interp.h magic.h +act_move.o: act_move.c merc.h interp.h +save.o: save.c merc.h recycle.h lookup.h tables.h +interp.o: interp.c merc.h interp.h +special.o: special.c merc.h interp.h magic.h +skills.o: skills.c merc.h interp.h magic.h recycle.h +fight.o: fight.c merc.h interp.h +comm.o: comm.c merc.h interp.h recycle.h tables.h telnet.h +healer.o: healer.c merc.h magic.h +const.o: const.c merc.h magic.h interp.h +flags.o: flags.c merc.h tables.h +act_wiz.o: act_wiz.c merc.h interp.h recycle.h tables.h lookup.h +act_info.o: act_info.c merc.h interp.h magic.h recycle.h tables.h \ + lookup.h +ban.o: ban.c merc.h recycle.h +handler.o: handler.c merc.h interp.h magic.h recycle.h tables.h Only in Rom24/src: Makefile.linux Only in Rom24/src: Makefile.normal Only in Rom24/src: Makefile.solaris diff -abPru Rom24/src/act_move.c fixup_081006/src/act_move.c --- Rom24/src/act_move.c 2007-03-05 16:27:47.000000000 -0500 +++ fixup_081006/src/act_move.c 2008-10-03 21:22:01.000000000 -0400 @@ -41,6 +41,7 @@ { "north", "east", "south", "west", "up", "down" }; +char * const dir_abbrev[] = {"N","E","S","W","U","D"}; const sh_int rev_dir [] = { diff -abPru Rom24/src/act_obj.c fixup_081006/src/act_obj.c --- Rom24/src/act_obj.c 2007-02-03 10:15:18.000000000 -0500 +++ fixup_081006/src/act_obj.c 2008-10-03 21:13:27.000000000 -0400 @@ -2503,6 +2503,7 @@ void do_buy( CHAR_DATA *ch, char *argument ) { + char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; int cost,roll; @@ -2514,8 +2515,6 @@ if ( IS_SET(ch->in_room->room_flags, ROOM_PET_SHOP) ) { - char arg[MAX_INPUT_LENGTH]; - char buf[MAX_STRING_LENGTH]; CHAR_DATA *pet; ROOM_INDEX_DATA *pRoomIndexNext; ROOM_INDEX_DATA *in_room; @@ -2613,7 +2612,6 @@ { CHAR_DATA *keeper; OBJ_DATA *obj,*t_obj; - char arg[MAX_INPUT_LENGTH]; int number, count = 1; if ( ( keeper = find_keeper( ch ) ) == NULL ) diff -abPru Rom24/src/act_wiz.c fixup_081006/src/act_wiz.c --- Rom24/src/act_wiz.c 2007-03-05 16:28:57.000000000 -0500 +++ fixup_081006/src/act_wiz.c 2008-10-06 14:48:05.000000000 -0400 @@ -2383,7 +2383,7 @@ else if (mob != NULL) { CHAR_DATA *clone; - OBJ_DATA *new_obj; + OBJ_DATA *cloned_obj; char buf[MAX_STRING_LENGTH]; if (!IS_NPC(mob)) @@ -2410,11 +2410,11 @@ { if (obj_check(ch,obj)) { - new_obj = create_object(obj->pIndexData,0); - clone_object(obj,new_obj); - recursive_clone(ch,obj,new_obj); - obj_to_char(new_obj,clone); - new_obj->wear_loc = obj->wear_loc; + cloned_obj = create_object(obj->pIndexData,0); + clone_object(obj,cloned_obj); + recursive_clone(ch,obj,cloned_obj); + obj_to_char(cloned_obj,clone); + cloned_obj->wear_loc = obj->wear_loc; } } char_to_room(clone,ch->in_room); @@ -3326,7 +3326,7 @@ char arg1 [MAX_INPUT_LENGTH]; char arg2 [MAX_INPUT_LENGTH]; char arg3 [MAX_INPUT_LENGTH]; - char buf[100]; + char buf [MAX_STRING_LENGTH]; CHAR_DATA *victim; int value; @@ -3463,8 +3463,6 @@ iclass = class_lookup(arg3); if ( iclass == -1 ) { - char buf[MAX_STRING_LENGTH]; - strcpy( buf, "Possible classes are: " ); for ( iclass = 0; iclass < MAX_CLASS; iclass++ ) { diff -abPru Rom24/src/comm.c fixup_081006/src/comm.c --- Rom24/src/comm.c 2007-03-05 17:21:17.000000000 -0500 +++ fixup_081006/src/comm.c 2008-10-06 14:56:46.000000000 -0400 @@ -170,7 +170,6 @@ int getpeername args( ( int s, struct sockaddr *name, int *namelen ) ); int getsockname args( ( int s, struct sockaddr *name, int *namelen ) ); int listen args( ( int s, int backlog ) ); -*/ int close args( ( int fd ) ); int gettimeofday args( ( struct timeval *tp, struct timezone *tzp ) ); @@ -179,6 +178,7 @@ fd_set *exceptfds, struct timeval *timeout ) ); int socket args( ( int domain, int type, int protocol ) ); int write args( ( int fd, char *buf, int nbyte ) ); +*/ #endif #if defined(macintosh) @@ -298,7 +298,7 @@ * Global variables. */ DESCRIPTOR_DATA * descriptor_list; /* All open descriptors */ -DESCRIPTOR_DATA * d_next; /* Next descriptor in loop */ +/* DESCRIPTOR_DATA * d_next; *//* Next descriptor in loop */ FILE * fpReserve; /* Reserved file handle */ bool god; /* All new chars are gods! */ bool merc_down; /* Shutdown */ @@ -502,6 +502,7 @@ struct timeval last_time; struct timeval now_time; static DESCRIPTOR_DATA dcon; + DESCRIPTOR_DATA * d_next; gettimeofday( &last_time, NULL ); current_time = (time_t) last_time.tv_sec; @@ -661,6 +662,7 @@ { static struct timeval null_time; struct timeval last_time; + DESCRIPTOR_DATA * d_next; signal( SIGPIPE, SIG_IGN ); gettimeofday( &last_time, NULL ); @@ -1001,8 +1003,8 @@ } } - if ( d_next == dclose ) - d_next = d_next->next; + /* if ( d_next == dclose ) + d_next = d_next->next; */ if ( dclose == descriptor_list ) { @@ -1325,7 +1327,6 @@ char doors[MAX_INPUT_LENGTH]; EXIT_DATA *pexit; bool found; - const char *dir_name[] = {"N","E","S","W","U","D"}; int door; point = buf; @@ -1369,7 +1370,7 @@ && !IS_SET(pexit->exit_info,EX_CLOSED)) { found = TRUE; - strcat(doors,dir_name[door]); + strcat(doors,dir_abbrev[door]); } } if (!found) @@ -2439,9 +2440,9 @@ char buf[MAX_STRING_LENGTH]; char fname[MAX_INPUT_LENGTH]; CHAR_DATA *to; - CHAR_DATA *vch = (CHAR_DATA *) arg2; - OBJ_DATA *obj1 = (OBJ_DATA *) arg1; - OBJ_DATA *obj2 = (OBJ_DATA *) arg2; + const CHAR_DATA *vch = (const CHAR_DATA *) arg2; + const OBJ_DATA *obj1 = (const OBJ_DATA *) arg1; + const OBJ_DATA *obj2 = (const OBJ_DATA *) arg2; const char *str; const char *i; char *point; @@ -2508,8 +2509,8 @@ default: bug( "Act: bad code %d.", *str ); i = " <@@@> "; break; /* Thx alex for 't' idea */ - case 't': i = (char *) arg1; break; - case 'T': i = (char *) arg2; break; + case 't': i = (const char *) arg1; break; + case 'T': i = (const char *) arg2; break; case 'n': i = PERS( ch, to ); break; case 'N': i = PERS( vch, to ); break; case 'e': i = he_she [URANGE(0, ch ->sex, 2)]; break; @@ -2532,13 +2533,13 @@ break; case 'd': - if ( arg2 == NULL || ((char *) arg2)[0] == '\0' ) + if ( arg2 == NULL || ((const char *) arg2)[0] == '\0' ) { i = "door"; } else { - one_argument( (char *) arg2, fname ); + get_argument( (const char *) arg2, fname ); i = fname; } break; diff -abPru Rom24/src/db.c fixup_081006/src/db.c --- Rom24/src/db.c 2007-03-05 17:34:07.000000000 -0500 +++ fixup_081006/src/db.c 2008-10-06 14:58:29.000000000 -0400 @@ -652,11 +652,11 @@ for ( ; ; ) { - char letter; + char another_letter; - letter = fread_letter( fp ); + another_letter = fread_letter( fp ); - if ( letter == 'A' ) + if ( another_letter == 'A' ) { AFFECT_DATA *paf; @@ -673,7 +673,7 @@ top_affect++; } - else if ( letter == 'E' ) + else if ( another_letter == 'E' ) { EXTRA_DESCR_DATA *ed; @@ -687,7 +687,7 @@ else { - ungetc( letter, fp ); + ungetc( another_letter, fp ); break; } } @@ -2048,11 +2048,11 @@ /* * Get an extra description from a list. */ -char *get_extra_descr( const char *name, EXTRA_DESCR_DATA *ed ) +char *get_extra_descr( char *name, EXTRA_DESCR_DATA *ed ) { for ( ; ed != NULL; ed = ed->next ) { - if ( is_name( (char *) name, ed->keyword ) ) + if ( is_name( name, ed->keyword ) ) return ed->description; } return NULL; @@ -2682,7 +2682,7 @@ * Duplicate a string into dynamic memory. * Fread_strings are read-only and shared. */ -char *str_dup( const char *str ) +char *str_dup( char *str ) { char *str_new; @@ -2690,7 +2690,7 @@ return &str_empty[0]; if ( str >= string_space && str < top_string ) - return (char *) str; + return str; str_new = (char *)alloc_mem( strlen(str) + 1 ); strcpy( str_new, str ); @@ -2791,7 +2791,7 @@ OBJ_DATA *obj; OBJ_INDEX_DATA *pObjIndex; ROOM_INDEX_DATA *room; - EXIT_DATA *exit; + EXIT_DATA *pExit; DESCRIPTOR_DATA *d; AFFECT_DATA *af; FILE *fp; @@ -2885,7 +2885,7 @@ /* exits */ fprintf(fp,"Exits %4d (%8d bytes)\n", - top_exit, top_exit * (sizeof(*exit))); + top_exit, top_exit * (sizeof(*pExit))); fclose(fp); diff -abPru Rom24/src/db2.c fixup_081006/src/db2.c --- Rom24/src/db2.c 2007-03-05 16:53:41.000000000 -0500 +++ fixup_081006/src/db2.c 2008-10-03 21:58:15.000000000 -0400 @@ -389,7 +389,7 @@ switch(pObjIndex->item_type) { case ITEM_WEAPON: - pObjIndex->value[0] = weapon_type(fread_word(fp)); + pObjIndex->value[0] = weapon_type_lookup(fread_word(fp)); pObjIndex->value[1] = fread_number(fp); pObjIndex->value[2] = fread_number(fp); pObjIndex->value[3] = attack_lookup(fread_word(fp)); @@ -455,11 +455,11 @@ for ( ; ; ) { - char letter; + char another_letter; - letter = fread_letter( fp ); + another_letter = fread_letter( fp ); - if ( letter == 'A' ) + if ( another_letter == 'A' ) { AFFECT_DATA *paf; @@ -476,13 +476,13 @@ top_affect++; } - else if (letter == 'F') + else if (another_letter == 'F') { AFFECT_DATA *paf; paf = (AFFECT_DATA *)alloc_perm( sizeof(*paf) ); - letter = fread_letter(fp); - switch (letter) + another_letter = fread_letter(fp); + switch (another_letter) { case 'A': paf->where = TO_AFFECTS; @@ -511,7 +511,7 @@ top_affect++; } - else if ( letter == 'E' ) + else if ( another_letter == 'E' ) { EXTRA_DESCR_DATA *ed; @@ -525,7 +525,7 @@ else { - ungetc( letter, fp ); + ungetc( another_letter, fp ); break; } } diff -abPru Rom24/src/fight.c fixup_081006/src/fight.c --- Rom24/src/fight.c 2007-03-05 16:54:22.000000000 -0500 +++ fixup_081006/src/fight.c 2008-10-03 22:10:30.000000000 -0400 @@ -584,8 +584,6 @@ /* but do we have a funky weapon? */ if (result && wield != NULL) { - int dam; - if (ch->fighting == victim && IS_WEAPON_STAT(wield,WEAPON_POISON)) { int level; @@ -1215,11 +1213,11 @@ { if ( ch->master == NULL ) { - char buf[MAX_STRING_LENGTH]; + char buf2[MAX_STRING_LENGTH]; - sprintf( buf, "Check_killer: %s bad AFF_CHARM", + sprintf( buf2, "Check_killer: %s bad AFF_CHARM", IS_NPC(ch) ? ch->short_descr : ch->name ); - bug( buf, 0 ); + bug( buf2, 0 ); affect_strip( ch, gsn_charm_person ); REMOVE_BIT( ch->affected_by, AFF_CHARM ); return; diff -abPru Rom24/src/handler.c fixup_081006/src/handler.c --- Rom24/src/handler.c 2007-03-05 16:59:58.000000000 -0500 +++ fixup_081006/src/handler.c 2008-10-06 15:18:52.000000000 -0400 @@ -155,7 +155,7 @@ return -1; } -int weapon_type (const char *name) +int weapon_type_lookup (const char *name) { int type; @@ -349,7 +349,7 @@ } /* for returning skill information */ -int get_skill(CHAR_DATA *ch, int sn) +int get_skill( const CHAR_DATA *ch, int sn ) { int skill; @@ -703,7 +703,7 @@ /* * Retrieve a character's trusted level for permission checking. */ -int get_trust( CHAR_DATA *ch ) +int get_trust( const CHAR_DATA *ch ) { if ( ch->desc != NULL && ch->desc->original != NULL ) ch = ch->desc->original; @@ -727,7 +727,7 @@ } /* command for retrieving stats */ -int get_curr_stat( CHAR_DATA *ch, int stat ) +int get_curr_stat( const CHAR_DATA *ch, int stat ) { int max; @@ -1644,7 +1644,9 @@ obj->wear_loc = -1; if (!obj->enchanted) + { for ( paf = obj->pIndexData->affected; paf != NULL; paf = paf->next ) + { if ( paf->location == APPLY_SPELL_AFFECT ) { for ( lpaf = ch->affected; lpaf != NULL; lpaf = lpaf_next ) @@ -1664,6 +1666,8 @@ affect_modify( ch, paf, FALSE ); affect_check(ch,paf->where,paf->bitvector); } + } + } for ( paf = obj->affected; paf != NULL; paf = paf->next ) if ( paf->location == APPLY_SPELL_AFFECT ) @@ -2439,7 +2443,7 @@ /* * True if char can see victim. */ -bool can_see( CHAR_DATA *ch, CHAR_DATA *victim ) +bool can_see( const CHAR_DATA *ch, const CHAR_DATA *victim ) { /* RT changed so that WIZ_INVIS has levels */ if ( ch == victim ) @@ -2494,7 +2498,7 @@ /* * True if char can see obj. */ -bool can_see_obj( CHAR_DATA *ch, OBJ_DATA *obj ) +bool can_see_obj( const CHAR_DATA *ch, const OBJ_DATA *obj ) { if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_HOLYLIGHT) ) return TRUE; @@ -2611,7 +2615,10 @@ if ( vector & AFF_SLOW ) strcat( buf, " slow" ); if ( vector & AFF_PLAGUE ) strcat( buf, " plague" ); if ( vector & AFF_DARK_VISION ) strcat( buf, " dark_vision" ); - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + if ( !*buf ) + strcat( buf, " none" ); + + return (char *)(buf+1); } @@ -2619,294 +2626,310 @@ /* * Return ascii name of extra flags vector. */ -char *extra_bit_name( int extra_flags ) +char *extra_bit_name( int vector ) { static char buf[512]; buf[0] = '\0'; - if ( extra_flags & ITEM_GLOW ) strcat( buf, " glow" ); - if ( extra_flags & ITEM_HUM ) strcat( buf, " hum" ); - if ( extra_flags & ITEM_DARK ) strcat( buf, " dark" ); - if ( extra_flags & ITEM_LOCK ) strcat( buf, " lock" ); - if ( extra_flags & ITEM_EVIL ) strcat( buf, " evil" ); - if ( extra_flags & ITEM_INVIS ) strcat( buf, " invis" ); - if ( extra_flags & ITEM_MAGIC ) strcat( buf, " magic" ); - if ( extra_flags & ITEM_NODROP ) strcat( buf, " nodrop" ); - if ( extra_flags & ITEM_BLESS ) strcat( buf, " bless" ); - if ( extra_flags & ITEM_ANTI_GOOD ) strcat( buf, " anti-good" ); - if ( extra_flags & ITEM_ANTI_EVIL ) strcat( buf, " anti-evil" ); - if ( extra_flags & ITEM_ANTI_NEUTRAL ) strcat( buf, " anti-neutral" ); - if ( extra_flags & ITEM_NOREMOVE ) strcat( buf, " noremove" ); - if ( extra_flags & ITEM_INVENTORY ) strcat( buf, " inventory" ); - if ( extra_flags & ITEM_NOPURGE ) strcat( buf, " nopurge" ); - if ( extra_flags & ITEM_VIS_DEATH ) strcat( buf, " vis_death" ); - if ( extra_flags & ITEM_ROT_DEATH ) strcat( buf, " rot_death" ); - if ( extra_flags & ITEM_NOLOCATE ) strcat( buf, " no_locate" ); - if ( extra_flags & ITEM_SELL_EXTRACT ) strcat( buf, " sell_extract" ); - if ( extra_flags & ITEM_BURN_PROOF ) strcat( buf, " burn_proof" ); - if ( extra_flags & ITEM_NOUNCURSE ) strcat( buf, " no_uncurse" ); - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + if ( vector & ITEM_GLOW ) strcat( buf, " glow" ); + if ( vector & ITEM_HUM ) strcat( buf, " hum" ); + if ( vector & ITEM_DARK ) strcat( buf, " dark" ); + if ( vector & ITEM_LOCK ) strcat( buf, " lock" ); + if ( vector & ITEM_EVIL ) strcat( buf, " evil" ); + if ( vector & ITEM_INVIS ) strcat( buf, " invis" ); + if ( vector & ITEM_MAGIC ) strcat( buf, " magic" ); + if ( vector & ITEM_NODROP ) strcat( buf, " nodrop" ); + if ( vector & ITEM_BLESS ) strcat( buf, " bless" ); + if ( vector & ITEM_ANTI_GOOD ) strcat( buf, " anti-good" ); + if ( vector & ITEM_ANTI_EVIL ) strcat( buf, " anti-evil" ); + if ( vector & ITEM_ANTI_NEUTRAL ) strcat( buf, " anti-neutral" ); + if ( vector & ITEM_NOREMOVE ) strcat( buf, " noremove" ); + if ( vector & ITEM_INVENTORY ) strcat( buf, " inventory" ); + if ( vector & ITEM_NOPURGE ) strcat( buf, " nopurge" ); + if ( vector & ITEM_VIS_DEATH ) strcat( buf, " vis_death" ); + if ( vector & ITEM_ROT_DEATH ) strcat( buf, " rot_death" ); + if ( vector & ITEM_NOLOCATE ) strcat( buf, " no_locate" ); + if ( vector & ITEM_SELL_EXTRACT ) strcat( buf, " sell_extract" ); + if ( vector & ITEM_BURN_PROOF ) strcat( buf, " burn_proof" ); + if ( vector & ITEM_NOUNCURSE ) strcat( buf, " no_uncurse" ); + if ( !*buf ) + strcat( buf, " none" ); + + return (char *)(buf+1); } /* return ascii name of an act vector */ -char *act_bit_name( int act_flags ) +char *act_bit_name( int vector ) { static char buf[512]; buf[0] = '\0'; - - if (IS_SET(act_flags,ACT_IS_NPC)) + if (IS_SET(vector,ACT_IS_NPC)) { strcat(buf," npc"); - if (act_flags & ACT_SENTINEL ) strcat(buf, " sentinel"); - if (act_flags & ACT_SCAVENGER ) strcat(buf, " scavenger"); - if (act_flags & ACT_AGGRESSIVE ) strcat(buf, " aggressive"); - if (act_flags & ACT_STAY_AREA ) strcat(buf, " stay_area"); - if (act_flags & ACT_WIMPY ) strcat(buf, " wimpy"); - if (act_flags & ACT_PET ) strcat(buf, " pet"); - if (act_flags & ACT_TRAIN ) strcat(buf, " train"); - if (act_flags & ACT_PRACTICE ) strcat(buf, " practice"); - if (act_flags & ACT_UNDEAD ) strcat(buf, " undead"); - if (act_flags & ACT_CLERIC ) strcat(buf, " cleric"); - if (act_flags & ACT_MAGE ) strcat(buf, " mage"); - if (act_flags & ACT_THIEF ) strcat(buf, " thief"); - if (act_flags & ACT_WARRIOR ) strcat(buf, " warrior"); - if (act_flags & ACT_NOALIGN ) strcat(buf, " no_align"); - if (act_flags & ACT_NOPURGE ) strcat(buf, " no_purge"); - if (act_flags & ACT_IS_HEALER ) strcat(buf, " healer"); - if (act_flags & ACT_IS_CHANGER ) strcat(buf, " changer"); - if (act_flags & ACT_GAIN ) strcat(buf, " skill_train"); - if (act_flags & ACT_UPDATE_ALWAYS) strcat(buf," update_always"); + if (vector & ACT_SENTINEL ) strcat(buf, " sentinel"); + if (vector & ACT_SCAVENGER ) strcat(buf, " scavenger"); + if (vector & ACT_AGGRESSIVE ) strcat(buf, " aggressive"); + if (vector & ACT_STAY_AREA ) strcat(buf, " stay_area"); + if (vector & ACT_WIMPY ) strcat(buf, " wimpy"); + if (vector & ACT_PET ) strcat(buf, " pet"); + if (vector & ACT_TRAIN ) strcat(buf, " train"); + if (vector & ACT_PRACTICE ) strcat(buf, " practice"); + if (vector & ACT_UNDEAD ) strcat(buf, " undead"); + if (vector & ACT_CLERIC ) strcat(buf, " cleric"); + if (vector & ACT_MAGE ) strcat(buf, " mage"); + if (vector & ACT_THIEF ) strcat(buf, " thief"); + if (vector & ACT_WARRIOR ) strcat(buf, " warrior"); + if (vector & ACT_NOALIGN ) strcat(buf, " no_align"); + if (vector & ACT_NOPURGE ) strcat(buf, " no_purge"); + if (vector & ACT_IS_HEALER ) strcat(buf, " healer"); + if (vector & ACT_IS_CHANGER ) strcat(buf, " changer"); + if (vector & ACT_GAIN ) strcat(buf, " skill_train"); + if (vector & ACT_UPDATE_ALWAYS ) strcat(buf, " update_always"); } else { strcat(buf," player"); - if (act_flags & PLR_AUTOASSIST ) strcat(buf, " autoassist"); - if (act_flags & PLR_AUTOEXIT ) strcat(buf, " autoexit"); - if (act_flags & PLR_AUTOLOOT ) strcat(buf, " autoloot"); - if (act_flags & PLR_AUTOSAC ) strcat(buf, " autosac"); - if (act_flags & PLR_AUTOGOLD ) strcat(buf, " autogold"); - if (act_flags & PLR_AUTOSPLIT ) strcat(buf, " autosplit"); - if (act_flags & PLR_HOLYLIGHT ) strcat(buf, " holy_light"); - if (act_flags & PLR_CANLOOT ) strcat(buf, " loot_corpse"); - if (act_flags & PLR_NOSUMMON ) strcat(buf, " no_summon"); - if (act_flags & PLR_NOFOLLOW ) strcat(buf, " no_follow"); - if (act_flags & PLR_FREEZE ) strcat(buf, " frozen"); - if (act_flags & PLR_THIEF ) strcat(buf, " thief"); - if (act_flags & PLR_KILLER ) strcat(buf, " killer"); + if (vector & PLR_AUTOASSIST ) strcat(buf, " autoassist"); + if (vector & PLR_AUTOEXIT ) strcat(buf, " autoexit"); + if (vector & PLR_AUTOLOOT ) strcat(buf, " autoloot"); + if (vector & PLR_AUTOSAC ) strcat(buf, " autosac"); + if (vector & PLR_AUTOGOLD ) strcat(buf, " autogold"); + if (vector & PLR_AUTOSPLIT ) strcat(buf, " autosplit"); + if (vector & PLR_HOLYLIGHT ) strcat(buf, " holy_light"); + if (vector & PLR_CANLOOT ) strcat(buf, " loot_corpse"); + if (vector & PLR_NOSUMMON ) strcat(buf, " no_summon"); + if (vector & PLR_NOFOLLOW ) strcat(buf, " no_follow"); + if (vector & PLR_FREEZE ) strcat(buf, " frozen"); + if (vector & PLR_THIEF ) strcat(buf, " thief"); + if (vector & PLR_KILLER ) strcat(buf, " killer"); } - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + if ( !*buf ) + strcat( buf, " none" ); + + return (char *)(buf+1); } -char *comm_bit_name(int comm_flags) +char *comm_bit_name(int vector) { static char buf[512]; buf[0] = '\0'; + if (vector & COMM_QUIET ) strcat(buf, " quiet"); + if (vector & COMM_DEAF ) strcat(buf, " deaf"); + if (vector & COMM_NOWIZ ) strcat(buf, " no_wiz"); + if (vector & COMM_NOAUCTION ) strcat(buf, " no_auction"); + if (vector & COMM_NOGOSSIP ) strcat(buf, " no_gossip"); + if (vector & COMM_NOQUESTION ) strcat(buf, " no_question"); + if (vector & COMM_NOMUSIC ) strcat(buf, " no_music"); + if (vector & COMM_NOQUOTE ) strcat(buf, " no_quote"); + if (vector & COMM_COMPACT ) strcat(buf, " compact"); + if (vector & COMM_BRIEF ) strcat(buf, " brief"); + if (vector & COMM_PROMPT ) strcat(buf, " prompt"); + if (vector & COMM_COMBINE ) strcat(buf, " combine"); + if (vector & COMM_NOEMOTE ) strcat(buf, " no_emote"); + if (vector & COMM_NOSHOUT ) strcat(buf, " no_shout"); + if (vector & COMM_NOTELL ) strcat(buf, " no_tell"); + if (vector & COMM_NOCHANNELS ) strcat(buf, " no_channels"); + if ( !*buf ) + strcat( buf, " none" ); - if (comm_flags & COMM_QUIET ) strcat(buf, " quiet"); - if (comm_flags & COMM_DEAF ) strcat(buf, " deaf"); - if (comm_flags & COMM_NOWIZ ) strcat(buf, " no_wiz"); - if (comm_flags & COMM_NOAUCTION ) strcat(buf, " no_auction"); - if (comm_flags & COMM_NOGOSSIP ) strcat(buf, " no_gossip"); - if (comm_flags & COMM_NOQUESTION ) strcat(buf, " no_question"); - if (comm_flags & COMM_NOMUSIC ) strcat(buf, " no_music"); - if (comm_flags & COMM_NOQUOTE ) strcat(buf, " no_quote"); - if (comm_flags & COMM_COMPACT ) strcat(buf, " compact"); - if (comm_flags & COMM_BRIEF ) strcat(buf, " brief"); - if (comm_flags & COMM_PROMPT ) strcat(buf, " prompt"); - if (comm_flags & COMM_COMBINE ) strcat(buf, " combine"); - if (comm_flags & COMM_NOEMOTE ) strcat(buf, " no_emote"); - if (comm_flags & COMM_NOSHOUT ) strcat(buf, " no_shout"); - if (comm_flags & COMM_NOTELL ) strcat(buf, " no_tell"); - if (comm_flags & COMM_NOCHANNELS ) strcat(buf, " no_channels"); - - - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } -char *imm_bit_name(int imm_flags) +char *imm_bit_name(int vector) { static char buf[512]; buf[0] = '\0'; + if (vector & IMM_SUMMON ) strcat(buf, " summon"); + if (vector & IMM_CHARM ) strcat(buf, " charm"); + if (vector & IMM_MAGIC ) strcat(buf, " magic"); + if (vector & IMM_WEAPON ) strcat(buf, " weapon"); + if (vector & IMM_BASH ) strcat(buf, " blunt"); + if (vector & IMM_PIERCE ) strcat(buf, " piercing"); + if (vector & IMM_SLASH ) strcat(buf, " slashing"); + if (vector & IMM_FIRE ) strcat(buf, " fire"); + if (vector & IMM_COLD ) strcat(buf, " cold"); + if (vector & IMM_LIGHTNING ) strcat(buf, " lightning"); + if (vector & IMM_ACID ) strcat(buf, " acid"); + if (vector & IMM_POISON ) strcat(buf, " poison"); + if (vector & IMM_NEGATIVE ) strcat(buf, " negative"); + if (vector & IMM_HOLY ) strcat(buf, " holy"); + if (vector & IMM_ENERGY ) strcat(buf, " energy"); + if (vector & IMM_MENTAL ) strcat(buf, " mental"); + if (vector & IMM_DISEASE ) strcat(buf, " disease"); + if (vector & IMM_DROWNING ) strcat(buf, " drowning"); + if (vector & IMM_LIGHT ) strcat(buf, " light"); + if (vector & VULN_IRON ) strcat(buf, " iron"); + if (vector & VULN_WOOD ) strcat(buf, " wood"); + if (vector & VULN_SILVER ) strcat(buf, " silver"); + if ( !*buf ) + strcat( buf, " none" ); - if (imm_flags & IMM_SUMMON ) strcat(buf, " summon"); - if (imm_flags & IMM_CHARM ) strcat(buf, " charm"); - if (imm_flags & IMM_MAGIC ) strcat(buf, " magic"); - if (imm_flags & IMM_WEAPON ) strcat(buf, " weapon"); - if (imm_flags & IMM_BASH ) strcat(buf, " blunt"); - if (imm_flags & IMM_PIERCE ) strcat(buf, " piercing"); - if (imm_flags & IMM_SLASH ) strcat(buf, " slashing"); - if (imm_flags & IMM_FIRE ) strcat(buf, " fire"); - if (imm_flags & IMM_COLD ) strcat(buf, " cold"); - if (imm_flags & IMM_LIGHTNING ) strcat(buf, " lightning"); - if (imm_flags & IMM_ACID ) strcat(buf, " acid"); - if (imm_flags & IMM_POISON ) strcat(buf, " poison"); - if (imm_flags & IMM_NEGATIVE ) strcat(buf, " negative"); - if (imm_flags & IMM_HOLY ) strcat(buf, " holy"); - if (imm_flags & IMM_ENERGY ) strcat(buf, " energy"); - if (imm_flags & IMM_MENTAL ) strcat(buf, " mental"); - if (imm_flags & IMM_DISEASE ) strcat(buf, " disease"); - if (imm_flags & IMM_DROWNING ) strcat(buf, " drowning"); - if (imm_flags & IMM_LIGHT ) strcat(buf, " light"); - if (imm_flags & VULN_IRON ) strcat(buf, " iron"); - if (imm_flags & VULN_WOOD ) strcat(buf, " wood"); - if (imm_flags & VULN_SILVER ) strcat(buf, " silver"); - - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } -char *wear_bit_name(int wear_flags) +char *wear_bit_name(int vector) { static char buf[512]; buf [0] = '\0'; - if (wear_flags & ITEM_TAKE ) strcat(buf, " take"); - if (wear_flags & ITEM_WEAR_FINGER ) strcat(buf, " finger"); - if (wear_flags & ITEM_WEAR_NECK ) strcat(buf, " neck"); - if (wear_flags & ITEM_WEAR_BODY ) strcat(buf, " torso"); - if (wear_flags & ITEM_WEAR_HEAD ) strcat(buf, " head"); - if (wear_flags & ITEM_WEAR_LEGS ) strcat(buf, " legs"); - if (wear_flags & ITEM_WEAR_FEET ) strcat(buf, " feet"); - if (wear_flags & ITEM_WEAR_HANDS ) strcat(buf, " hands"); - if (wear_flags & ITEM_WEAR_ARMS ) strcat(buf, " arms"); - if (wear_flags & ITEM_WEAR_SHIELD ) strcat(buf, " shield"); - if (wear_flags & ITEM_WEAR_ABOUT ) strcat(buf, " body"); - if (wear_flags & ITEM_WEAR_WAIST ) strcat(buf, " waist"); - if (wear_flags & ITEM_WEAR_WRIST ) strcat(buf, " wrist"); - if (wear_flags & ITEM_WIELD ) strcat(buf, " wield"); - if (wear_flags & ITEM_HOLD ) strcat(buf, " hold"); - if (wear_flags & ITEM_NO_SAC ) strcat(buf, " nosac"); - if (wear_flags & ITEM_WEAR_FLOAT ) strcat(buf, " float"); + if (vector & ITEM_TAKE ) strcat(buf, " take"); + if (vector & ITEM_WEAR_FINGER ) strcat(buf, " finger"); + if (vector & ITEM_WEAR_NECK ) strcat(buf, " neck"); + if (vector & ITEM_WEAR_BODY ) strcat(buf, " torso"); + if (vector & ITEM_WEAR_HEAD ) strcat(buf, " head"); + if (vector & ITEM_WEAR_LEGS ) strcat(buf, " legs"); + if (vector & ITEM_WEAR_FEET ) strcat(buf, " feet"); + if (vector & ITEM_WEAR_HANDS ) strcat(buf, " hands"); + if (vector & ITEM_WEAR_ARMS ) strcat(buf, " arms"); + if (vector & ITEM_WEAR_SHIELD ) strcat(buf, " shield"); + if (vector & ITEM_WEAR_ABOUT ) strcat(buf, " body"); + if (vector & ITEM_WEAR_WAIST ) strcat(buf, " waist"); + if (vector & ITEM_WEAR_WRIST ) strcat(buf, " wrist"); + if (vector & ITEM_WIELD ) strcat(buf, " wield"); + if (vector & ITEM_HOLD ) strcat(buf, " hold"); + if (vector & ITEM_NO_SAC ) strcat(buf, " nosac"); + if (vector & ITEM_WEAR_FLOAT ) strcat(buf, " float"); + if ( !*buf ) + strcat( buf, " none" ); - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } -char *form_bit_name(int form_flags) +char *form_bit_name(int vector) { static char buf[512]; buf[0] = '\0'; - if (form_flags & FORM_POISON ) strcat(buf, " poison"); - else if (form_flags & FORM_EDIBLE ) strcat(buf, " edible"); - if (form_flags & FORM_MAGICAL ) strcat(buf, " magical"); - if (form_flags & FORM_INSTANT_DECAY ) strcat(buf, " instant_rot"); - if (form_flags & FORM_OTHER ) strcat(buf, " other"); - if (form_flags & FORM_ANIMAL ) strcat(buf, " animal"); - if (form_flags & FORM_SENTIENT ) strcat(buf, " sentient"); - if (form_flags & FORM_UNDEAD ) strcat(buf, " undead"); - if (form_flags & FORM_CONSTRUCT ) strcat(buf, " construct"); - if (form_flags & FORM_MIST ) strcat(buf, " mist"); - if (form_flags & FORM_INTANGIBLE ) strcat(buf, " intangible"); - if (form_flags & FORM_BIPED ) strcat(buf, " biped"); - if (form_flags & FORM_CENTAUR ) strcat(buf, " centaur"); - if (form_flags & FORM_INSECT ) strcat(buf, " insect"); - if (form_flags & FORM_SPIDER ) strcat(buf, " spider"); - if (form_flags & FORM_CRUSTACEAN ) strcat(buf, " crustacean"); - if (form_flags & FORM_WORM ) strcat(buf, " worm"); - if (form_flags & FORM_BLOB ) strcat(buf, " blob"); - if (form_flags & FORM_MAMMAL ) strcat(buf, " mammal"); - if (form_flags & FORM_BIRD ) strcat(buf, " bird"); - if (form_flags & FORM_REPTILE ) strcat(buf, " reptile"); - if (form_flags & FORM_SNAKE ) strcat(buf, " snake"); - if (form_flags & FORM_DRAGON ) strcat(buf, " dragon"); - if (form_flags & FORM_AMPHIBIAN ) strcat(buf, " amphibian"); - if (form_flags & FORM_FISH ) strcat(buf, " fish"); - if (form_flags & FORM_COLD_BLOOD ) strcat(buf, " cold_blooded"); + if (vector & FORM_POISON ) strcat(buf, " poison"); + else if (vector & FORM_EDIBLE ) strcat(buf, " edible"); + if (vector & FORM_MAGICAL ) strcat(buf, " magical"); + if (vector & FORM_INSTANT_DECAY ) strcat(buf, " instant_rot"); + if (vector & FORM_OTHER ) strcat(buf, " other"); + if (vector & FORM_ANIMAL ) strcat(buf, " animal"); + if (vector & FORM_SENTIENT ) strcat(buf, " sentient"); + if (vector & FORM_UNDEAD ) strcat(buf, " undead"); + if (vector & FORM_CONSTRUCT ) strcat(buf, " construct"); + if (vector & FORM_MIST ) strcat(buf, " mist"); + if (vector & FORM_INTANGIBLE ) strcat(buf, " intangible"); + if (vector & FORM_BIPED ) strcat(buf, " biped"); + if (vector & FORM_CENTAUR ) strcat(buf, " centaur"); + if (vector & FORM_INSECT ) strcat(buf, " insect"); + if (vector & FORM_SPIDER ) strcat(buf, " spider"); + if (vector & FORM_CRUSTACEAN ) strcat(buf, " crustacean"); + if (vector & FORM_WORM ) strcat(buf, " worm"); + if (vector & FORM_BLOB ) strcat(buf, " blob"); + if (vector & FORM_MAMMAL ) strcat(buf, " mammal"); + if (vector & FORM_BIRD ) strcat(buf, " bird"); + if (vector & FORM_REPTILE ) strcat(buf, " reptile"); + if (vector & FORM_SNAKE ) strcat(buf, " snake"); + if (vector & FORM_DRAGON ) strcat(buf, " dragon"); + if (vector & FORM_AMPHIBIAN ) strcat(buf, " amphibian"); + if (vector & FORM_FISH ) strcat(buf, " fish"); + if (vector & FORM_COLD_BLOOD ) strcat(buf, " cold_blooded"); + if ( !*buf ) + strcat( buf, " none" ); - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } -char *part_bit_name(int part_flags) +char *part_bit_name(int vector) { static char buf[512]; buf[0] = '\0'; - if (part_flags & PART_HEAD ) strcat(buf, " head"); - if (part_flags & PART_ARMS ) strcat(buf, " arms"); - if (part_flags & PART_LEGS ) strcat(buf, " legs"); - if (part_flags & PART_HEART ) strcat(buf, " heart"); - if (part_flags & PART_BRAINS ) strcat(buf, " brains"); - if (part_flags & PART_GUTS ) strcat(buf, " guts"); - if (part_flags & PART_HANDS ) strcat(buf, " hands"); - if (part_flags & PART_FEET ) strcat(buf, " feet"); - if (part_flags & PART_FINGERS ) strcat(buf, " fingers"); - if (part_flags & PART_EAR ) strcat(buf, " ears"); - if (part_flags & PART_EYE ) strcat(buf, " eyes"); - if (part_flags & PART_LONG_TONGUE ) strcat(buf, " long_tongue"); - if (part_flags & PART_EYESTALKS ) strcat(buf, " eyestalks"); - if (part_flags & PART_TENTACLES ) strcat(buf, " tentacles"); - if (part_flags & PART_FINS ) strcat(buf, " fins"); - if (part_flags & PART_WINGS ) strcat(buf, " wings"); - if (part_flags & PART_TAIL ) strcat(buf, " tail"); - if (part_flags & PART_CLAWS ) strcat(buf, " claws"); - if (part_flags & PART_FANGS ) strcat(buf, " fangs"); - if (part_flags & PART_HORNS ) strcat(buf, " horns"); - if (part_flags & PART_SCALES ) strcat(buf, " scales"); + if (vector & PART_HEAD ) strcat(buf, " head"); + if (vector & PART_ARMS ) strcat(buf, " arms"); + if (vector & PART_LEGS ) strcat(buf, " legs"); + if (vector & PART_HEART ) strcat(buf, " heart"); + if (vector & PART_BRAINS ) strcat(buf, " brains"); + if (vector & PART_GUTS ) strcat(buf, " guts"); + if (vector & PART_HANDS ) strcat(buf, " hands"); + if (vector & PART_FEET ) strcat(buf, " feet"); + if (vector & PART_FINGERS ) strcat(buf, " fingers"); + if (vector & PART_EAR ) strcat(buf, " ears"); + if (vector & PART_EYE ) strcat(buf, " eyes"); + if (vector & PART_LONG_TONGUE ) strcat(buf, " long_tongue"); + if (vector & PART_EYESTALKS ) strcat(buf, " eyestalks"); + if (vector & PART_TENTACLES ) strcat(buf, " tentacles"); + if (vector & PART_FINS ) strcat(buf, " fins"); + if (vector & PART_WINGS ) strcat(buf, " wings"); + if (vector & PART_TAIL ) strcat(buf, " tail"); + if (vector & PART_CLAWS ) strcat(buf, " claws"); + if (vector & PART_FANGS ) strcat(buf, " fangs"); + if (vector & PART_HORNS ) strcat(buf, " horns"); + if (vector & PART_SCALES ) strcat(buf, " scales"); + if ( !*buf ) + strcat( buf, " none" ); - return (char *) (( buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } -char *weapon_bit_name(int weapon_flags) +char *weapon_bit_name(int vector) { static char buf[512]; buf[0] = '\0'; - if (weapon_flags & WEAPON_FLAMING ) strcat(buf, " flaming"); - if (weapon_flags & WEAPON_FROST ) strcat(buf, " frost"); - if (weapon_flags & WEAPON_VAMPIRIC ) strcat(buf, " vampiric"); - if (weapon_flags & WEAPON_SHARP ) strcat(buf, " sharp"); - if (weapon_flags & WEAPON_VORPAL ) strcat(buf, " vorpal"); - if (weapon_flags & WEAPON_TWO_HANDS ) strcat(buf, " two-handed"); - if (weapon_flags & WEAPON_SHOCKING ) strcat(buf, " shocking"); - if (weapon_flags & WEAPON_POISON ) strcat(buf, " poison"); + if (vector & WEAPON_FLAMING ) strcat(buf, " flaming"); + if (vector & WEAPON_FROST ) strcat(buf, " frost"); + if (vector & WEAPON_VAMPIRIC ) strcat(buf, " vampiric"); + if (vector & WEAPON_SHARP ) strcat(buf, " sharp"); + if (vector & WEAPON_VORPAL ) strcat(buf, " vorpal"); + if (vector & WEAPON_TWO_HANDS ) strcat(buf, " two-handed"); + if (vector & WEAPON_SHOCKING ) strcat(buf, " shocking"); + if (vector & WEAPON_POISON ) strcat(buf, " poison"); + if ( !*buf ) + strcat( buf, " none" ); - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } -char *cont_bit_name( int cont_flags) +char *cont_bit_name( int vector) { static char buf[512]; buf[0] = '\0'; + if (vector & CONT_CLOSEABLE ) strcat(buf, " closable"); + if (vector & CONT_PICKPROOF ) strcat(buf, " pickproof"); + if (vector & CONT_CLOSED ) strcat(buf, " closed"); + if (vector & CONT_LOCKED ) strcat(buf, " locked"); + if ( !*buf ) + strcat( buf, " none" ); - if (cont_flags & CONT_CLOSEABLE ) strcat(buf, " closable"); - if (cont_flags & CONT_PICKPROOF ) strcat(buf, " pickproof"); - if (cont_flags & CONT_CLOSED ) strcat(buf, " closed"); - if (cont_flags & CONT_LOCKED ) strcat(buf, " locked"); - - return (char *)((buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } -char *off_bit_name(int off_flags) +char *off_bit_name(int vector) { static char buf[512]; buf[0] = '\0'; + if (vector & OFF_AREA_ATTACK ) strcat(buf, " area attack"); + if (vector & OFF_BACKSTAB ) strcat(buf, " backstab"); + if (vector & OFF_BASH ) strcat(buf, " bash"); + if (vector & OFF_BERSERK ) strcat(buf, " berserk"); + if (vector & OFF_DISARM ) strcat(buf, " disarm"); + if (vector & OFF_DODGE ) strcat(buf, " dodge"); + if (vector & OFF_FADE ) strcat(buf, " fade"); + if (vector & OFF_FAST ) strcat(buf, " fast"); + if (vector & OFF_KICK ) strcat(buf, " kick"); + if (vector & OFF_KICK_DIRT ) strcat(buf, " kick_dirt"); + if (vector & OFF_PARRY ) strcat(buf, " parry"); + if (vector & OFF_RESCUE ) strcat(buf, " rescue"); + if (vector & OFF_TAIL ) strcat(buf, " tail"); + if (vector & OFF_TRIP ) strcat(buf, " trip"); + if (vector & OFF_CRUSH ) strcat(buf, " crush"); + if (vector & ASSIST_ALL ) strcat(buf, " assist_all"); + if (vector & ASSIST_ALIGN ) strcat(buf, " assist_align"); + if (vector & ASSIST_RACE ) strcat(buf, " assist_race"); + if (vector & ASSIST_PLAYERS ) strcat(buf, " assist_players"); + if (vector & ASSIST_GUARD ) strcat(buf, " assist_guard"); + if (vector & ASSIST_VNUM ) strcat(buf, " assist_vnum"); + if ( !*buf ) + strcat( buf, " none" ); - if (off_flags & OFF_AREA_ATTACK ) strcat(buf, " area attack"); - if (off_flags & OFF_BACKSTAB ) strcat(buf, " backstab"); - if (off_flags & OFF_BASH ) strcat(buf, " bash"); - if (off_flags & OFF_BERSERK ) strcat(buf, " berserk"); - if (off_flags & OFF_DISARM ) strcat(buf, " disarm"); - if (off_flags & OFF_DODGE ) strcat(buf, " dodge"); - if (off_flags & OFF_FADE ) strcat(buf, " fade"); - if (off_flags & OFF_FAST ) strcat(buf, " fast"); - if (off_flags & OFF_KICK ) strcat(buf, " kick"); - if (off_flags & OFF_KICK_DIRT ) strcat(buf, " kick_dirt"); - if (off_flags & OFF_PARRY ) strcat(buf, " parry"); - if (off_flags & OFF_RESCUE ) strcat(buf, " rescue"); - if (off_flags & OFF_TAIL ) strcat(buf, " tail"); - if (off_flags & OFF_TRIP ) strcat(buf, " trip"); - if (off_flags & OFF_CRUSH ) strcat(buf, " crush"); - if (off_flags & ASSIST_ALL ) strcat(buf, " assist_all"); - if (off_flags & ASSIST_ALIGN ) strcat(buf, " assist_align"); - if (off_flags & ASSIST_RACE ) strcat(buf, " assist_race"); - if (off_flags & ASSIST_PLAYERS ) strcat(buf, " assist_players"); - if (off_flags & ASSIST_GUARD ) strcat(buf, " assist_guard"); - if (off_flags & ASSIST_VNUM ) strcat(buf, " assist_vnum"); - - return (char *)(( buf[0] != '\0' ) ? buf+1 : "none"); + return (char *)(buf+1); } diff -abPru Rom24/src/interp.c fixup_081006/src/interp.c --- Rom24/src/interp.c 1998-05-25 03:12:59.000000000 -0400 +++ fixup_081006/src/interp.c 2008-10-06 11:10:14.000000000 -0400 @@ -741,6 +741,36 @@ return argument; } +const char *get_argument( const char *argument, char *arg_first ) +{ + char cEnd; + + while ( isspace(*argument) ) + argument++; + + cEnd = ' '; + if ( *argument == '\'' || *argument == '"' ) + cEnd = *argument++; + + while ( *argument != '\0' ) + { + if ( *argument == cEnd ) + { + argument++; + break; + } + *arg_first = LOWER(*argument); + arg_first++; + argument++; + } + *arg_first = '\0'; + + while ( isspace(*argument) ) + argument++; + + return argument; +} + /* * Contributed by Alander. */ diff -abPru Rom24/src/merc.h fixup_081006/src/merc.h --- Rom24/src/merc.h 2007-03-05 17:24:55.000000000 -0500 +++ fixup_081006/src/merc.h 2008-10-06 14:33:12.000000000 -0400 @@ -43,7 +43,6 @@ #endif - /* * Short scalar types. * Diavolo reports AIX compiler has bugs with short types. @@ -68,6 +67,13 @@ #endif +/* + * Accomodate both gcc and g++ + */ +#if !defined __cplusplus +typedef unsigned char bool; +#endif + /* * Structure types. @@ -1902,6 +1908,7 @@ [MAX_LEVEL+1] [2]; extern char * const dir_name []; +extern char * const dir_abbrev[]; extern const sh_int rev_dir []; @@ -2124,7 +2131,7 @@ OD * create_object args( ( OBJ_INDEX_DATA *pObjIndex, int level ) ); void clone_object args( ( OBJ_DATA *parent, OBJ_DATA *clone ) ); void clear_char args( ( CHAR_DATA *ch ) ); -char * get_extra_descr args( ( const char *name, EXTRA_DESCR_DATA *ed ) ); +char * get_extra_descr args( ( char *name, EXTRA_DESCR_DATA *ed ) ); MID * get_mob_index args( ( int vnum ) ); OID * get_obj_index args( ( int vnum ) ); RID * get_room_index args( ( int vnum ) ); @@ -2139,7 +2146,7 @@ void * alloc_mem args( ( int sMem ) ); void * alloc_perm args( ( int sMem ) ); void free_mem args( ( void *pMem, int sMem ) ); -char * str_dup args( ( const char *str ) ); +char * str_dup args( ( char *str ) ); void free_string args( ( char *pstr ) ); int number_fuzzy args( ( int number ) ); int number_range args( ( int from, int to ) ); @@ -2191,7 +2198,7 @@ int liq_lookup args( ( const char *name) ); int material_lookup args( ( const char *name) ); int weapon_lookup args( ( const char *name) ); -int weapon_type args( ( const char *name) ); +int weapon_type_lookup args( ( const char *name) ); char *weapon_name args( ( int weapon_Type) ); int item_lookup args( ( const char *name) ); char *item_name args( ( int item_type) ); @@ -2202,13 +2209,13 @@ bool is_clan args( (CHAR_DATA *ch) ); bool is_same_clan args( (CHAR_DATA *ch, CHAR_DATA *victim)); bool is_old_mob args ( (CHAR_DATA *ch) ); -int get_skill args( ( CHAR_DATA *ch, int sn ) ); +int get_skill args( ( const CHAR_DATA *ch, int sn ) ); int get_weapon_sn args( ( CHAR_DATA *ch ) ); int get_weapon_skill args(( CHAR_DATA *ch, int sn ) ); int get_age args( ( CHAR_DATA *ch ) ); void reset_char args( ( CHAR_DATA *ch ) ); -int get_trust args( ( CHAR_DATA *ch ) ); -int get_curr_stat args( ( CHAR_DATA *ch, int stat ) ); +int get_trust args( ( const CHAR_DATA *ch ) ); +int get_curr_stat args( ( const CHAR_DATA *ch, int stat ) ); int get_max_train args( ( CHAR_DATA *ch, int stat ) ); int can_carry_n args( ( CHAR_DATA *ch ) ); int can_carry_w args( ( CHAR_DATA *ch ) ); @@ -2253,25 +2260,26 @@ bool room_is_dark args( ( ROOM_INDEX_DATA *pRoomIndex ) ); bool is_room_owner args( ( CHAR_DATA *ch, ROOM_INDEX_DATA *room) ); bool room_is_private args( ( ROOM_INDEX_DATA *pRoomIndex ) ); -bool can_see args( ( CHAR_DATA *ch, CHAR_DATA *victim ) ); -bool can_see_obj args( ( CHAR_DATA *ch, OBJ_DATA *obj ) ); +bool can_see args( ( const CHAR_DATA *ch, const CHAR_DATA *victim ) ); +bool can_see_obj args( ( const CHAR_DATA *ch, const OBJ_DATA *obj ) ); bool can_see_room args( ( CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex) ); bool can_drop_obj args( ( CHAR_DATA *ch, OBJ_DATA *obj ) ); char * affect_loc_name args( ( int location ) ); char * affect_bit_name args( ( int vector ) ); -char * extra_bit_name args( ( int extra_flags ) ); -char * wear_bit_name args( ( int wear_flags ) ); -char * act_bit_name args( ( int act_flags ) ); -char * off_bit_name args( ( int off_flags ) ); -char * imm_bit_name args( ( int imm_flags ) ); -char * form_bit_name args( ( int form_flags ) ); -char * part_bit_name args( ( int part_flags ) ); -char * weapon_bit_name args( ( int weapon_flags ) ); -char * comm_bit_name args( ( int comm_flags ) ); -char * cont_bit_name args( ( int cont_flags) ); +char * extra_bit_name args( ( int vector ) ); +char * wear_bit_name args( ( int vector ) ); +char * act_bit_name args( ( int vector ) ); +char * off_bit_name args( ( int vector ) ); +char * imm_bit_name args( ( int vector ) ); +char * form_bit_name args( ( int vector ) ); +char * part_bit_name args( ( int vector ) ); +char * weapon_bit_name args( ( int vector ) ); +char * comm_bit_name args( ( int vector ) ); +char * cont_bit_name args( ( int vector ) ); /* interp.c */ +const char *get_argument args( ( const char *argument, char *arg_first ) ); void interpret args( ( CHAR_DATA *ch, char *argument ) ); bool is_number args( ( char *arg ) ); int number_argument args( ( char *argument, char *arg ) ); diff -abPru Rom24/src/save.c fixup_081006/src/save.c --- Rom24/src/save.c 2007-03-05 17:09:51.000000000 -0500 +++ fixup_081006/src/save.c 2008-10-03 23:18:40.000000000 -0400 @@ -728,6 +728,7 @@ void fread_char( CHAR_DATA *ch, FILE *fp ) { + static char end[MAX_INPUT_LENGTH] = "End"; char buf[MAX_STRING_LENGTH]; char *word; bool fMatch; @@ -740,7 +741,7 @@ for ( ; ; ) { - word = (char *) (feof( fp ) ? "End" : fread_word( fp ) ); + word = (char *) (feof( fp ) ? end : fread_word( fp ) ); fMatch = FALSE; switch ( UPPER(word[0]) ) @@ -1130,6 +1131,7 @@ /* load a pet from the forgotten reaches */ void fread_pet( CHAR_DATA *ch, FILE *fp ) { + static char end[MAX_INPUT_LENGTH] = "END"; char *word; CHAR_DATA *pet; bool fMatch; @@ -1137,7 +1139,7 @@ int percent; /* first entry had BETTER be the vnum or we barf */ - word = (char *)(feof(fp) ? "END" : fread_word(fp)); + word = (char *)(feof(fp) ? end : fread_word(fp)); if (!str_cmp(word,"Vnum")) { int vnum; @@ -1159,7 +1161,7 @@ for ( ; ; ) { - word = (char *)(feof(fp) ? "END" : fread_word(fp)); + word = (char *)(feof(fp) ? end : fread_word(fp)); fMatch = FALSE; switch (UPPER(word[0])) @@ -1345,6 +1347,7 @@ void fread_obj( CHAR_DATA *ch, FILE *fp ) { + static char end[MAX_INPUT_LENGTH] = "End"; OBJ_DATA *obj; char *word; int iNest; @@ -1361,7 +1364,7 @@ new_format = FALSE; make_new = FALSE; - word = (char *)(feof( fp ) ? "End" : fread_word( fp )); + word = (char *)(feof( fp ) ? end : fread_word( fp )); if (!str_cmp(word,"Vnum" )) { int vnum; @@ -1397,7 +1400,7 @@ if (first) first = FALSE; else - word = (char *)(feof( fp ) ? "End" : fread_word( fp )); + word = (char *)(feof( fp ) ? end : fread_word( fp )); fMatch = FALSE; switch ( UPPER(word[0]) )