[gnome-network]compiler warning cleanup



Hi,

Here is a patch that cleans up most of the compiler warnings that are now generated in netinfo.

Ok to commit?

Jon
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/ChangeLog,v
retrieving revision 1.97
diff -u -r1.97 ChangeLog
--- ChangeLog	19 Nov 2003 16:19:10 -0000	1.97
+++ ChangeLog	19 Nov 2003 18:08:28 -0000
@@ -1,5 +1,25 @@
 2003-11-19  William Jon McCann  <mccann jhu edu>
 
+	* main.c (main, load_info_widgets_from_xml): 
+	* util-mii.c: 
+	* whois.c (whois_do, whois_foreach): 
+	* finger.c (finger_do, finger_foreach): 
+	* lookup.c (lookup_do, lookup_foreach, lookup_create_model): 
+	* scan.c (scan_do, scan_foreach): 
+	* info.c (info_load_iface, info_nic_update_stats) 
+	(info_copy_to_clipboard): 
+	* netstat.c (netstat_get_active_option2, netstat_do) 
+	(netstat_foreach, netstat_foreach_with_tree) 
+	(netstat_copy_to_clipboard, strip_protocol_line) 
+	(strip_multicast_line, strip_route_line): 
+	* traceroute.c (traceroute_do, traceroute_foreach): 
+	* ping.c (ping_do, ping_foreach_with_tree, strip_line): 
+	* netinfo.c (netinfo_get_count, netinfo_text_buffer_insert) 
+	(netinfo_io_text_buffer_dialog, netinfo_toggle_button): 
+	* ping.h:
+	Clean up compiler warnings.  Mostly removed unused variables and
+	added prototypes.
+	
 	* netinfo.h: 
 	* main.c (main): 
 	* gnome-netinfo.glade: 
Index: callbacks.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/callbacks.c,v
retrieving revision 1.27
diff -u -r1.27 callbacks.c
--- callbacks.c	19 Nov 2003 16:19:10 -0000	1.27
+++ callbacks.c	19 Nov 2003 18:08:28 -0000
@@ -24,18 +24,19 @@
 
 #include <gnome.h>
 
+#include <sys/wait.h>
+#include <unistd.h>
+#include <sys/types.h>
+
 #include "callbacks.h"
 #include "traceroute.h"
 #include "info.h"
 #include "ping.h"
 #include "netstat.h"
 #include "scan.h"
+#include "lookup.h"
 #include "finger.h"
 #include "whois.h"
-
-#include "sys/wait.h"
-#include "unistd.h"
-#include "sys/types.h"
 
 /* Ping callbacks */
 void
