Remove priv arguments from ExprResolveFloat
authorDaniel Stone <daniel@fooishbar.org>
Mon, 20 Feb 2012 13:40:34 +0000 (13:40 +0000)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 20 Feb 2012 13:40:34 +0000 (13:40 +0000)
They've never been used.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/xkbcomp/expr.c
src/xkbcomp/expr.h
src/xkbcomp/geometry.c

index db1406c..3fbbf37 100644 (file)
@@ -387,8 +387,7 @@ ExprResolveBoolean(ExprDef * expr,
 
 int
 ExprResolveFloat(ExprDef * expr,
-                 ExprResult * val_rtrn,
-                 IdentLookupFunc lookup, char * lookupPriv)
+                 ExprResult * val_rtrn)
 {
     int ok = 0;
     ExprResult leftRtrn, rightRtrn;
@@ -418,26 +417,13 @@ ExprResolveFloat(ExprDef * expr,
             val_rtrn->ival *= XkbGeomPtsPerMM;
         return True;
     case ExprIdent:
-        if (lookup)
-        {
-            ok = (*lookup) (lookupPriv,
-                            None, expr->value.str, TypeFloat, val_rtrn);
-        }
-        if (!ok)
-            ERROR("Numeric identifier \"%s\" unknown\n",
-                   XkbcAtomText(expr->value.str));
+        ERROR("Numeric identifier \"%s\" unknown\n",
+              XkbcAtomText(expr->value.str));
         return ok;
     case ExprFieldRef:
-        if (lookup)
-        {
-            ok = (*lookup) (lookupPriv,
-                            expr->value.field.element,
-                            expr->value.field.field, TypeFloat, val_rtrn);
-        }
-        if (!ok)
-            ERROR("Numeric default \"%s.%s\" unknown\n",
-                   XkbcAtomText(expr->value.field.element),
-                   XkbcAtomText(expr->value.field.field));
+        ERROR("Numeric default \"%s.%s\" unknown\n",
+              XkbcAtomText(expr->value.field.element),
+              XkbcAtomText(expr->value.field.field));
         return ok;
     case OpAdd:
     case OpSubtract:
@@ -445,8 +431,8 @@ ExprResolveFloat(ExprDef * expr,
     case OpDivide:
         left = expr->value.binary.left;
         right = expr->value.binary.right;
-        if (ExprResolveFloat(left, &leftRtrn, lookup, lookupPriv) &&
-            ExprResolveFloat(right, &rightRtrn, lookup, lookupPriv))
+        if (ExprResolveFloat(left, &leftRtrn) &&
+            ExprResolveFloat(right, &rightRtrn))
         {
             switch (expr->op)
             {
@@ -470,16 +456,12 @@ ExprResolveFloat(ExprDef * expr,
         WSGO("Assignment operator not implemented yet\n");
         break;
     case OpNot:
-        left = expr->value.child;
-        if (ExprResolveFloat(left, &leftRtrn, lookup, lookupPriv))
-        {
-            ERROR("The ! operator cannot be applied to a number\n");
-        }
+        ERROR("The ! operator cannot be applied to a number\n");
         return False;
     case OpInvert:
     case OpNegate:
         left = expr->value.child;
-        if (ExprResolveFloat(left, &leftRtrn, lookup, lookupPriv))
+        if (ExprResolveFloat(left, &leftRtrn))
         {
             if (expr->op == OpNegate)
                 val_rtrn->ival = -leftRtrn.ival;
@@ -490,7 +472,7 @@ ExprResolveFloat(ExprDef * expr,
         return False;
     case OpUnaryPlus:
         left = expr->value.child;
-        return ExprResolveFloat(left, val_rtrn, lookup, lookupPriv);
+        return ExprResolveFloat(left, val_rtrn);
     default:
         WSGO("Unknown operator %d in ResolveFloat\n", expr->op);
         break;
index 230b85b..b5e537b 100644 (file)
@@ -119,9 +119,7 @@ extern int ExprResolveInteger(ExprDef * /* expr */ ,
     );
 
 extern int ExprResolveFloat(ExprDef * /* expr */ ,
-                            ExprResult * /* val_rtrn */ ,
-                            IdentLookupFunc /* lookup */ ,
-                            char *    /* lookupPriv */
+                            ExprResult * /* val_rtrn */
     );
 
 extern int ExprResolveString(ExprDef * /* expr */ ,
index 9114913..b9386d9 100644 (file)
@@ -1416,7 +1416,7 @@ SetShapeField(ShapeInfo * si,
             info->errorCount++;
             return ReportNotArray("key shape", field, shText(si));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType("key shape", field, shText(si), "number");
@@ -1450,7 +1450,7 @@ SetShapeDoodadField(DoodadInfo * di,
             info->errorCount++;
             return ReportNotArray(typeName, field, ddText(di));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType(typeName, field, ddText(di), "number");
@@ -1466,7 +1466,7 @@ SetShapeDoodadField(DoodadInfo * di,
             info->errorCount++;
             return ReportNotArray(typeName, field, ddText(di));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType(typeName, field, ddText(di), "number");
@@ -1523,7 +1523,7 @@ SetTextDoodadField(DoodadInfo * di,
             info->errorCount++;
             return ReportNotArray(typeName, field, ddText(di));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType(typeName, field, ddText(di), "number");
@@ -1626,7 +1626,7 @@ SetTextDoodadField(DoodadInfo * di,
     }
     else
     {
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType(typeName, field, ddText(di), "number");
@@ -1708,7 +1708,7 @@ SetLogoDoodadField(DoodadInfo * di,
             info->errorCount++;
             return ReportNotArray(typeName, field, ddText(di));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType(typeName, field, ddText(di), "number");
@@ -1724,7 +1724,7 @@ SetLogoDoodadField(DoodadInfo * di,
             info->errorCount++;
             return ReportNotArray(typeName, field, ddText(di));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType(typeName, field, ddText(di), "number");
@@ -1810,7 +1810,7 @@ SetDoodadField(DoodadInfo * di,
             info->errorCount++;
             return ReportNotArray("doodad", field, ddText(di));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType("doodad", field, ddText(di), "number");
@@ -1826,7 +1826,7 @@ SetDoodadField(DoodadInfo * di,
             info->errorCount++;
             return ReportNotArray("doodad", field, ddText(di));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType("doodad", field, ddText(di), "number");
@@ -1941,7 +1941,7 @@ SetSectionField(SectionInfo * si,
         info->errorCount++;
         return ReportNotArray("keyboard section", field, scText(si));
     }
-    if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+    if (!ExprResolveFloat(value, &tmp))
     {
         info->errorCount++;
         ReportBadType("keyboard section", field, scText(si), "number");
@@ -1966,7 +1966,7 @@ SetRowField(RowInfo * row,
             info->errorCount++;
             return ReportNotArray("keyboard row", field, rowText(row));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType("keyboard row", field, rowText(row),
@@ -1982,7 +1982,7 @@ SetRowField(RowInfo * row,
             info->errorCount++;
             return ReportNotArray("keyboard row", field, rowText(row));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType("keyboard row", field, rowText(row),
@@ -2029,7 +2029,7 @@ SetKeyField(KeyInfo * key,
             info->errorCount++;
             return ReportNotArray("key", field, keyText(key));
         }
-        if (!ExprResolveFloat(value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(value, &tmp))
         {
             info->errorCount++;
             return ReportBadType("key", field, keyText(key), "number");
@@ -2215,7 +2215,7 @@ HandleGeometryVar(VarDef * stmt, struct xkb_desc * xkb, GeometryInfo * info)
             info->errorCount++;
             ret = ReportNotArray("keyboard", field.str, "geometry");
         }
-        else if (!ExprResolveFloat(stmt->value, &tmp, NULL, NULL))
+        else if (!ExprResolveFloat(stmt->value, &tmp))
         {
             info->errorCount++;
             ret = ReportBadType("keyboard", field.str, "geometry", "number");
@@ -2248,7 +2248,7 @@ HandleGeometryVar(VarDef * stmt, struct xkb_desc * xkb, GeometryInfo * info)
             info->errorCount++;
             ret = ReportNotArray("keyboard", field.str, "geometry");
         }
-        if (!ExprResolveFloat(stmt->value, &tmp, NULL, NULL))
+        if (!ExprResolveFloat(stmt->value, &tmp))
         {
             info->errorCount++;
             ret = ReportBadType("keyboard", field.str, "geometry", "number");
@@ -2280,7 +2280,7 @@ HandleGeometryVar(VarDef * stmt, struct xkb_desc * xkb, GeometryInfo * info)
             info->errorCount++;
             ret = ReportNotArray("keyboard", field.str, "geometry");
         }
-        else if (!ExprResolveFloat(stmt->value, &tmp, NULL, NULL))
+        else if (!ExprResolveFloat(stmt->value, &tmp))
         {
             info->errorCount++;
             ret = ReportBadType("keyboard", field.str, "geometry", "number");