parser, symbols: drop unnecessary casts It's casted into ExprDef and then uncasted for no reason. 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
diff --git a/src/xkbcomp/ast-build.c b/src/xkbcomp/ast-build.c
index 9d760e0..9f429d9 100644
--- a/src/xkbcomp/ast-build.c
+++ b/src/xkbcomp/ast-build.c
@@ -302,7 +302,7 @@ KeyTypeCreate(xkb_atom_t name, VarDef *body)
}
SymbolsDef *
-SymbolsCreate(xkb_atom_t keyName, ExprDef *symbols)
+SymbolsCreate(xkb_atom_t keyName, VarDef *symbols)
{
SymbolsDef *def = malloc(sizeof(*def));
if (!def)
diff --git a/src/xkbcomp/ast-build.h b/src/xkbcomp/ast-build.h
index 2df7cd0..35a4ca7 100644
--- a/src/xkbcomp/ast-build.h
+++ b/src/xkbcomp/ast-build.h
@@ -80,7 +80,7 @@ KeyTypeDef *
KeyTypeCreate(xkb_atom_t name, VarDef *body);
SymbolsDef *
-SymbolsCreate(xkb_atom_t keyName, ExprDef *symbols);
+SymbolsCreate(xkb_atom_t keyName, VarDef *symbols);
GroupCompatDef *
GroupCompatCreate(int group, ExprDef *def);
diff --git a/src/xkbcomp/ast.h b/src/xkbcomp/ast.h
index 3e9f517..c63b796 100644
--- a/src/xkbcomp/ast.h
+++ b/src/xkbcomp/ast.h
@@ -233,7 +233,7 @@ typedef struct {
ParseCommon common;
enum merge_mode merge;
xkb_atom_t keyName;
- ExprDef *symbols;
+ VarDef *symbols;
} SymbolsDef;
typedef struct {
diff --git a/src/xkbcomp/parser.y b/src/xkbcomp/parser.y
index 486dcb4..272562f 100644
--- a/src/xkbcomp/parser.y
+++ b/src/xkbcomp/parser.y
@@ -434,7 +434,7 @@ KeyTypeDecl : TYPE String OBRACE
SymbolsDecl : KEY KEYNAME OBRACE
SymbolsBody
CBRACE SEMI
- { $$ = SymbolsCreate($2, (ExprDef *)$4); }
+ { $$ = SymbolsCreate($2, $4); }
;
SymbolsBody : SymbolsBody COMMA SymbolsVarDecl
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index e719da9..075516d 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1114,7 +1114,7 @@ HandleSymbolsDef(SymbolsInfo *info, SymbolsDef *stmt)
keyi.merge = stmt->merge;
keyi.name = stmt->keyName;
- if (!HandleSymbolsBody(info, (VarDef *) stmt->symbols, &keyi)) {
+ if (!HandleSymbolsBody(info, stmt->symbols, &keyi)) {
info->errorCount++;
return false;
}