Remove priv arguments from ExprResolveFloat They've never been used. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index db1406c..3fbbf37 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -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;
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 230b85b..b5e537b 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -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 */ ,
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index 9114913..b9386d9 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -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");