diff options
| author | Patrick Steinhardt <ps@pks.im> | 2017-01-27 14:20:24 +0100 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2017-02-17 11:41:06 +0100 |
| commit | 73028af85c11bd947184a73c1e2d7902819695b2 (patch) | |
| tree | 5be249b035620603b70dbe1e321a28f87ff4b7ea /src/idxmap.h | |
| parent | 85d2748c6f75bd810c7376647c8ae32984b5e3bb (diff) | |
| download | libgit2-73028af85c11bd947184a73c1e2d7902819695b2.tar.gz | |
khash: avoid using macro magic to get return address
Diffstat (limited to 'src/idxmap.h')
| -rw-r--r-- | src/idxmap.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/idxmap.h b/src/idxmap.h index 4122a89fe..e8fd3631a 100644 --- a/src/idxmap.h +++ b/src/idxmap.h @@ -51,16 +51,16 @@ static kh_inline khint_t idxentry_hash(const git_index_entry *e) ((*(hp) = kh_init(idxicase)) == NULL) ? giterr_set_oom(), -1 : 0 #define git_idxmap_insert(h, key, val, rval) do { \ - khiter_t __pos = kh_put(idx, h, key, &rval); \ - if (rval >= 0) { \ - if (rval == 0) kh_key(h, __pos) = key; \ + khiter_t __pos = kh_put(idx, h, key, rval); \ + if ((*rval) >= 0) { \ + if ((*rval) == 0) kh_key(h, __pos) = key; \ kh_val(h, __pos) = val; \ } } while (0) #define git_idxmap_icase_insert(h, key, val, rval) do { \ - khiter_t __pos = kh_put(idxicase, h, key, &rval); \ - if (rval >= 0) { \ - if (rval == 0) kh_key(h, __pos) = key; \ + khiter_t __pos = kh_put(idxicase, h, key, rval); \ + if ((*rval) >= 0) { \ + if ((*rval) == 0) kh_key(h, __pos) = key; \ kh_val(h, __pos) = val; \ } } while (0) |
