]> granicus.if.org Git - graphviz/commitdiff
Fix a couple of bugs and warnings;
authorerg <devnull@localhost>
Tue, 3 Nov 2009 18:43:11 +0000 (18:43 +0000)
committererg <devnull@localhost>
Tue, 3 Nov 2009 18:43:11 +0000 (18:43 +0000)
add copyright, etc. to some new files

cmd/smyrna/draw.c
cmd/smyrna/gui/appmouse.c
cmd/smyrna/gui/appmouse.h
cmd/smyrna/gui/frmobjectui.c
cmd/smyrna/gui/frmobjectui.h
cmd/smyrna/topview.c

index 88687cabb583f24e08d6f41bb506f409733cdca6..139d9f60e5b5e362d2e0cdc38b7f3aafeecc7932 100755 (executable)
@@ -787,16 +787,16 @@ void drawCircle(float x, float y, float radius, float zdepth)
 }
 
 drawfunc_t OpFns[] = {
-    DrawEllipse,
-    DrawPolygon,
-    DrawBeziers,
-    DrawPolyline,
-    EmbedText,
-    SetFillColor,
-    SetPenColor,
-    SetFont,
-    SetStyle,
-    InsertImage,
+    (drawfunc_t)DrawEllipse,
+    (drawfunc_t)DrawPolygon,
+    (drawfunc_t)DrawBeziers,
+    (drawfunc_t)DrawPolyline,
+    (drawfunc_t)EmbedText,
+    (drawfunc_t)SetFillColor,
+    (drawfunc_t)SetPenColor,
+    (drawfunc_t)SetFont,
+    (drawfunc_t)SetStyle,
+    (drawfunc_t)InsertImage,
 };
 
 glCompColor GetglCompColor(char *color)
index bedf27b822433e89c3765b9b11a06328cca6a8b3..97ed5d43c372fc5f1f02b0787909ab48aeffc327 100644 (file)
@@ -1,3 +1,19 @@
+/* $Id$Revision: */
+/* vim:set shiftwidth=4 ts=8: */
+
+/**********************************************************
+*      This software is part of the graphviz package      *
+*                http://www.graphviz.org/                 *
+*                                                         *
+*            Copyright (c) 1994-2004 AT&T Corp.           *
+*                and is licensed under the                *
+*            Common Public License, Version 1.0           *
+*                      by AT&T Corp.                      *
+*                                                         *
+*        Information and Software Systems Research        *
+*              AT&T Research, Florham Park NJ             *
+**********************************************************/
+
 #include "appmouse.h"
 #include "topfisheyeview.h"
 #include "arcball.h"
@@ -58,7 +74,7 @@ static void appmouse_up(ViewInfo* v,int x,int y)
 }
 static void appmouse_drag(ViewInfo* v,int x,int y)
 {
-    static float x1,y1,x2,y2;
+    static float x2,y2;
     v->mouse.pos.x=x;
     v->mouse.pos.y=y;
     GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z);
index b41a0781af9cfb4d293ae9c52135e4a539142901..75cd1da4bae7f1212d6035c6f1613dc2093e2e91 100644 (file)
@@ -1,3 +1,19 @@
+/* $Id$Revision: */
+/* vim:set shiftwidth=4 ts=8: */
+
+/**********************************************************
+*      This software is part of the graphviz package      *
+*                http://www.graphviz.org/                 *
+*                                                         *
+*            Copyright (c) 1994-2004 AT&T Corp.           *
+*                and is licensed under the                *
+*            Common Public License, Version 1.0           *
+*                      by AT&T Corp.                      *
+*                                                         *
+*        Information and Software Systems Research        *
+*              AT&T Research, Florham Park NJ             *
+**********************************************************/
+
 #ifndef APPMOUSE_H
 #define APPMOUSE_H
 #include "smyrnadefs.h"
