Mercurial > hg > early-roguelike
comparison 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 |
comparison
equal
deleted
inserted
replaced
214:e5a15b09ce1d | 215:1b73a8641b37 |
---|---|
19 #define KERNEL | 19 #define KERNEL |
20 #include <signal.h> | 20 #include <signal.h> |
21 #undef KERNEL | 21 #undef KERNEL |
22 #include "rogue.h" | 22 #include "rogue.h" |
23 | 23 |
24 void save_file(FILE *savef); | |
25 extern int rs_save_file(FILE *savef); | |
26 extern int rs_restore_file(int inf); | |
27 | |
24 typedef struct stat STAT; | 28 typedef struct stat STAT; |
25 | 29 |
26 extern char version[], encstr[]; | 30 extern char version[], encstr[]; |
27 extern bool _endwin; | 31 extern bool _endwin; |
28 | 32 |
31 /* | 35 /* |
32 * save_game: | 36 * save_game: |
33 * Implement the "save game" command | 37 * Implement the "save game" command |
34 */ | 38 */ |
35 /* This has to be cleaned up, these goto's are annoying. */ | 39 /* This has to be cleaned up, these goto's are annoying. */ |
36 save_game() | 40 bool |
41 save_game(void) | |
37 { | 42 { |
38 register FILE *savef; | 43 register FILE *savef; |
39 register int c; | 44 register int c; |
40 char buf[256]; | 45 char buf[256]; |
41 | 46 |
149 | 154 |
150 /* | 155 /* |
151 * save_file: | 156 * save_file: |
152 * Write the saved game on the file | 157 * Write the saved game on the file |
153 */ | 158 */ |
154 save_file(savef) | 159 void |
155 register FILE *savef; | 160 save_file(FILE *savef) |
156 { | 161 { |
157 int slines = LINES; | 162 int slines = LINES; |
158 int scols = COLS; | 163 int scols = COLS; |
159 | 164 |
160 /* | 165 /* |
187 /* | 192 /* |
188 * restore: | 193 * restore: |
189 * Restore a saved game from a file with elaborate checks for file | 194 * Restore a saved game from a file with elaborate checks for file |
190 * integrity from cheaters | 195 * integrity from cheaters |
191 */ | 196 */ |
192 restore(file, envp) | 197 bool |
193 register char *file; | 198 restore(char *file, char **envp) |
194 char **envp; | |
195 { | 199 { |
196 register int inf; | 200 register int inf; |
197 register bool syml; | 201 register bool syml; |
198 extern char **environ; | 202 extern char **environ; |
199 char buf[MAXSTR]; | 203 char buf[MAXSTR]; |
322 | 326 |
323 /* | 327 /* |
324 * encwrite: | 328 * encwrite: |
325 * Perform an encrypted write | 329 * Perform an encrypted write |
326 */ | 330 */ |
327 encwrite(starta, size, outf) | 331 void |
328 void *starta; | 332 encwrite(void *starta, int size, FILE *outf) |
329 unsigned int size; | |
330 register FILE *outf; | |
331 { | 333 { |
332 register char *ep; | 334 register char *ep; |
333 register char *start = (char *) starta; | 335 register char *start = (char *) starta; |
334 ep = encstr; | 336 ep = encstr; |
335 | 337 |
343 | 345 |
344 /* | 346 /* |
345 * encread: | 347 * encread: |
346 * Perform an encrypted read | 348 * Perform an encrypted read |
347 */ | 349 */ |
348 encread(starta, size, inf) | 350 int |
349 register void *starta; | 351 encread(void *starta, int size, int inf) |
350 unsigned int size; | |
351 register int inf; | |
352 { | 352 { |
353 register char *ep; | 353 register char *ep; |
354 register int read_size; | 354 register int read_size; |
355 register char *start = (char *) starta; | 355 register char *start = (char *) starta; |
356 | 356 |