summaryrefslogtreecommitdiff
path: root/xserver/xkb/xkbInit.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
commita90ee792d96752ad1b71b9ada922fa6afe478c99 (patch)
tree6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/xkb/xkbInit.c
parentbc97d4ecc0aa9e1b823565b07282f848700bd11a (diff)
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/xkb/xkbInit.c')
-rw-r--r--xserver/xkb/xkbInit.c79
1 files changed, 34 insertions, 45 deletions
diff --git a/xserver/xkb/xkbInit.c b/xserver/xkb/xkbInit.c
index 4a3219e2a..fbf8f14b8 100644
--- a/xserver/xkb/xkbInit.c
+++ b/xserver/xkb/xkbInit.c
@@ -43,6 +43,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "opaque.h"
#include "property.h"
+#include "scrnintstr.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <xkbsrv.h>
#include "xkbgeom.h"
@@ -140,14 +141,14 @@ XkbFreeRMLVOSet(XkbRMLVOSet *rmlvo, Bool freeRMLVO)
if (!rmlvo)
return;
- xfree(rmlvo->rules);
- xfree(rmlvo->model);
- xfree(rmlvo->layout);
- xfree(rmlvo->variant);
- xfree(rmlvo->options);
+ free(rmlvo->rules);
+ free(rmlvo->model);
+ free(rmlvo->layout);
+ free(rmlvo->variant);
+ free(rmlvo->options);
if (freeRMLVO)
- xfree(rmlvo);
+ free(rmlvo);
else
memset(rmlvo, 0, sizeof(XkbRMLVOSet));
}
@@ -174,7 +175,7 @@ char * pval;
ErrorF("[xkb] Atom error: %s not created\n",_XKB_RF_NAMES_PROP_ATOM);
return TRUE;
}
- pval= (char*) xalloc(len);
+ pval= (char*) malloc(len);
if (!pval) {
ErrorF("[xkb] Allocation error: %s proprerty not created\n",
_XKB_RF_NAMES_PROP_ATOM);
@@ -210,29 +211,24 @@ char * pval;
ErrorF("[xkb] Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n",
out,len);
}
- dixChangeWindowProperty(serverClient, WindowTable[0], name, XA_STRING, 8,
+ dixChangeWindowProperty(serverClient, screenInfo.screens[0]->root, name, XA_STRING, 8,
PropModeReplace, len, pval, TRUE);
- xfree(pval);
+ free(pval);
return TRUE;
}
static void
XkbSetRulesUsed(XkbRMLVOSet *rmlvo)
{
- if (XkbRulesUsed)
- xfree(XkbRulesUsed);
+ free(XkbRulesUsed);
XkbRulesUsed= (rmlvo->rules?_XkbDupString(rmlvo->rules):NULL);
- if (XkbModelUsed)
- xfree(XkbModelUsed);
+ free(XkbModelUsed);
XkbModelUsed= (rmlvo->model?_XkbDupString(rmlvo->model):NULL);
- if (XkbLayoutUsed)
- xfree(XkbLayoutUsed);
+ free(XkbLayoutUsed);
XkbLayoutUsed= (rmlvo->layout?_XkbDupString(rmlvo->layout):NULL);
- if (XkbVariantUsed)
- xfree(XkbVariantUsed);
+ free(XkbVariantUsed);
XkbVariantUsed= (rmlvo->variant?_XkbDupString(rmlvo->variant):NULL);
- if (XkbOptionsUsed)
- xfree(XkbOptionsUsed);
+ free(XkbOptionsUsed);
XkbOptionsUsed= (rmlvo->options?_XkbDupString(rmlvo->options):NULL);
if (XkbWantRulesProp)
QueueWorkProc(XkbWriteRulesProp,NULL,NULL);
@@ -243,28 +239,23 @@ void
XkbSetRulesDflts(XkbRMLVOSet *rmlvo)
{
if (rmlvo->rules) {
- if (XkbRulesDflt)
- xfree(XkbRulesDflt);
+ free(XkbRulesDflt);
XkbRulesDflt= _XkbDupString(rmlvo->rules);
}
if (rmlvo->model) {
- if (XkbModelDflt)
- xfree(XkbModelDflt);
+ free(XkbModelDflt);
XkbModelDflt= _XkbDupString(rmlvo->model);
}
if (rmlvo->layout) {
- if (XkbLayoutDflt)
- xfree(XkbLayoutDflt);
+ free(XkbLayoutDflt);
XkbLayoutDflt= _XkbDupString(rmlvo->layout);
}
if (rmlvo->variant) {
- if (XkbVariantDflt)
- xfree(XkbVariantDflt);
+ free(XkbVariantDflt);
XkbVariantDflt= _XkbDupString(rmlvo->variant);
}
if (rmlvo->options) {
- if (XkbOptionsDflt)
- xfree(XkbOptionsDflt);
+ free(XkbOptionsDflt);
XkbOptionsDflt= _XkbDupString(rmlvo->options);
}
return;
@@ -273,15 +264,15 @@ XkbSetRulesDflts(XkbRMLVOSet *rmlvo)
void
XkbDeleteRulesDflts(void)
{
- xfree(XkbRulesDflt);
+ free(XkbRulesDflt);
XkbRulesDflt = NULL;
- xfree(XkbModelDflt);
+ free(XkbModelDflt);
XkbModelDflt = NULL;
- xfree(XkbLayoutDflt);
+ free(XkbLayoutDflt);
XkbLayoutDflt = NULL;
- xfree(XkbVariantDflt);
+ free(XkbVariantDflt);
XkbVariantDflt = NULL;
- xfree(XkbOptionsDflt);
+ free(XkbOptionsDflt);
XkbOptionsDflt = NULL;
XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, TRUE);
@@ -515,20 +506,20 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet *rmlvo,
memset(&changes, 0, sizeof(changes));
XkbSetCauseUnknown(&cause);
- dev->key = xcalloc(1, sizeof(*dev->key));
+ dev->key = calloc(1, sizeof(*dev->key));
if (!dev->key) {
ErrorF("XKB: Failed to allocate key class\n");
return FALSE;
}
dev->key->sourceid = dev->id;
- dev->kbdfeed = xcalloc(1, sizeof(*dev->kbdfeed));
+ dev->kbdfeed = calloc(1, sizeof(*dev->kbdfeed));
if (!dev->kbdfeed) {
ErrorF("XKB: Failed to allocate key feedback class\n");
goto unwind_key;
}
- xkbi = xcalloc(1, sizeof(*xkbi));
+ xkbi = calloc(1, sizeof(*xkbi));
if (!xkbi) {
ErrorF("XKB: Failed to allocate XKB info\n");
goto unwind_kbdfeed;
@@ -620,13 +611,13 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet *rmlvo,
unwind_desc:
XkbFreeKeyboard(xkb, 0, TRUE);
unwind_info:
- xfree(xkbi);
+ free(xkbi);
dev->key->xkbInfo = NULL;
unwind_kbdfeed:
- xfree(dev->kbdfeed);
+ free(dev->kbdfeed);
dev->kbdfeed = NULL;
unwind_key:
- xfree(dev->key);
+ free(dev->key);
dev->key = NULL;
return FALSE;
}
@@ -644,10 +635,8 @@ unwind_key:
void
XkbFreeInfo(XkbSrvInfoPtr xkbi)
{
- if (xkbi->radioGroups) {
- xfree(xkbi->radioGroups);
- xkbi->radioGroups= NULL;
- }
+ free(xkbi->radioGroups);
+ xkbi->radioGroups = NULL;
if (xkbi->mouseKeyTimer) {
TimerFree(xkbi->mouseKeyTimer);
xkbi->mouseKeyTimer= NULL;
@@ -677,7 +666,7 @@ XkbFreeInfo(XkbSrvInfoPtr xkbi)
XkbFreeKeyboard(xkbi->desc,XkbAllComponentsMask,TRUE);
xkbi->desc= NULL;
}
- xfree(xkbi);
+ free(xkbi);
return;
}