ast: use more suitable types in a few ast nodes The int ones cannot be signed (they come as such from the scanner, and NEGATE is never applied to them). The uint32_t one is really an atom, but presumably the type was never converted to xkb_atom_t. 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
diff --git a/src/xkbcomp/ast-build.c b/src/xkbcomp/ast-build.c
index d470884..77cffab 100644
--- a/src/xkbcomp/ast-build.c
+++ b/src/xkbcomp/ast-build.c
@@ -356,7 +356,7 @@ SymbolsCreate(xkb_atom_t keyName, VarDef *symbols)
}
GroupCompatDef *
-GroupCompatCreate(int group, ExprDef *val)
+GroupCompatCreate(unsigned group, ExprDef *val)
{
GroupCompatDef *def = malloc(sizeof(*def));
if (!def)
@@ -372,7 +372,7 @@ GroupCompatCreate(int group, ExprDef *val)
}
ModMapDef *
-ModMapCreate(uint32_t modifier, ExprDef *keys)
+ModMapCreate(xkb_atom_t modifier, ExprDef *keys)
{
ModMapDef *def = malloc(sizeof(*def));
if (!def)
@@ -404,7 +404,7 @@ LedMapCreate(xkb_atom_t name, VarDef *body)
}
LedNameDef *
-LedNameCreate(int ndx, ExprDef *name, bool virtual)
+LedNameCreate(unsigned ndx, ExprDef *name, bool virtual)
{
LedNameDef *def = malloc(sizeof(*def));
if (!def)
diff --git a/src/xkbcomp/ast-build.h b/src/xkbcomp/ast-build.h
index 8146b06..f305c4c 100644
--- a/src/xkbcomp/ast-build.h
+++ b/src/xkbcomp/ast-build.h
@@ -98,16 +98,16 @@ SymbolsDef *
SymbolsCreate(xkb_atom_t keyName, VarDef *symbols);
GroupCompatDef *
-GroupCompatCreate(int group, ExprDef *def);
+GroupCompatCreate(unsigned group, ExprDef *def);
ModMapDef *
-ModMapCreate(uint32_t modifier, ExprDef *keys);
+ModMapCreate(xkb_atom_t modifier, ExprDef *keys);
LedMapDef *
LedMapCreate(xkb_atom_t name, VarDef *body);
LedNameDef *
-LedNameCreate(int ndx, ExprDef *name, bool virtual);
+LedNameCreate(unsigned ndx, ExprDef *name, bool virtual);
IncludeStmt *
IncludeCreate(struct xkb_context *ctx, char *str, enum merge_mode merge);
diff --git a/src/xkbcomp/ast.h b/src/xkbcomp/ast.h
index d6b1109..a141b8f 100644
--- a/src/xkbcomp/ast.h
+++ b/src/xkbcomp/ast.h
@@ -299,7 +299,7 @@ typedef struct {
typedef struct {
ParseCommon common;
enum merge_mode merge;
- int group;
+ unsigned group;
ExprDef *def;
} GroupCompatDef;
@@ -314,7 +314,7 @@ typedef struct {
typedef struct {
ParseCommon common;
enum merge_mode merge;
- int ndx;
+ unsigned ndx;
ExprDef *name;
bool virtual;
} LedNameDef;