Fix xkbparse.y compilation Thanks to autotools happily building stale generated sources, I hadn't actually ever built my xkbparse.y changes. Fix that so it not only compiles, but works. This seems to parse long keycodes correctly, although I very much would not recommend testing this by declaring 0x1fffffff as your highest keycode. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index be1e3b6..c8bbadc 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -636,19 +636,10 @@ HandleIncludeKeycodes(IncludeStmt * stmt, struct xkb_desc * xkb, KeyNamesInfo *
static int
HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info)
{
- int code;
- ExprResult result;
-
- if (!ExprResolveKeyCode(stmt->value, &result))
- {
- ACTION("No value keycode assigned to name <%s>\n", stmt->name);
- return 0;
- }
- code = result.uval;
- if ((info->explicitMin != 0 && code < info->explicitMin) ||
- (info->explicitMax != 0 && code > info->explicitMax))
+ if ((info->explicitMin != 0 && stmt->value < info->explicitMin) ||
+ (info->explicitMax != 0 && stmt->value > info->explicitMax))
{
- ERROR("Illegal keycode %d for name <%s>\n", code, stmt->name);
+ ERROR("Illegal keycode %lu for name <%s>\n", stmt->value, stmt->name);
ACTION("Must be in the range %d-%d inclusive\n",
info->explicitMin,
info->explicitMax ? info->explicitMax : XKB_KEYCODE_MAX);
@@ -661,7 +652,8 @@ HandleKeycodeDef(KeycodeDef * stmt, unsigned merge, KeyNamesInfo * info)
else
merge = stmt->merge;
}
- return AddKeyName(info, code, stmt->name, merge, info->fileID, True);
+ return AddKeyName(info, stmt->value, stmt->name, merge, info->fileID,
+ True);
}
#define MIN_KEYCODE_DEF 0
diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c
index c8491e7..69b8a5c 100644
--- a/src/xkbcomp/parseutils.c
+++ b/src/xkbcomp/parseutils.c
@@ -120,7 +120,7 @@ ExprCreateBinary(unsigned op, ExprDef * left, ExprDef * right)
}
KeycodeDef *
-KeycodeCreate(char *name, ExprDef * value)
+KeycodeCreate(char *name, unsigned long value)
{
KeycodeDef *def;
diff --git a/src/xkbcomp/parseutils.h b/src/xkbcomp/parseutils.h
index c0a78df..dbaf683 100644
--- a/src/xkbcomp/parseutils.h
+++ b/src/xkbcomp/parseutils.h
@@ -31,6 +31,7 @@
extern char scanBuf[1024];
extern int scanInt;
+extern unsigned long scanULong;
extern int lineNum;
extern XkbFile *rtrnValue;
@@ -65,7 +66,7 @@ extern ExprDef *ExprCreateBinary(unsigned /* op */ ,
);
extern KeycodeDef *KeycodeCreate(char * /* name */ ,
- ExprDef * /* value */
+ unsigned long /* value */
);
extern KeyAliasDef *KeyAliasCreate(char * /* alias */ ,
diff --git a/src/xkbcomp/xkbcomp.h b/src/xkbcomp/xkbcomp.h
index 3772a88..502b0ba 100644
--- a/src/xkbcomp/xkbcomp.h
+++ b/src/xkbcomp/xkbcomp.h
@@ -192,7 +192,7 @@ typedef struct _KeycodeDef
ParseCommon common;
unsigned merge;
char name[5];
- ExprDef *value;
+ unsigned long value;
} KeycodeDef;
typedef struct _KeyAliasDef
diff --git a/src/xkbcomp/xkbparse.y b/src/xkbcomp/xkbparse.y
index 4214e9c..5634fb7 100644
--- a/src/xkbcomp/xkbparse.y
+++ b/src/xkbcomp/xkbparse.y
@@ -707,13 +707,6 @@ Terminal : String
free($1);
$$= expr;
}
- | KeyCode
- {
- ExprDef *expr;
- expr= ExprCreate(ExprValue,TypeKeyCode);
- expr->value.uval= $1;
- $$= expr;
- }
;
OptKeySymList : KeySymList { $$= $1; }