summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-01-29 11:16:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-02-04 10:53:59 +1000
commit2fc38d1e299587d25ca8225051e0ea9403164b15 (patch)
tree7b5dcf7a2d6b54bd3ad5e2e97456b153bde9a587 /xkb
parent6307d60dd592f4b438f880d02bde9fd8d50ae264 (diff)
xkb: add a call to init an XkbRMLVOSet from const chars
Just forcing everything to const char* is not helpful, compiler warnings are supposed to warn about broken code. Forcing everything to const when it clearly isn't less than ideal. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbInit.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 22b971fc6..33420b6b6 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -129,11 +129,11 @@ XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO)
if (!rmlvo)
return;
- free((void *) rmlvo->rules);
- free((void *) rmlvo->model);
- free((void *) rmlvo->layout);
- free((void *) rmlvo->variant);
- free((void *) rmlvo->options);
+ free(rmlvo->rules);
+ free(rmlvo->model);
+ free(rmlvo->layout);
+ free(rmlvo->variant);
+ free(rmlvo->options);
if (freeRMLVO)
free(rmlvo);
@@ -206,6 +206,21 @@ XkbWriteRulesProp(ClientPtr client, void *closure)
return TRUE;
}
+void
+XkbInitRules(XkbRMLVOSet *rmlvo,
+ const char *rules,
+ const char *model,
+ const char *layout,
+ const char *variant,
+ const char *options)
+{
+ rmlvo->rules = rules ? xnfstrdup(rules) : NULL;
+ rmlvo->model = model ? xnfstrdup(model) : NULL;
+ rmlvo->layout = layout ? xnfstrdup(layout) : NULL;
+ rmlvo->variant = variant ? xnfstrdup(variant) : NULL;
+ rmlvo->options = options ? xnfstrdup(options) : NULL;
+}
+
static void
XkbSetRulesUsed(XkbRMLVOSet * rmlvo)
{