diff options
author | Uli Schlachter <psychon@znc.in> | 2021-03-09 09:44:25 +0100 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2021-03-09 11:00:13 +0200 |
commit | 21c864ccbf9368fe0c504c017bf8f8f414bc2f89 (patch) | |
tree | eb1a15f948522bf12772ca52cde6ee63217f3a9d /src | |
parent | c033970163bada868361a3cd58cc24ae5d4785a8 (diff) | |
download | libxkbcommon-21c864ccbf9368fe0c504c017bf8f8f414bc2f89.tar.gz libxkbcommon-21c864ccbf9368fe0c504c017bf8f8f414bc2f89.tar.bz2 libxkbcommon-21c864ccbf9368fe0c504c017bf8f8f414bc2f89.zip |
Inline x11_atom_interner_adopt_atoms() into callers
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src')
-rw-r--r-- | src/x11/keymap.c | 11 | ||||
-rw-r--r-- | src/x11/util.c | 10 | ||||
-rw-r--r-- | src/x11/x11-priv.h | 6 |
3 files changed, 8 insertions, 19 deletions
diff --git a/src/x11/keymap.c b/src/x11/keymap.c index 1e7fc3b..ce0f7e7 100644 --- a/src/x11/keymap.c +++ b/src/x11/keymap.c @@ -893,8 +893,10 @@ get_type_names(struct xkb_keymap *keymap, struct x11_atom_interner *interner, ALLOC_OR_FAIL(type->level_names, type->num_levels); x11_atom_interner_adopt_atom(interner, wire_type_name, &type->name); - x11_atom_interner_adopt_atoms(interner, kt_level_names_iter, - type->level_names, wire_num_levels); + for (size_t j = 0; j < wire_num_levels; j++) { + x11_atom_interner_adopt_atom(interner, kt_level_names_iter[j], + &type->level_names[j]); + } type->num_level_names = type->num_levels; kt_level_names_iter += wire_num_levels; @@ -975,7 +977,10 @@ get_group_names(struct xkb_keymap *keymap, struct x11_atom_interner *interner, keymap->num_group_names = msb_pos(reply->groupNames); ALLOC_OR_FAIL(keymap->group_names, keymap->num_group_names); - x11_atom_interner_adopt_atoms(interner, iter, keymap->group_names, length); + for (size_t i = 0; i < length; i++) { + x11_atom_interner_adopt_atom(interner, iter[i], + &keymap->group_names[i]); + } return true; diff --git a/src/x11/util.c b/src/x11/util.c index ac8f061..c4609e4 100644 --- a/src/x11/util.c +++ b/src/x11/util.c @@ -212,16 +212,6 @@ retry: interner->pending[idx].cookie = xcb_get_atom_name(interner->conn, atom); } -void -x11_atom_interner_adopt_atoms(struct x11_atom_interner *interner, - const xcb_atom_t *from, xkb_atom_t *to, - size_t count) -{ - for (size_t i = 0; i < count; i++) { - x11_atom_interner_adopt_atom(interner, from[i], &to[i]); - } -} - void x11_atom_interner_round_trip(struct x11_atom_interner *interner) { struct xkb_context *ctx = interner->ctx; xcb_connection_t *conn = interner->conn; diff --git a/src/x11/x11-priv.h b/src/x11/x11-priv.h index 480590d..7f37fd5 100644 --- a/src/x11/x11-priv.h +++ b/src/x11/x11-priv.h @@ -69,12 +69,6 @@ void x11_atom_interner_adopt_atom(struct x11_atom_interner *interner, const xcb_atom_t atom, xkb_atom_t *out); - -void -x11_atom_interner_adopt_atoms(struct x11_atom_interner *interner, - const xcb_atom_t *from, xkb_atom_t *to, - size_t count); - /* * Get a strdup'd and XkbEscapeMapName'd name of an X atom. The actual write is * delayed until the next call to x11_atom_interner_round_trip(). |