From: ellson Date: Tue, 8 Nov 2005 17:21:46 +0000 (+0000) Subject: janitor stuff - clean up some unitialized variable warnings X-Git-Tag: LAST_LIBGRAPH~32^2~6983 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57a4f00429a9126e57ee2ace1b00ee0626e615a1;p=graphviz janitor stuff - clean up some unitialized variable warnings --- diff --git a/cmd/lefty/dot2l/dot2l.c b/cmd/lefty/dot2l/dot2l.c index 5419174c7..c62c842ee 100644 --- a/cmd/lefty/dot2l/dot2l.c +++ b/cmd/lefty/dot2l/dot2l.c @@ -309,6 +309,8 @@ void D2Lwritegraph (int ioi, Tobj graph, int flag) { writeattr (ioi, to, buf); IOwriteline (ioi, "\t]"); } + + n = 0; if ((nodes = Tfinds (graph, "nodes"))) { if (!(no = Tfinds (graph, "maxnid")) || !T_ISNUMBER (no)) n = 100 * Tgettablen (nodes); diff --git a/cmd/lefty/exec.c b/cmd/lefty/exec.c index 75c0cdc8f..5f2f66e8c 100644 --- a/cmd/lefty/exec.c +++ b/cmd/lefty/exec.c @@ -680,6 +680,7 @@ static Tobj getval (Tobj co, int ci) { int ct, vt; int vi, ni, nn; + cvo = NULL; if ((ct = TCgettype (co, ci)) == C_LVAR) { nn = (int) TCgetinteger (co, (ni = TCgetnext (co, TCgetfp (co, ci)))); cto = cvo = lvarp[flvari + nn].o; @@ -722,6 +723,9 @@ static int getvar (Tobj co, int ci, tnk_t *tnkp) { long m; int vi, ovi, nn, ni; + nn = 0; + vt = 0; + cko = cto = NULL; if ((ct = TCgettype (co, ci)) == C_LVAR) { nn = (int) TCgetinteger (co, (ni = TCgetnext (co, TCgetfp (co, ci)))); cvo = cto = lvarp[flvari + nn].o; diff --git a/cmd/lefty/gfxview.c b/cmd/lefty/gfxview.c index 773cd213c..cf72efa03 100644 --- a/cmd/lefty/gfxview.c +++ b/cmd/lefty/gfxview.c @@ -196,6 +196,7 @@ void GFXlabelcb (Gevent_t *evp) { char s[2]; long fm; + fn = NULL; wo = Tfindi (rootwo, evp->wi); switch (evp->type) { case G_MOUSE: @@ -259,6 +260,9 @@ void GFXevent (Gevent_t *evp) { long fm; int ni; + pp.x = pp.y = 0; + pvo = NULL; + fn = NULL; ni = Gwidgets[evp->wi].udata; np = &gfxnodes[ni]; wo = Tfindi (rootwo, evp->wi); @@ -502,6 +506,8 @@ void GFXarrayresizecb (int wi, Gawdata_t *dp) { Tinss (to, "size", (so = Ttable (2))); Tinss (so, "x", Treal ((double) dp->sx)); Tinss (so, "y", Treal ((double) dp->sy)); + + lrtno = NULL; if ((co = Pfcall (fo, to))) lrtno = Eunit (co); Mpopmark (fm); @@ -830,6 +836,8 @@ int GFXgetgfxattr (int argc, lvar_t *argv) { !T_ISTABLE (argv[1].o) ) return L_FAILURE; + + s = NULL; for (Tgetfirst (argv[1].o, &tkvi); tkvi.kvp; Tgetnext (&tkvi)) { if (!T_ISSTRING (tkvi.kvp->vo)) continue; @@ -1756,6 +1764,7 @@ static void hsv2rgb (float h, float s, float v, Gcolor_t *cp) { h = max (min (h, 1.0), 0.0); s = max (min (s, 1.0), 0.0); v = max (min (v, 1.0), 0.0); + r = g = b = 0.0; if (s == 0.0) r = g = b = v;