Remove priv arguments from ExprResolveString 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 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index cf8d852..eaaacd4 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -985,7 +985,7 @@ HandleActionMessage(struct xkb_desc * xkb,
case F_Data:
if (array_ndx == NULL)
{
- if (!ExprResolveString(value, &rtrn, NULL, NULL))
+ if (!ExprResolveString(value, &rtrn))
return ReportMismatch(action->type, field, "string");
else
{
@@ -1190,7 +1190,7 @@ HandlePrivate(struct xkb_desc * xkb,
case F_Data:
if (array_ndx == NULL)
{
- if (!ExprResolveString(value, &rtrn, NULL, NULL))
+ if (!ExprResolveString(value, &rtrn))
return ReportMismatch(action->type, field, "string");
else
{
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index bb8a826..7bfc0a3 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -652,10 +652,8 @@ ExprResolveInteger(ExprDef * expr,
int
ExprResolveString(ExprDef * expr,
- ExprResult * val_rtrn,
- IdentLookupFunc lookup, char * lookupPriv)
+ ExprResult * val_rtrn)
{
- int ok = 0;
ExprResult leftRtrn, rightRtrn;
ExprDef *left;
ExprDef *right;
@@ -675,40 +673,26 @@ ExprResolveString(ExprDef * expr,
val_rtrn->str = strdup("");
return True;
case ExprIdent:
- if (lookup)
- {
- ok = (*lookup) (lookupPriv,
- None, expr->value.str, TypeString, val_rtrn);
- }
- if (!ok)
- ERROR("Identifier \"%s\" of type string not found\n",
- XkbcAtomText(expr->value.str));
- return ok;
+ ERROR("Identifier \"%s\" of type string not found\n",
+ XkbcAtomText(expr->value.str));
+ return False;
case ExprFieldRef:
- if (lookup)
- {
- ok = (*lookup) (lookupPriv,
- expr->value.field.element,
- expr->value.field.field, TypeString, val_rtrn);
- }
- if (!ok)
- ERROR("Default \"%s.%s\" of type string not found\n",
- XkbcAtomText(expr->value.field.element),
- XkbcAtomText(expr->value.field.field));
- return ok;
+ ERROR("Default \"%s.%s\" of type string not found\n",
+ XkbcAtomText(expr->value.field.element),
+ XkbcAtomText(expr->value.field.field));
+ return False;
case OpAdd:
left = expr->value.binary.left;
right = expr->value.binary.right;
- if (ExprResolveString(left, &leftRtrn, lookup, lookupPriv) &&
- ExprResolveString(right, &rightRtrn, lookup, lookupPriv))
+ if (ExprResolveString(left, &leftRtrn) &&
+ ExprResolveString(right, &rightRtrn))
{
int len;
char *new;
len = strlen(leftRtrn.str) + strlen(rightRtrn.str) + 1;
new = (char *) malloc(len);
if (new)
- {
- sprintf(new, "%s%s", leftRtrn.str, rightRtrn.str);
+ { sprintf(new, "%s%s", leftRtrn.str, rightRtrn.str);
free(leftRtrn.str);
free(rightRtrn.str);
val_rtrn->str = new;
@@ -739,18 +723,10 @@ ExprResolveString(ExprDef * expr,
ERROR("%s of string values not permitted\n", bogus);
return False;
case OpNot:
- left = expr->value.child;
- if (ExprResolveString(left, &leftRtrn, lookup, lookupPriv))
- {
- ERROR("The ! operator cannot be applied to a string\n");
- }
+ ERROR("The ! operator cannot be applied to a string\n");
return False;
case OpUnaryPlus:
- left = expr->value.child;
- if (ExprResolveString(left, &leftRtrn, lookup, lookupPriv))
- {
- ERROR("The + operator cannot be applied to a string\n");
- }
+ ERROR("The + operator cannot be applied to a string\n");
return False;
default:
WSGO("Unknown operator %d in ResolveString\n", expr->op);
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 7c27c04..2f3dd79 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -121,9 +121,7 @@ extern int ExprResolveFloat(ExprDef * /* expr */ ,
);
extern int ExprResolveString(ExprDef * /* expr */ ,
- ExprResult * /* val_rtrn */ ,
- IdentLookupFunc /* lookup */ ,
- char * /* lookupPriv */
+ ExprResult * /* val_rtrn */
);
extern int ExprResolveKeyName(ExprDef * /* expr */ ,
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index f2eb5da..52d9679 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -1482,7 +1482,7 @@ SetShapeDoodadField(DoodadInfo * di,
info->errorCount++;
return ReportNotArray(typeName, field, ddText(di));
}
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType(typeName, field, ddText(di), "string");
@@ -1615,7 +1615,7 @@ SetTextDoodadField(DoodadInfo * di,
}
if (type == FIELD_STRING)
{
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType(typeName, field, ddText(di), "string");
@@ -1664,7 +1664,7 @@ SetIndicatorDoodadField(DoodadInfo * di,
info->errorCount++;
return ReportNotArray("indicator doodad", field, ddText(di));
}
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType("indicator doodad", field,
@@ -1740,7 +1740,7 @@ SetLogoDoodadField(DoodadInfo * di,
info->errorCount++;
return ReportNotArray(typeName, field, ddText(di));
}
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType(typeName, field, ddText(di), "string");
@@ -1758,7 +1758,7 @@ SetLogoDoodadField(DoodadInfo * di,
info->errorCount++;
return ReportNotArray(typeName, field, ddText(di));
}
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType(typeName, field, ddText(di),
@@ -1842,7 +1842,7 @@ SetDoodadField(DoodadInfo * di,
info->errorCount++;
return ReportNotArray("doodad", field, ddText(di));
}
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType("doodad", field, ddText(di), "string");
@@ -2044,7 +2044,7 @@ SetKeyField(KeyInfo * key,
info->errorCount++;
return ReportNotArray("key", field, keyText(key));
}
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType("key", field, keyText(key), "string");
@@ -2061,7 +2061,7 @@ SetKeyField(KeyInfo * key,
info->errorCount++;
return ReportNotArray("key", field, keyText(key));
}
- if (!ExprResolveString(value, &tmp, NULL, NULL))
+ if (!ExprResolveString(value, &tmp))
{
info->errorCount++;
return ReportBadType("key", field, keyText(key), "string");
@@ -2104,7 +2104,7 @@ SetGeometryProperty(GeometryInfo * info, char *property, ExprDef * value)
InitPropertyInfo(&pi, info);
pi.name = property;
- if (!ExprResolveString(value, &result, NULL, NULL))
+ if (!ExprResolveString(value, &result))
{
info->errorCount++;
ERROR("Property values must be type string\n");
@@ -2307,7 +2307,7 @@ HandleGeometryVar(VarDef * stmt, struct xkb_desc * xkb, GeometryInfo * info)
info->errorCount++;
ret = ReportNotArray("keyboard", field.str, "geometry");
}
- if (!ExprResolveString(stmt->value, &tmp, NULL, NULL))
+ if (!ExprResolveString(stmt->value, &tmp))
{
info->errorCount++;
ret = ReportBadType("keyboard", field.str, "geometry", "string");
@@ -2327,7 +2327,7 @@ HandleGeometryVar(VarDef * stmt, struct xkb_desc * xkb, GeometryInfo * info)
info->errorCount++;
ret = ReportNotArray("keyboard", field.str, "geometry");
}
- if (!ExprResolveString(stmt->value, &tmp, NULL, NULL))
+ if (!ExprResolveString(stmt->value, &tmp))
{
info->errorCount++;
ret = ReportBadType("keyboard", field.str, "geometry", "string");
@@ -2382,7 +2382,7 @@ HandleGeometryVar(VarDef * stmt, struct xkb_desc * xkb, GeometryInfo * info)
info->errorCount++;
ret = ReportNotArray("keyboard", field.str, "geometry");
}
- else if (!ExprResolveString(stmt->value, &tmp, NULL, NULL))
+ else if (!ExprResolveString(stmt->value, &tmp))
{
info->errorCount++;
ret = ReportBadType("keyboard", field.str, "geometry", "string");
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index e8d3d35..8457245 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -770,7 +770,7 @@ HandleIndicatorNameDef(IndicatorNameDef * def,
}
InitIndicatorNameInfo(&ii, info);
ii.ndx = def->ndx;
- if (!ExprResolveString(def->name, &tmp, NULL, NULL))
+ if (!ExprResolveString(def->name, &tmp))
{
char buf[20];
snprintf(buf, sizeof(buf), "%d", def->ndx);
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index 9ea3a7b..3dcceda 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -833,7 +833,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
return False;
}
level = rtrn.ival - 1;
- if (!ExprResolveString(value, &rtrn, NULL, NULL))
+ if (!ExprResolveString(value, &rtrn))
{
ERROR("Non-string name for level %d in key type %s\n", level + 1,
XkbcAtomText(type->name));
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index d26032b..e666256 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1131,7 +1131,7 @@ SetSymbolsField(KeyInfo * key,
if (uStrCaseCmp(field, "type") == 0)
{
ExprResult ndx;
- if ((!ExprResolveString(value, &tmp, NULL, NULL))
+ if ((!ExprResolveString(value, &tmp))
&& (warningLevel > 0))
{
WARN("The type field of a key symbol map must be a string\n");
@@ -1397,7 +1397,7 @@ SetGroupName(SymbolsInfo * info, ExprDef * arrayNdx, ExprDef * value)
ACTION("Name for group %d ignored\n", tmp.uval);
return False;
}
- if (!ExprResolveString(value, &name, NULL, NULL))
+ if (!ExprResolveString(value, &name))
{
ERROR("Group name must be a string\n");
ACTION("Illegal name for group %d ignored\n", tmp.uval);