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

@ -1,4 +1,3 @@
#define DEFINE_GLOBALS_FROM_INCLUDES
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
@ -51,7 +50,7 @@ int main(int argc, char *argv[])
" -v version number of save format.\n");
fprintf(stderr,
" -o file name of save game to write.\n");
exit(-1);
exit(EXIT_FAILURE);
break;
}
}
@ -61,7 +60,7 @@ int main(int argc, char *argv[])
usage, argv[0]);
fprintf(stderr,
"ERROR: filename required\n");
exit(-1);
exit(EXIT_FAILURE);
}
FILE *fp = NULL;
@ -89,7 +88,7 @@ int main(int argc, char *argv[])
if (fp == NULL) {
fprintf(stderr,
"Can't open file %s. Exiting.\n", savefilename);
exit(-1);
exit(EXIT_FAILURE);
}
savefile(fp, version);