Ethereal-dev: [Ethereal-dev] Fedora built fails on error_t

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Radek Vokál <rvokal@xxxxxxxxxx>
Date: Thu, 22 Dec 2005 14:02:06 +0100
The error_t struct from gtk/expert_comp_dlg.c is already defined in
errno.h . This break Fedora Core build, quick patch is attached
(s/error_t/dlg_error_t - I do know that this "sed" renamed also some
other variables)
-- 
Radek Vokál <rvokal@xxxxxxxxxx>
--- ethereal-0.10.14-SVN-16880/gtk/expert_comp_dlg.c.errno	2005-12-22 08:56:07.000000000 +0100
+++ ethereal-0.10.14-SVN-16880/gtk/expert_comp_dlg.c	2005-12-22 13:44:32.000000000 +0100
@@ -46,7 +46,7 @@
 #include <epan/stat_cmd_args.h>
 
 /* used to keep track of the statistics for an entire program interface */
-typedef struct _error_t {
+typedef struct _dlg_error_t {
 	GtkWidget *win;
     GtkWidget *chat_label;
     GtkWidget *note_label;
@@ -55,11 +55,12 @@
 	error_equiv_table chat_table;
 	error_equiv_table note_table;
 	error_equiv_table warn_table;
-    error_equiv_table error_table;
-} error_t;
+    error_equiv_table dlg_error_table;
+} dlg_error_t;
+
 
 static void
-error_set_title(error_t *ss)
+error_set_title(dlg_error_t *ss)
 {
 	char *title;
 
@@ -72,10 +73,10 @@
 static void
 error_reset(void *pss)
 {
-	error_t *ss=(error_t *)pss;
+	dlg_error_t *ss=(dlg_error_t *)pss;
 
-	reset_error_table_data(&ss->error_table);
-    gtk_label_set_text( GTK_LABEL(ss->error_label), g_strdup_printf("Errors: %u", ss->error_table.num_procs));
+	reset_error_table_data(&ss->dlg_error_table);
+    gtk_label_set_text( GTK_LABEL(ss->error_label), g_strdup_printf("Errors: %u", ss->dlg_error_table.num_procs));
 	reset_error_table_data(&ss->warn_table);
     gtk_label_set_text( GTK_LABEL(ss->warn_label), g_strdup_printf("Warnings: %u", ss->warn_table.num_procs));
 	reset_error_table_data(&ss->note_table);
@@ -88,7 +89,7 @@
 static int
 error_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv)
 {
-	error_t *ss=(error_t *)pss;
+	dlg_error_t *ss=(dlg_error_t *)pss;
     const expert_info_t *error_pkt=prv;
 
 	/* if return value is 0 then no error */
@@ -97,9 +98,9 @@
 	}
     switch (error_pkt->severity) {
     case PI_ERROR:
-        init_error_table_row(&ss->error_table, error_pkt);
-        add_error_table_data(&ss->error_table, error_pkt);
-        gtk_label_set_text( GTK_LABEL(ss->error_label), g_strdup_printf("Errors: %u", ss->error_table.num_procs));
+        init_error_table_row(&ss->dlg_error_table, error_pkt);
+        add_error_table_data(&ss->dlg_error_table, error_pkt);
+        gtk_label_set_text( GTK_LABEL(ss->error_label), g_strdup_printf("Errors: %u", ss->dlg_error_table.num_procs));
         break;
     case PI_WARN:
         init_error_table_row(&ss->warn_table, error_pkt);
@@ -127,9 +128,9 @@
 static void
 error_draw(void *pss)
 {
-	error_t *ss=(error_t *)pss;
+	dlg_error_t *ss=(dlg_error_t *)pss;
 
-	draw_error_table_data(&ss->error_table);
+	draw_error_table_data(&ss->dlg_error_table);
 	draw_error_table_data(&ss->warn_table);
 	draw_error_table_data(&ss->note_table);
 	draw_error_table_data(&ss->chat_table);
@@ -140,13 +141,13 @@
 static void
 win_destroy_cb(GtkWindow *win _U_, gpointer data)
 {
-	error_t *ss=(error_t *)data;
+	dlg_error_t *ss=(dlg_error_t *)data;
 
 	protect_thread_critical_region();
 	remove_tap_listener(ss);
 	unprotect_thread_critical_region();
 
-	free_error_table_data(&ss->error_table);
+	free_error_table_data(&ss->dlg_error_table);
 	free_error_table_data(&ss->warn_table);
 	free_error_table_data(&ss->note_table);
 	free_error_table_data(&ss->chat_table);
@@ -156,7 +157,7 @@
 static void
 expert_comp_init(const char *optarg)
 {
-	error_t *ss;
+	dlg_error_t *ss;
 	const char *filter=NULL;
 	GString *error_string;
     GtkWidget *temp_page;
@@ -165,7 +166,7 @@
 	GtkWidget *bbox;
 	GtkWidget *close_bt;
     
-	ss=g_malloc(sizeof(error_t));
+	ss=g_malloc(sizeof(dlg_error_t));
 
 	ss->win=window_new(GTK_WINDOW_TOPLEVEL, "err");
 	gtk_window_set_default_size(GTK_WINDOW(ss->win), 700, 300);
@@ -185,7 +186,7 @@
 
     /* We must display TOP LEVEL Widget before calling init_srt_table() */
 	gtk_widget_show_all(ss->win);
-    init_error_table(&ss->error_table, 0, temp_page);
+    init_error_table(&ss->dlg_error_table, 0, temp_page);
     /* Warnings */
     temp_page = gtk_vbox_new(FALSE, 6);
     ss->warn_label = gtk_label_new("Warnings: 0");

Attachment: signature.asc
Description: This is a digitally signed message part