summaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c54
1 files changed, 23 insertions, 31 deletions
diff --git a/expr.c b/expr.c
index 4ca9820..f31f412 100644
--- a/expr.c
+++ b/expr.c
@@ -127,9 +127,8 @@ exprTypeText(unsigned type)
}
int
-ExprResolveLhs(ExprDef * expr,
- ExprResult * elem_rtrn,
- ExprResult * field_rtrn, ExprDef ** index_rtrn)
+ExprResolveLhs(const ExprDef *expr, ExprResult *elem_rtrn,
+ ExprResult *field_rtrn, ExprDef **index_rtrn)
{
switch (expr->op)
{
@@ -154,8 +153,8 @@ ExprResolveLhs(ExprDef * expr,
}
Bool
-SimpleLookup(XPointer priv,
- Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+SimpleLookup(const XPointer priv,
+ Atom elem, Atom field, unsigned type, ExprResult *val_rtrn)
{
char *str;
@@ -166,7 +165,7 @@ SimpleLookup(XPointer priv,
return False;
}
str = XkbAtomGetString(NULL, field);
- for (LookupEntry *entry = (LookupEntry *) priv;
+ for (const LookupEntry *entry = (const LookupEntry *) priv;
(entry != NULL) && (entry->name != NULL); entry++)
{
if (uStrCaseCmp(str, entry->name) == 0)
@@ -181,8 +180,8 @@ SimpleLookup(XPointer priv,
}
Bool
-RadioLookup(XPointer priv,
- Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+RadioLookup(const XPointer priv,
+ Atom elem, Atom field, unsigned type, ExprResult *val_rtrn)
{
char *str;
int rg;
@@ -249,9 +248,9 @@ static LookupEntry modIndexNames[] = {
{NULL, 0}
};
-int
-LookupModIndex(XPointer priv,
- Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
+Bool
+LookupModIndex(const XPointer priv,
+ Atom elem, Atom field, unsigned type, ExprResult *val_rtrn)
{
return SimpleLookup((XPointer) modIndexNames, elem, field, type,
val_rtrn);
@@ -289,7 +288,7 @@ LookupModMask(XPointer priv,
#if 0
int
-ExprResolveModIndex(ExprDef * expr,
+ExprResolveModIndex(const ExprDef *expr,
ExprResult * val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
@@ -367,8 +366,7 @@ ExprResolveModIndex(ExprDef * expr,
#endif
int
-ExprResolveModMask(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveModMask(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
LookupPriv priv = {
@@ -381,8 +379,7 @@ ExprResolveModMask(ExprDef * expr,
}
int
-ExprResolveBoolean(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveBoolean(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
@@ -478,8 +475,7 @@ ExprResolveBoolean(ExprDef * expr,
}
int
-ExprResolveFloat(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveFloat(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
@@ -591,8 +587,7 @@ ExprResolveFloat(ExprDef * expr,
}
int
-ExprResolveInteger(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveInteger(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
@@ -712,8 +707,7 @@ ExprResolveInteger(ExprDef * expr,
}
int
-ExprResolveString(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveString(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
@@ -828,8 +822,7 @@ ExprResolveString(ExprDef * expr,
}
int
-ExprResolveKeyName(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveKeyName(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
@@ -918,7 +911,8 @@ ExprResolveKeyName(ExprDef * expr,
/***====================================================================***/
int
-ExprResolveEnum(ExprDef * expr, ExprResult * val_rtrn, LookupEntry * values)
+ExprResolveEnum(const ExprDef *expr, ExprResult *val_rtrn,
+ const LookupEntry *values)
{
if (expr->op != ExprIdent)
{
@@ -948,13 +942,12 @@ ExprResolveEnum(ExprDef * expr, ExprResult * val_rtrn, LookupEntry * values)
}
int
-ExprResolveMask(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveMask(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
ExprResult leftRtrn, rightRtrn;
- ExprDef *left, *right;
+ const ExprDef *left, *right;
const char *bogus = NULL;
switch (expr->op)
@@ -1057,15 +1050,14 @@ ExprResolveMask(ExprDef * expr,
}
int
-ExprResolveKeySym(ExprDef * expr,
- ExprResult * val_rtrn,
+ExprResolveKeySym(const ExprDef *expr, ExprResult *val_rtrn,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
if (expr->op == ExprIdent)
{
- char *str;
+ const char *str;
KeySym sym;
str = XkbAtomGetString(NULL, expr->value.str);