summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2018-05-09 16:22:16 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2018-05-10 10:05:41 -0500
commitfc46379b37e8dd9d06c96c074af4cc1738cacffd (patch)
tree2839c74817423efd6d32253164ead2bb8b745f2e /common
parent754cd54e1a807e5e9e87402392b8be9fdb66c637 (diff)
miLineArc(): initialize edge1, edge2
When compiling spice-common with meson/ninja under "release" mode, I get several compiler warnings about possibly-uninitialized members. For example: ../subprojects/spice-common/common/lines.c: In function ‘miLineArc’: ../subprojects/spice-common/common/lines.c:2167:17: error: ‘edge2.dx’ may be used uninitialized in this function [-Werror=maybe-uninitialized] edge->e += edge->dx; \ ^~ ../subprojects/spice-common/common/lines.c:2426:24: note: ‘edge2.dx’ was declared here PolyEdgeRec edge1, edge2; ^~~~~ Initializing these structures to zero silences the warnings. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'common')
-rw-r--r--common/lines.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/lines.c b/common/lines.c
index e5097c4..dadaf86 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -2423,7 +2423,7 @@ miLineArc (GCPtr pGC,
int xorgi = 0, yorgi = 0;
Spans spanRec;
int n;
- PolyEdgeRec edge1, edge2;
+ PolyEdgeRec edge1 = { 0 }, edge2 = { 0 };
int edgey1, edgey2;
Boolean edgeleft1, edgeleft2;