Remove more float support

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-03-15 09:33:56 +00:00
parent 3560bf7bf4
commit 937d40492c
3 changed files with 4 additions and 13 deletions

View File

@ -169,8 +169,7 @@ SimpleLookup(const void * priv, xkb_atom_t field, unsigned type,
const LookupEntry *entry; const LookupEntry *entry;
const char *str; const char *str;
if ((priv == NULL) || (field == None) || if ((priv == NULL) || (field == None) || (type != TypeInt))
((type != TypeInt) && (type != TypeFloat)))
{ {
return False; return False;
} }
@ -180,8 +179,6 @@ SimpleLookup(const void * priv, xkb_atom_t field, unsigned type,
if (uStrCaseCmp(str, entry->name) == 0) if (uStrCaseCmp(str, entry->name) == 0)
{ {
val_rtrn->uval = entry->result; val_rtrn->uval = entry->result;
if (type == TypeFloat)
val_rtrn->uval *= XkbGeomPtsPerMM;
return True; return True;
} }
} }
@ -335,7 +332,7 @@ ExprResolveFloat(ExprDef * expr,
return True; return True;
} }
} }
if ((expr->type != TypeInt) && (expr->type != TypeFloat)) if (expr->type != TypeInt)
{ {
ERROR("Found constant of type %s, expected a number\n", ERROR("Found constant of type %s, expected a number\n",
exprTypeText(expr->type)); exprTypeText(expr->type));
@ -516,7 +513,7 @@ ExprResolveIntegerLookup(ExprDef * expr,
break; break;
} }
} }
if ((expr->type != TypeInt) && (expr->type != TypeFloat)) if (expr->type != TypeInt)
{ {
ERROR ERROR
("Found constant of type %s where an int was expected\n", ("Found constant of type %s where an int was expected\n",
@ -524,8 +521,6 @@ ExprResolveIntegerLookup(ExprDef * expr,
return False; return False;
} }
val_rtrn->ival = expr->value.ival; val_rtrn->ival = expr->value.ival;
if (expr->type == TypeFloat)
val_rtrn->ival /= XkbGeomPtsPerMM;
return True; return True;
case ExprIdent: case ExprIdent:
if (lookup) if (lookup)

View File

@ -45,7 +45,6 @@ extern char *scanFile;
#define TypeUnknown 0 #define TypeUnknown 0
#define TypeBoolean 1 #define TypeBoolean 1
#define TypeInt 2 #define TypeInt 2
#define TypeFloat 3
#define TypeString 4 #define TypeString 4
#define TypeAction 5 #define TypeAction 5
#define TypeKeyName 6 #define TypeKeyName 6

View File

@ -680,10 +680,7 @@ Terminal : String
} }
| Float | Float
{ {
ExprDef *expr; $$= NULL;
expr= ExprCreate(ExprValue,TypeFloat);
expr->value.ival= $1;
$$= expr;
} }
| KeyName | KeyName
{ {