expr: Remove ExprResolveFloat Remnant from geometry. 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index e0fc5b2..7653255 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -301,105 +301,6 @@ ExprResolveBoolean(struct xkb_context *ctx, ExprDef *expr,
}
int
-ExprResolveFloat(struct xkb_context *ctx, ExprDef *expr,
- ExprResult *val_rtrn)
-{
- int ok = 0;
- ExprResult leftRtrn, rightRtrn;
- ExprDef *left, *right;
-
- switch (expr->op) {
- case ExprValue:
- if (expr->type == TypeString) {
- const char *str;
- str = xkb_atom_text(ctx, expr->value.str);
- if ((str != NULL) && (strlen(str) == 1)) {
- val_rtrn->uval = str[0] * XkbGeomPtsPerMM;
- return true;
- }
- }
- if (expr->type != TypeInt) {
- log_err(ctx, "Found constant of type %s, expected a number\n",
- exprTypeText(expr->type));
- return false;
- }
- val_rtrn->ival = expr->value.ival;
- if (expr->type == TypeInt)
- val_rtrn->ival *= XkbGeomPtsPerMM;
- return true;
-
- case ExprIdent:
- log_err(ctx, "Numeric identifier \"%s\" unknown\n",
- xkb_atom_text(ctx, expr->value.str));
- return ok;
-
- case ExprFieldRef:
- log_err(ctx, "Numeric default \"%s.%s\" unknown\n",
- xkb_atom_text(ctx, expr->value.field.element),
- xkb_atom_text(ctx, expr->value.field.field));
- return false;
-
- case OpAdd:
- case OpSubtract:
- case OpMultiply:
- case OpDivide:
- left = expr->value.binary.left;
- right = expr->value.binary.right;
- if (ExprResolveFloat(ctx, left, &leftRtrn) &&
- ExprResolveFloat(ctx, right, &rightRtrn)) {
- switch (expr->op) {
- case OpAdd:
- val_rtrn->ival = leftRtrn.ival + rightRtrn.ival;
- break;
-
- case OpSubtract:
- val_rtrn->ival = leftRtrn.ival - rightRtrn.ival;
- break;
-
- case OpMultiply:
- val_rtrn->ival = leftRtrn.ival * rightRtrn.ival;
- break;
-
- case OpDivide:
- val_rtrn->ival = leftRtrn.ival / rightRtrn.ival;
- break;
- }
- return true;
- }
- return false;
-
- case OpAssign:
- log_wsgo(ctx, "Assignment operator not implemented yet\n");
- break;
-
- case OpNot:
- log_err(ctx, "The ! operator cannot be applied to a number\n");
- return false;
-
- case OpInvert:
- case OpNegate:
- left = expr->value.child;
- if (ExprResolveFloat(ctx, left, &leftRtrn)) {
- if (expr->op == OpNegate)
- val_rtrn->ival = -leftRtrn.ival;
- else
- val_rtrn->ival = ~leftRtrn.ival;
- return true;
- }
- return false;
-
- case OpUnaryPlus:
- left = expr->value.child;
- return ExprResolveFloat(ctx, left, val_rtrn);
-
- default:
- log_wsgo(ctx, "Unknown operator %d in ResolveFloat\n", expr->op);
- break;
- }
- return false;
-}
-
-int
ExprResolveKeyCode(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index bdaa7c6..15b880a 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -95,9 +95,6 @@ ExprResolveButton(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveFloat(struct xkb_context *ctx, ExprDef *expr, ExprResult *val_rtrn);
-
-extern int
ExprResolveString(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);