Various cleanups.

* Remove disused macro.
* GCC doesn't seem to mind if IGNORE() is left off.
* Enumify phase codes.
* Use EXIT_* macros in all exit() calls.
* How did this even work without extern?
* Give advent.h a much-needed makeover.
* Use the chomp indicator in YAML string blocks to avoid code ugliness.
This commit is contained in:
Jason S. Ninneman 2017-06-30 13:51:03 -07:00 committed by Eric S. Raymond
parent 31f27b672c
commit 8bc08773fa
7 changed files with 186 additions and 201 deletions

View file

@ -38,7 +38,7 @@ int savefile(FILE *fp, long version)
save.version = (version == 0) ? VRSION : version;
memcpy(&save.game, &game, sizeof(struct game_t));
IGNORE(fwrite(&save, sizeof(struct save_t), 1, fp));
fwrite(&save, sizeof(struct save_t), 1, fp);
return (0);
}
@ -73,7 +73,7 @@ int suspend(void)
savefile(fp, VRSION);
fclose(fp);
rspeak(RESUME_HELP);
exit(0);
exit(EXIT_SUCCESS);
}
int resume(void)
@ -114,7 +114,7 @@ int restore(FILE* fp)
return GO_UNKNOWN;
#endif
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
fread(&save, sizeof(struct save_t), 1, fp);
fclose(fp);
if (save.version != VRSION) {
rspeak(VERSION_SKEW, save.version / 10, MOD(save.version, 10), VRSION / 10, MOD(VRSION, 10));