index a4d9de08f94bcf33db2ab10d4b0205b8707580c4..f1def3a16c6d7ba637f2da7dab92aebca2a0bf87 100644 (file)
@@ -124,8 +124,8 @@ attr_t* new_attr_ref(attr_t* refAttr)
 
 static void reset_attr_list_widgets(attr_list* l)
 {
-       int id=0;
-       for (id;id < MAX_FILTERED_ATTR_COUNT ;id ++)
+       int id;
+       for (id=0;id < MAX_FILTERED_ATTR_COUNT ;id ++)
        {
                gtk_label_set_text(l->fLabels[id],"");
        }
@@ -135,8 +135,8 @@ static void reset_attr_list_widgets(attr_list* l)
 
 static void free_attr_list_widgets(attr_list* l)
 {
-       int id=0;
-       for (id;id < MAX_FILTERED_ATTR_COUNT ;id ++)
+       int id;
+       for (id=0;id < MAX_FILTERED_ATTR_COUNT ;id ++)
        {
                gtk_object_destroy((GtkObject*)l->fLabels[id]);
        }
@@ -145,8 +145,8 @@ static void free_attr_list_widgets(attr_list* l)
 
 void free_attr_list(attr_list* l)
 {
-       int id=0;
-       for (id;id < l->attr_count; id ++)
+       int id;
+       for (id=0;id < l->attr_count; id ++)
        {
                free_attr(l->attributes[id]);
        }
@@ -156,7 +156,7 @@ void free_attr_list(attr_list* l)
 }
 attr_list* attr_list_new(Agraph_t * g,int with_widgets )
 {
-       int id=0;
+       int id;
        attr_list* l=malloc(sizeof(attr_list));
        l->attr_count=0;
        l->capacity=DEFAULT_ATTR_LIST_CAPACITY;
@@ -175,7 +175,7 @@ attr_list* attr_list_new(Agraph_t * g,int with_widgets )
     g_signal_connect((gpointer)glade_xml_get_widget(xml, "frmObject"), "motion_notify_event",  G_CALLBACK(attr_label_motion), NULL);*/
        if(with_widgets)
        {
-               for (id ; id < MAX_FILTERED_ATTR_COUNT ; id ++)
+               for (id=0 ; id < MAX_FILTERED_ATTR_COUNT ; id ++)
                {
                        l->fLabels[id]=(GtkLabel*)gtk_label_new(""); 
 
@@ -196,8 +196,8 @@ attr_list* attr_list_new(Agraph_t * g,int with_widgets )
 }
 void print_attr_list(attr_list* l)
 {
-       int id=0;
-       for (id;id < l->attr_count; id ++)
+       int id;
+       for (id=0;id < l->attr_count; id ++)
        {
                printf ("%d  %s (%d %d %d) \n",l->attributes[id]->index,l->attributes[id]->name,l->attributes[id]->objType[0],l->attributes[id]->objType[1],l->attributes[id]->objType[2]);
                printf ("defG:%s defN:%s defE:%s\n",l->attributes[id]->defValG,l->attributes[id]->defValN,l->attributes[id]->defValE);
@@ -219,7 +219,7 @@ static void attr_list_sort(attr_list* l)
 
 void attr_list_add(attr_list* l,attr_t* a)
 {
-       int id=0;
+       int id;
        if ( (!l) || (!a))
                return;
        l->attr_count ++ ;
@@ -232,7 +232,7 @@ void attr_list_add(attr_list* l,attr_t* a)
        if (l->attr_count > 1)
                attr_list_sort(l);
        /*update indices*/
-       for (id;id < l->attr_count; id ++)
+       for (id=0;id < l->attr_count; id ++)
                l->attributes[id]->index=id;
 
 
@@ -279,7 +279,7 @@ static void set_attr_object_type(char* str,int* t)
        char* a;
        a=strtok(str," ");
        object_type_helper(a,t);
-       while (a=strtok(NULL," or "))
+       while ((a=strtok(NULL," or ")))
                object_type_helper(a,t);
 
 }
@@ -379,7 +379,7 @@ void filter_attributes(char* prefix,topview* t)
 //void filter_attributes(char* prefix, attr_list* l)
 {
 
-       int ind=0;
+       int ind;
        int tmp;
 
        attr_list* l=t->attributes;
@@ -391,7 +391,7 @@ void filter_attributes(char* prefix,topview* t)
        fl=attr_list_new(NULL,0);
        reset_attr_list_widgets(l);
        create_filtered_list(prefix,l,fl);
-       for (ind;ind < fl->attr_count; ind ++)
+       for (ind=0;ind < fl->attr_count; ind ++)
        {
                gtk_label_set_text(l->fLabels[ind],fl->attributes[ind]->name);
        }
@@ -460,8 +460,7 @@ _BB void on_txtAttr_changed(GtkWidget * widget, gpointer user_data)
 
 _BB void on_attrApplyBtn_clicked (GtkWidget * widget, gpointer user_data)
 {
-       int ind=0;
-       int cnt=0;
+       int ind;
        char* attr_name;
        char* value;
        char* def_val;
@@ -494,9 +493,8 @@ _BB void on_attrApplyBtn_clicked (GtkWidget * widget, gpointer user_data)
        if(objKind==AGRAPH)
                        agset(g,attr_name,value);
        /*nodes*/
-       if(objKind==AGNODE)
-       {
-               for (ind;ind < view->Topview->Nodecount; ind ++)
+       else if(objKind==AGNODE) {
+               for (ind=0;ind < view->Topview->Nodecount; ind ++)
                {
                        n=&t->Nodes[ind];
                        if (n->data.Selected)
@@ -506,18 +504,20 @@ _BB void on_attrApplyBtn_clicked (GtkWidget * widget, gpointer user_data)
                }
        }
        /*edges*/
-       if(objKind==AGEDGE)
-       {
+       else if(objKind==AGEDGE) {
 
-               for (ind;ind < view->Topview->Edgecount; ind ++)
+               for (ind=0;ind < view->Topview->Edgecount; ind ++)
                {
                        e=&t->Edges[ind];
                        if (e->data.Selected)
                                agset(e->Edge,attr_name,value);
                }
        }
+       else
+           fprintf (stderr, "on_attrApplyBtn_clicked: unknown object kind %d\n",
+               objKind);
 }
-_BB on_attrRB0_clicked (GtkWidget * widget, gpointer user_data)
+_BB void on_attrRB0_clicked (GtkWidget * widget, gpointer user_data)
 {
        filter_attributes((char*)
                gtk_entry_get_text((GtkEntry*)glade_xml_get_widget(xml, "txtAttr")),view->Topview);
@@ -531,13 +531,15 @@ _BB void on_attrProg_toggled (GtkWidget * widget, gpointer user_data)
 
 _BB void attr_label_motion(GtkWidget * widget,GdkEventMotion * event, gpointer data)
 {
+#ifdef UNUSED
     float x = (float) event->x;
     float y = (float) event->y;
-//     printf ("%f %f \n",x,y);
+    printf ("%f %f \n",x,y);
+#endif
 }
 _BB void on_attrAddBtn_clicked (GtkWidget * widget, gpointer user_data)
 {
-       int ind=0;
+       int ind;
        int cnt=0;
        char* attr_name;
        char* value;
@@ -575,17 +577,15 @@ _BB void on_attrAddBtn_clicked (GtkWidget * widget, gpointer user_data)
        }
        attr->propagate=0;
 
-       if (objKind==AGRAPH)
-       {
+       if (objKind==AGRAPH) {
                agattr(g, AGRAPH, attr_name,defValue);
                attr->defValG=safestrdup(defValue);
                attr->objType[0]=1;
        }
 
        /*nodes*/
-       if (objKind==AGNODE)
-       {
-               for (ind;ind < view->Topview->Nodecount; ind ++)
+       else if (objKind==AGNODE) {
+               for (ind=0;ind < view->Topview->Nodecount; ind ++)
                {
                        n=&t->Nodes[ind];
                        if (n->data.Selected)
@@ -605,12 +605,11 @@ _BB void on_attrAddBtn_clicked (GtkWidget * widget, gpointer user_data)
 
 
        }
-       if (objKind==AGEDGE)
-       {
+       else if (objKind==AGEDGE) {
        
                cnt=0;
                /*edges*/
-               for (ind;ind < view->Topview->Edgecount; ind ++)
+               for (ind=0;ind < view->Topview->Edgecount; ind ++)
                {
                        e=&t->Edges[ind];
                        if (e->data.Selected)
@@ -627,9 +626,11 @@ _BB void on_attrAddBtn_clicked (GtkWidget * widget, gpointer user_data)
                attr->objType[2]=1;
 
        }
+       else
+           fprintf (stderr, "on_attrAddBtn_clicked: unknown object kind %d\n",
+               objKind);
        filter_attributes(attr_name,view->Topview);
 
-
 }
 
 attr_list* load_attr_list(Agraph_t* g)
@@ -657,7 +658,7 @@ attr_list* load_attr_list(Agraph_t* g)
                        a=strtok(line,",");
                        attr->index=i;
                        attr->type=get_attr_data_type(a[0]);
-                       while (a=strtok(NULL,","))
+                       while ((a=strtok(NULL,",")))
                        {
                                        /*C,(0)color, (1)black, (2)EDGE Or NODE Or CLUSTER, (3)ALL_ENGINES*/
 
@@ -721,7 +722,7 @@ static void set_header_text()
        int nodeCnt;
        int edgeCnt;
        static char buf[512];
-       int ind=0;
+       int ind;
 
        topview* t;
        topview_node* n;
@@ -734,7 +735,7 @@ static void set_header_text()
        t=view->Topview;
 
 
-       for (ind;ind < view->Topview->Nodecount; ind ++)
+       for (ind=0;ind < view->Topview->Nodecount; ind ++)
        {
                n=&t->Nodes[ind];
                if (n->data.Selected)
@@ -742,7 +743,7 @@ static void set_header_text()
                        nodeCnt++;
                }
        }
-       for (ind;ind < view->Topview->Edgecount; ind ++)
+       for (ind=0;ind < view->Topview->Edgecount; ind ++)
        {
                e=&t->Edges[ind];
                if (e->data.Selected)
index 681f758af6737f7a4465e5151638a2dd7579cac9..2655b0b9d116b5242892a91039f2436ad1a4b642 100644 (file)
@@ -1,4 +1,18 @@
+/* $Id$Revision: */
+/* vim:set shiftwidth=4 ts=8: */
 
+/**********************************************************
+*      This software is part of the graphviz package      *
+*                http://www.graphviz.org/                 *
+*                                                         *
+*            Copyright (c) 1994-2004 AT&T Corp.           *
+*                and is licensed under the                *
+*            Common Public License, Version 1.0           *
+*                      by AT&T Corp.                      *
+*                                                         *
+*        Information and Software Systems Research        *
+*              AT&T Research, Florham Park NJ             *
+**********************************************************/
 
 #ifndef FRMOBJECTUI_H
 #define FRMOBJECTUI_H
 */
 
 #define ATTR_NOTEBOOK_IDX 6
+
 extern attr_list* attr_list_new(Agraph_t * g,int with_widgets );
 extern void attr_list_add(attr_list* l,attr_t* a);
 extern void free_attr_list(attr_list* l);
 extern attr_list* load_attr_list();
 extern void filter_attributes(char* prefix,topview* t);
+
 _BB void on_txtAttr_changed(GtkWidget * widget, gpointer user_data);
 _BB void attr_label_motion(GtkWidget * widget,GdkEventMotion * event, gpointer data);
 _BB void on_attrApplyBtn_clicked (GtkWidget * widget, gpointer user_data);
 _BB void on_attrAddBtn_clicked (GtkWidget * widget, gpointer user_data);
-_BB on_on_attrRB0_clicked (GtkWidget * widget, gpointer user_data);
+
 extern attr_list* load_attr_list(Agraph_t* g);
 extern void showAttrsWidget(topview* t);
-#endif
\ No newline at end of file
+
+#endif
index 531a6b72f9f12eab1ca0a909cd7de03aac4924a9..4c2f32ba4b4402b9425b338b4bd971ed07bfc808 100755 (executable)
@@ -265,16 +265,17 @@ void settvcolorinfo(Agraph_t * g, topview * t)
 
 }
 
+#if UNUSED
 static xdot *parseXdotwithattr(void *p, char *attr)
 {
-       int ind=0;
+       int ind;
        xdot *xDot;
        xdot_op* x_op;
        sdot_op* s_op;
     xDot = parseXDotF(agget(p, attr), OpFns, sizeof(sdot_op));
        if (!xDot)
                        return NULL;
-       for (ind ; ind < xDot->cnt; ind ++)
+       for (ind = 0 ; ind < xDot->cnt; ind ++)
        {
                x_op=&(xDot->ops[ind]);
                s_op=(sdot_op*)x_op;
@@ -283,6 +284,7 @@ static xdot *parseXdotwithattr(void *p, char *attr)
        }
        return xDot;
 }
+#endif
 
 static xdot* parseXdotwithattrs(void *e)
 {