diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-13 19:01:49 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-13 19:01:49 -0800 |
| commit | 43aeadaab8c29351e506c03829c3dc74a9f6b86a (patch) | |
| tree | aa8ec115dee11f7a8adcd9f9e1a649bb5e985fb3 | |
| parent | 3443d817150e641221749bf129cc6716e6baaf32 (diff) | |
Replaced _exit()s with exits()
| -rw-r--r-- | bp.c | 2 | ||||
| -rw-r--r-- | compiler.c | 2 | ||||
| -rw-r--r-- | grammar.c | 2 | ||||
| -rw-r--r-- | utils.c | 4 | ||||
| -rw-r--r-- | utils.h | 2 | ||||
| -rw-r--r-- | vm.c | 2 |
6 files changed, 7 insertions, 7 deletions
@@ -80,7 +80,7 @@ static int process_file(def_t *defs, const char *filename, vm_op_t *pattern, uns intern_file(f); match_t *m = match(defs, f, f->contents, pattern, flags); if (m && print_errors(f, m, print_options) > 0) - _exit(1); + exit(1); if (m != NULL && m->end > m->start + 1) { success = 1; @@ -10,7 +10,7 @@ #include "compiler.h" #include "utils.h" -#define file_err(f, ...) do { fprint_line(stderr, f, __VA_ARGS__); _exit(1); } while(0) +#define file_err(f, ...) do { fprint_line(stderr, f, __VA_ARGS__); exit(1); } while(0) __attribute__((nonnull)) static vm_op_t *expand_chain(file_t *f, vm_op_t *first); @@ -51,7 +51,7 @@ def_t *load_grammar(def_t *defs, file_t *f) } if (src < f->end) { fprint_line(stderr, f, src, NULL, "Invalid BP pattern"); - _exit(1); + exit(1); } return defs; } @@ -194,7 +194,7 @@ void *memcheck(void *p) { if (p == NULL) { fprintf(stderr, "memory allocation failure\n"); - _exit(1); + exit(1); } return p; } @@ -218,7 +218,7 @@ void xfree(void *p) { if (*(void**)p == NULL) { fprintf(stderr, "Attempt to free(NULL)\n"); - _exit(1); + exit(1); } free(*(void**)p); p = NULL; @@ -12,7 +12,7 @@ #define streq(a, b) (strcmp(a, b) == 0) // TODO: better error reporting -#define check(cond, ...) do { if (!(cond)) { fprintf(stderr, __VA_ARGS__); fwrite("\n", 1, 1, stderr); _exit(1); } } while(0) +#define check(cond, ...) do { if (!(cond)) { fprintf(stderr, __VA_ARGS__); fwrite("\n", 1, 1, stderr); exit(1); } } while(0) #define debug(...) do { if (verbose) fprintf(stderr, __VA_ARGS__); } while(0) #define new(t) memcheck(calloc(sizeof(t), 1)) #define xcalloc(a,b) memcheck(calloc(a,b)) @@ -481,7 +481,7 @@ static match_t *_match(def_t *defs, file_t *f, const char *str, vm_op_t *op, uns } default: { fprintf(stderr, "Unknown opcode: %d", op->type); - _exit(1); + exit(1); return NULL; } } |
