summaryrefslogtreecommitdiff
path: root/randr/rrproperty.c
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-05-06 01:44:06 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-05-13 00:22:37 +0700
commit3f3ff971ecff9936cebafc813af9193b97bba89c (patch)
treefdbbad794a42488b7ffe41eed7aba4e498335f55 /randr/rrproperty.c
parent96c7ab27c383ec767f62a7a11e5fd76f86363fbc (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 'randr/rrproperty.c')
-rw-r--r--randr/rrproperty.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 12e30e486..5fc04a9ea 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -76,10 +76,10 @@ RRDeleteAllOutputProperties (RROutputPtr output)
event.timestamp = currentTime.milliseconds;
RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
if (prop->current.data)
- xfree(prop->current.data);
+ free(prop->current.data);
if (prop->pending.data)
- xfree(prop->pending.data);
- xfree(prop);
+ free(prop->pending.data);
+ free(prop);
}
}
@@ -97,7 +97,7 @@ RRCreateOutputProperty (Atom property)
{
RRPropertyPtr prop;
- prop = (RRPropertyPtr)xalloc(sizeof(RRPropertyRec));
+ prop = (RRPropertyPtr)malloc(sizeof(RRPropertyRec));
if (!prop)
return NULL;
prop->next = NULL;
@@ -116,14 +116,14 @@ static void
RRDestroyOutputProperty (RRPropertyPtr prop)
{
if (prop->valid_values)
- xfree (prop->valid_values);
+ free(prop->valid_values);
if (prop->current.data)
- xfree(prop->current.data);
+ free(prop->current.data);
if (prop->pending.data)
- xfree(prop->pending.data);
+ free(prop->pending.data);
if (prop->valid_values)
- xfree(prop->valid_values);
- xfree(prop);
+ free(prop->valid_values);
+ free(prop);
}
void
@@ -201,7 +201,7 @@ RRChangeOutputProperty (RROutputPtr output, 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)
@@ -239,11 +239,11 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
prop->propertyName, &new_value))
{
if (new_value.data)
- xfree (new_value.data);
+ free(new_value.data);
return (BadValue);
}
if (prop_value->data)
- xfree (prop_value->data);
+ free(prop_value->data);
*prop_value = new_value;
}
@@ -372,7 +372,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property,
if (range && (num_values & 1))
return BadMatch;
- new_values = xalloc (num_values * sizeof (INT32));
+ new_values = malloc(num_values * sizeof (INT32));
if (!new_values && num_values)
return BadAlloc;
if (num_values)
@@ -385,7 +385,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property,
if (prop->is_pending && !pending)
{
if (prop->pending.data)
- xfree (prop->pending.data);
+ free(prop->pending.data);
RRInitOutputPropertyValue (&prop->pending);
}
@@ -394,7 +394,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property,
prop->immutable = immutable;
prop->num_valid = num_values;
if (prop->valid_values)
- xfree (prop->valid_values);
+ free(prop->valid_values);
prop->valid_values = new_values;
if (add) {
@@ -422,7 +422,7 @@ ProcRRListOutputProperties (ClientPtr client)
for (prop = output->properties; prop; prop = prop->next)
numProps++;
if (numProps)
- if(!(pAtoms = (Atom *)xalloc(numProps * sizeof(Atom))))
+ if(!(pAtoms = (Atom *)malloc(numProps * sizeof(Atom))))
return(BadAlloc);
rep.type = X_Reply;
@@ -445,7 +445,7 @@ ProcRRListOutputProperties (ClientPtr client)
{
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
- xfree(pAtoms);
+ free(pAtoms);
}
return(client->noClientException);
}
@@ -468,7 +468,7 @@ ProcRRQueryOutputProperty (ClientPtr client)
return BadName;
if (prop->num_valid) {
- extra = xalloc(prop->num_valid * sizeof(INT32));
+ extra = malloc(prop->num_valid * sizeof(INT32));
if (!extra)
return BadAlloc;
}
@@ -491,7 +491,7 @@ ProcRRQueryOutputProperty (ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32),
extra);
- xfree(extra);
+ free(extra);
}
return(client->noClientException);
}
@@ -699,7 +699,7 @@ ProcRRGetOutputProperty (ClientPtr client)
len = min(n - ind, 4 * stuff->longLength);
if (len) {
- extra = xalloc(len);
+ extra = malloc(len);
if (!extra)
return BadAlloc;
}
@@ -745,7 +745,7 @@ ProcRRGetOutputProperty (ClientPtr client)
}
WriteSwappedDataToClient(client, len,
extra);
- xfree(extra);
+ free(extra);
}
if (stuff->delete && (reply.bytesAfter == 0))