From 21c864ccbf9368fe0c504c017bf8f8f414bc2f89 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 9 Mar 2021 09:44:25 +0100 Subject: Inline x11_atom_interner_adopt_atoms() into callers Signed-off-by: Uli Schlachter --- src/x11/keymap.c | 11 ++++++++--- src/x11/util.c | 10 ---------- src/x11/x11-priv.h | 6 ------ 3 files changed, 8 insertions(+), 19 deletions(-) (limited to 'src') 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(). -- cgit v1.2.3