diff options
author | Keith Packard <keithp@keithp.com> | 2010-11-10 16:58:21 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-11-10 16:58:21 -0800 |
commit | 4ed4915bc0fbe9b4419ca4a0d4e43c2fee032ae9 (patch) | |
tree | e4ea374adb5e3bf00eeddcd8c35a6e4063a34c03 | |
parent | 291c39dfef84d1b204d7f5e63e925dee2dbdaca7 (diff) | |
parent | ec1bfbc66926130e1153facc3b92ee175f1cb6b6 (diff) |
Merge remote branch 'whot/for-keith'
-rw-r--r-- | Xi/xichangehierarchy.c | 522 | ||||
-rw-r--r-- | config/x11-input.fdi | 5 | ||||
-rw-r--r-- | dix/grabs.c | 7 | ||||
-rw-r--r-- | dix/ptrveloc.c | 8 | ||||
-rw-r--r-- | glx/glxdri.c | 4 | ||||
-rw-r--r-- | glx/glxdri2.c | 4 | ||||
-rw-r--r-- | glx/single2.c | 7 | ||||
-rw-r--r-- | hw/dmx/glxProxy/glxcmds.c | 2 | ||||
-rw-r--r-- | hw/dmx/glxProxy/glxext.c | 18 | ||||
-rw-r--r-- | hw/kdrive/fake/fake.c | 7 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 11 | ||||
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.man.pre | 9 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 3 | ||||
-rw-r--r-- | hw/xwin/glx/indirect.c | 5 | ||||
-rw-r--r-- | hw/xwin/wincmap.c | 7 | ||||
-rw-r--r-- | hw/xwin/winpixmap.c | 7 | ||||
-rw-r--r-- | mi/mispans.c | 2 | ||||
-rw-r--r-- | miext/rootless/rootlessScreen.c | 3 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 6 | ||||
-rw-r--r-- | os/log.c | 6 | ||||
-rw-r--r-- | os/strlcat.c | 4 | ||||
-rw-r--r-- | os/strlcpy.c | 4 | ||||
-rw-r--r-- | render/miindex.c | 14 | ||||
-rw-r--r-- | render/picture.c | 7 | ||||
-rw-r--r-- | xkb/XKBAlloc.c | 6 | ||||
-rw-r--r-- | xkb/XKBGAlloc.c | 30 | ||||
-rw-r--r-- | xkb/XKBMAlloc.c | 40 | ||||
-rw-r--r-- | xkb/ddxLoad.c | 6 |
28 files changed, 355 insertions, 399 deletions
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index c1899e109..b9cdedf77 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -136,12 +136,286 @@ int SProcXIChangeHierarchy(ClientPtr client) return (ProcXIChangeHierarchy(client)); } +static int +add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; + char* name; + int rc; + + name = calloc(c->name_len + 1, sizeof(char)); + strncpy(name, (char*)&c[1], c->name_len); + + rc = AllocDevicePair(client, name, &ptr, &keybd, + CorePointerProc, CoreKeyboardProc, TRUE); + if (rc != Success) + goto unwind; + + if (!c->send_core) + ptr->coreEvents = keybd->coreEvents = FALSE; + + /* Allocate virtual slave devices for xtest events */ + rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd); + if (rc != Success) + { + DeleteInputDeviceRequest(ptr); + DeleteInputDeviceRequest(keybd); + goto unwind; + } + + ActivateDevice(ptr, FALSE); + ActivateDevice(keybd, FALSE); + flags[ptr->id] |= XIMasterAdded; + flags[keybd->id] |= XIMasterAdded; + + ActivateDevice(XTestptr, FALSE); + ActivateDevice(XTestkeybd, FALSE); + flags[XTestptr->id] |= XISlaveAdded; + flags[XTestkeybd->id] |= XISlaveAdded; + + if (c->enable) + { + EnableDevice(ptr, FALSE); + EnableDevice(keybd, FALSE); + flags[ptr->id] |= XIDeviceEnabled; + flags[keybd->id] |= XIDeviceEnabled; + + EnableDevice(XTestptr, FALSE); + EnableDevice(XTestkeybd, FALSE); + flags[XTestptr->id] |= XIDeviceEnabled; + flags[XTestkeybd->id] |= XIDeviceEnabled; + } + + /* Attach the XTest virtual devices to the newly + created master device */ + AttachDevice(NULL, XTestptr, ptr); + AttachDevice(NULL, XTestkeybd, keybd); + flags[XTestptr->id] |= XISlaveAttached; + flags[XTestkeybd->id] |= XISlaveAttached; + +unwind: + free(name); + return rc; +} + +static int +remove_master(ClientPtr client, xXIRemoveMasterInfo *r, + int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; + int rc = Success; + + if (r->return_mode != XIAttachToMaster && + r->return_mode != XIFloating) + return BadValue; + + rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(ptr)) + { + client->errorValue = r->deviceid; + rc = BadDevice; + goto unwind; + } + + /* XXX: For now, don't allow removal of VCP, VCK */ + if (ptr == inputInfo.pointer || ptr == inputInfo.keyboard) + { + rc = BadDevice; + goto unwind; + } + + + ptr = GetMaster(ptr, MASTER_POINTER); + rc = dixLookupDevice(&ptr, ptr->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + keybd = GetMaster(ptr, MASTER_KEYBOARD); + rc = dixLookupDevice(&keybd, keybd->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + XTestptr = GetXTestDevice(ptr); + rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + XTestkeybd = GetXTestDevice(keybd); + rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, + DixDestroyAccess); + if (rc != Success) + goto unwind; + + /* Disabling sends the devices floating, reattach them if + * desired. */ + if (r->return_mode == XIAttachToMaster) + { + DeviceIntPtr attached, + newptr, + newkeybd; + + rc = dixLookupDevice(&newptr, r->return_pointer, client, DixAddAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(newptr)) + { + client->errorValue = r->return_pointer; + rc = BadDevice; + goto unwind; + } + + rc = dixLookupDevice(&newkeybd, r->return_keyboard, + client, DixAddAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(newkeybd)) + { + client->errorValue = r->return_keyboard; + rc = BadDevice; + goto unwind; + } + + for (attached = inputInfo.devices; attached; attached = attached->next) + { + if (!IsMaster(attached)) { + if (attached->u.master == ptr) + { + AttachDevice(client, attached, newptr); + flags[attached->id] |= XISlaveAttached; + } + if (attached->u.master == keybd) + { + AttachDevice(client, attached, newkeybd); + flags[attached->id] |= XISlaveAttached; + } + } + } + } + + /* can't disable until we removed pairing */ + keybd->spriteInfo->paired = NULL; + ptr->spriteInfo->paired = NULL; + XTestptr->spriteInfo->paired = NULL; + XTestkeybd->spriteInfo->paired = NULL; + + /* disable the remove the devices, XTest devices must be done first + else the sprites they rely on will be destroyed */ + DisableDevice(XTestptr, FALSE); + DisableDevice(XTestkeybd, FALSE); + DisableDevice(keybd, FALSE); + DisableDevice(ptr, FALSE); + flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached; + flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached; + flags[keybd->id] |= XIDeviceDisabled; + flags[ptr->id] |= XIDeviceDisabled; + + RemoveDevice(XTestptr, FALSE); + RemoveDevice(XTestkeybd, FALSE); + RemoveDevice(keybd, FALSE); + RemoveDevice(ptr, FALSE); + flags[XTestptr->id] |= XISlaveRemoved; + flags[XTestkeybd->id] |= XISlaveRemoved; + flags[keybd->id] |= XIMasterRemoved; + flags[ptr->id] |= XIMasterRemoved; + +unwind: + return rc; +} + +static int +detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES]) +{ + DeviceIntPtr dev; + int rc; + + rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); + if (rc != Success) + goto unwind; + + if (IsMaster(dev)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + /* Don't allow changes to XTest Devices, these are fixed */ + if (IsXTestDevice(dev, NULL)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + AttachDevice(client, dev, NULL); + flags[dev->id] |= XISlaveDetached; + +unwind: + return rc; +} + +static int +attach_slave(ClientPtr client, xXIAttachSlaveInfo *c, + int flags[MAXDEVICES]) +{ + DeviceIntPtr dev; + DeviceIntPtr newmaster; + int rc; + + rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); + if (rc != Success) + goto unwind; + + if (IsMaster(dev)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + /* Don't allow changes to XTest Devices, these are fixed */ + if (IsXTestDevice(dev, NULL)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess); + if (rc != Success) + goto unwind; + if (!IsMaster(newmaster)) + { + client->errorValue = c->new_master; + rc = BadDevice; + goto unwind; + } + + if (!((IsPointerDevice(newmaster) && IsPointerDevice(dev)) || + (IsKeyboardDevice(newmaster) && IsKeyboardDevice(dev)))) + { + rc = BadDevice; + goto unwind; + } + + AttachDevice(client, dev, newmaster); + flags[dev->id] |= XISlaveAttached; + +unwind: + return rc; +} + + + #define SWAPIF(cmd) if (client->swapped) { cmd; } int ProcXIChangeHierarchy(ClientPtr client) { - DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; xXIAnyHierarchyChangeInfo *any; int required_len = sizeof(xXIChangeHierarchyReq); char n; @@ -169,276 +443,38 @@ ProcXIChangeHierarchy(ClientPtr client) case XIAddMaster: { xXIAddMasterInfo* c = (xXIAddMasterInfo*)any; - char* name; - SWAPIF(swaps(&c->name_len, n)); - name = calloc(c->name_len + 1, sizeof(char)); - strncpy(name, (char*)&c[1], c->name_len); - - - rc = AllocDevicePair(client, name, &ptr, &keybd, - CorePointerProc, CoreKeyboardProc, - TRUE); - if (rc != Success) - { - free(name); - goto unwind; - } - - if (!c->send_core) - ptr->coreEvents = keybd->coreEvents = FALSE; - /* Allocate virtual slave devices for xtest events */ - rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, - ptr, keybd); + rc = add_master(client, c, flags); if (rc != Success) - { - - free(name); goto unwind; - } - - ActivateDevice(ptr, FALSE); - ActivateDevice(keybd, FALSE); - flags[ptr->id] |= XIMasterAdded; - flags[keybd->id] |= XIMasterAdded; - - ActivateDevice(XTestptr, FALSE); - ActivateDevice(XTestkeybd, FALSE); - flags[XTestptr->id] |= XISlaveAdded; - flags[XTestkeybd->id] |= XISlaveAdded; - - if (c->enable) - { - EnableDevice(ptr, FALSE); - EnableDevice(keybd, FALSE); - flags[ptr->id] |= XIDeviceEnabled; - flags[keybd->id] |= XIDeviceEnabled; - - EnableDevice(XTestptr, FALSE); - EnableDevice(XTestkeybd, FALSE); - flags[XTestptr->id] |= XIDeviceEnabled; - flags[XTestkeybd->id] |= XIDeviceEnabled; - } - - /* Attach the XTest virtual devices to the newly - created master device */ - AttachDevice(NULL, XTestptr, ptr); - AttachDevice(NULL, XTestkeybd, keybd); - flags[XTestptr->id] |= XISlaveAttached; - flags[XTestkeybd->id] |= XISlaveAttached; - - free(name); } break; case XIRemoveMaster: { xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any; - if (r->return_mode != XIAttachToMaster && - r->return_mode != XIFloating) - return BadValue; - - rc = dixLookupDevice(&ptr, r->deviceid, client, - DixDestroyAccess); + rc = remove_master(client, r, flags); if (rc != Success) goto unwind; - - if (!IsMaster(ptr)) - { - client->errorValue = r->deviceid; - rc = BadDevice; - goto unwind; - } - - /* XXX: For now, don't allow removal of VCP, VCK */ - if (ptr == inputInfo.pointer || - ptr == inputInfo.keyboard) - { - rc = BadDevice; - goto unwind; - } - - - ptr = GetMaster(ptr, MASTER_POINTER); - rc = dixLookupDevice(&ptr, - ptr->id, - client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - keybd = GetMaster(ptr, MASTER_KEYBOARD); - rc = dixLookupDevice(&keybd, - keybd->id, - client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - XTestptr = GetXTestDevice(ptr); - rc = dixLookupDevice(&XTestptr, XTestptr->id, client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - XTestkeybd = GetXTestDevice(keybd); - rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - /* Disabling sends the devices floating, reattach them if - * desired. */ - if (r->return_mode == XIAttachToMaster) - { - DeviceIntPtr attached, - newptr, - newkeybd; - - rc = dixLookupDevice(&newptr, r->return_pointer, - client, DixAddAccess); - if (rc != Success) - goto unwind; - - if (!IsMaster(newptr)) - { - client->errorValue = r->return_pointer; - rc = BadDevice; - goto unwind; - } - - rc = dixLookupDevice(&newkeybd, r->return_keyboard, - client, DixAddAccess); - if (rc != Success) - goto unwind; - - if (!IsMaster(newkeybd)) - { - client->errorValue = r->return_keyboard; - rc = BadDevice; - goto unwind; - } - - for (attached = inputInfo.devices; - attached; - attached = attached->next) - { - if (!IsMaster(attached)) { - if (attached->u.master == ptr) - { - AttachDevice(client, attached, newptr); - flags[attached->id] |= XISlaveAttached; - } - if (attached->u.master == keybd) - { - AttachDevice(client, attached, newkeybd); - flags[attached->id] |= XISlaveAttached; - } - } - } - } - - /* can't disable until we removed pairing */ - keybd->spriteInfo->paired = NULL; - ptr->spriteInfo->paired = NULL; - XTestptr->spriteInfo->paired = NULL; - XTestkeybd->spriteInfo->paired = NULL; - - /* disable the remove the devices, XTest devices must be done first - else the sprites they rely on will be destroyed */ - DisableDevice(XTestptr, FALSE); - DisableDevice(XTestkeybd, FALSE); - DisableDevice(keybd, FALSE); - DisableDevice(ptr, FALSE); - flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached; - flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached; - flags[keybd->id] |= XIDeviceDisabled; - flags[ptr->id] |= XIDeviceDisabled; - - RemoveDevice(XTestptr, FALSE); - RemoveDevice(XTestkeybd, FALSE); - RemoveDevice(keybd, FALSE); - RemoveDevice(ptr, FALSE); - flags[XTestptr->id] |= XISlaveRemoved; - flags[XTestkeybd->id] |= XISlaveRemoved; - flags[keybd->id] |= XIMasterRemoved; - flags[ptr->id] |= XIMasterRemoved; } break; case XIDetachSlave: { xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any; - rc = dixLookupDevice(&ptr, c->deviceid, client, - DixManageAccess); + rc = detach_slave(client, c, flags); if (rc != Success) goto unwind; - - if (IsMaster(ptr)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - AttachDevice(client, ptr, NULL); - flags[ptr->id] |= XISlaveDetached; } break; case XIAttachSlave: { xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any; - DeviceIntPtr newmaster; - rc = dixLookupDevice(&ptr, c->deviceid, client, - DixManageAccess); + rc = attach_slave(client, c, flags); if (rc != Success) goto unwind; - - if (IsMaster(ptr)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - rc = dixLookupDevice(&newmaster, c->new_master, - client, DixAddAccess); - if (rc != Success) - goto unwind; - if (!IsMaster(newmaster)) - { - client->errorValue = c->new_master; - rc = BadDevice; - goto unwind; - } - - if (!((IsPointerDevice(newmaster) && - IsPointerDevice(ptr)) || - (IsKeyboardDevice(newmaster) && - IsKeyboardDevice(ptr)))) - { - rc = BadDevice; - goto unwind; - } - AttachDevice(client, ptr, newmaster); - flags[ptr->id] |= XISlaveAttached; } break; } diff --git a/config/x11-input.fdi b/config/x11-input.fdi index 9e629cbd0..b263f36cb 100644 --- a/config/x11-input.fdi +++ b/config/x11-input.fdi @@ -45,11 +45,6 @@ See the evdev documentation for more information. - You will probably want to add the following option to the ServerFlags of - your xorg.conf: - - Option "AllowEmptyInput" "True" - FIXME: Support tablets too. TODO: I think its fixed, can't test diff --git a/dix/grabs.c b/dix/grabs.c index f850e3d84..69c58dff9 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -117,11 +117,8 @@ CreateGrab( static void FreeGrab(GrabPtr pGrab) { - if (pGrab->modifiersDetail.pMask != NULL) - free(pGrab->modifiersDetail.pMask); - - if (pGrab->detail.pMask != NULL) - free(pGrab->detail.pMask); + free(pGrab->modifiersDetail.pMask); + free(pGrab->detail.pMask); if (pGrab->cursor) FreeCursor(pGrab->cursor, (Cursor)0); diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index 30e14b17e..8f0332161 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -952,11 +952,9 @@ SetAccelerationProfile( if(profile == NULL && profile_num != PROFILE_UNINITIALIZE) return FALSE; - if(vel->profile_private != NULL){ - /* Here one could free old profile-private data */ - free(vel->profile_private); - vel->profile_private = NULL; - } + /* Here one could free old profile-private data */ + free(vel->profile_private); + vel->profile_private = NULL; /* Here one could init profile-private data */ vel->Profile = profile; vel->statistics.profile_number = profile_num; diff --git a/glx/glxdri.c b/glx/glxdri.c index 6458ef928..db3fcd5cb 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -1158,9 +1158,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); (void) __glXGetExtensionString(screen->glx_enable_bits, diff --git a/glx/glxdri2.c b/glx/glxdri2.c index c2305ad90..0b6920151 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -792,9 +792,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); (void) __glXGetExtensionString(screen->glx_enable_bits, diff --git a/glx/single2.c b/glx/single2.c index 56ad86dc6..07b89a823 100644 --- a/glx/single2.c +++ b/glx/single2.c @@ -346,9 +346,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) cl->GLClientextensions); buf = __glXcombine_strings(buf1, cx->pGlxScreen->GLextensions); - if (buf1 != NULL) { - free(buf1); - } + free(buf1); string = buf; } else if ( name == GL_VERSION ) { @@ -377,8 +375,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) __GLX_SEND_HEADER(); WriteToClient(client, length, (char *) string); - if (buf != NULL) - free(buf); + free(buf); return Success; } diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index a9744e186..760212865 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -2565,7 +2565,7 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc) cl->GLClientmajorVersion = req->major; cl->GLClientminorVersion = req->minor; - if (cl->GLClientextensions) free(cl->GLClientextensions); + free(cl->GLClientextensions); buf = (const char *)(req+1); cl->GLClientextensions = strdup(buf); diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c index a8fc0a88d..886b317c6 100644 --- a/hw/dmx/glxProxy/glxext.c +++ b/hw/dmx/glxProxy/glxext.c @@ -77,10 +77,10 @@ static void ResetClientState(int clientIndex) Display **keep_be_displays; int i; - if (cl->returnBuf) free(cl->returnBuf); - if (cl->currentContexts) free(cl->currentContexts); - if (cl->currentDrawables) free(cl->currentDrawables); - if (cl->largeCmdBuf) free(cl->largeCmdBuf); + free(cl->returnBuf); + free(cl->currentContexts); + free(cl->currentDrawables); + free(cl->largeCmdBuf); for (i=0; i< screenInfo.numScreens; i++) { if (cl->be_displays[i]) @@ -97,7 +97,7 @@ static void ResetClientState(int clientIndex) */ cl->GLClientmajorVersion = 1; cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) free(cl->GLClientextensions); + free(cl->GLClientextensions); memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *)); } @@ -222,10 +222,10 @@ GLboolean __glXFreeContext(__GLXcontext *cx) { if (cx->idExists || cx->isCurrent) return GL_FALSE; - if (cx->feedbackBuf) free(cx->feedbackBuf); - if (cx->selectBuf) free(cx->selectBuf); - if (cx->real_ids) free(cx->real_ids); - if (cx->real_vids) free(cx->real_vids); + free(cx->feedbackBuf); + free(cx->selectBuf); + free(cx->real_ids); + free(cx->real_vids); if (cx->pGlxPixmap) { /* diff --git a/hw/kdrive/fake/fake.c b/hw/kdrive/fake/fake.c index b8306db0a..ba05234dc 100644 --- a/hw/kdrive/fake/fake.c +++ b/hw/kdrive/fake/fake.c @@ -215,11 +215,8 @@ fakeUnmapFramebuffer (KdScreenInfo *screen) { FakePriv *priv = screen->card->driver; KdShadowFbFree (screen); - if (priv->base) - { - free (priv->base); - priv->base = 0; - } + free(priv->base); + priv->base = NULL; return TRUE; } diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index e3b2831c2..88e2e8d3b 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -742,8 +742,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN, {0}, FALSE }, - { FLAG_ALLOW_EMPTY_INPUT, "AllowEmptyInput", OPTV_BOOLEAN, - {0}, FALSE }, { FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE }, { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, @@ -956,7 +954,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) /* AllowEmptyInput is automatically true if we're hotplugging */ xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices); - xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput); /* AEI on? Then we're not using kbd, so use the evdev rules set. */ #if defined(linux) @@ -1437,8 +1434,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "reconfigure %s or disable AutoAddDevices.\n", config_backend, config_backend); #else - xf86Msg(X_INFO, "Hotplugging is disabled and no input devices were configured.\n" - "\tTry disabling AllowEmptyInput.\n"); + xf86Msg(X_WARNING, "Hotplugging requested but the server was " + "compiled without a config backend. " + "No input devices were configured, the server " + "will start without any input devices.\n"); #endif } @@ -2353,7 +2352,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { IDevPtr *current; if (!warned) { - xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using " + xf86Msg(X_WARNING, "Hotplugging is on, devices using " "drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n"); warned = TRUE; } diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index cbfea7d98..a7259fb8b 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -558,9 +558,6 @@ Default: off. This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__) drivers to not report failure if the mouse device can't be opened/initialised. It has no effect on the evdev(__drivermansuffix__) or other drivers. -The previous functionality of allowing the server to start up even if -the mouse device can't be opened/initialised is now handled by the -AllowEmptyInput option. Default: false. .TP 7 .BI "Option \*qVTSysReq\*q \*q" boolean \*q @@ -677,12 +674,6 @@ default. Allow modules built for a different, potentially incompatible version of the X server to load. Disabled by default. .TP 7 -.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q -If enabled, don't add the standard keyboard and mouse drivers, if there are no -input devices in the config file. Enabled by default if AutoAddDevices and -AutoEnableDevices is enabled, otherwise disabled. -If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are ignored. -.TP 7 .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q If this option is disabled, then no devices will be added from HAL events. Enabled by default. diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index b2daec72e..7fc2a60f7 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -2964,8 +2964,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) int size; #endif - if (output->MonInfo != NULL) - free(output->MonInfo); + free(output->MonInfo); output->MonInfo = edid_mon; diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 38918859a..5d7391d4c 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -682,10 +682,7 @@ glxWinScreenProbe(ScreenPtr pScreen) unsigned int buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) - { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); __glXGetExtensionString(screen->glx_enable_bits, screen->base.GLXextensions); diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c index 9da03888d..d526a9201 100644 --- a/hw/xwin/wincmap.c +++ b/hw/xwin/wincmap.c @@ -516,11 +516,8 @@ winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap) pScreen->blackPixel = 0; /* Free colormap */ - if (ppeColors != NULL) - { - free (ppeColors); - ppeColors = NULL; - } + free(ppeColors); + ppeColors = NULL; /* Free the DC */ if (hdc != NULL) diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c index 050c71a7f..8bd8e3478 100644 --- a/hw/xwin/winpixmap.c +++ b/hw/xwin/winpixmap.c @@ -163,11 +163,8 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap) if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap); /* Free the bitmap info header memory */ - if (pPixmapPriv->pbmih != NULL) - { - free (pPixmapPriv->pbmih); - pPixmapPriv->pbmih = NULL; - } + free(pPixmapPriv->pbmih); + pPixmapPriv->pbmih = NULL; /* Free the pixmap memory */ free (pPixmap); diff --git a/mi/mispans.c b/mi/mispans.c index 9f56e3c3d..53539e515 100644 --- a/mi/mispans.c +++ b/mi/mispans.c @@ -215,7 +215,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans) void miFreeSpanGroup(SpanGroup *spanGroup) { - if (spanGroup->group != NULL) free(spanGroup->group); + free(spanGroup->group); } static void QuickSortSpansX( diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 43b9cbb53..61d2f5dab 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -92,8 +92,7 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen) rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth); if (s->pixmap_data_size < rowbytes) { - if (s->pixmap_data != NULL) - free(s->pixmap_data); + free(s->pixmap_data); s->pixmap_data_size = rowbytes; s->pixmap_data = malloc(s->pixmap_data_size); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 42ab8dab2..c4a32aa0d 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -1140,10 +1140,8 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, } } - if (gResizeDeathBits != NULL) { - free(gResizeDeathBits); - gResizeDeathBits = NULL; - } + free(gResizeDeathBits); + gResizeDeathBits = NULL; if (gravity) { pScreen->CopyWindow = gResizeOldCopyWindowProc; @@ -481,8 +481,7 @@ AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) ErrorF("%slast message repeated %d times\n", prefix != NULL ? prefix : "", nrepeat); nrepeat = 0; - if (prefix != NULL) - free(prefix); + free(prefix); return AUDIT_TIMEOUT; } else { /* if the timer expires without anything to print, flush the message */ @@ -515,8 +514,7 @@ VAuditF(const char *f, va_list args) nrepeat = 0; auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); } - if (prefix != NULL) - free(prefix); + free(prefix); } void diff --git a/os/strlcat.c b/os/strlcat.c index 91ceabb1c..7d53b0a6a 100644 --- a/os/strlcat.c +++ b/os/strlcat.c @@ -15,8 +15,8 @@ */ -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> #endif #include <sys/types.h> diff --git a/os/strlcpy.c b/os/strlcpy.c index e8e1b0217..2e55b2e63 100644 --- a/os/strlcpy.c +++ b/os/strlcpy.c @@ -14,8 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> #endif #include <sys/types.h> diff --git a/render/miindex.c b/render/miindex.c index 5e2e06c35..4603136a4 100644 --- a/render/miindex.c +++ b/render/miindex.c @@ -322,16 +322,10 @@ void miCloseIndexed (ScreenPtr pScreen, PictFormatPtr pFormat) { - if (pFormat->index.devPrivate) - { - free(pFormat->index.devPrivate); - pFormat->index.devPrivate = 0; - } - if (pFormat->index.pValues) - { - free(pFormat->index.pValues); - pFormat->index.pValues = 0; - } + free(pFormat->index.devPrivate); + pFormat->index.devPrivate = NULL; + free(pFormat->index.pValues); + pFormat->index.pValues = NULL; } void diff --git a/render/picture.c b/render/picture.c index 7fda6b93a..896eaa7be 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1391,11 +1391,8 @@ SetPictureTransform (PicturePtr pPicture, } else { - if (pPicture->transform) - { - free(pPicture->transform); - pPicture->transform = 0; - } + free(pPicture->transform); + pPicture->transform = NULL; } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c index c52e091da..bffd60fce 100644 --- a/xkb/XKBAlloc.c +++ b/xkb/XKBAlloc.c @@ -212,10 +212,8 @@ XkbNamesPtr names; register XkbKeyTypePtr type; type= map->types; for (i=0;i<map->num_types;i++,type++) { - if (type->level_names!=NULL) { - free(type->level_names); - type->level_names= NULL; - } + free(type->level_names); + type->level_names = NULL; } } } diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c index d1adea34e..3ec9edab8 100644 --- a/xkb/XKBGAlloc.c +++ b/xkb/XKBGAlloc.c @@ -50,10 +50,8 @@ _XkbFreeGeomLeafElems( Bool freeAll, { if ((freeAll)||(*elems==NULL)) { *num_inout= *sz_inout= 0; - if (*elems!=NULL) { - free(*elems); - *elems= NULL; - } + free(*elems); + *elems = NULL; return; } @@ -373,22 +371,16 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in; switch (doodad->any.type) { case XkbTextDoodad: { - if (doodad->text.text!=NULL) { - free(doodad->text.text); - doodad->text.text= NULL; - } - if (doodad->text.font!=NULL) { - free(doodad->text.font); - doodad->text.font= NULL; - } + free(doodad->text.text); + doodad->text.text = NULL; + free(doodad->text.font); + doodad->text.font = NULL; } break; case XkbLogoDoodad: { - if (doodad->logo.logo_name!=NULL) { - free(doodad->logo.logo_name); - doodad->logo.logo_name= NULL; - } + free(doodad->logo.logo_name); + doodad->logo.logo_name = NULL; } break; } @@ -434,10 +426,8 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap) if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL)) XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,TRUE); if (freeMap) { - if (geom->label_font!=NULL) { - free(geom->label_font); - geom->label_font= NULL; - } + free(geom->label_font); + geom->label_font = NULL; free(geom); } return; diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index 6b186c1ad..2681ba3c3 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -292,11 +292,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; } type= &xkb->map->types[type_ndx]; if (map_count==0) { - if (type->map!=NULL) - free(type->map); + free(type->map); type->map= NULL; - if (type->preserve!=NULL) - free(type->preserve); + free(type->preserve); type->preserve= NULL; type->map_count= 0; } @@ -321,9 +319,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; return BadAlloc; } } - else if (type->preserve!=NULL) { + else { free(type->preserve); - type->preserve= NULL; + type->preserve = NULL; } type->map_count= map_count; } @@ -807,19 +805,13 @@ XkbClientMapPtr map; register int i; XkbKeyTypePtr type; for (i=0,type=map->types;i<map->num_types;i++,type++) { - if (type->map!=NULL) { - free(type->map); - type->map= NULL; - } - if (type->preserve!=NULL) { - free(type->preserve); - type->preserve= NULL; - } + free(type->map); + type->map = NULL; + free(type->preserve); + type->preserve = NULL; type->map_count= 0; - if (type->level_names!=NULL) { - free(type->level_names); - type->level_names= NULL; - } + free(type->level_names); + type->level_names = NULL; } } free(map->types); @@ -828,10 +820,8 @@ XkbClientMapPtr map; } } if (what&XkbKeySymsMask) { - if (map->key_sym_map!=NULL) { - free(map->key_sym_map); - map->key_sym_map= NULL; - } + free(map->key_sym_map); + map->key_sym_map = NULL; if (map->syms!=NULL) { free(map->syms); map->size_syms= map->num_syms= 0; @@ -864,10 +854,8 @@ XkbServerMapPtr map; map->explicit= NULL; } if (what&XkbKeyActionsMask) { - if (map->key_acts!=NULL) { - free(map->key_acts); - map->key_acts= NULL; - } + free(map->key_acts); + map->key_acts = NULL; if (map->acts!=NULL) { free(map->acts); map->num_acts= map->size_acts= 0; diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index 5e6ab8770..cfc6198fd 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -267,8 +267,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, strncpy(nameRtrn,keymap,nameRtrnLen); nameRtrn[nameRtrnLen-1]= '\0'; } - if (buf != NULL) - free(buf); + free(buf); return TRUE; } else @@ -287,8 +286,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, } if (nameRtrn) nameRtrn[0]= '\0'; - if (buf != NULL) - free(buf); + free(buf); return FALSE; } |