summaryrefslogtreecommitdiff
path: root/epan/stats_tree.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2007-03-28 21:55:11 +0000
committerStephen Fisher <steve@stephen-fisher.com>2007-03-28 21:55:11 +0000
commit8fd3ee05600dd7d0e6434e7eb824932c52000ce3 (patch)
treedc1df6288600e883ed53ac7e43a38a2d03abb9f3 /epan/stats_tree.c
parent32780e71e8ce8c8fd1898cbcb62f6bc8a59341f3 (diff)
downloadwireshark-8fd3ee05600dd7d0e6434e7eb824932c52000ce3.tar.gz
Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it. svn path=/trunk/; revision=21253
Diffstat (limited to 'epan/stats_tree.c')
-rw-r--r--epan/stats_tree.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/epan/stats_tree.c b/epan/stats_tree.c
index d63cb0f970..ec533ca7f0 100644
--- a/epan/stats_tree.c
+++ b/epan/stats_tree.c
@@ -48,13 +48,13 @@ static GHashTable* registry = NULL;
extern void stats_tree_get_strs_from_node(const stat_node* node, guint8* value, guint8* rate, guint8* percent) {
float f;
- if (value) g_snprintf((char*)value,NUM_BUF_SIZE,"%u",node->counter);
+ if (value) g_snprintf(value,NUM_BUF_SIZE,"%u",node->counter);
if (rate) {
*rate = '\0';
if (node->st->elapsed > 0.0) {
f = ((float)node->counter) / (float)node->st->elapsed;
- g_snprintf((gchar*)rate,NUM_BUF_SIZE,"%f",f);
+ g_snprintf(rate,NUM_BUF_SIZE,"%f",f);
}
}
@@ -62,7 +62,7 @@ extern void stats_tree_get_strs_from_node(const stat_node* node, guint8* value,
*percent = '\0';
if (node->parent->counter > 0) {
f = (float)(((float)node->counter * 100.0) / node->parent->counter);
- g_snprintf((gchar*)percent,NUM_BUF_SIZE,"%.2f%%",f);
+ g_snprintf(percent,NUM_BUF_SIZE,"%.2f%%",f);
}
}
}
@@ -73,10 +73,10 @@ if buffer is NULL returns a newly allocated string */
extern guint8* stats_tree_node_to_str(const stat_node* node,
guint8* buffer, guint len) {
if (buffer) {
- g_snprintf((gchar*)buffer,len,"%s: %i",node->name, node->counter);
+ g_snprintf(buffer,len,"%s: %i",node->name, node->counter);
return buffer;
} else {
- return (guint8*)g_strdup_printf("%s: %i",node->name, node->counter);
+ return g_strdup_printf("%s: %i",node->name, node->counter);
}
}
@@ -117,7 +117,7 @@ extern void stats_tree_branch_to_str(const stat_node* node, GString* s, guint in
format = g_strdup_printf(" %%s%%-%us%%12s %%12s %%12s\n",stats_tree_branch_max_namelen(node,0));
}
- stats_tree_get_strs_from_node(node, (guint8*)value, (guint8*)rate, (guint8*)percent);
+ stats_tree_get_strs_from_node(node, value, rate, percent);
indent = indent > INDENT_MAX ? INDENT_MAX : indent;
@@ -256,9 +256,9 @@ extern void stats_tree_register(const guint8* tapname,
/* at the very least the abbrev and the packet function should be given */
g_assert( tapname && abbr && packet );
- cfg->tapname = (guint8*)g_strdup((gchar*)tapname);
- cfg->abbr = (guint8*)g_strdup((gchar*)abbr);
- cfg->name = name ? (guint8*)g_strdup((gchar*)name) : (guint8*)g_strdup((gchar*)abbr);
+ cfg->tapname = g_strdup(tapname);
+ cfg->abbr = g_strdup(abbr);
+ cfg->name = name ? g_strdup(name) : g_strdup(abbr);
cfg->packet = packet;
cfg->init = init;
@@ -294,7 +294,7 @@ extern stats_tree* stats_tree_new(stats_tree_cfg* cfg, tree_pres* pr,char* filte
st->elapsed = 0.0;
st->root.counter = 0;
- st->root.name = g_strdup((gchar*)cfg->name);
+ st->root.name = g_strdup(cfg->name);
st->root.st = st;
st->root.parent = NULL;
st->root.children = NULL;
@@ -494,7 +494,7 @@ extern int stats_tree_manip_node(manip_node_mode mode, stats_tree* st, const gui
}
if ( node == NULL )
- node = new_stat_node(st,(gchar*)name,parent_id,with_hash,with_hash);
+ node = new_stat_node(st,name,parent_id,with_hash,with_hash);
switch (mode) {
case MN_INCREASE: node->counter += value; break;
@@ -518,7 +518,7 @@ extern guint8* stats_tree_get_abbr(const guint8* optarg) {
for (i=0; optarg[i] && optarg[i] != ','; i++);
if (optarg[i] == ',') {
- return (guint8*)g_strndup((gchar*)optarg,i);
+ return g_strndup(optarg,i);
} else {
return NULL;
}
@@ -593,7 +593,7 @@ extern int stats_tree_create_range_node(stats_tree* st,
va_start( list, parent_id );
while (( curr_range = va_arg(list, guint8*) )) {
- range_node = new_stat_node(st, (gchar*)curr_range, rng_root->id, FALSE, FALSE);
+ range_node = new_stat_node(st, curr_range, rng_root->id, FALSE, FALSE);
range_node->rng = get_range(curr_range);
}
va_end( list );
@@ -624,7 +624,7 @@ extern int stats_tree_range_node_with_pname(stats_tree* st,
va_start( list, parent_name );
while (( curr_range = va_arg(list, guint8*) )) {
- range_node = new_stat_node(st, (gchar*)curr_range, rng_root->id, FALSE, FALSE);
+ range_node = new_stat_node(st, curr_range, rng_root->id, FALSE, FALSE);
range_node->rng = get_range(curr_range);
}
va_end( list );
@@ -703,7 +703,7 @@ extern int stats_tree_tick_pivot(stats_tree* st,
stat_node* parent = g_ptr_array_index(st->parents,pivot_id);
parent->counter++;
- stats_tree_manip_node( MN_INCREASE, st, (guint8*)pivot_value, pivot_id, FALSE, 1);
+ stats_tree_manip_node( MN_INCREASE, st, pivot_value, pivot_id, FALSE, 1);
return pivot_id;
}