randr: RRCreateProviderProperty(): use calloc()
We can rely on everything being cleared. And usually even faster, as the compiler can emit optimized instructions for clearing a whole block at once. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
This commit is contained in:
parent
3d3137513a
commit
05188ccec1
|
@ -107,16 +107,10 @@ RRCreateProviderProperty(Atom property)
|
||||||
{
|
{
|
||||||
RRPropertyPtr prop;
|
RRPropertyPtr prop;
|
||||||
|
|
||||||
prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec));
|
prop = (RRPropertyPtr) calloc(1, sizeof(RRPropertyRec));
|
||||||
if (!prop)
|
if (!prop)
|
||||||
return NULL;
|
return NULL;
|
||||||
prop->next = NULL;
|
|
||||||
prop->propertyName = property;
|
prop->propertyName = property;
|
||||||
prop->is_pending = FALSE;
|
|
||||||
prop->range = FALSE;
|
|
||||||
prop->immutable = FALSE;
|
|
||||||
prop->num_valid = 0;
|
|
||||||
prop->valid_values = NULL;
|
|
||||||
RRInitProviderPropertyValue(&prop->current);
|
RRInitProviderPropertyValue(&prop->current);
|
||||||
RRInitProviderPropertyValue(&prop->pending);
|
RRInitProviderPropertyValue(&prop->pending);
|
||||||
return prop;
|
return prop;
|
||||||
|
|
Loading…
Reference in New Issue