diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-03-21 03:07:23 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-03-21 03:07:23 +0000 |
commit | 48af69f95fe3b2ac35145570da940ae9e4f4b677 (patch) | |
tree | 84c247ceaa531bf6b1e216c6455d44c00851adf7 /plugins | |
parent | 35d1b406d74101f0ec04026e9a8b2ce75d57201d (diff) |
From beroset:
remove C++ incompatibilities
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10409
svn path=/trunk/; revision=48449
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mate/mate_grammar.lemon | 40 | ||||
-rw-r--r-- | plugins/mate/mate_parser.l | 6 | ||||
-rw-r--r-- | plugins/mate/mate_runtime.c | 36 | ||||
-rw-r--r-- | plugins/mate/mate_setup.c | 26 | ||||
-rw-r--r-- | plugins/mate/mate_util.c | 62 | ||||
-rw-r--r-- | plugins/mate/packet-mate.c | 6 |
6 files changed, 88 insertions, 88 deletions
diff --git a/plugins/mate/mate_grammar.lemon b/plugins/mate/mate_grammar.lemon index 0e0a9d6606..fdda2f22f6 100644 --- a/plugins/mate/mate_grammar.lemon +++ b/plugins/mate/mate_grammar.lemon @@ -96,7 +96,7 @@ static void configuration_error(mate_config* mc, const gchar* fmt, ...) { incl = " "; } - current_frame = g_ptr_array_index(mc->config_stack,(guint)i); + current_frame = (mate_config_frame *)g_ptr_array_index(mc->config_stack,(guint)i); g_string_append_printf(mc->config_error,"%s%s at line %u",incl, current_frame->filename, current_frame->linenum); } @@ -108,7 +108,7 @@ static void configuration_error(mate_config* mc, const gchar* fmt, ...) { } static AVPL_Transf* new_transform_elem(AVPL* match, AVPL* replace, avpl_match_mode match_mode, avpl_replace_mode replace_mode) { - AVPL_Transf* t = g_malloc(sizeof(AVPL_Transf)); + AVPL_Transf* t = (AVPL_Transf *)g_malloc(sizeof(AVPL_Transf)); t->name = NULL; t->match = match; @@ -313,7 +313,7 @@ gop_lifetime_default ::= . gop_drop_unassigned_default ::= DROP_UNASSIGNED_KW true_false(B) SEMICOLON. { mc->defaults.gop.drop_unassigned = B; } gop_drop_unassigned_default ::= . -gop_tree_mode_default ::= SHOW_TREE_KW gop_tree_mode(B) SEMICOLON. { mc->defaults.gop.pdu_tree_mode = B; } +gop_tree_mode_default ::= SHOW_TREE_KW gop_tree_mode(B) SEMICOLON. { mc->defaults.gop.pdu_tree_mode = (gop_pdu_tree_t)B; } gop_tree_mode_default ::= . gop_show_times_default ::= SHOW_TIMES_KW true_false(B) SEMICOLON. { mc->defaults.gop.show_times = B; } @@ -367,25 +367,25 @@ transform_statement(A) ::= transform_match(Match) transform_action(Action) SEMIC } transform_match(A) ::= MATCH_KW match_mode(Mode) avpl(Avpl). { - A = g_malloc(sizeof(transf_match_t)); + A = (transf_match_t *)g_malloc(sizeof(transf_match_t)); A->match_mode = Mode; A->avpl = Avpl; } transform_match(A) ::= . { - A = g_malloc(sizeof(transf_match_t)); + A = (transf_match_t *)g_malloc(sizeof(transf_match_t)); A->match_mode = AVPL_STRICT; A->avpl = new_avpl(""); } transform_action(A) ::= . { - A = g_malloc(sizeof(transf_action_t)); + A = (transf_action_t *)g_malloc(sizeof(transf_action_t)); A->replace_mode = AVPL_INSERT; A->avpl = new_avpl(""); } transform_action(A) ::= action_mode(Mode) avpl(Avpl). { - A = g_malloc(sizeof(transf_action_t)); + A = (transf_action_t *)g_malloc(sizeof(transf_action_t)); A->replace_mode = Mode; A->avpl = Avpl; } @@ -464,7 +464,7 @@ payload_statement(A) ::= PAYLOAD_KW proto_stack(B) SEMICOLON. { A = B; } criteria_statement(A) ::= . { A = NULL; } criteria_statement(A) ::= CRITERIA_KW accept_mode(B) match_mode(C) avpl(D) SEMICOLON. { - A = g_malloc(sizeof(pdu_criteria_t)); + A = (pdu_criteria_t *)g_malloc(sizeof(pdu_criteria_t)); A->criterium_avpl = D; A->criterium_match_mode = C; A->criterium_accept_mode = B; @@ -478,7 +478,7 @@ extraction_statements(A) ::= extraction_statements(B) extraction_statement(C). { extraction_statements(A) ::= extraction_statement(B). { A = B; A->last = A; } extraction_statement(A) ::= EXTRACT_KW NAME(NAME) FROM_KW field(FIELD) SEMICOLON. { - A = g_malloc(sizeof(extraction_t)); + A = (extraction_t *)g_malloc(sizeof(extraction_t)); A->as = NAME; A->hfi = FIELD; A->next = A->last = NULL; @@ -495,7 +495,7 @@ last_extracted_statement(A) ::= LAST_PDU_KW true_false(B) SEMICOLON. { A = B; } last_extracted_statement(A) ::= . { A = mc->defaults.pdu.last_extracted; } proto_stack(A) ::= proto_stack(B) SLASH field(C). { - int* hfidp = g_malloc(sizeof(int)); + int* hfidp = (int *)g_malloc(sizeof(int)); g_string_append_printf(mc->fields_filter,"||%s",C->abbrev); @@ -505,7 +505,7 @@ proto_stack(A) ::= proto_stack(B) SLASH field(C). { } proto_stack(A) ::= field(B). { - int* hfidp = g_malloc(sizeof(int)); + int* hfidp = (int *)g_malloc(sizeof(int)); *hfidp = B->id; g_string_append_printf(mc->fields_filter,"||%s",B->abbrev); @@ -546,7 +546,7 @@ gop_decl(A) ::= GOP_KW NAME(Name) ON_KW pdu_name(PduName) MATCH_KW avpl(Key) OPE cfg->key = Key; cfg->drop_unassigned = DropUnassigned; cfg->show_times = ShowTimes; - cfg->pdu_tree_mode = TreeMode; + cfg->pdu_tree_mode = (gop_pdu_tree_t)TreeMode; cfg->expiration = Expiration; cfg->idle_timeout = IdleTimeout; cfg->lifetime = Lifetime; @@ -568,7 +568,7 @@ gop_stop_statement(A) ::= STOP_KW avpl(B) SEMICOLON. { A = B; } gop_stop_statement(A) ::= . { A = NULL; } show_goptree_statement(A) ::= SHOW_TREE_KW gop_tree_mode(B) SEMICOLON. { A = B; } -show_goptree_statement(A) ::= . { A = mc->defaults.gop.pdu_tree_mode; } +show_goptree_statement(A) ::= . { A = (gop_tree_mode_t)mc->defaults.gop.pdu_tree_mode; } show_times_statement(A) ::= SHOW_TIMES_KW true_false(B) SEMICOLON. { A = B; } show_times_statement(A) ::= . { A = mc->defaults.gop.show_times; } @@ -582,17 +582,17 @@ idle_timeout_statement(A) ::= . { A = mc->defaults.gop.lifetime; } lifetime_statement(A) ::= LIFETIME_KW time_value(B) SEMICOLON. { A = B; } lifetime_statement(A) ::= . { A = mc->defaults.gop.lifetime; } -gop_tree_mode(A) ::= NO_TREE_KW. { A = GOP_NO_TREE; } -gop_tree_mode(A) ::= PDU_TREE_KW. { A = GOP_PDU_TREE; } -gop_tree_mode(A) ::= FRAME_TREE_KW. { A = GOP_FRAME_TREE; } -gop_tree_mode(A) ::= BASIC_TREE_KW. { A = GOP_BASIC_PDU_TREE; } +gop_tree_mode(A) ::= NO_TREE_KW. { A = (gop_tree_mode_t)GOP_NO_TREE; } +gop_tree_mode(A) ::= PDU_TREE_KW. { A = (gop_tree_mode_t)GOP_PDU_TREE; } +gop_tree_mode(A) ::= FRAME_TREE_KW. { A = (gop_tree_mode_t)GOP_FRAME_TREE; } +gop_tree_mode(A) ::= BASIC_TREE_KW. { A = (gop_tree_mode_t)GOP_BASIC_PDU_TREE; } true_false(A) ::= TRUE_KW. { A = TRUE; } true_false(A) ::= FALSE_KW. { A = FALSE; } pdu_name(A) ::= NAME(B). { mate_cfg_pdu* c; - if (( c = g_hash_table_lookup(mc->pducfgs,B) )) { + if (( c = (mate_cfg_pdu *)g_hash_table_lookup(mc->pducfgs,B) )) { A = c->name; } else { configuration_error(mc,"No such Pdu: '%s'",B); @@ -665,7 +665,7 @@ gog_key_statement(A) ::= MEMBER_KW gop_name(B) avpl(C) SEMICOLON. { gop_name(A) ::= NAME(B). { mate_cfg_gop* c; - if (( c = g_hash_table_lookup(mc->gopcfgs,B) )) { + if (( c = (mate_cfg_gop *)g_hash_table_lookup(mc->gopcfgs,B) )) { A = c->name; } else { configuration_error(mc,"No Gop called '%s' has been already declared",B); @@ -694,7 +694,7 @@ transform_list(A) ::= transform(B). { transform(A) ::= NAME(B). { AVPL_Transf* t; - if (( t = g_hash_table_lookup(mc->transfs,B) )) { + if (( t = (AVPL_Transf *)g_hash_table_lookup(mc->transfs,B) )) { A = t; } else { configuration_error(mc,"There's no such Transformation: %s",B); diff --git a/plugins/mate/mate_parser.l b/plugins/mate/mate_parser.l index 759570120c..f752f0a964 100644 --- a/plugins/mate/mate_parser.l +++ b/plugins/mate/mate_parser.l @@ -191,7 +191,7 @@ blk_cmnt_stop "*/" } else { - current_frame = g_malloc(sizeof(mate_config_frame)); + current_frame = (mate_config_frame *)g_malloc(sizeof(mate_config_frame)); current_frame->filename = g_strdup(yytext); current_frame->linenum = 1; @@ -213,7 +213,7 @@ blk_cmnt_stop "*/" g_free(current_frame->filename); g_free(current_frame); - current_frame = g_ptr_array_remove_index(mc->config_stack,mc->config_stack->len-1); + current_frame = (mate_config_frame *)g_ptr_array_remove_index(mc->config_stack,mc->config_stack->len-1); } } @@ -303,7 +303,7 @@ extern gboolean mate_load_config(const gchar* filename, mate_config* matecfg) { mc->config_stack = g_ptr_array_new(); - current_frame = g_malloc(sizeof(mate_config_frame)); + current_frame = (mate_config_frame *)g_malloc(sizeof(mate_config_frame)); current_frame->filename = g_strdup(filename); current_frame->linenum = 1; diff --git a/plugins/mate/mate_runtime.c b/plugins/mate/mate_runtime.c index 2425251be8..23284c4735 100644 --- a/plugins/mate/mate_runtime.c +++ b/plugins/mate/mate_runtime.c @@ -106,14 +106,14 @@ static gboolean return_true(gpointer k _U_, gpointer v _U_, gpointer p _U_) { } static void destroy_pdus_in_cfg(gpointer k _U_, gpointer v, gpointer p _U_) { - mate_cfg_pdu* c = v; + mate_cfg_pdu* c = (mate_cfg_pdu *)v; g_hash_table_foreach_remove(c->items,destroy_mate_pdus,NULL); c->last_id = 0; } static void destroy_gops_in_cfg(gpointer k _U_, gpointer v, gpointer p _U_) { - mate_cfg_gop* c = v; + mate_cfg_gop* c = (mate_cfg_gop *)v; g_hash_table_foreach_remove(c->gop_index,return_true,NULL); g_hash_table_destroy(c->gop_index); @@ -128,7 +128,7 @@ static void destroy_gops_in_cfg(gpointer k _U_, gpointer v, gpointer p _U_) { } static void destroy_gogs_in_cfg(gpointer k _U_, gpointer v, gpointer p _U_) { - mate_cfg_gog* c = v; + mate_cfg_gog* c = (mate_cfg_gog *)v; g_hash_table_foreach_remove(c->items,destroy_mate_gogs,NULL); c->last_id = 0; } @@ -139,7 +139,7 @@ extern void initialize_mate_runtime(void) { if (( mc = mate_cfg() )) { if (rd == NULL ) { - rd = g_malloc(sizeof(mate_runtime_data)); + rd = (mate_runtime_data *)g_malloc(sizeof(mate_runtime_data)); } else { g_hash_table_foreach(mc->pducfgs,destroy_pdus_in_cfg,NULL); g_hash_table_foreach(mc->gopcfgs,destroy_gops_in_cfg,NULL); @@ -271,7 +271,7 @@ static void apply_transforms(GPtrArray* transforms, AVPL* avpl) { guint i; for (i = 0; i < transforms->len; i++) { - transform = g_ptr_array_index(transforms,i); + transform = (AVPL_Transf *)g_ptr_array_index(transforms,i); avpl_transform(avpl, transform); } } @@ -291,7 +291,7 @@ static void gog_remove_keys (mate_gog* gog) { gogkey* gog_key; while (gog->gog_keys->len) { - gog_key = g_ptr_array_remove_index_fast(gog->gog_keys,0); + gog_key = (gogkey *)g_ptr_array_remove_index_fast(gog->gog_keys,0); if (g_hash_table_lookup(gog_key->cfg->gog_index,gog_key->key) == gog) { g_hash_table_remove(gog_key->cfg->gog_index,gog_key->key); @@ -333,11 +333,11 @@ static void reanalyze_gop(mate_gop* gop) { gog_keys = gog->cfg->keys; while (( curr_gogkey = get_next_avpl(gog_keys,&cookie) )) { - gop_cfg = g_hash_table_lookup(mc->gopcfgs,curr_gogkey->name); + gop_cfg = (mate_cfg_gop *)g_hash_table_lookup(mc->gopcfgs,curr_gogkey->name); if (( gogkey_match = new_avpl_exact_match(gop_cfg->name,gog->avpl,curr_gogkey,FALSE) )) { - gog_key = g_malloc(sizeof(gogkey)); + gog_key = (gogkey *)g_malloc(sizeof(gogkey)); gog_key->key = avpl_to_str(gogkey_match); delete_avpl(gogkey_match,FALSE); @@ -387,7 +387,7 @@ static void analyze_gop(mate_gop* gop) { /* no gog, let's either find one or create it if due */ dbg_print (dbg_gog,1,dbg_facility,"analyze_gop: no gog"); - gog_keys = g_hash_table_lookup(mc->gogs_by_gopname,gop->cfg->name); + gog_keys = (LoAL *)g_hash_table_lookup(mc->gogs_by_gopname,gop->cfg->name); if ( ! gog_keys ) { dbg_print (dbg_gog,1,dbg_facility,"analyze_gop: no gog_keys for this gop"); @@ -405,7 +405,7 @@ static void analyze_gop(mate_gop* gop) { dbg_print (dbg_gog,1,dbg_facility,"analyze_gop: got gogkey_match: %s",key); - if (( gog = g_hash_table_lookup(gop->cfg->gog_index,key) )) { + if (( gog = (mate_gog *)g_hash_table_lookup(gop->cfg->gog_index,key) )) { dbg_print (dbg_gog,1,dbg_facility,"analyze_gop: got already a matching gog"); if (gog->num_of_counting_gops == gog->num_of_released_gops && gog->expiration < rd->now) { @@ -426,7 +426,7 @@ static void analyze_gop(mate_gop* gop) { } else { dbg_print (dbg_gog,1,dbg_facility,"analyze_gop: no such gog in hash, let's create a new %s",curr_gogkey->name); - cfg = g_hash_table_lookup(mc->gogcfgs,curr_gogkey->name); + cfg = (mate_cfg_gog *)g_hash_table_lookup(mc->gogcfgs,curr_gogkey->name); if (cfg) { gog = new_gog(cfg,gop); @@ -483,13 +483,13 @@ static void analyze_pdu(mate_pdu* pdu) { dbg_print (dbg_gop,1,dbg_facility,"analyze_pdu: %s",pdu->cfg->name); - if (! (cfg = g_hash_table_lookup(mc->gops_by_pduname,pdu->cfg->name)) ) + if (! (cfg = (mate_cfg_gop *)g_hash_table_lookup(mc->gops_by_pduname,pdu->cfg->name)) ) return; if ((gopkey_match = new_avpl_exact_match("gop_key_match",pdu->avpl,cfg->key, TRUE))) { gop_key = avpl_to_str(gopkey_match); - g_hash_table_lookup_extended(cfg->gop_index,(gconstpointer)gop_key,(gpointer)&orig_gop_key,(gpointer)&gop); + g_hash_table_lookup_extended(cfg->gop_index,(gconstpointer)gop_key,(gpointer *)&orig_gop_key,(gpointer *)&gop); if ( gop ) { g_free(gop_key); @@ -548,7 +548,7 @@ static void analyze_pdu(mate_pdu* pdu) { apply_extras(pdu->avpl,gopkey_match,cfg->extra); - gog_keys = g_hash_table_lookup(mc->gogs_by_gopname,cfg->name); + gog_keys = (LoAL *)g_hash_table_lookup(mc->gogs_by_gopname,cfg->name); if (gog_keys) { @@ -746,7 +746,7 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto, data.tree = tree; /* first we create the proto range */ - proto_range = g_malloc(sizeof(mate_range)); + proto_range = (mate_range *)g_malloc(sizeof(mate_range)); proto_range->start = proto->start; proto_range->end = proto->start + proto->length; g_ptr_array_add(data.ranges,proto_range); @@ -772,7 +772,7 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto, } if ( range_fi ) { - range = g_malloc(sizeof(*range)); + range = (mate_range *)g_malloc(sizeof(*range)); range->start = range_fi->start; range->end = range_fi->start + range_fi->length; g_ptr_array_add(data.ranges,range); @@ -809,7 +809,7 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto, } if ( range_fi ) { - range = g_malloc(sizeof(*range)); + range = (mate_range *)g_malloc(sizeof(*range)); range->start = range_fi->start; range->end = range_fi->start + range_fi->length; g_ptr_array_add(data.ranges,range); @@ -852,7 +852,7 @@ extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree) { && rd->highest_analyzed_frame < pinfo->fd->num ) { for ( i = 0; i < mc->pducfglist->len; i++ ) { - cfg = g_ptr_array_index(mc->pducfglist,i); + cfg = (mate_cfg_pdu *)g_ptr_array_index(mc->pducfglist,i); dbg_print (dbg_pdu,4,dbg_facility,"mate_analyze_frame: trying to extract: %s",cfg->name); protos = proto_get_finfo_ptr_array(tree, cfg->hfid_proto); diff --git a/plugins/mate/mate_setup.c b/plugins/mate/mate_setup.c index 177df5a735..e906aaa38b 100644 --- a/plugins/mate/mate_setup.c +++ b/plugins/mate/mate_setup.c @@ -48,7 +48,7 @@ static void report_error(const gchar* fmt, ...) { is going to be called only by the grammar which will set all those elements that aren't set here */ extern mate_cfg_pdu* new_pducfg(gchar* name) { - mate_cfg_pdu* cfg = g_malloc(sizeof(mate_cfg_pdu)); + mate_cfg_pdu* cfg = (mate_cfg_pdu *)g_malloc(sizeof(mate_cfg_pdu)); cfg->name = g_strdup(name); cfg->last_id = 0; @@ -79,7 +79,7 @@ extern mate_cfg_pdu* new_pducfg(gchar* name) { } extern mate_cfg_gop* new_gopcfg(gchar* name) { - mate_cfg_gop* cfg = g_malloc(sizeof(mate_cfg_gop)); + mate_cfg_gop* cfg = (mate_cfg_gop *)g_malloc(sizeof(mate_cfg_gop)); cfg->name = g_strdup(name); cfg->last_id = 0; @@ -114,7 +114,7 @@ extern mate_cfg_gop* new_gopcfg(gchar* name) { } extern mate_cfg_gog* new_gogcfg(gchar* name) { - mate_cfg_gog* cfg = g_malloc(sizeof(mate_cfg_gop)); + mate_cfg_gog* cfg = (mate_cfg_gog *)g_malloc(sizeof(mate_cfg_gop)); cfg->name = g_strdup(name); cfg->last_id = 0; @@ -163,11 +163,11 @@ extern gboolean add_hfid(header_field_info* hfi, gchar* how, GHashTable* where) while (hfi) { exists = TRUE; - ip = g_malloc(sizeof(int)); + ip = (int *)g_malloc(sizeof(int)); *ip = hfi->id; - if (( as = g_hash_table_lookup(where,ip) )) { + if (( as = (gchar *)g_hash_table_lookup(where,ip) )) { g_free(ip); if (! g_str_equal(as,how)) { report_error("MATE Error: add field to Pdu: attempt to add %s(%i) as %s" @@ -201,7 +201,7 @@ extern gchar* add_ranges(gchar* range,GPtrArray* range_ptr_arr) { for (i=0; ranges[i]; i++) { hfi = proto_registrar_get_byname(ranges[i]); if (hfi) { - hfidp = g_malloc(sizeof(int)); + hfidp = (int *)g_malloc(sizeof(int)); *hfidp = hfi->id; g_ptr_array_add(range_ptr_arr,(gpointer)hfidp); g_string_append_printf(matecfg->fields_filter, "||%s",ranges[i]); @@ -218,7 +218,7 @@ extern gchar* add_ranges(gchar* range,GPtrArray* range_ptr_arr) { } static void new_attr_hfri(gchar* item_name, GHashTable* hfids, gchar* name) { - int* p_id = g_malloc(sizeof(int)); + int* p_id = (int *)g_malloc(sizeof(int)); hf_register_info hfri; memset(&hfri, 0, sizeof hfri); @@ -247,7 +247,7 @@ static const gchar* my_protoname(int proto_id) { } static void analyze_pdu_hfids(gpointer k, gpointer v, gpointer p) { - mate_cfg_pdu* cfg = p; + mate_cfg_pdu* cfg = (mate_cfg_pdu *)p; new_attr_hfri(cfg->name,cfg->my_hfids,(gchar*) v); g_string_append_printf(matecfg->fields_filter,"||%s",my_protoname(*(int*)k)); @@ -260,7 +260,7 @@ static void analyze_transform_hfrs(gchar* name, GPtrArray* transforms, GHashTabl AVP* avp; for (i=0; i < transforms->len;i++) { - for (t = g_ptr_array_index(transforms,i); t; t=t->next ) { + for (t = (AVPL_Transf *)g_ptr_array_index(transforms,i); t; t=t->next ) { cookie = NULL; while(( avp = get_next_avp(t->replace,&cookie) )) { if (! g_hash_table_lookup(hfids,avp->n)) { @@ -314,7 +314,7 @@ static void analyze_pdu_config(mate_cfg_pdu* cfg) { } static void analyze_gop_config(gpointer k _U_, gpointer v, gpointer p _U_) { - mate_cfg_gop* cfg = v; + mate_cfg_gop* cfg = (mate_cfg_gop *)v; void* cookie = NULL; AVP* avp; gint* ett; @@ -426,7 +426,7 @@ static void analyze_gop_config(gpointer k _U_, gpointer v, gpointer p _U_) { } static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p _U_) { - mate_cfg_gog* cfg = v; + mate_cfg_gog* cfg = (mate_cfg_gog *)v; void* avp_cookie; void* avpl_cookie; AVP* avp; @@ -506,7 +506,7 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p _U_) { avpl_cookie = NULL; while (( avpl = get_next_avpl(cfg->keys,&avpl_cookie) )) { - if (! ( gog_keys = g_hash_table_lookup(matecfg->gogs_by_gopname,avpl->name))) { + if (! ( gog_keys = (LoAL *)g_hash_table_lookup(matecfg->gogs_by_gopname,avpl->name))) { gog_keys = new_loal(avpl->name); g_hash_table_insert(matecfg->gogs_by_gopname,gog_keys->name,gog_keys); } @@ -575,7 +575,7 @@ extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) { gint* ett; avp_init(); - matecfg = g_malloc(sizeof(mate_config)); + matecfg = (mate_config *)g_malloc(sizeof(mate_config)); matecfg->hfid_mate = mate_hfid; diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c index 8de5db6d0b..06a005796e 100644 --- a/plugins/mate/mate_util.c +++ b/plugins/mate/mate_util.c @@ -102,7 +102,7 @@ static void destroy_scs_collection(SCS_collection* c) { } static SCS_collection* scs_init(void) { - SCS_collection* c = g_malloc(sizeof(SCS_collection)); + SCS_collection* c = (SCS_collection *)g_malloc(sizeof(SCS_collection)); c->hash = g_hash_table_new(g_str_hash,g_str_equal); @@ -127,7 +127,7 @@ gchar* scs_subscribe(SCS_collection* c, const gchar* s) { guint* ip = NULL; size_t len = 0; - g_hash_table_lookup_extended(c->hash,(gconstpointer)s,(gpointer)&orig,(gpointer)&ip); + g_hash_table_lookup_extended(c->hash,(gconstpointer)s,(gpointer)&orig,(gpointer *)&ip); if (ip) { (*ip)++; @@ -150,7 +150,7 @@ gchar* scs_subscribe(SCS_collection* c, const gchar* s) { g_warning("mate SCS: string truncated due to huge size"); } - orig = g_slice_alloc(len); + orig = (gchar *)g_slice_alloc(len); g_strlcpy(orig,s,len); g_hash_table_insert(c->hash,orig,ip); @@ -172,7 +172,7 @@ void scs_unsubscribe(SCS_collection* c, gchar* s) { guint* ip = NULL; size_t len = 0xffff; - g_hash_table_lookup_extended(c->hash,(gconstpointer)s,(gpointer)&orig,(gpointer)&ip); + g_hash_table_lookup_extended(c->hash,(gconstpointer)s,(gpointer *)&orig,(gpointer *)&ip); if (ip) { if (*ip == 0) { @@ -309,11 +309,11 @@ extern void avp_init(void) { * **/ extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo) { - AVP* new = (AVP*)g_slice_new(any_avp_type); + AVP* new_avp = (AVP*)g_slice_new(any_avp_type); gchar* value; gchar* repr = NULL; - new->n = scs_subscribe(avp_strings, name); + new_avp->n = scs_subscribe(avp_strings, name); if (finfo->value.ftype->val_to_string_repr) { repr = fvalue_to_string_repr(&finfo->value,FTREPR_DISPLAY,NULL); @@ -331,15 +331,15 @@ extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo) { value = scs_subscribe(avp_strings, ""); } - new->v = value; + new_avp->v = value; - new->o = '='; + new_avp->o = '='; #ifdef _AVP_DEBUGGING - dbg_print (dbg_avp,1,dbg_fp,"new_avp_from_finfo: %X %s%c%s;",(guint32) new,new->n,new->o,new->v); + dbg_print (dbg_avp,1,dbg_fp,"new_avp_from_finfo: %X %s%c%s;",(guint32) new_avp,new_avp->n,new_avp->o,new_avp->v); #endif - return new; + return new_avp; } @@ -355,16 +355,16 @@ extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo) { * **/ extern AVP* new_avp(const gchar* name, const gchar* value, gchar o) { - AVP* new = (AVP*)g_slice_new(any_avp_type); + AVP* new_avp = (AVP*)g_slice_new(any_avp_type); - new->n = scs_subscribe(avp_strings, name); - new->v = scs_subscribe(avp_strings, value); - new->o = o; + new_avp->n = scs_subscribe(avp_strings, name); + new_avp->v = scs_subscribe(avp_strings, value); + new_avp->o = o; #ifdef _AVP_DEBUGGING - dbg_print(dbg_avp,1,dbg_fp,"new_avp: %X %s%c%s;",(guint32) new,new->n,new->o,new->v); + dbg_print(dbg_avp,1,dbg_fp,"new_avp: %X %s%c%s;",(guint32) new_avp,new_avp->n,new_avp->o,new_avp->v); #endif - return new; + return new_avp; } @@ -396,17 +396,17 @@ extern void delete_avp(AVP* avp) { * **/ extern AVP* avp_copy(AVP* from) { - AVP* new = (AVP*)g_slice_new(any_avp_type); + AVP* new_avp = (AVP*)g_slice_new(any_avp_type); - new->n = scs_subscribe(avp_strings, from->n); - new->v = scs_subscribe(avp_strings, from->v); - new->o = from->o; + new_avp->n = scs_subscribe(avp_strings, from->n); + new_avp->v = scs_subscribe(avp_strings, from->v); + new_avp->o = from->o; #ifdef _AVP_DEBUGGING - dbg_print(dbg_avp,1,dbg_fp,"copy_avp: %X %s%c%s;",(guint32) new,new->n,new->o,new->v); + dbg_print(dbg_avp,1,dbg_fp,"copy_avp: %X %s%c%s;",(guint32) new_avp,new_avp->n,new_avp->o,new_avp->v); #endif - return new; + return new_avp; } /** @@ -453,13 +453,13 @@ extern void rename_avpl(AVPL* avpl, gchar* name) { * it is not inserted. **/ extern gboolean insert_avp(AVPL* avpl, AVP* avp) { - AVPN* new = (AVPN*)g_slice_new(any_avp_type); + AVPN* new_avp = (AVPN*)g_slice_new(any_avp_type); AVPN* c; - new->avp = avp; + new_avp->avp = avp; #ifdef _AVP_DEBUGGING - dbg_print(dbg_avpl_op,7,dbg_fp,"new_avpn: %X",new); + dbg_print(dbg_avpl_op,7,dbg_fp,"new_avpn: %X",new_avp); dbg_print(dbg_avpl_op,4,dbg_fp,"insert_avp: %X %X %s%c%s;",avpl,avp,avp->n,avp->o,avp->v); #endif @@ -475,9 +475,9 @@ extern gboolean insert_avp(AVPL* avpl, AVP* avp) { if (avp->v == c->avp->v) { if (avp->o == AVP_OP_EQUAL) { #ifdef _AVP_DEBUGGING - dbg_print(dbg_avpl_op,7,dbg_fp,"delete_avpn: %X",new); + dbg_print(dbg_avpl_op,7,dbg_fp,"delete_avpn: %X",new_avp); #endif - g_slice_free(any_avp_type,(any_avp_type*)new); + g_slice_free(any_avp_type,(any_avp_type*)new_avp); return FALSE; } } @@ -492,10 +492,10 @@ extern gboolean insert_avp(AVPL* avpl, AVP* avp) { dbg_print(dbg_avpl,5,dbg_fp,"insert_avp: inserting %X in %X before %X;",avp,avpl,c); #endif - new->next = c; - new->prev = c->prev; - c->prev->next = new; - c->prev = new; + new_avp->next = c; + new_avp->prev = c->prev; + c->prev->next = new_avp; + c->prev = new_avp; avpl->len++; diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c index 37f4baed1c..7b45b18fec 100644 --- a/plugins/mate/packet-mate.c +++ b/plugins/mate/packet-mate.c @@ -52,7 +52,7 @@ static void pdu_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_pdu* pdu) { avpl_t = proto_item_add_subtree(avpl_i, pdu->cfg->ett_attr); for ( c = pdu->avpl->null.next; c->avp; c = c->next) { - hfi_p = g_hash_table_lookup(pdu->cfg->my_hfids,(char*)c->avp->n); + hfi_p = (int *)g_hash_table_lookup(pdu->cfg->my_hfids,(char*)c->avp->n); if (hfi_p) { proto_tree_add_string(avpl_t,*hfi_p,tvb,0,0,c->avp->v); @@ -73,7 +73,7 @@ static void gop_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) { avpl_t = proto_item_add_subtree(avpl_i, gop->cfg->ett_attr); for ( c = gop->avpl->null.next; c->avp; c = c->next) { - hfi_p = g_hash_table_lookup(gop->cfg->my_hfids,(char*)c->avp->n); + hfi_p = (int *)g_hash_table_lookup(gop->cfg->my_hfids,(char*)c->avp->n); if (hfi_p) { proto_tree_add_string(avpl_t,*hfi_p,tvb,0,0,c->avp->v); @@ -94,7 +94,7 @@ static void gog_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog) { avpl_t = proto_item_add_subtree(avpl_i, gog->cfg->ett_attr); for ( c = gog->avpl->null.next; c->avp; c = c->next) { - hfi_p = g_hash_table_lookup(gog->cfg->my_hfids,(char*)c->avp->n); + hfi_p = (int *)g_hash_table_lookup(gog->cfg->my_hfids,(char*)c->avp->n); if (hfi_p) { proto_tree_add_string(avpl_t,*hfi_p,tvb,0,0,c->avp->v); |