aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-07-17 00:22:30 +0000
committerGuy Harris <guy@alum.mit.edu>2002-07-17 00:22:30 +0000
commitca6badc579350a0736dae5bf95e06c6aae0bf1a7 (patch)
tree2070b00eba4f737b51b7a2c93117c6f9e6fe5ece /gtk
parentff49944dcd069fca04abbcc72bb99adc3a53d695 (diff)
downloadwireshark-ca6badc579350a0736dae5bf95e06c6aae0bf1a7.tar.gz
wireshark-ca6badc579350a0736dae5bf95e06c6aae0bf1a7.tar.bz2
wireshark-ca6badc579350a0736dae5bf95e06c6aae0bf1a7.zip
Get rid of some "unused variable" and "unused static function" warnings,
and some compile errors in Tethereal, when compiling without libpcap. If libpcap is missing (whether that's detected at compile time or, as on Windows, at run time), don't call any of the "capture_prefs" routines - the routine to create the capture preferences page wasn't called, so the other routines can try to refer to non-existent widgets and other items and crash. Get rid of the stub routines in "capture_prefs()" used when compiling without libpcap, as they're no longer called. svn path=/trunk/; revision=5888
Diffstat (limited to 'gtk')
-rw-r--r--gtk/capture_prefs.c27
-rw-r--r--gtk/prefs_dlg.c70
2 files changed, 71 insertions, 26 deletions
diff --git a/gtk/capture_prefs.c b/gtk/capture_prefs.c
index 00742c5c06..18d25c5907 100644
--- a/gtk/capture_prefs.c
+++ b/gtk/capture_prefs.c
@@ -1,7 +1,7 @@
/* capture_prefs.c
* Dialog box for capture preferences
*
- * $Id: capture_prefs.c,v 1.12 2002/06/28 01:59:46 guy Exp $
+ * $Id: capture_prefs.c,v 1.13 2002/07/17 00:22:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -26,6 +26,8 @@
#include "config.h"
#endif
+#ifdef HAVE_LIBPCAP
+
#include <string.h>
#include <errno.h>
#include <gtk/gtk.h>
@@ -43,8 +45,6 @@
#include "pcap-util.h"
#include "main.h"
-#ifdef HAVE_LIBPCAP
-
#define DEVICE_KEY "device"
#define PROM_MODE_KEY "prom_mode"
#define CAPTURE_REAL_TIME_KEY "capture_real_time"
@@ -167,25 +167,4 @@ capture_prefs_destroy(GtkWidget *w _U_)
{
}
-#else /* HAVE_LIBPCAP */
-
-/*
- * Stub routines.
- */
-
-void
-capture_prefs_apply(GtkWidget *w)
-{
-}
-
-void
-capture_prefs_destroy(GtkWidget *w)
-{
-}
-
-void
-capture_prefs_fetch(GtkWidget *w)
-{
-}
-
#endif /* HAVE_LIBPCAP */
diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c
index 8e8959ce85..fe3773174e 100644
--- a/gtk/prefs_dlg.c
+++ b/gtk/prefs_dlg.c
@@ -1,7 +1,7 @@
/* prefs_dlg.c
* Routines for handling preferences
*
- * $Id: prefs_dlg.c,v 1.48 2002/06/16 00:58:38 guy Exp $
+ * $Id: prefs_dlg.c,v 1.49 2002/07/17 00:22:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -249,7 +249,10 @@ prefs_cb(GtkWidget *w _U_, gpointer dummy _U_)
{
GtkWidget *main_vb, *top_hb, *bbox, *prefs_nb, *ct_sb, *frame,
*ok_bt, *apply_bt, *save_bt, *cancel_bt;
- GtkWidget *print_pg, *column_pg, *stream_pg, *gui_pg, *capture_pg;
+ GtkWidget *print_pg, *column_pg, *stream_pg, *gui_pg;
+#ifdef HAVE_LIBPCAP
+ GtkWidget *capture_pg;
+#endif
GtkWidget *nameres_pg;
gchar label_str[MAX_TREE_NODE_NAME_LEN], *label_ptr = label_str;
GtkCTreeNode *ct_node;
@@ -816,7 +819,16 @@ prefs_main_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
column_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gui_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
+#ifdef HAVE_LIBPCAP
+#ifdef _WIN32
+ /* Is WPcap loaded? */
+ if (has_wpcap) {
+#endif /* _WIN32 */
capture_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_CAPTURE_PAGE_KEY));
+#ifdef _WIN32
+ }
+#endif /* _WIN32 */
+#endif /* HAVE_LIBPCAP */
nameres_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_NAMERES_PAGE_KEY));
prefs_module_foreach(module_prefs_fetch, &must_redissect);
@@ -825,7 +837,16 @@ prefs_main_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
column_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gui_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
+#ifdef HAVE_LIBPCAP
+#ifdef _WIN32
+ /* Is WPcap loaded? */
+ if (has_wpcap) {
+#endif /* _WIN32 */
capture_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_CAPTURE_PAGE_KEY));
+#ifdef _WIN32
+ }
+#endif /* _WIN32 */
+#endif /* HAVE_LIBPCAP */
nameres_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_NAMERES_PAGE_KEY));
prefs_apply_all();
@@ -850,7 +871,16 @@ prefs_main_apply_cb(GtkWidget *apply_bt _U_, gpointer parent_w)
column_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gui_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
+#ifdef HAVE_LIBPCAP
+#ifdef _WIN32
+ /* Is WPcap loaded? */
+ if (has_wpcap) {
+#endif /* _WIN32 */
capture_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_CAPTURE_PAGE_KEY));
+#ifdef _WIN32
+ }
+#endif /* _WIN32 */
+#endif /* HAVE_LIBPCAP */
nameres_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_NAMERES_PAGE_KEY));
prefs_module_foreach(module_prefs_fetch, &must_redissect);
@@ -859,7 +889,16 @@ prefs_main_apply_cb(GtkWidget *apply_bt _U_, gpointer parent_w)
column_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gui_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
+#ifdef HAVE_LIBPCAP
+#ifdef _WIN32
+ /* Is WPcap loaded? */
+ if (has_wpcap) {
+#endif /* _WIN32 */
capture_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_CAPTURE_PAGE_KEY));
+#ifdef _WIN32
+ }
+#endif /* _WIN32 */
+#endif /* HAVE_LIBPCAP */
nameres_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_NAMERES_PAGE_KEY));
prefs_apply_all();
@@ -884,7 +923,16 @@ prefs_main_save_cb(GtkWidget *save_bt _U_, gpointer parent_w)
column_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gui_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
+#ifdef HAVE_LIBPCAP
+#ifdef _WIN32
+ /* Is WPcap loaded? */
+ if (has_wpcap) {
+#endif /* _WIN32 */
capture_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_CAPTURE_PAGE_KEY));
+#ifdef _WIN32
+ }
+#endif /* _WIN32 */
+#endif /* HAVE_LIBPCAP */
nameres_prefs_fetch(gtk_object_get_data(GTK_OBJECT(parent_w), E_NAMERES_PAGE_KEY));
prefs_module_foreach(module_prefs_fetch, &must_redissect);
@@ -923,7 +971,16 @@ prefs_main_save_cb(GtkWidget *save_bt _U_, gpointer parent_w)
column_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gui_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
+#ifdef HAVE_LIBPCAP
+#ifdef _WIN32
+ /* Is WPcap loaded? */
+ if (has_wpcap) {
+#endif /* _WIN32 */
capture_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_CAPTURE_PAGE_KEY));
+#ifdef _WIN32
+ }
+#endif /* _WIN32 */
+#endif /* HAVE_LIBPCAP */
nameres_prefs_apply(gtk_object_get_data(GTK_OBJECT(parent_w), E_NAMERES_PAGE_KEY));
prefs_apply_all();
@@ -1046,7 +1103,16 @@ prefs_main_destroy_cb(GtkWidget *win _U_, gpointer user_data _U_)
column_prefs_destroy(gtk_object_get_data(GTK_OBJECT(prefs_w), E_COLUMN_PAGE_KEY));
stream_prefs_destroy(gtk_object_get_data(GTK_OBJECT(prefs_w), E_STREAM_PAGE_KEY));
gui_prefs_destroy(gtk_object_get_data(GTK_OBJECT(prefs_w), E_GUI_PAGE_KEY));
+#ifdef HAVE_LIBPCAP
+#ifdef _WIN32
+ /* Is WPcap loaded? */
+ if (has_wpcap) {
+#endif /* _WIN32 */
capture_prefs_destroy(gtk_object_get_data(GTK_OBJECT(prefs_w), E_CAPTURE_PAGE_KEY));
+#ifdef _WIN32
+ }
+#endif /* _WIN32 */
+#endif /* HAVE_LIBPCAP */
nameres_prefs_destroy(gtk_object_get_data(GTK_OBJECT(prefs_w), E_NAMERES_PAGE_KEY));
/* Free up the saved preferences (both for "prefs" and for registered