extern void
stats_tree_reset(void *p)
{
- stats_tree *st = p;
+ stats_tree *st = (stats_tree *)p;
st->start = -1.0;
st->elapsed = 0.0;
extern void
stats_tree_reinit(void *p)
{
- stats_tree *st = p;
+ stats_tree *st = (stats_tree *)p;
stat_node *child;
stat_node *next;
stat_tree_cleanup_cb cleanup, register_stat_group_t stat_group)
{
- stats_tree_cfg *cfg = g_malloc( sizeof(stats_tree_cfg) );
+ stats_tree_cfg *cfg = (stats_tree_cfg *)g_malloc( sizeof(stats_tree_cfg) );
/* at the very least the abbrev and the packet function should be given */
g_assert( tapname && abbr && packet );
extern stats_tree*
stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter)
{
- stats_tree *st = g_malloc(sizeof(stats_tree));
+ stats_tree *st = (stats_tree *)g_malloc(sizeof(stats_tree));
st->cfg = cfg;
st->pr = pr;
extern int
stats_tree_packet(void *p, packet_info *pinfo, epan_dissect_t *edt, const void *pri)
{
- stats_tree *st = p;
- double now = nstime_to_msec(&pinfo->fd->rel_ts);
+ stats_tree *st = (stats_tree *)p;
+ double now = nstime_to_msec(&pinfo->rel_ts);
if (st->start < 0.0) st->start = now;
extern stats_tree_cfg*
stats_tree_get_cfg_by_abbr(char *abbr)
{
- return g_hash_table_lookup(registry,abbr);
+ return (stats_tree_cfg *)g_hash_table_lookup(registry,abbr);
}
extern GList*
static void
setup_tree_presentation(gpointer k _U_, gpointer v, gpointer p)
{
- stats_tree_cfg *cfg = v;
- struct _stats_tree_pres_cbs *d = p;
+ stats_tree_cfg *cfg = (stats_tree_cfg *)v;
+ struct _stats_tree_pres_cbs *d = (struct _stats_tree_pres_cbs *)p;
cfg->in_use = FALSE;
cfg->setup_node_pr = d->setup_node_pr;
/* creates a stat_tree node
* name: the name of the stats_tree node
* parent_name: the name of the ALREADY REGISTERED parent
-* with_hash: whether or not it should keep a hash with it's children names
+* with_hash: whether or not it should keep a hash with its children names
* as_named_node: whether or not it has to be registered in the root namespace
*/
static stat_node*
gboolean with_hash, gboolean as_parent_node)
{
- stat_node *node = g_malloc (sizeof(stat_node));
+ stat_node *node = (stat_node *)g_malloc (sizeof(stat_node));
stat_node *last_chld = NULL;
node->counter = 0;
}
if (parent_id >= 0 && parent_id < (int) st->parents->len ) {
- node->parent = g_ptr_array_index(st->parents,parent_id);
+ node->parent = (stat_node *)g_ptr_array_index(st->parents,parent_id);
} else {
/* ??? should we set the parent to be root ??? */
g_assert_not_reached();
g_assert( parent_id >= 0 && parent_id < (int) st->parents->len );
- parent = g_ptr_array_index(st->parents,parent_id);
+ parent = (stat_node *)g_ptr_array_index(st->parents,parent_id);
if( parent->hash ) {
- node = g_hash_table_lookup(parent->hash,name);
+ node = (stat_node *)g_hash_table_lookup(parent->hash,name);
} else {
- node = g_hash_table_lookup(st->names,name);
+ node = (stat_node *)g_hash_table_lookup(st->names,name);
}
if ( node == NULL )
extern char*
-stats_tree_get_abbr(const char *optarg)
+stats_tree_get_abbr(const char *opt_arg)
{
guint i;
/* XXX: this fails when tshark is given any options
after the -z */
- g_assert(optarg != NULL);
+ g_assert(opt_arg != NULL);
- for (i=0; optarg[i] && optarg[i] != ','; i++);
+ for (i=0; opt_arg[i] && opt_arg[i] != ','; i++);
- if (optarg[i] == ',') {
- return g_strndup(optarg,i);
+ if (opt_arg[i] == ',') {
+ return g_strndup(opt_arg,i);
} else {
return NULL;
}
return NULL;
}
- rng = g_malloc(sizeof(range_pair_t));
+ rng = (range_pair_t *)g_malloc(sizeof(range_pair_t));
/* string == "X-?" */
if (*(split[0]) != '\0') {
extern int
stats_tree_parent_id_by_name(stats_tree *st, const gchar *parent_name)
{
- stat_node *node = g_hash_table_lookup(st->names,parent_name);
+ stat_node *node = (stat_node *)g_hash_table_lookup(st->names,parent_name);
if (node)
return node->id;
gint floor, ceil;
if (parent_id >= 0 && parent_id < (int) st->parents->len) {
- parent = g_ptr_array_index(st->parents,parent_id);
+ parent = (stat_node *)g_ptr_array_index(st->parents,parent_id);
} else {
g_assert_not_reached();
}
if( parent->hash ) {
- node = g_hash_table_lookup(parent->hash,name);
+ node = (stat_node *)g_hash_table_lookup(parent->hash,name);
} else {
- node = g_hash_table_lookup(st->names,name);
+ node = (stat_node *)g_hash_table_lookup(st->names,name);
}
if ( node == NULL )
stats_tree_tick_pivot(stats_tree *st, int pivot_id, const gchar *pivot_value)
{
- stat_node *parent = g_ptr_array_index(st->parents,pivot_id);
+ stat_node *parent = (stat_node *)g_ptr_array_index(st->parents,pivot_id);
parent->counter++;
stats_tree_manip_node( MN_INCREASE, st, pivot_value, pivot_id, FALSE, 1);