From b406886bbffadaa52864a99f2a0520999eadc15d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 14 Apr 2009 16:57:29 +1000 Subject: input: allow NULL as XkbRMVLOSet in InitKeyboardDeviceStruct. Virtually all callers use XkbGetRulesDefault(&rmlvo); InitKeyboardDeviceStruct(..., rmlvo); Let's save them the trouble and accept NULL as a hint to take the default RMLVO. Signed-off-by: Peter Hutterer Acked-by: Benjamin Close Signed-off-by: Daniel Stone --- xkb/xkbInit.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xkb') diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 1f5f8dc49..2e7561294 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -474,10 +474,18 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, XkbSrvLedInfoPtr sli; XkbChangesRec changes; XkbEventCauseRec cause; + XkbRMLVOSet rmlvo_dflts = { NULL }; - if (dev->key || dev->kbdfeed || !rmlvo) + if (dev->key || dev->kbdfeed) return False; + if (!rmlvo) + { + rmlvo = &rmlvo_dflts; + XkbGetRulesDflts(rmlvo); + } + + memset(&changes, 0, sizeof(changes)); XkbSetCauseUnknown(&cause); -- cgit v1.2.3