Commit 26285a7bd94d7c4467187d490f31515281e75851

Daniel Stone 2012-02-20T14:15:08

Remove priv arguments from ExprResolveString They've never been used. Signed-off-by: Daniel Stone <daniel@fooishbar.org>

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);