Commit 068016e4dd9a7463e5a74d0cec7612c2a9bdd6c0

Ran Benita 2013-12-01T10:45:52

parser, symbols: drop unnecessary casts It's casted into ExprDef and then uncasted for no reason. Signed-off-by: Ran Benita <ran234@gmail.com>

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;
     }