summaryrefslogtreecommitdiffhomepage
path: root/ir/libcore
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2015-12-06 22:38:19 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2015-12-07 18:41:49 +0100
commit4075c5421f35fe15adb08b9e3ae189a13ab7e408 (patch)
tree3d98c31fb57018200b462ad593d50a369f975f66 /ir/libcore
parent31f3d128912d1097c070fee3bc46a122da28c181 (diff)
adt: Add and use 'streq()'.
Diffstat (limited to 'ir/libcore')
-rw-r--r--ir/libcore/lc_opts.c2
-rw-r--r--ir/libcore/lc_opts_enum.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/ir/libcore/lc_opts.c b/ir/libcore/lc_opts.c
index 6c2893c..ec35e6f 100644
--- a/ir/libcore/lc_opts.c
+++ b/ir/libcore/lc_opts.c
@@ -30,7 +30,7 @@ static void set_name(lc_opt_entry_t *ent, const char *name)
}
#define entry_matches(ent,hash_val,str) \
- ((ent)->hash == hash_val && strcmp((ent)->name, (str)) == 0)
+ ((ent)->hash == hash_val && streq((ent)->name, (str)))
static lc_opt_entry_t *init_entry(lc_opt_entry_t *ent, lc_opt_entry_t *parent,
const char *name, const char *desc)
diff --git a/ir/libcore/lc_opts_enum.c b/ir/libcore/lc_opts_enum.c
index 73533a7..932256f 100644
--- a/ir/libcore/lc_opts_enum.c
+++ b/ir/libcore/lc_opts_enum.c
@@ -8,6 +8,7 @@
#include "lc_opts_t.h"
#include "lc_opts_enum.h"
+#include "util.h"
#include "xmalloc.h"
static const char *delim = " \t|,";
@@ -39,7 +40,7 @@ bool lc_opt_enum_ ## N ## _cb(void *const data, size_t const len, char const *co
s[end - begin] = '\0'; \
\
for (i = 0; items[i].name != NULL; ++i) { \
- if (strcmp(s, items[i].name) == 0) { \
+ if (streq(s, items[i].name)) { \
*var->value op items[i].value; \
res = true; \
} \