From df0df1bc37fa2ff60768493c78bf70355e320739 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 24 May 2009 12:17:15 +0200 Subject: [PATCH] Fix a couple of harmless compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In each widget's *_geometry function, two warnings were generated, e.g.: warning: ‘geometry.y’ is used uninitialized in this function warning: ‘geometry.x’ is used uninitialized in this function Found by gogonkt with GCC 4.2.4 on gentoo. Signed-off-by: Uli Schlachter --- widgets/graph.c | 1 + widgets/imagebox.c | 2 ++ widgets/progressbar.c | 2 ++ widgets/systray.c | 2 ++ widgets/textbox.c | 2 ++ 5 files changed, 9 insertions(+) diff --git a/widgets/graph.c b/widgets/graph.c index 675239ba..672a97de 100644 --- a/widgets/graph.c +++ b/widgets/graph.c @@ -153,6 +153,7 @@ graph_geometry(widget_t *widget, screen_t *screen, int height, int width) area_t geometry; graph_data_t *d = widget->data; + geometry.x = geometry.y = 0; geometry.height = height; geometry.width = d->width; diff --git a/widgets/imagebox.c b/widgets/imagebox.c index de8b5f06..a9598fd9 100644 --- a/widgets/imagebox.c +++ b/widgets/imagebox.c @@ -69,6 +69,8 @@ imagebox_geometry(widget_t *widget, screen_t *screen, int height, int width) geometry.height = 0; } + geometry.x = geometry.y = 0; + return geometry; } diff --git a/widgets/progressbar.c b/widgets/progressbar.c index 940c0581..8d1de1d5 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -158,6 +158,8 @@ progressbar_geometry(widget_t *widget, screen_t *screen, int height, int width) geometry.width = pb_width + 2 * (d->border_width + d->border_padding); } + geometry.x = geometry.y = 0; + return geometry; } diff --git a/widgets/systray.c b/widgets/systray.c index 2c277f73..16cb7fd2 100644 --- a/widgets/systray.c +++ b/widgets/systray.c @@ -45,6 +45,8 @@ systray_geometry(widget_t *widget, screen_t *screen, int height, int width) /** \todo use class hints */ geometry.width = MIN(n * height, width); + geometry.x = geometry.y = 0; + return geometry; } diff --git a/widgets/textbox.c b/widgets/textbox.c index 6848108c..ed508a88 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -72,6 +72,8 @@ textbox_geometry(widget_t *widget, screen_t *screen, int height, int width) else geometry.width = MIN(d->extents.width + d->margin.left + d->margin.right, width); + geometry.x = geometry.y = 0; + return geometry; }