]> granicus.if.org Git - graphviz/commitdiff
janitor stuff - clean up some unitialized variable warnings
authorellson <devnull@localhost>
Tue, 8 Nov 2005 17:21:46 +0000 (17:21 +0000)
committerellson <devnull@localhost>
Tue, 8 Nov 2005 17:21:46 +0000 (17:21 +0000)
cmd/lefty/dot2l/dot2l.c
cmd/lefty/exec.c
cmd/lefty/gfxview.c

index 5419174c7bffffbdd7fcdb7c26ecebef95a00628..c62c842ee526405e5e3fd91d83c52c1b79be7fc7 100644 (file)
@@ -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);
index 75c0cdc8ff79d960351a2b5df8cc0391340fd327..5f2f66e8c5e5e20dbd3eff813bade8209282e2b7 100644 (file)
@@ -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;
index 773cd213ceb2bd6487a52f48278da8b0f14c3bd4..cf72efa037f5ee98245f49097cf4829aa49092a1 100644 (file)
@@ -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;