summaryrefslogtreecommitdiffhomepage
path: root/ir/libcore
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2011-12-13 18:32:46 +0100
committerMatthias Braun <matze@braunis.de>2011-12-14 01:51:49 +0100
commit6032e9e802d2d5c696b90fd17f4b4c9bf9a39540 (patch)
treeb054016b1614fee64151b69f6c7f5fa79510e075 /ir/libcore
parent68d6fda00d6fb04a040905f232c6d9454f6e0136 (diff)
hashptr.h: use inline functions instead of #define
Diffstat (limited to 'ir/libcore')
-rw-r--r--ir/libcore/lc_opts.c4
-rw-r--r--ir/libcore/lc_printf.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/ir/libcore/lc_opts.c b/ir/libcore/lc_opts.c
index 665398a..db1cb68 100644
--- a/ir/libcore/lc_opts.c
+++ b/ir/libcore/lc_opts.c
@@ -44,7 +44,7 @@ static struct obstack obst;
static void set_name(lc_opt_entry_t *ent, const char *name)
{
ent->name = name;
- ent->hash = HASH_STR(name, strlen(name));
+ ent->hash = hash_str(name);
}
#define entry_matches(ent,hash_val,str) \
@@ -234,7 +234,7 @@ static lc_opt_entry_t *lc_opt_find_ent(const struct list_head *head, const char
{
lc_opt_entry_t *ent, *found = NULL;
int error = error_to_use;
- unsigned hash = HASH_STR(name, strlen(name));
+ unsigned hash = hash_str(name);
if (!list_empty(head)) {
list_for_each_entry(lc_opt_entry_t, ent, head, list) {
diff --git a/ir/libcore/lc_printf.c b/ir/libcore/lc_printf.c
index 6ea8d31..402d271 100644
--- a/ir/libcore/lc_printf.c
+++ b/ir/libcore/lc_printf.c
@@ -113,7 +113,7 @@ int lc_arg_register(lc_arg_env_t *env, const char *name, char letter, const lc_a
base = 'a';
}
- ent = (lc_arg_t*)set_insert(env->args, &arg, sizeof(arg), HASH_STR(name, strlen(name)));
+ ent = (lc_arg_t*)set_insert(env->args, &arg, sizeof(arg), hash_str(name));
if (ent && base != 0)
map[letter - base] = ent;
@@ -438,7 +438,7 @@ int lc_evpprintf(const lc_arg_env_t *env, lc_appendable_t *app, const char *fmt,
name[n] = '\0';
tmp.name = name;
- arg = (lc_arg_t*)set_find(env->args, &tmp, sizeof(tmp), HASH_STR(named, n));
+ arg = (lc_arg_t*)set_find(env->args, &tmp, sizeof(tmp), hash_str(named));
occ.modifier = "";
occ.modifier_length = 0;