From b7b02528d7121b71adced7f79af48d09558dfa85 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 13 May 2020 21:01:39 -0400 Subject: check for circular includes --- misc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'misc.c') diff --git a/misc.c b/misc.c index 655fce8..de9a49f 100644 --- a/misc.c +++ b/misc.c @@ -66,20 +66,19 @@ static inline char *str_to_cstr(String s) { return cstr(s.str, s.len); } -static bool str_eq_cstr(String s, const char *str) { +static inline bool str_eq_cstr(String s, const char *str) { return strncmp(s.str, str, s.len) == 0; } +static inline bool streq(const char *a, const char *b) { + return strcmp(a, b) == 0; +} + static inline U32 rand_u32(U32 seed) { U64 seed64 = (U64)seed; return (U32)((seed64 * 0x832f0fda4e1a8642 + 0x41d49cd5459a2ab4) >> 32); } - -static inline bool strs_equal(const char *a, const char *b) { - return strcmp(a, b) == 0; -} - #define plural_suffix(x) ((x) == 1 ? "" : "s") static const char *indefinite_article(const char *s) { /* usually, words starting with "u" use "a" - "a unique thing", "a u64" */ -- cgit v1.2.3