[Intel-gfx] [PATCH] Fixing compiler warning concerning uninitialized variables

Stead, Alan alan.stead at intel.com
Fri Nov 18 20:15:08 CET 2011


The width and height variables are used in the call to
CopyArea in line 1209, however they are initially set on line 1137.
The if condition to use the variables on line 1209 can only be met
if localDst is changed on line 1170, which means the variables
would have been set.  This just initializes the variables to 0 so
we can compile without the warnings.

Signed-off-by: Alan Stead <alan.stead at intel.com>
---
 uxa/uxa-glyphs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 6c9ea0d..c257966 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -1059,7 +1059,7 @@ uxa_glyphs(CARD8 op,
    int xDst = list->xOff, yDst = list->yOff;
    BoxRec extents = { 0, 0, 0, 0 };
    Bool have_extents = FALSE;
-   int width, height, ret;
+   int width = 0, height = 0, ret;
    PicturePtr localDst = pDst;

    if (!uxa_screen->info->prepare_composite ||
--
1.7.7.1




More information about the Intel-gfx mailing list