From b100b4084660c38c5766a96814ce122ae637044e Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Tue, 31 Jan 2017 20:33:49 -0500 Subject: [PATCH] UltraRogue: fix various build failures. --- urogue/Makefile | 8 ++++++-- urogue/daemons.c | 6 +++--- urogue/dictutil.c | 14 +++++++------- urogue/memory.c | 2 +- urogue/rogue.h | 13 ++++++------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/urogue/Makefile b/urogue/Makefile index b2eb426..24988c7 100644 --- a/urogue/Makefile +++ b/urogue/Makefile @@ -30,6 +30,7 @@ OBJS = armor.o \ magic.o \ main.o \ maze.o \ + mdport.o \ memory.o \ misc.o \ monsdata.o \ @@ -55,7 +56,8 @@ OBJS = armor.o \ verify.o \ vers.o \ weapons.o \ - wizard.o + wizard.o \ + xcrypt.o PROGRAM = ur @@ -78,6 +80,7 @@ CFILES = armor.c \ magic.c \ main.c \ maze.c \ + mdport.c \ memory.c \ misc.c \ monsdata.c \ @@ -103,7 +106,8 @@ CFILES = armor.c \ verify.c \ vers.c \ weapons.c \ - wizard.c + wizard.c \ + xcrypt.c MISC= Makefile README LICENSE.TXT history.txt TODO diff --git a/urogue/daemons.c b/urogue/daemons.c index 84a01e5..9cace7c 100644 --- a/urogue/daemons.c +++ b/urogue/daemons.c @@ -225,7 +225,7 @@ doctor_spell_points(struct thing *tp) called to roll to see if a wandering monster starts up */ -daemon +void rollwand(daemon_arg *arg) { NOOP(arg); @@ -246,7 +246,7 @@ rollwand(daemon_arg *arg) digest the hero's food */ -daemon +void stomach(daemon_arg *arg) { int oldfood, old_hunger; @@ -322,7 +322,7 @@ stomach(daemon_arg *arg) each other, this routine have been enhanced and may need more work yet */ -daemon +void runners(daemon_arg *arg) { struct linked_list *item; diff --git a/urogue/dictutil.c b/urogue/dictutil.c index 5839ef2..49766ed 100644 --- a/urogue/dictutil.c +++ b/urogue/dictutil.c @@ -28,7 +28,7 @@ static char sccsid[] = "%W% %G%"; #include "dictutil.h" #include "rogue.h" -int trace; +int dict_trace; FILE *ft; @@ -83,13 +83,13 @@ void *dict_load_block( DICTIONARY *dict , char *toc_id , if ( block == NULL ) { ptr = malloc( dt_entry->size ); - if ( trace > 3 ) { + if ( dict_trace > 3 ) { fprintf( ft , "\ndict_load_block allocates %lx bytes at location %p\n" , dt_entry->size , ptr ); } /* endif */ } else { ptr = block; - if ( trace > 3 ) { + if ( dict_trace > 3 ) { fprintf( ft , "\ndict_load_block uses memory at location %p\n" , ptr ); } /* endif */ } /* endif */ @@ -113,7 +113,7 @@ void *dict_load_block( DICTIONARY *dict , char *toc_id , dt_entry->ptr = ptr; - if ( trace > 3 ) { + if ( dict_trace > 3 ) { fprintf( ft , "\nLoaded block\nTOC entry: id:%s offset:%lx size:%lx ptr:%p checksum:%lx type:%d\n" , dict->toc[index].id , dict->toc[index].offset , dict->toc[index].size , dict->toc[index].ptr , @@ -160,7 +160,7 @@ BOOLEANC dict_save_block( DICTIONARY *dict , char *toc_id , FILE *fo ) return( FALSE ); } /* endif */ - if ( trace > 3 ) { + if ( dict_trace > 3 ) { fprintf( ft , "\nStored block\nTOC entry: id:%s offset:%lx size:%lx ptr:%p checksum:%lx type:%d\n" , dict->toc[index].id , dict->toc[index].offset , dict->toc[index].size , dict->toc[index].ptr , @@ -418,7 +418,7 @@ BOOLEANC dict_set_parm_variables( DICTIONARY *dict ) } /*********** -** If trace (global) > 0 , signal an error +** If dict_trace (global) > 0 , signal an error ** If severity > 0 , abort ***********/ @@ -426,7 +426,7 @@ void signal_error( char *header , char *message , int severity ) { FILE *fpe; - if ( trace > 0 ) { + if ( dict_trace > 0 ) { printf( "%s: %s\n" , header , message ); fpe = fopen( "ERROR.FIL" , "a" ); fprintf( fpe , "\n%s: %s\n" , header , message ); diff --git a/urogue/memory.c b/urogue/memory.c index 688d1fc..412da50 100644 --- a/urogue/memory.c +++ b/urogue/memory.c @@ -339,7 +339,7 @@ void *mem_realloc(const void *ptr, const size_t new_size) /* check a pointer to be sure all check bytes are OK. abort if not */ /* always returns 1 if not aborting so that it can be included in */ /* if statement boolean expressions */ -int mem_validate(void *ptr) +int mem_validate(const void *ptr) { unsigned char *mem_temp = (unsigned char *)ptr; size_t mem_size; diff --git a/urogue/rogue.h b/urogue/rogue.h index 4c3c0b4..4a294f8 100644 --- a/urogue/rogue.h +++ b/urogue/rogue.h @@ -1062,7 +1062,6 @@ struct delayed_action #define FUSE 2 typedef void fuse; -typedef void daemon; typedef union { @@ -1087,7 +1086,7 @@ struct fuse struct daemon { int index; - daemon (*func)(daemon_arg *arg); + void (*func)(daemon_arg *arg); }; #define MAXDAEMONS 60 @@ -1156,10 +1155,10 @@ extern void activity(void); /* daemons.c */ extern void doctor_spell_points(struct thing *tp); -extern daemon runners(daemon_arg *arg); -extern daemon doctor(daemon_arg *tp); -extern daemon rollwand(daemon_arg *arg); -extern daemon stomach(daemon_arg *arg); +extern void runners(daemon_arg *arg); +extern void doctor(daemon_arg *tp); +extern void rollwand(daemon_arg *arg); +extern void stomach(daemon_arg *arg); extern fuse swander(fuse_arg *arg); extern fuse unconfuse(fuse_arg *arg); extern fuse unscent(fuse_arg *arg); @@ -1812,4 +1811,4 @@ void md_srandom(long seed); int md_readchar(WINDOW *win); #define NOOP(x) (x += 0) -#define CCHAR(x) ( (char) (x & A_CHARTEXT) ) \ No newline at end of file +#define CCHAR(x) ( (char) (x & A_CHARTEXT) )