1 $NetBSD: patch-hw_xfree86_dri2_dri2.c,v 1.2 2015/04/25 11:47:03 tnn Exp $
3 Fix uninitialized variables warning from clang (X crashes without this)
5 dri2.c:242:27: note: initialize the variable 'ref' to silence this warning
6 DRI2DrawableRefPtr ref;
7 dri2.c:320:27: note: initialize the variable 'ref' to silence this warning
8 DRI2DrawableRefPtr ref, next;
9 dri2.c:601:27: note: initialize the variable 'ref' to silence this warning
10 DRI2DrawableRefPtr ref;
12 --- a/hw/xfree86/dri2/dri2.c.orig 2015-01-26 18:42:23.000000000 +0000
13 +++ b/hw/xfree86/dri2/dri2.c
14 @@ -279,7 +279,7 @@ typedef struct DRI2DrawableRefRec {
15 static DRI2DrawableRefPtr
16 DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id)
18 - DRI2DrawableRefPtr ref;
19 + DRI2DrawableRefPtr ref = NULL;
21 xorg_list_for_each_entry(ref, &pPriv->reference_list, link) {
23 @@ -359,7 +359,7 @@ static int
24 DRI2DrawableGone(void *p, XID id)
26 DRI2DrawablePtr pPriv = p;
27 - DRI2DrawableRefPtr ref, next;
28 + DRI2DrawableRefPtr ref = NULL, next;
32 @@ -676,7 +676,7 @@ static void
33 DRI2InvalidateDrawable(DrawablePtr pDraw)
35 DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
36 - DRI2DrawableRefPtr ref;
37 + DRI2DrawableRefPtr ref = NULL;
39 if (!pPriv || !pPriv->needInvalidate)