diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-06 01:44:06 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-13 00:22:37 +0700 |
commit | 3f3ff971ecff9936cebafc813af9193b97bba89c (patch) | |
tree | fdbbad794a42488b7ffe41eed7aba4e498335f55 /Xi | |
parent | 96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff) |
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 54 | ||||
-rw-r--r-- | Xi/extinit.c | 2 | ||||
-rw-r--r-- | Xi/getdctl.c | 4 | ||||
-rw-r--r-- | Xi/getfctl.c | 4 | ||||
-rw-r--r-- | Xi/getkmap.c | 4 | ||||
-rw-r--r-- | Xi/getmmap.c | 2 | ||||
-rw-r--r-- | Xi/getprop.c | 4 | ||||
-rw-r--r-- | Xi/getselev.c | 4 | ||||
-rw-r--r-- | Xi/gtmotion.c | 2 | ||||
-rw-r--r-- | Xi/listdev.c | 8 | ||||
-rw-r--r-- | Xi/queryst.c | 4 | ||||
-rw-r--r-- | Xi/xichangehierarchy.c | 12 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 4 | ||||
-rw-r--r-- | Xi/xiproperty.c | 28 | ||||
-rw-r--r-- | Xi/xiquerydevice.c | 8 | ||||
-rw-r--r-- | Xi/xiquerypointer.c | 4 | ||||
-rw-r--r-- | Xi/xiselectev.c | 6 |
17 files changed, 77 insertions, 77 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 949efe77f..3ddee7791 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -234,7 +234,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*i)) { - *i = xcalloc(1, sizeof(IntegerFeedbackClassRec)); + *i = calloc(1, sizeof(IntegerFeedbackClassRec)); if (!(*i)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -269,7 +269,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*s)) { - *s = xcalloc(1, sizeof(StringFeedbackClassRec)); + *s = calloc(1, sizeof(StringFeedbackClassRec)); if (!(*s)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -304,7 +304,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*b)) { - *b = xcalloc(1, sizeof(BellFeedbackClassRec)); + *b = calloc(1, sizeof(BellFeedbackClassRec)); if (!(*b)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -340,7 +340,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*l)) { - *l = xcalloc(1, sizeof(LedFeedbackClassRec)); + *l = calloc(1, sizeof(LedFeedbackClassRec)); if (!(*l)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -390,7 +390,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*k)) { - *k = xcalloc(1, sizeof(KbdFeedbackClassRec)); + *k = calloc(1, sizeof(KbdFeedbackClassRec)); if (!*k) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -471,7 +471,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) to->focus = classes->focus; if (!to->focus) { - to->focus = xcalloc(1, sizeof(FocusClassRec)); + to->focus = calloc(1, sizeof(FocusClassRec)); if (!to->focus) FatalError("[Xi] no memory for class shift.\n"); } else @@ -479,7 +479,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) oldTrace = to->focus->trace; memcpy(to->focus, from->focus, sizeof(FocusClassRec)); - to->focus->trace = xrealloc(oldTrace, + to->focus->trace = realloc(oldTrace, to->focus->traceSize * sizeof(WindowPtr)); if (!to->focus->trace && to->focus->traceSize) FatalError("[Xi] no memory for trace.\n"); @@ -517,7 +517,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*p)) { - *p = xcalloc(1, sizeof(PtrFeedbackClassRec)); + *p = calloc(1, sizeof(PtrFeedbackClassRec)); if (!*p) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -548,7 +548,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) classes->valuator = NULL; } - to->valuator = xrealloc(to->valuator, sizeof(ValuatorClassRec) + + to->valuator = realloc(to->valuator, sizeof(ValuatorClassRec) + from->valuator->numAxes * sizeof(AxisInfo) + from->valuator->numAxes * sizeof(double)); v = to->valuator; @@ -578,7 +578,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) to->button = classes->button; if (!to->button) { - to->button = xcalloc(1, sizeof(ButtonClassRec)); + to->button = calloc(1, sizeof(ButtonClassRec)); if (!to->button) FatalError("[Xi] no memory for class shift.\n"); } else @@ -589,14 +589,14 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!to->button->xkb_acts) { - to->button->xkb_acts = xcalloc(1, sizeof(XkbAction)); + to->button->xkb_acts = calloc(1, sizeof(XkbAction)); if (!to->button->xkb_acts) FatalError("[Xi] not enough memory for xkb_acts.\n"); } memcpy(to->button->xkb_acts, from->button->xkb_acts, sizeof(XkbAction)); } else - xfree(to->button->xkb_acts); + free(to->button->xkb_acts); memcpy(to->button->labels, from->button->labels, from->button->numButtons * sizeof(Atom)); @@ -617,7 +617,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) to->proximity = classes->proximity; if (!to->proximity) { - to->proximity = xcalloc(1, sizeof(ProximityClassRec)); + to->proximity = calloc(1, sizeof(ProximityClassRec)); if (!to->proximity) FatalError("[Xi] no memory for class shift.\n"); } else @@ -641,7 +641,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) to->absolute = classes->absolute; if (!to->absolute) { - to->absolute = xcalloc(1, sizeof(AbsoluteClassRec)); + to->absolute = calloc(1, sizeof(AbsoluteClassRec)); if (!to->absolute) FatalError("[Xi] no memory for class shift.\n"); } else @@ -698,7 +698,7 @@ XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master, DeviceChanged /* we don't actually swap if there's a NullClient, swapping is done * later when event is delivered. */ SendEventToAllWindows(master, XI_DeviceChangedMask, (xEvent*)dcce, 1); - xfree(dcce); + free(dcce); } static void @@ -928,7 +928,7 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device) for (i = 0; i < screenInfo.numScreens; i++) DeliverEventsToWindow(device, WindowTable[i], xi, 1, GetEventFilter(device, xi), NULL); - xfree(xi); + free(xi); } } @@ -1116,7 +1116,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) { ProximityClassPtr proxc; - proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec)); + proxc = (ProximityClassPtr) malloc(sizeof(ProximityClassRec)); if (!proxc) return FALSE; proxc->sourceid = dev->id; @@ -1232,7 +1232,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, btlen = bytes_to_int32(btlen); len = sizeof(xXIFocusInEvent) + btlen * 4; - xi2event = xcalloc(1, len); + xi2event = calloc(1, len); xi2event->type = GenericEvent; xi2event->extension = IReqCode; xi2event->evtype = type; @@ -1268,7 +1268,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeliverEventsToWindow(dev, pWin, (xEvent*)xi2event, 1, GetEventFilter(dev, (xEvent*)xi2event), NullGrab); - xfree(xi2event); + free(xi2event); /* XI 1.x event */ event.deviceid = dev->id; @@ -1322,7 +1322,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, } } - sev = ev = (deviceStateNotify *) xalloc(evcount * sizeof(xEvent)); + sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent)); FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); if (b != NULL) { @@ -1377,7 +1377,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeliverEventsToWindow(dev, pWin, (xEvent *) sev, evcount, DeviceStateNotifyMask, NullGrab); - xfree(sev); + free(sev); } } @@ -1627,7 +1627,7 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx) if (!pWin->optional && !MakeWindowOptional(pWin)) return BadAlloc; - others = xcalloc(1, sizeof(InputClients)); + others = calloc(1, sizeof(InputClients)); if (!others) return BadAlloc; if (!pWin->optional->inputMasks && !MakeInputMasks(pWin)) @@ -1646,7 +1646,7 @@ MakeInputMasks(WindowPtr pWin) { struct _OtherInputMasks *imasks; - imasks = xcalloc(1, sizeof(struct _OtherInputMasks)); + imasks = calloc(1, sizeof(struct _OtherInputMasks)); if (!imasks) return FALSE; pWin->optional->inputMasks = imasks; @@ -1709,14 +1709,14 @@ InputClientGone(WindowPtr pWin, XID id) if (other->resource == id) { if (prev) { prev->next = other->next; - xfree(other); + free(other); } else if (!(other->next)) { if (ShouldFreeInputMasks(pWin, TRUE)) { wOtherInputMasks(pWin)->inputClients = other->next; - xfree(wOtherInputMasks(pWin)); + free(wOtherInputMasks(pWin)); pWin->optional->inputMasks = (OtherInputMasks *) NULL; CheckWindowOptionalNeed(pWin); - xfree(other); + free(other); } else { other->resource = FakeClientID(0); if (!AddResource(other->resource, RT_INPUTCLIENT, @@ -1725,7 +1725,7 @@ InputClientGone(WindowPtr pWin, XID id) } } else { wOtherInputMasks(pWin)->inputClients = other->next; - xfree(other); + free(other); } RecalculateDeviceDeliverableEvents(pWin); return (Success); diff --git a/Xi/extinit.c b/Xi/extinit.c index 37f985664..f9d8dc8e7 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -1156,7 +1156,7 @@ void AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name) { dev->xinput_type = type; - dev->name = (char *)xalloc(strlen(name) + 1); + dev->name = (char *)malloc(strlen(name) + 1); strcpy(dev->name, name); } diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 68181fa61..3e81e9479 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -281,7 +281,7 @@ ProcXGetDeviceControl(ClientPtr client) return BadValue; } - buf = (char *)xalloc(total_length); + buf = (char *)malloc(total_length); if (!buf) return BadAlloc; savbuf = buf; @@ -309,6 +309,6 @@ ProcXGetDeviceControl(ClientPtr client) rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep); WriteToClient(client, total_length, savbuf); - xfree(savbuf); + free(savbuf); return Success; } diff --git a/Xi/getfctl.c b/Xi/getfctl.c index 607765e98..9563d63d6 100644 --- a/Xi/getfctl.c +++ b/Xi/getfctl.c @@ -340,7 +340,7 @@ ProcXGetFeedbackControl(ClientPtr client) if (total_length == 0) return BadMatch; - buf = (char *)xalloc(total_length); + buf = (char *)malloc(total_length); if (!buf) return BadAlloc; savbuf = buf; @@ -361,6 +361,6 @@ ProcXGetFeedbackControl(ClientPtr client) rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep); WriteToClient(client, total_length, savbuf); - xfree(savbuf); + free(savbuf); return Success; } diff --git a/Xi/getkmap.c b/Xi/getkmap.c index 78449e212..c38467b96 100644 --- a/Xi/getkmap.c +++ b/Xi/getkmap.c @@ -133,8 +133,8 @@ ProcXGetDeviceKeyMapping(ClientPtr client) syms->mapWidth * stuff->count * sizeof(KeySym), &syms->map[syms->mapWidth * (stuff->firstKeyCode - syms->minKeyCode)]); - xfree(syms->map); - xfree(syms); + free(syms->map); + free(syms); return Success; } diff --git a/Xi/getmmap.c b/Xi/getmmap.c index ddf27a5f0..bd652e9d4 100644 --- a/Xi/getmmap.c +++ b/Xi/getmmap.c @@ -113,7 +113,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client) WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep); WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap); - xfree(modkeymap); + free(modkeymap); return Success; } diff --git a/Xi/getprop.c b/Xi/getprop.c index 1f28a8a40..246045981 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -119,7 +119,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) &count, COUNT); if (count) { rep.count = count; - buf = (XEventClass *) xalloc(rep.count * sizeof(XEventClass)); + buf = (XEventClass *) malloc(rep.count * sizeof(XEventClass)); rep.length = bytes_to_int32(rep.count * sizeof(XEventClass)); tbuf = buf; @@ -134,7 +134,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) if (count) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf); - xfree(buf); + free(buf); } return Success; } diff --git a/Xi/getselev.c b/Xi/getselev.c index 90f6284e5..d63b661cd 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -132,7 +132,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) total_length = (rep.all_clients_count + rep.this_client_count) * sizeof(XEventClass); rep.length = bytes_to_int32(total_length); - buf = (XEventClass *) xalloc(total_length); + buf = (XEventClass *) malloc(total_length); tclient = buf; aclient = buf + rep.this_client_count; @@ -152,7 +152,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) if (total_length) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, total_length, buf); - xfree(buf); + free(buf); } return Success; } diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 8e91c5a47..32d80eeec 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -154,7 +154,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) WriteToClient(client, length * 4, (char *)coords); } if (coords) - xfree(coords); + free(coords); return Success; } diff --git a/Xi/listdev.c b/Xi/listdev.c index 98ef7aa43..db7e5400e 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -360,7 +360,7 @@ ProcXListInputDevices(ClientPtr client) AddOtherInputDevices(); /* allocate space for saving skip value */ - skip = xcalloc(sizeof(Bool), inputInfo.numDevices); + skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) return BadAlloc; @@ -386,7 +386,7 @@ ProcXListInputDevices(ClientPtr client) /* allocate space for reply */ total_length = numdevs * sizeof(xDeviceInfo) + size + namesize; - devbuf = (char *)xcalloc(1, total_length); + devbuf = (char *)calloc(1, total_length); classbuf = devbuf + (numdevs * sizeof(xDeviceInfo)); namebuf = classbuf + size; savbuf = devbuf; @@ -411,8 +411,8 @@ ProcXListInputDevices(ClientPtr client) rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep); WriteToClient(client, total_length, savbuf); - xfree(savbuf); - xfree(skip); + free(savbuf); + free(skip); return Success; } diff --git a/Xi/queryst.c b/Xi/queryst.c index 78b97a769..65a43d1d2 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -119,7 +119,7 @@ ProcXQueryDeviceState(ClientPtr client) total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int))); num_classes++; } - buf = (char *)xcalloc(total_length, 1); + buf = (char *)calloc(total_length, 1); if (!buf) return BadAlloc; savbuf = buf; @@ -169,7 +169,7 @@ ProcXQueryDeviceState(ClientPtr client) WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep); if (total_length > 0) WriteToClient(client, total_length, savbuf); - xfree(savbuf); + free(savbuf); return Success; } diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 1a06e4555..c1899e109 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -68,7 +68,7 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) if (!flags) return; - ev = xcalloc(1, sizeof(xXIHierarchyEvent) + + ev = calloc(1, sizeof(xXIHierarchyEvent) + MAXDEVICES * sizeof(xXIHierarchyInfo)); ev->type = GenericEvent; ev->extension = IReqCode; @@ -116,7 +116,7 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) dummyDev.id = XIAllDevices; SendEventToAllWindows(&dummyDev, (XI_HierarchyChangedMask >> 8), (xEvent*)ev, 1); - xfree(ev); + free(ev); } @@ -172,7 +172,7 @@ ProcXIChangeHierarchy(ClientPtr client) char* name; SWAPIF(swaps(&c->name_len, n)); - name = xcalloc(c->name_len + 1, sizeof(char)); + name = calloc(c->name_len + 1, sizeof(char)); strncpy(name, (char*)&c[1], c->name_len); @@ -181,7 +181,7 @@ ProcXIChangeHierarchy(ClientPtr client) TRUE); if (rc != Success) { - xfree(name); + free(name); goto unwind; } @@ -194,7 +194,7 @@ ProcXIChangeHierarchy(ClientPtr client) if (rc != Success) { - xfree(name); + free(name); goto unwind; } @@ -228,7 +228,7 @@ ProcXIChangeHierarchy(ClientPtr client) flags[XTestptr->id] |= XISlaveAttached; flags[XTestkeybd->id] |= XISlaveAttached; - xfree(name); + free(name); } break; case XIRemoveMaster: diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 41a56b14e..a62fe7946 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -158,7 +158,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) status = CheckGrabValues(client, ¶m); modifiers = (uint32_t*)&stuff[1] + stuff->mask_len; - modifiers_failed = xcalloc(stuff->num_modifiers, sizeof(xXIGrabModifierInfo)); + modifiers_failed = calloc(stuff->num_modifiers, sizeof(xXIGrabModifierInfo)); if (!modifiers_failed) return BadAlloc; @@ -204,7 +204,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed); } - xfree(modifiers_failed); + free(modifiers_failed); return ret; } diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 8b8063776..8bb19624c 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -225,7 +225,7 @@ static int list_atoms(DeviceIntPtr dev, int *natoms, Atom **atoms_return) { Atom *a; - atoms = xalloc(nprops * sizeof(Atom)); + atoms = malloc(nprops * sizeof(Atom)); if(!atoms) return BadAlloc; a = atoms; @@ -457,7 +457,7 @@ XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return) if (!buf && !(*nelem_return)) { - buf = xcalloc(val->size, sizeof(int)); + buf = calloc(val->size, sizeof(int)); if (!buf) return BadAlloc; *buf_return = buf; @@ -517,7 +517,7 @@ XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return) if (!buf && !(*nelem_return)) { - buf = xcalloc(val->size, sizeof(float)); + buf = calloc(val->size, sizeof(float)); if (!buf) return BadAlloc; *buf_return = buf; @@ -549,7 +549,7 @@ XIRegisterPropertyHandler(DeviceIntPtr dev, { XIPropertyHandlerPtr new_handler; - new_handler = xcalloc(1, sizeof(XIPropertyHandler)); + new_handler = calloc(1, sizeof(XIPropertyHandler)); if (!new_handler) return 0; @@ -583,7 +583,7 @@ XIUnregisterPropertyHandler(DeviceIntPtr dev, long id) else prev->next = curr->next; - xfree(curr); + free(curr); } static XIPropertyPtr @@ -591,7 +591,7 @@ XICreateDeviceProperty (Atom property) { XIPropertyPtr prop; - prop = (XIPropertyPtr)xalloc(sizeof(XIPropertyRec)); + prop = (XIPropertyPtr)malloc(sizeof(XIPropertyRec)); if (!prop) return NULL; @@ -621,8 +621,8 @@ static void XIDestroyDeviceProperty (XIPropertyPtr prop) { if (prop->value.data) - xfree(prop->value.data); - xfree(prop); + free(prop->value.data); + free(prop); } /* This function destroys all of the device's property-related stuff, @@ -649,7 +649,7 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device) while(curr_handler) { next_handler = curr_handler->next; - xfree(curr_handler); + free(curr_handler); curr_handler = next_handler; } @@ -745,7 +745,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, pointer new_data = NULL, old_data = NULL; total_size = total_len * size_in_bytes; - new_value.data = (pointer)xalloc (total_size); + new_value.data = (pointer)malloc(total_size); if (!new_value.data && total_size) { if (add) @@ -797,7 +797,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, if (checkonly && rc != Success) { if (new_value.data) - xfree (new_value.data); + free(new_value.data); return (rc); } } @@ -807,7 +807,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, } while (!checkonly); } if (prop_value->data) - xfree (prop_value->data); + free(prop_value->data); *prop_value = new_value; } else if (len == 0) { @@ -905,7 +905,7 @@ ProcXListDeviceProperties (ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms); - xfree(atoms); + free(atoms); } return rc; } @@ -1149,7 +1149,7 @@ ProcXIListProperties(ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms); - xfree(atoms); + free(atoms); } return rc; } diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 47ab688fd..303c8b27d 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -87,7 +87,7 @@ ProcXIQueryDevice(ClientPtr client) } else { - skip = xcalloc(sizeof(Bool), inputInfo.numDevices); + skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) return BadAlloc; @@ -106,7 +106,7 @@ ProcXIQueryDevice(ClientPtr client) } } - info = xcalloc(1, len); + info = calloc(1, len); if (!info) return BadAlloc; @@ -155,8 +155,8 @@ ProcXIQueryDevice(ClientPtr client) WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); WriteToClient(client, rep.length * 4, ptr); - xfree(ptr); - xfree(skip); + free(ptr); + free(skip); return rc; } diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index 93ceba4c3..41253fb18 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -144,7 +144,7 @@ ProcXIQueryPointer(ClientPtr client) rep.buttons_len = bytes_to_int32(bits_to_bytes(pDev->button->numButtons)); rep.length += rep.buttons_len; buttons_size = rep.buttons_len * 4; - buttons = xcalloc(1, buttons_size); + buttons = calloc(1, buttons_size); if (!buttons) return BadAlloc; @@ -195,7 +195,7 @@ ProcXIQueryPointer(ClientPtr client) if (buttons) WriteToClient(client, buttons_size, buttons); - xfree(buttons); + free(buttons); return Success; } diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index 672edab3b..7aa3f0ab6 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -173,7 +173,7 @@ ProcXISelectEvents(ClientPtr client) RecalculateDeliverableEvents(win); - xfree(types); + free(types); return Success; } @@ -234,7 +234,7 @@ ProcXIGetSelectedEvents(ClientPtr client) return Success; } - buffer = xcalloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE)); + buffer = calloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE)); if (!buffer) return BadAlloc; @@ -281,7 +281,7 @@ ProcXIGetSelectedEvents(ClientPtr client) if (reply.num_masks) WriteToClient(client, reply.length * 4, buffer); - xfree(buffer); + free(buffer); return Success; } |