Index: finger.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/finger.c,v
retrieving revision 1.1
diff -u -r1.1 finger.c
--- finger.c	31 Jul 2003 20:34:40 -0000	1.1
+++ finger.c	19 Nov 2003 18:08:29 -0000
@@ -35,16 +35,15 @@
 {
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter start, end;
-	gushort count;
-	gchar *host = NULL;
-	gchar *user = NULL;
+	const gchar *host = NULL;
+	const gchar *user = NULL;
 	gchar *command = NULL;
 	gchar *program = NULL;
 	GtkWidget *parent;
 
 	gchar **command_line;
 	gchar **command_options;
-	gchar *tmptr;
+
 	gint i, j, num_terms;
 	gchar *command_arg = NULL;
 	gboolean user_is_set, host_is_set;
@@ -52,9 +51,7 @@
 	g_return_if_fail (netinfo != NULL);
 
 	host = netinfo_get_host (netinfo);
-	g_strstrip (host);
 	user = netinfo_get_user (netinfo);
-	g_strstrip (user);
 
 	buffer =
 		gtk_text_view_get_buffer (GTK_TEXT_VIEW (netinfo->output));
@@ -124,7 +121,6 @@
 {
 	gchar *text_utf8;
 	gssize bytes_written;
-	GtkWidget *entry = NULL;
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter iter;
 	
Index: info.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/info.c,v
retrieving revision 1.18
diff -u -r1.18 info.c
--- info.c	24 Jul 2003 21:34:16 -0000	1.18
+++ info.c	19 Nov 2003 18:08:29 -0000
@@ -1,3 +1,4 @@
+/* -*- mode:C; indent-tabs-mode:t; tab-width:8; c-basic-offset:8; -*- */
 /* gnome-netinfo - A GUI Interface for network utilities
  * Copyright (C) 2002, 2003 by German Poo-Caaman~o
  *
@@ -37,13 +38,8 @@
 #include "utils.h"
 #include "util-mii.h"
 
-/* 
-#ifdef IFCONFIG_PROGRAM
-
-#define IFCONFIG IFCONFIG_PROGRAM " -s"
-*/
-
-GList * info_get_interfaces ();
+static gboolean info_nic_update_stats (gpointer data);
+static GList * info_get_interfaces (void);
 
 void
 info_do (const gchar * nic, Netinfo * info)
@@ -55,10 +51,6 @@
 info_load_iface (Netinfo * info, GtkWidget * combo)
 {
 	GList *items = NULL;
-	FILE *pfp;
-	GIOChannel *io = NULL;
-	gchar *line, *iface, rest[1000];
-	gboolean title = TRUE;
 
 	items = info_get_interfaces ();
 	if (items != NULL) {
@@ -68,8 +60,9 @@
 	g_list_free (items);
 }
 
-gboolean
-info_nic_update_stats (gpointer data) {
+static gboolean
+info_nic_update_stats (gpointer data)
+{
 	Netinfo *info = data;
 	/*
 	gchar mtu[10], met[10], rx[10], rx_error[10], rx_drop[10], rx_ovr[10];
@@ -81,7 +74,6 @@
 	gchar tx_bytes[16], tx_pkt[10], tx_error[10], tx_drop[10], tx_fifo[10];
 	gchar collissions[10];
 
-	FILE *pfp;
 	GIOChannel *io = NULL;
 	gchar *line;
 	gboolean title = TRUE;
@@ -93,10 +85,6 @@
 	text = gtk_entry_get_text (GTK_ENTRY (info->nic));
 	
 #if defined(__linux__)
-/*	
-	pfp = popen (IFCONFIG, "r");
-	io = g_io_channel_unix_new (fileno (pfp));
-*/
 	io = g_io_channel_new_file ("/proc/net/dev", "r", NULL);
 	
 	while (g_io_channel_read_line (io, &line, NULL, NULL, NULL) == G_IO_STATUS_NORMAL) {
@@ -137,9 +125,6 @@
 	}
 	
 	g_io_channel_unref (io);
-	/*
-	pclose (pfp);
-	*/
 #endif /* defined(__linux__) */
 
 	return TRUE;
@@ -174,10 +159,9 @@
 	gint sockfd, len;
 	gchar *ptr, buf[2048], dst[INFO_ADDRSTRLEN];
 	struct ifconf ifc;
-	struct ifreq *ifr, ifrcopy;
+	struct ifreq *ifr = NULL, ifrcopy;
 	struct sockaddr_in *sinptr;
 	gint flags;
-	gboolean loopback;
 	mii_data_result data;
 		
 	sockfd = socket (AF_INET, SOCK_DGRAM, 0);
@@ -325,13 +309,12 @@
 	g_free (ifr);
 }
 
-GList *
+static GList *
 info_get_interfaces ()
 {
 	GList *items = NULL;
 	gchar *iface;
 	gchar *ptr, buf[2048];
-	struct sockaddr_in *sinptr;
 	struct ifconf ifc;
 	struct ifreq *ifr;
 	int sockfd, len;
@@ -360,21 +343,16 @@
 	return items;
 }
 
-/*
-#endif
-*/
-
 /* Copy on clipboard */
 void
 info_copy_to_clipboard (Netinfo * netinfo, gpointer user_data)
 {
-	GString *result, *content;
+	GString *result;
 	const gchar *nic;
 	const gchar *hw_address;
 	const gchar *ip_address;
 	const gchar *broadcast;
 	const gchar *netmask;
-	const gchar *dst_address;
 	const gchar *multicast;
 	const gchar *link_speed;
 	const gchar *state;
Index: lookup.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/lookup.c,v
retrieving revision 1.9
diff -u -r1.9 lookup.c
--- lookup.c	18 Nov 2003 21:55:54 -0000	1.9
+++ lookup.c	19 Nov 2003 18:08:29 -0000
@@ -55,9 +55,6 @@
 void
 lookup_do (Netinfo * netinfo)
 {
-	GtkTextBuffer *buffer = NULL;
-	GtkTextIter start, end;
-	gushort count;
 	const gchar *host = NULL;
 	gchar *command = NULL;
 	gchar *program = NULL;
@@ -70,7 +67,6 @@
 	const gchar *query_types[12] = {"", "A", "CNAME", "HINFO", "MX", "MINFO", "NS", "PTR", "SOA", "TXT", "WKS", "ANY"};
 	gchar **command_line;
 	gchar **command_options;
-	gchar *tmptr;
 	gint i, j, num_terms;
 
 	g_return_if_fail (netinfo != NULL);
@@ -92,14 +88,6 @@
 	active_item = gtk_menu_get_active (GTK_MENU (menu));
 	active_index = g_list_index (GTK_MENU_SHELL (menu)->children, active_item);
 
-/*	buffer =
-		gtk_text_view_get_buffer (GTK_TEXT_VIEW (netinfo->output));
-
-	gtk_text_buffer_get_start_iter (buffer, &start);
-	gtk_text_buffer_get_end_iter (buffer, &end);
-
-	gtk_text_buffer_delete (buffer, &start, &end);*/
-
 	parent = gtk_widget_get_toplevel (netinfo->output);
 	
 	program = util_find_program_dialog ("dig", parent);
@@ -151,7 +139,6 @@
 {
 	gchar *text_utf8;
 	gssize bytes_written;
-	GtkWidget *entry = NULL;
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter iter;
 	
@@ -175,14 +162,13 @@
 
 void
 lookup_foreach_with_tree (Netinfo * netinfo, gchar * line, gint len,
-			      gpointer user_data)
+			  gpointer user_data)
 {
 	GtkTreeIter iter, sibling;
 	GList *columns;
 	GtkTreePath *path;
 	GtkTreeModel *model;
 	GtkTreeView *widget;
-	const gchar *text;
 	gint count;
 	lookup_data data;
 
@@ -192,7 +178,6 @@
 	widget = (GTK_TREE_VIEW (netinfo->output));
 
 	if (len > 0) {		/* there are data to show */
-		//count = traceroute_strip_line (line, &data);
 		count = strip_line (line, &data);
 
 		if (count == LOOKUP_NUM_ARGS) {
@@ -285,7 +270,7 @@
 	column =
 	    gtk_tree_view_column_new_with_attributes
 	    (_("Name"), renderer, "text", LOOKUP_SOURCE, NULL);
-//	g_object_set (G_OBJECT (renderer), "xalign", 1.0);
+
 	gtk_tree_view_append_column (widget, column);
 
 	renderer = gtk_cell_renderer_text_new ();
@@ -312,7 +297,7 @@
 	column =
 	    gtk_tree_view_column_new_with_attributes
 	    (_("Record Type"), renderer, "text", LOOKUP_RECORD_TYPE, NULL);
-//	g_object_set (G_OBJECT (renderer), "xalign", 1.0);
+
 	gtk_tree_view_append_column (widget, column);
 
 
@@ -321,7 +306,7 @@
 	column =
 	    gtk_tree_view_column_new_with_attributes
 	    (_("Address"), renderer, "text", LOOKUP_DESTINATION, NULL);
-//	g_object_set (G_OBJECT (GTK_CELL_RENDERER (renderer)), "xalign", 1.0);
+
 	gtk_tree_view_append_column (widget, column);
 
 	model = GTK_TREE_MODEL (gtk_list_store_new
Index: main.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/main.c,v
retrieving revision 1.39
diff -u -r1.39 main.c
--- main.c	19 Nov 2003 16:19:10 -0000	1.39
+++ main.c	19 Nov 2003 18:08:29 -0000
@@ -24,6 +24,7 @@
 
 #include <gnome.h>
 #include <glade/glade.h>
+
 #include "callbacks.h"
 #include "ping.h"
 #include "traceroute.h"
@@ -48,8 +49,6 @@
 {
 	GtkWidget *window;
 	GladeXML *xml;
-	GtkWidget *output, *entry;
-	GtkWidget *scroll;
 	GtkWidget *notebook;
 	const gchar *dialog = DATADIR "gnome-netinfo.glade";
 	Netinfo *pinger;
@@ -268,7 +267,7 @@
 load_info_widgets_from_xml (GladeXML * xml)
 {
 	Netinfo *info;
-	GtkWidget *entry, *combo;
+	GtkWidget *combo;
 	GtkWidget *vbox_info;
 
 	g_return_val_if_fail (xml != NULL, NULL);
Index: netinfo.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/netinfo.c,v
retrieving revision 1.16
diff -u -r1.16 netinfo.c
--- netinfo.c	18 Nov 2003 21:55:54 -0000	1.16
+++ netinfo.c	19 Nov 2003 18:08:29 -0000
@@ -28,14 +28,9 @@
 #include "netinfo.h"
 #include "utils.h"
 
-static GtkTreeModel *protocol_model;
-static GtkTreeModel *route_model;
-static GtkTreeModel *multicast_model;
-
 gushort
 netinfo_get_count (Netinfo * netinfo)
 {
-	gushort count = 0;
 
 	g_return_val_if_fail (netinfo != NULL, 1);
 
@@ -179,7 +174,6 @@
 netinfo_text_buffer_insert (Netinfo * netinfo)
 {
 	gchar *dir = g_get_current_dir ();
-	gchar *argv[6];
 	gint child_pid, pout, perr;
 	GIOChannel *channel;
 	GError *err = NULL;
@@ -228,10 +222,8 @@
 netinfo_io_text_buffer_dialog (GIOChannel * channel,
 			       GIOCondition condition, gpointer data)
 {
-	gchar *text, *text_utf8;
+	gchar *text;
 	gint len;
-	gssize bytes_written;
-	GtkWidget *entry = NULL;
 	Netinfo *netinfo = (Netinfo *) data;
 
 	g_return_val_if_fail (channel != NULL, FALSE);
@@ -335,7 +327,7 @@
 void
 netinfo_toggle_button (Netinfo * netinfo)
 {
-	GtkWidget *parent, *alignment, *hbox, *label, *image;
+	GtkWidget *parent, *alignment, *hbox, *label;
 	GtkWidget *button, *icon;
 	gchar *text;
 
Index: netstat.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/netstat.c,v
retrieving revision 1.10
diff -u -r1.10 netstat.c
--- netstat.c	31 Aug 2003 16:18:24 -0000	1.10
+++ netstat.c	19 Nov 2003 18:08:29 -0000
@@ -1,3 +1,4 @@
+/* -*- mode:C; indent-tabs-mode:t; tab-width:8; c-basic-offset:8; -*- */
 /* gnome-netinfo - A GUI Interface for network utilities
  * Copyright (C) 2002 by German Poo-Caaman~o
  *
@@ -32,8 +33,10 @@
 static gint strip_multicast_line (gchar * line, netstat_multicast_data *data);
 void netstat_create_multicast_model (GtkTreeView *widget);
 
+static NetstatOption netstat_get_active_option2 (Netinfo * netinfo);
+static gchar * netstat_get_active_option (Netinfo * netinfo);
+
 static GtkTreeModel *protocol_model, *route_model, *multicast_model;
-static GtkTreeView *protocol_view, *route_view, *multicast_view;
 
 void clean_gtk_tree_view (GtkTreeView *widget);
 
@@ -41,7 +44,8 @@
  * the right GtkTreeModel
  */
 void
-on_protocol_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) {
+on_protocol_button_toggled (GtkToggleButton *togglebutton, gpointer user_data)
+{
 	GtkTreeView *widget;
 	Netinfo *netinfo = user_data;
 	/* GtkWidget *parent, *child; */
@@ -77,10 +81,10 @@
 	/* gtk_widget_unref (child); */
 }
 
-NetstatOption 
+static NetstatOption
 netstat_get_active_option2 (Netinfo * netinfo)
 {
-	NetstatOption  option;
+	NetstatOption option = NONE;
 	
 	g_return_val_if_fail (netinfo != NULL, ROUTE);
 	
@@ -96,7 +100,7 @@
 	return option;
 }
 
-gchar *
+static gchar *
 netstat_get_active_option (Netinfo * netinfo)
 {
 	gchar *option = NULL;
@@ -119,7 +123,8 @@
 }
 
 void
-netstat_stop (Netinfo * netinfo) {
+netstat_stop (Netinfo * netinfo)
+{
 	g_return_if_fail (netinfo != NULL);
 	
 	netinfo_stop_process_command (netinfo);
@@ -128,8 +133,6 @@
 void
 netstat_do (Netinfo * netinfo)
 {
-	GtkTextBuffer *buffer = NULL;
-	GtkTextIter start, end;
 	gchar *command = NULL;
 	gchar *option = NULL;
 	gchar *program = NULL;
@@ -145,21 +148,12 @@
 		gtk_list_store_clear (GTK_LIST_STORE (model));
 	}
 
-/*	buffer =
-	    gtk_text_view_get_buffer (GTK_TEXT_VIEW (netinfo->output));
-
-	gtk_text_buffer_get_start_iter (buffer, &start);
-	gtk_text_buffer_get_end_iter (buffer, &end);
-
-	gtk_text_buffer_delete (buffer, &start, &end);
-*/
 	parent = gtk_widget_get_toplevel (netinfo->output);
 	
 	program = util_find_program_dialog ("netstat", parent);
 
 	if (program != NULL) {
 		command =
-//			g_strdup_printf ("%s netstat %s", NETSTAT_PROGRAM, option);
 			g_strdup_printf ("%s netstat %s", program, option);
 	
 		netinfo->command_line = g_strsplit (command, " ", -1);
@@ -180,7 +174,6 @@
 {
 	gchar *text_utf8;
 	gssize bytes_written;
-	GtkWidget *entry = NULL;
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter iter;
 	
@@ -230,7 +223,7 @@
 */
 void
 netstat_foreach_with_tree (Netinfo * netinfo, gchar * line, gint len,
-			gpointer user_data)
+			   gpointer user_data)
 {
 	GtkTreeView *widget;
 
@@ -251,20 +244,23 @@
 		case MULTICAST:
 			netstat_multicast_tree_insert (widget, line);
 			break;
+		case NONE:
+		default:
+			break;
 		}
 	}
 }
 
 /* PROTOCOL */
 void
-netstat_protocol_tree_insert (GtkTreeView *widget, gchar *line) {
+netstat_protocol_tree_insert (GtkTreeView *widget, gchar *line)
+{
 	GtkTreeIter iter, sibling;
-	GList *columns;
+	/*GList *columns;*/
 	GtkTreePath *path;
 	GtkTreeModel *model;
 	gint count;
 	netstat_protocol_data data;
-	struct protoent *protocol = NULL;
 
 	g_return_if_fail (GTK_IS_TREE_VIEW (widget));
 	g_return_if_fail (line != NULL);
@@ -341,9 +337,9 @@
 	line = g_strdelimit (line, ":", ' ');
 
 	count = sscanf (line, NETSTAT_PROTOCOL_FORMAT,
-			&(data)->protocol, &n2, &n3,
-			&(data)->ip_src, &(data)->port_src, 
-			s6, s7, &(data)->state);
+			data->protocol, &n2, &n3,
+			data->ip_src, data->port_src, 
+			s6, s7, data->state);
 	
 	if (count == 7) {
 		bzero (&(data)->state, 30);
@@ -352,14 +348,13 @@
 	return count;
 }
 
-//static GtkTreeModel *
 void
 netstat_create_protocol_model (GtkTreeView *widget)
 {
 	GtkCellRenderer *renderer;
 	GtkTreeViewColumn *column;
 
-//	clean_gtk_tree_view (widget);
+	/*clean_gtk_tree_view (widget);*/
 	
 	renderer = gtk_cell_renderer_text_new ();
 	/* Transport Protocol that runs over */
@@ -397,9 +392,10 @@
 
 /* ROUTE */
 void
-netstat_route_tree_insert (GtkTreeView *widget, gchar *line) {
+netstat_route_tree_insert (GtkTreeView *widget, gchar *line)
+{
 	GtkTreeIter iter, sibling;
-	GList *columns;
+	/*GList *columns;*/
 	GtkTreePath *path;
 	GtkTreeModel *model;
 	gint count;
@@ -479,10 +475,10 @@
 	gint ref, use;
 
 	count = sscanf (line, NETSTAT_ROUTE_FORMAT,
-			&(data)->destination,
-			&(data)->gateway, &(data)->netmask, 
+			data->destination,
+			data->gateway, data->netmask, 
 			flags, &(data)->metric, &ref, &use, 
-			&(data)->iface);
+			data->iface);
 	
 	return count;
 }
@@ -524,9 +520,10 @@
 
 /* MULTICAST */
 void
-netstat_multicast_tree_insert (GtkTreeView *widget, gchar *line) {
+netstat_multicast_tree_insert (GtkTreeView *widget, gchar *line)
+{
 	GtkTreeIter iter, sibling;
-	GList *columns;
+	/*GList *columns;*/
 	GtkTreePath *path;
 	GtkTreeModel *model;
 	gint count;
@@ -604,8 +601,8 @@
 	gint members;
 
 	count = sscanf (line, NETSTAT_MULTICAST_FORMAT,
-			&(data)->iface,
-			&members, &(data)->group);
+			data->iface,
+			&members, data->group);
 	snprintf ((data)->members, 30, "%d", members);
 	
 	return count;
@@ -644,7 +641,8 @@
 
 /* Remove all columns from a GtkTreeView */
 void
-clean_gtk_tree_view (GtkTreeView *widget) {
+clean_gtk_tree_view (GtkTreeView *widget)
+{
 	GList *columns, *list;
 	gint n, i;
 	GtkTreeViewColumn *column;
@@ -668,7 +666,6 @@
 netstat_copy_to_clipboard (Netinfo * netinfo, gpointer user_data)
 {
 	GString *result, *content;
-	NetstatOption option;
 
 	g_return_if_fail (netinfo != NULL);
 
@@ -691,6 +688,9 @@
 		/* The netstat "Multicast information" output in text format.
 		   It's a tabular output, and these belongs to the column titles */
 		result = g_string_new (_("Interface\tMember\tGroup\n"));
+		break;
+	case NONE:
+	default:
 		break;
 	}
 
Index: ping.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/ping.c,v
retrieving revision 1.21
diff -u -r1.21 ping.c
--- ping.c	18 Nov 2003 20:51:50 -0000	1.21
+++ ping.c	19 Nov 2003 18:08:29 -0000
@@ -29,8 +29,6 @@
 static gint strip_line (gchar * line, ping_data * data, Netinfo * netinfo);
 static gint strip_total_line (gchar * line, gint * packet_total);
 static GtkTreeModel *ping_create_model (GtkTreeView * widget);
-static gboolean ping_output_foreach (GtkTreeModel * model, GtkTreePath * path,
-		     GtkTreeIter * iter, gpointer data);
 			 
 static gfloat rttmin, rttmax, rttavg;
 static gint packets_transmitted;
@@ -48,8 +46,6 @@
 void
 ping_do (Netinfo * netinfo)
 {
-	GtkTextBuffer *buffer = NULL;
-	GtkTextIter start, end;
 	gushort count;
 	const gchar *host = NULL;
 	gchar *command = NULL;
@@ -57,7 +53,7 @@
 	GtkLabel *min, *avg, *max, *pkt_transmitted, *pkt_received,
 	    *pkt_loss;
 	gchar stmp[128];
-	gchar *program;
+	gchar *program = NULL;
 	GtkWidget *parent;
 	gint ip_version;
 
@@ -122,6 +118,7 @@
 		
 		break;
 	case -1:
+	default:
 		/*invalid host or ip address*/
 		return;
 	}
@@ -171,7 +168,6 @@
 {
 	gchar *text_utf8;
 	gssize bytes_written;
-	GtkWidget *entry = NULL;
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter iter;
 
@@ -202,7 +198,6 @@
 	GtkTreePath *path;
 	GtkTreeModel *model;
 	GtkTreeView *widget;
-	const gchar *text;
 	gint count;
 	ping_data data;
 	gdouble rtt;
@@ -213,8 +208,6 @@
 	g_return_if_fail (netinfo != NULL);
 	g_return_if_fail (line != NULL);
 
-//      text = g_strchomp (line);
-
 	widget = (GTK_TREE_VIEW (netinfo->output));
 	min = GTK_LABEL (netinfo->min);
 	avg = GTK_LABEL (netinfo->avg);
@@ -328,7 +321,6 @@
 		g_sprintf (stmp, "%d%%", packets_loss);
 		gtk_label_set_text (pkt_loss, stmp);
 	}
-	//g_free (text);
 }
 
 static gint
@@ -342,12 +334,12 @@
 #ifdef PING_PARAMS_5
 	count = sscanf (line, PING_FORMAT,
 			&(data)->bytes, data->ip, &(data)->icmp_seq,
-			&(data)->srtt, data->unit);
+			data->srtt, data->unit);
 #endif
 #ifdef PING_PARAMS_6
 	count = sscanf (line, PING_FORMAT,
 			&(data)->bytes, data->ip, &(data)->icmp_seq,
-			&(data)->ttl, &(data)->srtt, data->unit);
+			&(data)->ttl, data->srtt, data->unit);
 #endif
 	if (count != 5 && count != 6) {
 
Index: ping.h
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/ping.h,v
retrieving revision 1.12
diff -u -r1.12 ping.h
--- ping.h	2 Oct 2003 21:26:16 -0000	1.12
+++ ping.h	19 Nov 2003 18:08:29 -0000
@@ -60,6 +60,7 @@
 
 /* Ping funtions */
 void ping_do (Netinfo * netinfo);
+void ping_stop (Netinfo * netinfo);
 void ping_foreach (Netinfo * netinfo, gchar * line, gint len, gpointer user_data);
 void ping_foreach_with_tree (Netinfo * netinfo, gchar * line, gint len, gpointer user_data);
 void ping_copy_to_clipboard (Netinfo * netinfo, gpointer user_data);
Index: scan.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/scan.c,v
retrieving revision 1.8
diff -u -r1.8 scan.c
--- scan.c	18 Nov 2003 20:51:50 -0000	1.8
+++ scan.c	19 Nov 2003 18:08:29 -0000
@@ -60,7 +60,6 @@
 	GIOChannel *channel2;
 	gint pfd[2];
 	gint pid;
-	gint nread;
 	gchar buf[SIZE];
 	gchar *service_name = NULL;
 	gint ip_version, pf;
@@ -84,19 +83,20 @@
 	
 	switch (ip_version = netinfo_get_ip_version (netinfo))
 	{
+	case IPV4:
+		pf = PF_INET;
+		break;
+	case IPV6:
+		pf = PF_INET6;
+		break;
 	case -1:
+	default:
 #ifdef DEBUG
 		g_print ("Error: Host unkown\n");
 #endif /* DEBUG */
 		return;
 		/*g_return_if_fail (hp != NULL);*/
 		break;
-	case IPV4:
-		pf = PF_INET;
-		break;
-	case IPV6:
-		pf = PF_INET6;
-		break;
 	}
 
 	hp = gethostbyname2 (host, pf);
@@ -181,11 +181,6 @@
 scan_foreach (Netinfo * netinfo, gchar * line, gint len,
 	      gpointer user_data)
 {
-	gchar *text_utf8;
-	gssize bytes_written;
-	GtkWidget *entry = NULL;
-	GtkTextBuffer *buffer = NULL;
-	GtkTextIter iter;
 	scan_data data;
 	gint count;
 
Index: traceroute.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/traceroute.c,v
retrieving revision 1.18
diff -u -r1.18 traceroute.c
--- traceroute.c	18 Nov 2003 20:51:50 -0000	1.18
+++ traceroute.c	19 Nov 2003 18:08:29 -0000
@@ -35,9 +35,6 @@
 void
 traceroute_do (Netinfo * netinfo)
 {
-	GtkTextBuffer *buffer = NULL;
-	GtkTextIter start, end;
-	gushort count;
 	const gchar *host = NULL;
 	gchar *command = NULL;
 	gchar *program = NULL;
@@ -59,14 +56,6 @@
 		gtk_list_store_clear (GTK_LIST_STORE (model));
 	}
 
-/*	buffer =
-	    gtk_text_view_get_buffer (GTK_TEXT_VIEW (netinfo->output));
-
-	gtk_text_buffer_get_start_iter (buffer, &start);
-	gtk_text_buffer_get_end_iter (buffer, &end);
-
-	gtk_text_buffer_delete (buffer, &start, &end);*/
-
 	parent = gtk_widget_get_toplevel (netinfo->output);
 	
 	switch (netinfo_get_ip_version (netinfo))
@@ -113,7 +102,6 @@
 {
 	gchar *text_utf8;
 	gssize bytes_written;
-	GtkWidget *entry = NULL;
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter iter;
 
@@ -144,15 +132,12 @@
 	GtkTreePath *path;
 	GtkTreeModel *model;
 	GtkTreeView *widget;
-	const gchar *text;
 	gint count;
 	traceroute_data data;
 
 	g_return_if_fail (netinfo != NULL);
 	g_return_if_fail (line != NULL);
 
-    /* text = g_strchomp (line); */
-
 	widget = (GTK_TREE_VIEW (netinfo->output));
 
 	if (len > 0) {		/* there are data to show */
@@ -216,7 +201,6 @@
 	while (gtk_events_pending ()) {
 		  gtk_main_iteration_do (FALSE);
 	}
-	/* g_free (text); */
 }
 
 static gint
Index: util-mii.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/util-mii.c,v
retrieving revision 1.3
diff -u -r1.3 util-mii.c
--- util-mii.c	25 Jul 2003 21:47:58 -0000	1.3
+++ util-mii.c	19 Nov 2003 18:08:29 -0000
@@ -1,3 +1,4 @@
+/* -*- mode:C; indent-tabs-mode:t; tab-width:8; c-basic-offset:8; -*- */
 /*
  * util-mii: get basic value from a network interface
  *
@@ -47,6 +48,9 @@
 #include <linux/if_ether.h>
 #endif
 
+#include <string.h>
+#include <unistd.h>
+
 #include "mii.h"
 #include "util-mii.h"
 #include "util-mii-wireless.h"
@@ -55,6 +59,9 @@
 
 static struct ifreq ifr;
 
+static void get_legible_bits (gchar *buffer, gint bitrate);
+static mii_data_result mii_get_basic_wireless (int skfd, const char *ifname);
+
 /*--------------------------------------------------------------------*/
 
 static int
@@ -84,7 +91,7 @@
 	"100baseTx", MII_AN_100BASETX_FD | MII_AN_100BASETX_HD}, {
 "10baseT", MII_AN_10BASET_FD | MII_AN_10BASET_HD},};
 
-void
+static void
 get_legible_bits (gchar *buffer, gint bitrate)
 {
 	gdouble rate = bitrate;
@@ -133,7 +140,7 @@
  * We will call all the classical wireless ioctl on the driver through
  * the socket to know what is supported and to get the settings...
  */
-mii_data_result 
+static mii_data_result 
 mii_get_basic_wireless (int skfd, const char *ifname)
 {
 	struct iwreq wrq;
Index: whois.c
===================================================================
RCS file: /cvs/gnome/gnome-network/gnome-netinfo/whois.c,v
retrieving revision 1.1
diff -u -r1.1 whois.c
--- whois.c	19 Nov 2003 16:20:53 -0000	1.1
+++ whois.c	19 Nov 2003 18:08:29 -0000
@@ -35,7 +35,6 @@
 {
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter start, end;
-	gushort count;
 	const gchar *host = NULL;
 	gchar *command = NULL;
 	gchar *program = NULL;
@@ -43,7 +42,7 @@
 
 	gchar **command_line;
 	gchar **command_options;
-	gchar *tmptr;
+
 	gint i, j, num_terms;
 	gchar *command_arg = NULL;
 	gboolean host_is_set;
@@ -115,7 +114,6 @@
 {
 	gchar *text_utf8;
 	gssize bytes_written;
-	GtkWidget *entry = NULL;
 	GtkTextBuffer *buffer = NULL;
 	GtkTextIter iter;
 	


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]