From 82d8a5fedf11bcc9bdc59c3cadadc0dfc2220553 Mon Sep 17 00:00:00 2001 From: ellson Date: Sat, 7 Nov 2009 13:37:06 +0000 Subject: [PATCH] janitor cleanups proper function declarations proper return values --- cmd/smyrna/Makefile.am | 8 ++++---- cmd/smyrna/btree.c | 4 ++-- cmd/smyrna/draw.c | 1 + cmd/smyrna/glexpose.c | 5 +++-- cmd/smyrna/glmotion.c | 1 + cmd/smyrna/gui/appmouse.c | 2 ++ cmd/smyrna/gui/frmobjectui.c | 6 +++--- cmd/smyrna/gui/frmobjectui.h | 1 - cmd/smyrna/gui/glcompui.c | 1 + cmd/smyrna/gui/topviewsettings.h | 2 +- cmd/smyrna/hotkeymap.c | 1 + cmd/smyrna/topview.c | 5 +++-- cmd/smyrna/topview.h | 22 +++++++++++----------- cmd/smyrna/viewport.c | 4 ++-- 14 files changed, 35 insertions(+), 28 deletions(-) diff --git a/cmd/smyrna/Makefile.am b/cmd/smyrna/Makefile.am index 7e80a1c24..601cbfe0a 100644 --- a/cmd/smyrna/Makefile.am +++ b/cmd/smyrna/Makefile.am @@ -26,19 +26,19 @@ endif noinst_HEADERS = btree.h draw.h filter.h glexpose.h glmotion.h gltemplate.h \ hier.h materials.h selection.h smyrnadefs.h support.h topview.h \ - topviewdata.h topviewdefs.h trackball.h tvnodes.h viewport.h \ + topviewdata.h topviewdefs.h trackball.h tvnodes.h viewport.h hotkeymap.h \ topfisheyeview.h viewportcamera.h gvprpipe.h md5.h drawxdot.h arcball.h \ gui/beacon.h gui/callbacks.h gui/datalistcallbacks.h gui/filterscallbacks.h \ gui/frmobjectui.h gui/glcompui.h gui/gui.h gui/menucallbacks.h \ - gui/toolboxcallbacks.h gui/topviewsettings.h gui/appmouse.h hotkeymap.h + gui/toolboxcallbacks.h gui/topviewsettings.h gui/appmouse.h smyrna_SOURCES = btree.c draw.c filter.c glexpose.c glmotion.c gltemplate.c \ hier.c main.c selection.c support.c template.c topview.c topviewdata.c \ topfisheyeview.c trackball.c tvnodes.c viewport.c viewportcamera.c \ - gvprpipe.c md5.c drawxdot.c arcball.c \ + gvprpipe.c md5.c drawxdot.c arcball.c hotkeymap.c \ gui/beacon.c gui/callbacks.c gui/datalistcallbacks.c gui/filterscallbacks.c \ gui/frmobjectui.c gui/glcompui.c gui/gui.c gui/menucallbacks.c \ - gui/toolboxcallbacks.c gui/topviewsettings.c gui/appmouse.c hotkeymap.c + gui/toolboxcallbacks.c gui/topviewsettings.c gui/appmouse.c smyrna_LDADD = $(top_builddir)/lib/cgraph/libcgraph_C.la \ $(top_builddir)/lib/cdt/libcdt_C.la \ diff --git a/cmd/smyrna/btree.c b/cmd/smyrna/btree.c index c1cb89306..eb2cee88b 100644 --- a/cmd/smyrna/btree.c +++ b/cmd/smyrna/btree.c @@ -133,7 +133,7 @@ int print_children(btree_node * n) } -int sample_tree() +int sample_tree(void) { btree_node *root; btree_node *n; @@ -179,7 +179,7 @@ btree_node *tree_from_filter_string(char *filter_string) char *b_cursor = 0; char *c_cursor; char op = '\0'; - char last_char; + char last_char = '\0'; root = new_node("R", "", 0, 0); cursor = root; c_cursor = filter_string; diff --git a/cmd/smyrna/draw.c b/cmd/smyrna/draw.c index f437f7eb2..29f8f230e 100755 --- a/cmd/smyrna/draw.c +++ b/cmd/smyrna/draw.c @@ -29,6 +29,7 @@ XDOT DRAWING FUNCTIONS, maybe need to move them somewhere else #include "viewport.h" #include "topfisheyeview.h" #include "appmouse.h" +#include "hotkeymap.h" //delta values static float dx = 0.0; diff --git a/cmd/smyrna/glexpose.c b/cmd/smyrna/glexpose.c index 8dcd03891..e40196a61 100644 --- a/cmd/smyrna/glexpose.c +++ b/cmd/smyrna/glexpose.c @@ -22,6 +22,7 @@ #include "topfisheyeview.h" #include "gui/toolboxcallbacks.h" #include "arcball.h" +#include "hotkeymap.h" void drawRotatingAxis(void); void draw_cube() @@ -164,7 +165,7 @@ int glexpose_main(ViewInfo * view) } } else - return; + return 0; glexpose_grid(view); draw_fisheye_magnifier(view); @@ -320,4 +321,4 @@ void drawRotatingTools(void) } } -*/ \ No newline at end of file +*/ diff --git a/cmd/smyrna/glmotion.c b/cmd/smyrna/glmotion.c index 6436cf888..d88191cb8 100644 --- a/cmd/smyrna/glmotion.c +++ b/cmd/smyrna/glmotion.c @@ -22,6 +22,7 @@ #include "draw.h" #include "topview.h" #include "glutils.h" +#include "hotkeymap.h" gboolean redraw = FALSE; diff --git a/cmd/smyrna/gui/appmouse.c b/cmd/smyrna/gui/appmouse.c index 6326f78eb..1b08f0420 100644 --- a/cmd/smyrna/gui/appmouse.c +++ b/cmd/smyrna/gui/appmouse.c @@ -20,6 +20,8 @@ #include "topview.h" #include "glmotion.h" #include "beacon.h" +#include "hotkeymap.h" +#include "selection.h" static float prevX=0; diff --git a/cmd/smyrna/gui/frmobjectui.c b/cmd/smyrna/gui/frmobjectui.c index f1def3a16..5e13f3d6f 100644 --- a/cmd/smyrna/gui/frmobjectui.c +++ b/cmd/smyrna/gui/frmobjectui.c @@ -47,7 +47,7 @@ static char* safestrdup(char* src) else return strdup(src); } -static int get_object_type() +static int get_object_type(void) { if(gtk_toggle_button_get_active((GtkToggleButton*)glade_xml_get_widget(xml, "attrRB0"))) return AGRAPH; @@ -68,7 +68,7 @@ void free_attr(attr_t* at) } -attr_t* new_attr() +attr_t* new_attr(void) { attr_t* attr=malloc(sizeof(attr_t)); attr->defValG=(char*)0; @@ -717,7 +717,7 @@ attr_list* load_attr_list(Agraph_t* g) } /**/ -static void set_header_text() +static void set_header_text(void) { int nodeCnt; int edgeCnt; diff --git a/cmd/smyrna/gui/frmobjectui.h b/cmd/smyrna/gui/frmobjectui.h index 2655b0b9d..d775ba8bb 100644 --- a/cmd/smyrna/gui/frmobjectui.h +++ b/cmd/smyrna/gui/frmobjectui.h @@ -33,7 +33,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); diff --git a/cmd/smyrna/gui/glcompui.c b/cmd/smyrna/gui/glcompui.c index 9ab4935a3..6c6f823e8 100644 --- a/cmd/smyrna/gui/glcompui.c +++ b/cmd/smyrna/gui/glcompui.c @@ -25,6 +25,7 @@ #include "topfisheyeview.h" #include "toolboxcallbacks.h" #include "viewportcamera.h" +#include "selection.h" #include "frmobjectui.h" diff --git a/cmd/smyrna/gui/topviewsettings.h b/cmd/smyrna/gui/topviewsettings.h index 3fa54358d..185dd3c3f 100644 --- a/cmd/smyrna/gui/topviewsettings.h +++ b/cmd/smyrna/gui/topviewsettings.h @@ -31,7 +31,7 @@ extern "C" { extern int load_settings_from_graph(Agraph_t * g); extern int update_graph_from_settings(Agraph_t * g); - extern int show_settings_form(); + extern int show_settings_form(void); #ifdef __cplusplus } /* end extern "C" */ diff --git a/cmd/smyrna/hotkeymap.c b/cmd/smyrna/hotkeymap.c index 919ca5c95..7c2e43d7c 100644 --- a/cmd/smyrna/hotkeymap.c +++ b/cmd/smyrna/hotkeymap.c @@ -34,4 +34,5 @@ int get_mode(ViewInfo* v) if ((view->mouse.t==MOUSE_BUTTON_2)&&(view->mouse.down) ) return MM_RECTANGULAR_SELECT; + return 0; } diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 3edbe7b1c..8710b8043 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -39,6 +39,7 @@ #include "colorprocs.h" #include #include "frmobjectui.h" +#include "hotkeymap.h" static float dx = 0.0; static float dy = 0.0; static float dz = 0.0; @@ -1097,13 +1098,13 @@ int move_TVnodes(void) { float delX,delY; topview_node *v; - static flag=0; + static int flag=0; int ind = 0; if (!flag) { // printf ("dragx:%f dragy:%f\n",view->mouse.dragX,view->mouse.dragY); flag=1; - return; + return 0; } delX = GetOGLDistance((int) view->mouse.dragX); diff --git a/cmd/smyrna/topview.h b/cmd/smyrna/topview.h index b1a6be429..ddc6fbb38 100755 --- a/cmd/smyrna/topview.h +++ b/cmd/smyrna/topview.h @@ -23,18 +23,18 @@ extern "C" { #endif - void cleartopview(topview * t); - void preparetopview(Agraph_t * g, topview * t); - void update_topview(Agraph_t * g, topview * t, int init); - void drawTopViewGraph(Agraph_t * g); - int move_TVnodes(void); - void local_zoom(topview * t); - void originate_distorded_coordinates(topview * t); - float calcfontsize(float totaledgelength, int totallabelsize, + extern void cleartopview(topview * t); + extern void preparetopview(Agraph_t * g, topview * t); + extern void update_topview(Agraph_t * g, topview * t, int init); + extern void drawTopViewGraph(Agraph_t * g); + extern int move_TVnodes(void); + extern void local_zoom(topview * t); + extern void originate_distorded_coordinates(topview * t); + extern float calcfontsize(float totaledgelength, int totallabelsize, int edgecount, int totalnodecount); - void select_with_regex(char *exp); - void settvcolorinfo(Agraph_t * g, topview * t); - void setMultiedges(Agraph_t * g, char *attrname); + extern void select_with_regex(char *exp); + extern void settvcolorinfo(Agraph_t * g, topview * t); + extern void setMultiedges(Agraph_t * g, char *attrname); #ifdef __cplusplus } /* end extern "C" */ diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index 20b9d3fbd..1d5216236 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -330,7 +330,7 @@ static gboolean gl_main_expose(gpointer data) return 1; } -static void get_data_dir() +static void get_data_dir(void) { if (view->template_file) { free(view->template_file); @@ -1117,7 +1117,7 @@ colorschemaset *create_color_theme(int themeid) } -void test_color_pallete() +void test_color_pallete(void) { int ind = 0; float xGAP = 5; -- 2.40.0