X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=exec.c;h=d4e75b82e8b580394a8d0300ead3705b1364486f;hp=57b47318fab3211a8d269db944933ad26eeb95ee;hb=360389638bc546a53bd577e43168c0674be3c354;hpb=87d9371a5c08f5b05ba70b11c63df80960b40831 diff --git a/exec.c b/exec.c index 57b4731..d4e75b8 100644 --- a/exec.c +++ b/exec.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013 + * Copyright (C) 2012, 2013, 2014 * Wolfgang Bumiller * Dale Weiler * @@ -587,7 +587,6 @@ cleanup: * main for when building the standalone executor */ -#if defined(QCVM_EXECUTOR) #include const char *type_name[TYPE_COUNT] = { @@ -915,7 +914,7 @@ int main(int argc, char **argv) { if (argc < 2) { usage(); - exit(1); + exit(EXIT_FAILURE); } while (argc > 1) { @@ -924,7 +923,7 @@ int main(int argc, char **argv) { !strcmp(argv[1], "--help")) { usage(); - exit(0); + exit(EXIT_SUCCESS); } else if (!strcmp(argv[1], "-v")) { ++opts_v; @@ -938,7 +937,7 @@ int main(int argc, char **argv) { ++opts_v; else { usage(); - exit(1); + exit(EXIT_FAILURE); } } --argc; @@ -948,7 +947,7 @@ int main(int argc, char **argv) { !strcmp(argv[1], "--version")) { version(); - exit(0); + exit(EXIT_SUCCESS); } else if (!strcmp(argv[1], "-trace")) { --argc; @@ -977,7 +976,7 @@ int main(int argc, char **argv) { ++argv; if (argc <= 1) { usage(); - exit(1); + exit(EXIT_FAILURE); } vec_push(dis_list, argv[1]); --argc; @@ -1020,7 +1019,7 @@ int main(int argc, char **argv) { ++argv; if (argc < 2) { usage(); - exit(1); + exit(EXIT_FAILURE); } p.value = argv[1]; @@ -1037,7 +1036,7 @@ int main(int argc, char **argv) { if (progsfile) { fprintf(stderr, "only 1 program file may be specified\n"); usage(); - exit(1); + exit(EXIT_FAILURE); } progsfile = argv[1]; --argc; @@ -1047,7 +1046,7 @@ int main(int argc, char **argv) { { fprintf(stderr, "unknown parameter: %s\n", argv[1]); usage(); - exit(1); + exit(EXIT_FAILURE); } } @@ -1060,13 +1059,13 @@ int main(int argc, char **argv) { if (!progsfile) { fprintf(stderr, "must specify a program to execute\n"); usage(); - exit(1); + exit(EXIT_FAILURE); } prog = prog_load(progsfile, noexec); if (!prog) { fprintf(stderr, "failed to load program '%s'\n", progsfile); - exit(1); + exit(EXIT_FAILURE); } prog->builtins = qc_builtins; @@ -1156,7 +1155,7 @@ int main(int argc, char **argv) { if (opts_printfuns) { for (i = 0; i < vec_size(prog->functions); ++i) { int32_t a; - printf("Function: %-16s taking %i parameters:(", + printf("Function: %-16s taking %u parameters:(", prog_getstring(prog, prog->functions[i].name), (unsigned int)prog->functions[i].nargs); for (a = 0; a < prog->functions[i].nargs; ++a) { @@ -1226,7 +1225,6 @@ void prog_disasm_function(qc_program_t *prog, size_t id) { ++st; } } -#endif #else /* !QCVM_LOOP */ /* * Everything from here on is not including into the compilation of the