From 254c00ba6f95362487369a2453b8bc88fc6bd117 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Sat, 23 Jun 2012 17:32:42 +0100 Subject: [PATCH] Address 'may be used uninitialized' warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Making all in src CC actions.o actions.c: In function ‘wMaximizeWindow’: actions.c:421:14: warning: ‘maximus_height’ may be used uninitialized in this function [-Wuninitialized] actions.c:440:29: warning: ‘maximus_width’ may be used uninitialized in this function [-Wuninitialized] actions.c:442:35: warning: ‘maximus_y’ may be used uninitialized in this function [-Wuninitialized] actions.c:454:18: warning: ‘maximus_x’ may be used uninitialized in this function [-Wuninitialized] CCLD wmaker These warnings were harmless because they were at a point where find_Maximus_geometry() had already been called. So let's simply initialize them to zero to silence gcc. --- src/actions.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/actions.c b/src/actions.c index fed1c1e8..9617fb5c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -317,8 +317,10 @@ void wMaximizeWindow(WWindow *wwin, int directions) { int new_x, new_y; unsigned int new_width, new_height, half_scr_width; - int maximus_x, maximus_y; - unsigned int maximus_width, maximus_height; + int maximus_x = 0; + int maximus_y = 0; + unsigned int maximus_width = 0; + unsigned int maximus_height = 0; WArea usableArea, totalArea; Bool has_border = 1; int save_directions = 0;