summaryrefslogtreecommitdiff
path: root/parseutils.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2010-06-07 22:43:01 +0100
committerDaniel Stone <daniel@fooishbar.org>2010-06-15 19:26:49 +0100
commit02de53d767b20bab1517b4e8a3e7eb3b9e7f15be (patch)
treee917c813c074a6acb89f03cd15dcc36855c8388c /parseutils.c
parent07cc4d60dea2b4c947fed45b082edae4a53b186a (diff)
Lazy keysym parsing (avoid XStringToKeysym)
Instead of calling XStringToKeysym on every keysym we parse, store it as a string until we need to store it in an actual keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'parseutils.c')
-rw-r--r--parseutils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/parseutils.c b/parseutils.c
index ad1b0d1..d59e3fb 100644
--- a/parseutils.c
+++ b/parseutils.c
@@ -392,7 +392,7 @@ ActionCreate(Atom name, ExprDef * args)
}
ExprDef *
-CreateKeysymList(KeySym sym)
+CreateKeysymList(char *sym)
{
ExprDef *def;
@@ -400,8 +400,8 @@ CreateKeysymList(KeySym sym)
if (def)
{
def->value.list.nSyms = 1;
- def->value.list.szSyms = 2;
- def->value.list.syms = uTypedCalloc(2, KeySym);
+ def->value.list.szSyms = 4;
+ def->value.list.syms = uTypedCalloc(4, char *);
if (def->value.list.syms != NULL)
{
def->value.list.syms[0] = sym;
@@ -600,7 +600,7 @@ DoodadCreate(unsigned type, Atom name, VarDef * body)
}
ExprDef *
-AppendKeysymList(ExprDef * list, KeySym sym)
+AppendKeysymList(ExprDef * list, char *sym)
{
if (list->value.list.nSyms >= list->value.list.szSyms)
{
@@ -608,7 +608,7 @@ AppendKeysymList(ExprDef * list, KeySym sym)
list->value.list.syms = uTypedRecalloc(list->value.list.syms,
list->value.list.nSyms,
list->value.list.szSyms,
- KeySym);
+ char *);
if (list->value.list.syms == NULL)
{
FATAL("Couldn't resize list of symbols for append\n");