From fe696310d649cb8da4d4301c32ff471b8fcdbfa5 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 24 Jul 2010 18:16:56 +0000 Subject: [PATCH] muffle `may be used uninitialized' warnings --- ChangeLog | 4 ++++ src/frontend/plotting/x11.c | 21 ++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e07a384a..5eb275338 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-07-24 Robert Larice + * src/frontend/plotting/x11.c : + muffle `may be used uninitialized' warnings + 2010-07-24 Robert Larice * src/spicelib/devices/bsim3soi/b4soi.c , * src/spicelib/devices/bsim3soi/b4soiacld.c , diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 27237c6e1..786e48239 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -829,8 +829,6 @@ zoomin(GRAPH *graph) void hardcopy(Widget w, caddr_t client_data, caddr_t call_data) { - X11devdep tempdevdep; - Bool hasdevdep = FALSE; /* com_hardcopy() -> gr_resize() -> setcolor() dirung postscript printing will act on currentgraph with a DEVDEP inherited from PSdevdep. But currentgraph had not changed its devdep, which was derived from @@ -838,16 +836,17 @@ hardcopy(Widget w, caddr_t client_data, caddr_t call_data) temporary remedy, until there will be a cleanup of graph handling. E.g. CopyGraph() does not make a copy of its devdep, but just copies the pointer, so keeping the old devdep. */ - if (currentgraph->devdep) { - tempdevdep = DEVDEP(currentgraph); - hasdevdep = TRUE; - } + lasthardcopy = (GRAPH *) client_data; - com_hardcopy(NULL); - if (hasdevdep) - DEVDEP(currentgraph) = tempdevdep; - else - currentgraph->devdep = NULL; + + if (currentgraph->devdep) { + X11devdep tempdevdep = DEVDEP(currentgraph); + com_hardcopy(NULL); + DEVDEP(currentgraph) = tempdevdep; + } else { + com_hardcopy(NULL); + currentgraph->devdep = NULL; + } } void