Get rid of struct xkb_key_name Just embed it directly. Signed-off-by: Ran Benita <ran234@gmail.com>
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
diff --git a/src/keymap-dump.c b/src/keymap-dump.c
index fbe0c9b..1d99e35 100644
--- a/src/keymap-dump.c
+++ b/src/keymap-dump.c
@@ -327,11 +327,11 @@ write_keycodes(struct xkb_keymap *keymap, char **buf, size_t *size,
for (kc = keymap->min_key_code; kc <= keymap->max_key_code; kc++) {
key = XkbKey(keymap, kc);
- if (key->name.name[0] == '\0')
+ if (key->name[0] == '\0')
continue;
write_buf(keymap, buf, size, offset, "\t\t%6s = %d;\n",
- XkbcKeyNameText(key->name.name), kc);
+ XkbcKeyNameText(key->name), kc);
}
for (i = 0; i < XkbNumIndicators; i++) {
@@ -811,7 +811,7 @@ write_symbols(struct xkb_keymap *keymap, char **buf, size_t *size,
continue;
write_buf(keymap, buf, size, offset, "\t\tkey %6s {",
- XkbcKeyNameText(key->name.name));
+ XkbcKeyNameText(key->name));
if (key->explicit & XkbExplicitKeyTypesMask) {
bool multi_type = false;
@@ -935,7 +935,7 @@ write_symbols(struct xkb_keymap *keymap, char **buf, size_t *size,
write_buf(keymap, buf, size, offset,
"\t\tmodifier_map %s { %s };\n",
get_mod_index_text(mod),
- XkbcKeyNameText(key->name.name));
+ XkbcKeyNameText(key->name));
}
}
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index 3c0ecab..4b0fcc2 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -284,10 +284,6 @@ struct xkb_indicator_map {
unsigned int ctrls;
};
-struct xkb_key_name {
- char name[XkbKeyNameLength];
-};
-
struct xkb_key_alias {
char real[XkbKeyNameLength];
char alias[XkbKeyNameLength];
@@ -310,7 +306,7 @@ struct xkb_controls {
};
struct xkb_key {
- struct xkb_key_name name;
+ char name[XkbKeyNameLength];
unsigned char explicit;
struct xkb_sym_map sym_map;
unsigned char modmap;
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 7a48cd4..964b777 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -812,11 +812,11 @@ HandleRedirectKey(struct xkb_keymap *keymap, struct xkb_any_action *action,
case F_Keycode:
if (!ExprResolveKeyName(keymap->ctx, value, &rtrn))
return ReportMismatch(action->type, field, "key name");
- tmp = KeyNameToLong(rtrn.keyName.name);
+ tmp = KeyNameToLong(rtrn.name);
if (!FindNamedKey(keymap, tmp, &kc, true, CreateKeyNames(keymap),
0)) {
return ReportNotFound(action->type, field, "Key",
- XkbcKeyNameText(rtrn.keyName.name));
+ XkbcKeyNameText(rtrn.name));
}
act->new_kc = kc;
return true;
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index f44acb2..2dcc74c 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -779,7 +779,7 @@ ExprResolveKeyName(struct xkb_context *ctx, ExprDef *expr,
exprTypeText(expr->type));
return false;
}
- memcpy(val_rtrn->keyName.name, expr->value.keyName, XkbKeyNameLength);
+ memcpy(val_rtrn->name, expr->value.keyName, XkbKeyNameLength);
return true;
case ExprIdent:
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index c4371b4..7b48c95 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -33,7 +33,7 @@ typedef union _ExprResult {
char *str;
int ival;
unsigned uval;
- struct xkb_key_name keyName;
+ char name[XkbKeyNameLength];
} ExprResult;
extern int
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index 9ff9f37..e77e047 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -757,7 +757,7 @@ CompileKeycodes(XkbFile *file, struct xkb_keymap *keymap,
darray_resize0(keymap->keys, keymap->max_key_code + 1);
for (kc = info.computedMin; kc <= info.computedMax; kc++)
LongToKeyName(darray_item(info.names, kc),
- XkbKey(keymap, kc)->name.name);
+ XkbKey(keymap, kc)->name);
if (info.name)
keymap->keycodes_section_name = strdup(info.name);
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index e10a23e..bc1ab42 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -231,7 +231,7 @@ FindNamedKey(struct xkb_keymap *keymap, unsigned long name,
unsigned long tmp;
key = XkbKey(keymap, kc);
- tmp = KeyNameToLong(key->name.name);
+ tmp = KeyNameToLong(key->name);
if (tmp == name) {
*kc_rtrn = kc;
return true;
@@ -252,10 +252,10 @@ FindNamedKey(struct xkb_keymap *keymap, unsigned long name,
for (kc = keymap->min_key_code; kc <= keymap->max_key_code; kc++) {
key = XkbKey(keymap, kc);
- if (key->name.name[0] == '\0') {
+ if (key->name[0] == '\0') {
char buf[XkbKeyNameLength + 1];
LongToKeyName(name, buf);
- memcpy(key->name.name, buf, XkbKeyNameLength);
+ memcpy(key->name, buf, XkbKeyNameLength);
*kc_rtrn = kc;
return true;
}
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 0adc819..eede0c5 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1966,12 +1966,12 @@ CompileSymbols(XkbFile *file, struct xkb_keymap *keymap,
if (warningLevel > 3) {
for (kc = keymap->min_key_code; kc <= keymap->max_key_code; kc++) {
key = XkbKey(keymap, kc);
- if (key->name.name[0] == '\0')
+ if (key->name[0] == '\0')
continue;
if (XkbKeyNumGroups(keymap, kc) < 1)
WARN("No symbols defined for <%.4s> (keycode %d)\n",
- key->name.name, kc);
+ key->name, kc);
}
}