aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/ansi_a_stat.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-01-01 02:57:02 +0000
committerGuy Harris <guy@alum.mit.edu>2005-01-01 02:57:02 +0000
commit71217a80071adae12b53253e3025b2220e6c89f5 (patch)
tree0e6002853a3a04b81db3f093f0a09459ebbccc7e /gtk/ansi_a_stat.c
parent3f0d0ca5ea5f6034904e4cb03b38b66e7b03e165 (diff)
As we've made the tap_specific_data field of a tap_packet_t structure a
const pointer (so that we don't get complaints when we make the tap-specific data argument to "tap_queue_packet()" a const pointer, allowing dissectors to hand const data to a tap without a complaint), we should make the tap per-packet function take a const pointer as an argument as well. Do so. In some taps, use _U_, or actually use the argument, rather than sticking in dummy "X = X" assignments to fake use of parameters. (This means that the tap functions in question no longer have the notion that they act on a particular static structure wired in.) svn path=/trunk/; revision=12910
Diffstat (limited to 'gtk/ansi_a_stat.c')
-rw-r--r--gtk/ansi_a_stat.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/gtk/ansi_a_stat.c b/gtk/ansi_a_stat.c
index 5f1d000523..4f78e3e754 100644
--- a/gtk/ansi_a_stat.c
+++ b/gtk/ansi_a_stat.c
@@ -83,33 +83,30 @@ static void
ansi_a_stat_reset(
void *tapdata)
{
- tapdata = tapdata;
+ ansi_a_stat_t *stat_p = tapdata;
- memset((void *) &stat, 0, sizeof(ansi_a_stat_t));
+ memset(stat_p, 0, sizeof(ansi_a_stat_t));
}
static int
ansi_a_stat_packet(
void *tapdata,
- packet_info *pinfo,
+ packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
- void *data)
+ const void *data)
{
- ansi_a_tap_rec_t *data_p = data;
-
-
- tapdata = tapdata;
- pinfo = pinfo;
+ ansi_a_stat_t *stat_p = tapdata;
+ const ansi_a_tap_rec_t *data_p = data;
switch (data_p->pdu_type)
{
case BSSAP_PDU_TYPE_BSMAP:
- stat.bsmap_message_type[data_p->message_type]++;
+ stat_p->bsmap_message_type[data_p->message_type]++;
break;
case BSSAP_PDU_TYPE_DTAP:
- stat.dtap_message_type[data_p->message_type]++;
+ stat_p->dtap_message_type[data_p->message_type]++;
break;
default:
@@ -127,12 +124,10 @@ static void
ansi_a_stat_draw(
void *tapdata)
{
+ ansi_a_stat_t *stat_p = tapdata;
int i, j;
char *strp;
-
- tapdata = tapdata;
-
if (dlg_bsmap.win != NULL)
{
i = 0;
@@ -142,7 +137,7 @@ ansi_a_stat_draw(
j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_bsmap.table), (gpointer) i);
strp = g_strdup_printf("%d",
- stat.bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value]);
+ stat_p->bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value]);
gtk_clist_set_text(GTK_CLIST(dlg_bsmap.table), j, 2, strp);
g_free(strp);
@@ -161,7 +156,7 @@ ansi_a_stat_draw(
j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_dtap.table), (gpointer) i);
strp = g_strdup_printf("%d",
- stat.dtap_message_type[ansi_a_ios401_dtap_strings[i].value]);
+ stat_p->dtap_message_type[ansi_a_ios401_dtap_strings[i].value]);
gtk_clist_set_text(GTK_CLIST(dlg_dtap.table), j, 2, strp);
g_free(strp);
@@ -470,7 +465,7 @@ register_tap_listener_gtkansi_a_stat(void)
memset((void *) &stat, 0, sizeof(ansi_a_stat_t));
err_p =
- register_tap_listener("ansi_a", NULL, NULL,
+ register_tap_listener("ansi_a", &stat, NULL,
ansi_a_stat_reset,
ansi_a_stat_packet,
ansi_a_stat_draw);