Inline x11_atom_interner_adopt_atoms() into callers Signed-off-by: Uli Schlachter <psychon@znc.in>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
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().