From e98574570ec0e355c6cff2b6e30bd992f20fe610 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 18 Jan 2021 11:15:53 -0800 Subject: More static analysis cleanup --- pattern.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pattern.c') diff --git a/pattern.c b/pattern.c index cd154b4..cf5b095 100644 --- a/pattern.c +++ b/pattern.c @@ -3,6 +3,7 @@ // #include +#include #include #include #include @@ -11,7 +12,7 @@ #include "pattern.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(EXIT_FAILURE); } while(0) __attribute__((nonnull)) static pat_t *expand_chain(file_t *f, pat_t *first); @@ -161,7 +162,7 @@ static pat_t *bp_simplepattern(file_t *f, const char *str) // Expand postfix operators (if any) str = after_spaces(pat->end); while (str+2 < f->end && (matchstr(&str, "!=") || matchstr(&str, "=="))) { // Equality == and inequality != - int equal = str[-2] == '='; + bool equal = str[-2] == '='; pat_t *first = pat; pat_t *second = bp_simplepattern(f, str); if (!second) @@ -224,7 +225,7 @@ static pat_t *_bp_simplepattern(file_t *f, const char *str) case '`': { pat_t *all = NULL; do { - char c = *str; + c = *str; if (!c || c == '\n') file_err(f, str, str, "There should be a character here after the '`'"); const char *opstart = str-1; @@ -490,7 +491,6 @@ static pat_t *_bp_simplepattern(file_t *f, const char *str) return ref; } } - return NULL; } // -- cgit v1.2.3