From d2383d385252d2bf583e9d56a31bb62490fa5cb6 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 1 Aug 2013 20:44:46 +0300 Subject: [PATCH libxkbcommon 1/3] keymap-dump: use correct format specifiers For keycodes, groups, levels, etc, which are unsigned. The really proper inttypes.h ones seem a bit much though. Signed-off-by: Ran Benita --- src/xkbcomp/keymap-dump.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/xkbcomp/keymap-dump.c b/src/xkbcomp/keymap-dump.c index 71b9a8c..6b4c266 100644 --- a/src/xkbcomp/keymap-dump.c +++ b/src/xkbcomp/keymap-dump.c @@ -161,20 +161,20 @@ write_keycodes(struct xkb_keymap *keymap, struct buf *buf) * a maximum of at least 255, else XWayland really starts hating life. * If this is a problem and people really need strictly bounded keymaps, * we should probably control this with a flag. */ - write_buf(buf, "\tminimum = %d;\n", min(keymap->min_key_code, 8)); - write_buf(buf, "\tmaximum = %d;\n", max(keymap->max_key_code, 255)); + write_buf(buf, "\tminimum = %u;\n", min(keymap->min_key_code, 8)); + write_buf(buf, "\tmaximum = %u;\n", max(keymap->max_key_code, 255)); xkb_foreach_key(key, keymap) { if (key->name == XKB_ATOM_NONE) continue; - write_buf(buf, "\t%-20s = %d;\n", + write_buf(buf, "\t%-20s = %u;\n", KeyNameText(keymap->ctx, key->name), key->keycode); } darray_enumerate(idx, led, keymap->leds) if (led->name != XKB_ATOM_NONE) - write_buf(buf, "\tindicator %d = \"%s\";\n", + write_buf(buf, "\tindicator %u = \"%s\";\n", idx + 1, xkb_atom_text(keymap->ctx, led->name)); @@ -219,7 +219,7 @@ write_types(struct xkb_keymap *keymap, struct buf *buf) continue; str = ModMaskText(keymap, entry->mods.mods); - write_buf(buf, "\t\tmap[%s]= Level%d;\n", + write_buf(buf, "\t\tmap[%s]= Level%u;\n", str, entry->level + 1); if (entry->preserve.mods) @@ -229,7 +229,7 @@ write_types(struct xkb_keymap *keymap, struct buf *buf) for (xkb_level_index_t n = 0; n < type->num_levels; n++) if (type->level_names[n]) - write_buf(buf, "\t\tlevel_name[Level%d]= \"%s\";\n", n + 1, + write_buf(buf, "\t\tlevel_name[Level%u]= \"%s\";\n", n + 1, xkb_atom_text(keymap->ctx, type->level_names[n])); write_buf(buf, "\t};\n"); @@ -618,7 +618,7 @@ write_symbols(struct xkb_keymap *keymap, struct buf *buf) for (group = 0; group < keymap->num_group_names; group++) if (keymap->group_names[group]) write_buf(buf, - "\tname[group%d]=\"%s\";\n", group + 1, + "\tname[group%u]=\"%s\";\n", group + 1, xkb_atom_text(keymap->ctx, keymap->group_names[group])); if (group > 0) write_buf(buf, "\n"); -- 1.8.3.4