Mercurial > hg > early-roguelike
diff rogue4/save.c @ 215:1b73a8641b37
rogue4: fix most GCC5 warnings.
Converting all function definitions to ANSI style accounts for most of
the change. This has exposed other problems, such as daemons not
actually being their stated type, that will require more careful
solutions.
author | John "Elwin" Edwards |
---|---|
date | Wed, 27 Jan 2016 19:41:05 -0500 |
parents | 1fe660009fd3 |
children | 3d4252fa2ed3 |
line wrap: on
line diff
--- a/rogue4/save.c Sat Jan 23 09:35:14 2016 -0500 +++ b/rogue4/save.c Wed Jan 27 19:41:05 2016 -0500 @@ -21,6 +21,10 @@ #undef KERNEL #include "rogue.h" +void save_file(FILE *savef); +extern int rs_save_file(FILE *savef); +extern int rs_restore_file(int inf); + typedef struct stat STAT; extern char version[], encstr[]; @@ -33,7 +37,8 @@ * Implement the "save game" command */ /* This has to be cleaned up, these goto's are annoying. */ -save_game() +bool +save_game(void) { register FILE *savef; register int c; @@ -151,8 +156,8 @@ * save_file: * Write the saved game on the file */ -save_file(savef) -register FILE *savef; +void +save_file(FILE *savef) { int slines = LINES; int scols = COLS; @@ -189,9 +194,8 @@ * Restore a saved game from a file with elaborate checks for file * integrity from cheaters */ -restore(file, envp) -register char *file; -char **envp; +bool +restore(char *file, char **envp) { register int inf; register bool syml; @@ -324,10 +328,8 @@ * encwrite: * Perform an encrypted write */ -encwrite(starta, size, outf) -void *starta; -unsigned int size; -register FILE *outf; +void +encwrite(void *starta, int size, FILE *outf) { register char *ep; register char *start = (char *) starta; @@ -345,10 +347,8 @@ * encread: * Perform an encrypted read */ -encread(starta, size, inf) -register void *starta; -unsigned int size; -register int inf; +int +encread(void *starta, int size, int inf) { register char *ep; register int read_size;