[PATCH 2/2] Zero-fill RROutputRec instead of manually clearing all the fields
Jamey Sharp
jamey at minilop.net
Sun Jun 6 06:58:16 PDT 2010
Reviewed-by: Jamey Sharp <jamey at minilop.net>
Of course, now there's only one caller of RRInitOutputPropertyValue;
is it worth inlining?
Jamey
On Sun, Jun 6, 2010 at 6:40 AM, Mikhail Gusarov <dottedmag at dottedmag.net> wrote:
> Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
> ---
> randr/rrproperty.c | 10 +---------
> 1 files changed, 1 insertions(+), 9 deletions(-)
>
> diff --git a/randr/rrproperty.c b/randr/rrproperty.c
> index 7b8e44e..c4dcb1a 100644
> --- a/randr/rrproperty.c
> +++ b/randr/rrproperty.c
> @@ -103,18 +103,10 @@ RRCreateOutputProperty (Atom property)
> {
> RRPropertyPtr prop;
>
> - prop = (RRPropertyPtr)malloc(sizeof(RRPropertyRec));
> + prop = calloc(1, sizeof(RRPropertyRec));
> if (!prop)
> return NULL;
> - prop->next = NULL;
> prop->propertyName = property;
> - prop->is_pending = FALSE;
> - prop->range = FALSE;
> - prop->immutable = FALSE;
> - prop->num_valid = 0;
> - prop->valid_values = NULL;
> - RRInitOutputPropertyValue (&prop->current);
> - RRInitOutputPropertyValue (&prop->pending);
> return prop;
> }
>
> --
> 1.7.1
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list