From 937d40492cefb3922a91c440302b0f9085290405 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 15 Mar 2012 09:33:56 +0000 Subject: [PATCH] Remove more float support Signed-off-by: Daniel Stone --- src/xkbcomp/expr.c | 11 +++-------- src/xkbcomp/xkbcomp.h | 1 - src/xkbcomp/xkbparse.y | 5 +---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c index 60467cd..e4b0569 100644 --- a/src/xkbcomp/expr.c +++ b/src/xkbcomp/expr.c @@ -169,8 +169,7 @@ SimpleLookup(const void * priv, xkb_atom_t field, unsigned type, const LookupEntry *entry; const char *str; - if ((priv == NULL) || (field == None) || - ((type != TypeInt) && (type != TypeFloat))) + if ((priv == NULL) || (field == None) || (type != TypeInt)) { return False; } @@ -180,8 +179,6 @@ SimpleLookup(const void * priv, xkb_atom_t field, unsigned type, if (uStrCaseCmp(str, entry->name) == 0) { val_rtrn->uval = entry->result; - if (type == TypeFloat) - val_rtrn->uval *= XkbGeomPtsPerMM; return True; } } @@ -335,7 +332,7 @@ ExprResolveFloat(ExprDef * expr, return True; } } - if ((expr->type != TypeInt) && (expr->type != TypeFloat)) + if (expr->type != TypeInt) { ERROR("Found constant of type %s, expected a number\n", exprTypeText(expr->type)); @@ -516,7 +513,7 @@ ExprResolveIntegerLookup(ExprDef * expr, break; } } - if ((expr->type != TypeInt) && (expr->type != TypeFloat)) + if (expr->type != TypeInt) { ERROR ("Found constant of type %s where an int was expected\n", @@ -524,8 +521,6 @@ ExprResolveIntegerLookup(ExprDef * expr, return False; } val_rtrn->ival = expr->value.ival; - if (expr->type == TypeFloat) - val_rtrn->ival /= XkbGeomPtsPerMM; return True; case ExprIdent: if (lookup) diff --git a/src/xkbcomp/xkbcomp.h b/src/xkbcomp/xkbcomp.h index 1261c73..08a32c6 100644 --- a/src/xkbcomp/xkbcomp.h +++ b/src/xkbcomp/xkbcomp.h @@ -45,7 +45,6 @@ extern char *scanFile; #define TypeUnknown 0 #define TypeBoolean 1 #define TypeInt 2 -#define TypeFloat 3 #define TypeString 4 #define TypeAction 5 #define TypeKeyName 6 diff --git a/src/xkbcomp/xkbparse.y b/src/xkbcomp/xkbparse.y index bf45dff..7c18e32 100644 --- a/src/xkbcomp/xkbparse.y +++ b/src/xkbcomp/xkbparse.y @@ -680,10 +680,7 @@ Terminal : String } | Float { - ExprDef *expr; - expr= ExprCreate(ExprValue,TypeFloat); - expr->value.ival= $1; - $$= expr; + $$= NULL; } | KeyName {