From 7ffa781dc39a7274692d8db11043b3a9e92e36ce Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Tue, 25 Aug 2015 08:45:46 +0000 Subject: Re #1881: Fixed compile warnings on VS2015 about declaration hides previous declaration. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5170 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/pjsua/pjsua_app.c | 42 +++++++++++------------ pjsip-apps/src/pjsua/pjsua_app_cli.c | 60 ++++++++++++++++----------------- pjsip-apps/src/pjsua/pjsua_app_legacy.c | 42 +++++++++++------------ pjsip-apps/src/samples/clidemo.c | 5 ++- pjsip-apps/src/samples/httpdemo.c | 8 ++--- pjsip-apps/src/samples/mix.c | 6 ++-- pjsip-apps/src/samples/pcaputil.c | 2 -- pjsip-apps/src/samples/pjsip-perf.c | 8 ++--- pjsip-apps/src/samples/siprtp.c | 3 -- pjsip-apps/src/samples/stateful_proxy.c | 12 +++---- 10 files changed, 91 insertions(+), 97 deletions(-) (limited to 'pjsip-apps') diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index 912d986f..af34ac91 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -138,7 +138,7 @@ static void call_timeout_callback(pj_timer_heap_t *timer_heap, struct pj_timer_entry *entry) { pjsua_call_id call_id = entry->id; - pjsua_msg_data msg_data; + pjsua_msg_data msg_data_; pjsip_generic_string_hdr warn; pj_str_t hname = pj_str("Warning"); pj_str_t hvalue = pj_str("399 pjsua \"Call duration exceeded\""); @@ -151,16 +151,16 @@ static void call_timeout_callback(pj_timer_heap_t *timer_heap, } /* Add warning header */ - pjsua_msg_data_init(&msg_data); + pjsua_msg_data_init(&msg_data_); pjsip_generic_string_hdr_init2(&warn, &hname, &hvalue); - pj_list_push_back(&msg_data.hdr_list, &warn); + pj_list_push_back(&msg_data_.hdr_list, &warn); /* Call duration has been exceeded; disconnect the call */ PJ_LOG(3,(THIS_FILE, "Duration (%d seconds) has been exceeded " "for call %d, disconnecting the call", app_config.duration, call_id)); entry->id = PJSUA_INVALID_ID; - pjsua_call_hangup(call_id, 200, NULL, &msg_data); + pjsua_call_hangup(call_id, 200, NULL, &msg_data_); } /* @@ -293,13 +293,13 @@ static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, ring_start(call_id); if (app_config.auto_answer > 0) { - pjsua_call_setting call_opt; + pjsua_call_setting opt; - pjsua_call_setting_default(&call_opt); - call_opt.aud_cnt = app_config.aud_cnt; - call_opt.vid_cnt = app_config.vid.vid_cnt; + pjsua_call_setting_default(&opt); + opt.aud_cnt = app_config.aud_cnt; + opt.vid_cnt = app_config.vid.vid_cnt; - pjsua_call_answer2(call_id, &call_opt, app_config.auto_answer, NULL, + pjsua_call_answer2(call_id, &opt, app_config.auto_answer, NULL, NULL); } @@ -667,7 +667,7 @@ static void on_incoming_subscribe(pjsua_acc_id acc_id, pjsip_rx_data *rdata, pjsip_status_code *code, pj_str_t *reason, - pjsua_msg_data *msg_data) + pjsua_msg_data *msg_data_) { /* Just accept the request (the default behavior) */ PJ_UNUSED_ARG(acc_id); @@ -677,7 +677,7 @@ static void on_incoming_subscribe(pjsua_acc_id acc_id, PJ_UNUSED_ARG(rdata); PJ_UNUSED_ARG(code); PJ_UNUSED_ARG(reason); - PJ_UNUSED_ARG(msg_data); + PJ_UNUSED_ARG(msg_data_); } @@ -1412,26 +1412,26 @@ static pj_status_t app_init() pjmedia_port *tport; char name[80]; pj_str_t label; - pj_status_t status; + pj_status_t status2; pj_ansi_snprintf(name, sizeof(name), "tone-%d,%d", app_config.tones[i].freq1, app_config.tones[i].freq2); label = pj_str(name); - status = pjmedia_tonegen_create2(app_config.pool, &label, - 8000, 1, 160, 16, - PJMEDIA_TONEGEN_LOOP, &tport); - if (status != PJ_SUCCESS) { + status2 = pjmedia_tonegen_create2(app_config.pool, &label, + 8000, 1, 160, 16, + PJMEDIA_TONEGEN_LOOP, &tport); + if (status2 != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Unable to create tone generator", status); goto on_error; } - status = pjsua_conf_add_port(app_config.pool, tport, + status2 = pjsua_conf_add_port(app_config.pool, tport, &app_config.tone_slots[i]); - pj_assert(status == PJ_SUCCESS); + pj_assert(status2 == PJ_SUCCESS); - status = pjmedia_tonegen_play(tport, 1, &app_config.tones[i], 0); - pj_assert(status == PJ_SUCCESS); + status2 = pjmedia_tonegen_play(tport, 1, &app_config.tones[i], 0); + pj_assert(status2 == PJ_SUCCESS); } /* Optionally create recorder file, if any. */ @@ -1448,7 +1448,7 @@ static pj_status_t app_init() /* Create ringback tones */ if (app_config.no_tones == PJ_FALSE) { - unsigned i, samples_per_frame; + unsigned samples_per_frame; pjmedia_tone_desc tone[RING_CNT+RINGBACK_CNT]; pj_str_t name; diff --git a/pjsip-apps/src/pjsua/pjsua_app_cli.c b/pjsip-apps/src/pjsua/pjsua_app_cli.c index 0ba15979..4d6b1d41 100644 --- a/pjsip-apps/src/pjsua/pjsua_app_cli.c +++ b/pjsip-apps/src/pjsua/pjsua_app_cli.c @@ -1748,9 +1748,9 @@ static pj_status_t cmd_transfer_call(pj_cli_cmd_val *cval) pjsua_call_xfer( current_call, &binfo.uri, &msg_data); } } else if (result.uri_result) { - pj_str_t tmp; - tmp = pj_str(result.uri_result); - pjsua_call_xfer( current_call, &tmp, &msg_data); + pj_str_t tmp2; + tmp2 = pj_str(result.uri_result); + pjsua_call_xfer( current_call, &tmp2, &msg_data); } } return PJ_SUCCESS; @@ -1768,7 +1768,7 @@ static pj_status_t cmd_transfer_replace_call(pj_cli_cmd_val *cval) pj_str_t STR_REFER_SUB = { "Refer-Sub", 9 }; pj_str_t STR_FALSE = { "false", 5 }; pjsua_call_id ids[PJSUA_MAX_CALLS]; - pjsua_msg_data msg_data; + pjsua_msg_data msg_data_; char buf[8] = {0}; pj_str_t tmp = pj_str(buf); unsigned count; @@ -1822,17 +1822,17 @@ static pj_status_t cmd_transfer_replace_call(pj_cli_cmd_val *cval) return PJ_SUCCESS; } - pjsua_msg_data_init(&msg_data); + pjsua_msg_data_init(&msg_data_); if (app_config.no_refersub) { /* Add Refer-Sub: false in outgoing REFER request */ pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, &STR_FALSE); - pj_list_push_back(&msg_data.hdr_list, &refer_sub); + pj_list_push_back(&msg_data_.hdr_list, &refer_sub); } pjsua_call_xfer_replaces(call, dst_call, PJSUA_XFER_NO_REQUIRE_REPLACES, - &msg_data); + &msg_data_); } return PJ_SUCCESS; } @@ -2661,7 +2661,7 @@ static pj_status_t cmd_restart_handler(pj_cli_cmd_val *cval) return PJ_SUCCESS; } -static pj_status_t add_call_command(pj_cli_t *cli) +static pj_status_t add_call_command(pj_cli_t *c) { char* call_command = "" @@ -2733,12 +2733,12 @@ static pj_status_t add_call_command(pj_cli_t *cli) ""; pj_str_t xml = pj_str(call_command); - return pj_cli_add_cmd_from_xml(cli, NULL, + return pj_cli_add_cmd_from_xml(c, NULL, &xml, cmd_call_handler, NULL, get_choice_value); } -static pj_status_t add_presence_command(pj_cli_t *cli) +static pj_status_t add_presence_command(pj_cli_t *c) { char* presence_command = "" @@ -2789,12 +2789,12 @@ static pj_status_t add_presence_command(pj_cli_t *cli) pj_str_t xml = pj_str(presence_command); - return pj_cli_add_cmd_from_xml(cli, NULL, + return pj_cli_add_cmd_from_xml(c, NULL, &xml, cmd_presence_handler, NULL, get_choice_value); } -static pj_status_t add_account_command(pj_cli_t *cli) +static pj_status_t add_account_command(pj_cli_t *c) { char* account_command = "" @@ -2834,12 +2834,12 @@ static pj_status_t add_account_command(pj_cli_t *cli) ""; pj_str_t xml = pj_str(account_command); - return pj_cli_add_cmd_from_xml(cli, NULL, + return pj_cli_add_cmd_from_xml(c, NULL, &xml, cmd_account_handler, NULL, get_choice_value); } -static pj_status_t add_media_command(pj_cli_t *cli) +static pj_status_t add_media_command(pj_cli_t *c) { char* media_command = "" @@ -2869,12 +2869,12 @@ static pj_status_t add_media_command(pj_cli_t *cli) ""; pj_str_t xml = pj_str(media_command); - return pj_cli_add_cmd_from_xml(cli, NULL, + return pj_cli_add_cmd_from_xml(c, NULL, &xml, cmd_media_handler, NULL, get_choice_value); } -static pj_status_t add_config_command(pj_cli_t *cli) +static pj_status_t add_config_command(pj_cli_t *c) { char* config_command = "" @@ -2890,7 +2890,7 @@ static pj_status_t add_config_command(pj_cli_t *cli) ""; pj_str_t xml = pj_str(config_command); - return pj_cli_add_cmd_from_xml(cli, NULL, + return pj_cli_add_cmd_from_xml(c, NULL, &xml, cmd_config_handler, NULL, get_choice_value); } @@ -3041,7 +3041,7 @@ static pj_status_t add_video_command(pj_cli_t *cli) } #endif -static pj_status_t add_other_command(pj_cli_t *cli) +static pj_status_t add_other_command(pj_cli_t *c) { char* sleep_command = "" @@ -3068,63 +3068,63 @@ static pj_status_t add_other_command(pj_cli_t *cli) pj_str_t shutdown_xml = pj_str(shutdown_command); pj_str_t restart_xml = pj_str(restart_command); - status = pj_cli_add_cmd_from_xml(cli, NULL, + status = pj_cli_add_cmd_from_xml(c, NULL, &sleep_xml, cmd_sleep_handler, NULL, NULL); if (status != PJ_SUCCESS) return status; - status = pj_cli_add_cmd_from_xml(cli, NULL, + status = pj_cli_add_cmd_from_xml(c, NULL, &network_xml, cmd_network_handler, NULL, NULL); if (status != PJ_SUCCESS) return status; - status = pj_cli_add_cmd_from_xml(cli, NULL, + status = pj_cli_add_cmd_from_xml(c, NULL, &shutdown_xml, cmd_quit_handler, NULL, NULL); if (status != PJ_SUCCESS) return status; - status = pj_cli_add_cmd_from_xml(cli, NULL, + status = pj_cli_add_cmd_from_xml(c, NULL, &restart_xml, cmd_restart_handler, NULL, NULL); return status; } -pj_status_t cli_setup_command(pj_cli_t *cli) +pj_status_t cli_setup_command(pj_cli_t *c) { pj_status_t status; - status = add_call_command(cli); + status = add_call_command(c); if (status != PJ_SUCCESS) return status; - status = add_presence_command(cli); + status = add_presence_command(c); if (status != PJ_SUCCESS) return status; - status = add_account_command(cli); + status = add_account_command(c); if (status != PJ_SUCCESS) return status; - status = add_media_command(cli); + status = add_media_command(c); if (status != PJ_SUCCESS) return status; - status = add_config_command(cli); + status = add_config_command(c); if (status != PJ_SUCCESS) return status; #if PJSUA_HAS_VIDEO - status = add_video_command(cli); + status = add_video_command(c); if (status != PJ_SUCCESS) return status; #endif - status = add_other_command(cli); + status = add_other_command(c); return status; } diff --git a/pjsip-apps/src/pjsua/pjsua_app_legacy.c b/pjsip-apps/src/pjsua/pjsua_app_legacy.c index d687aded..dab8bfb9 100644 --- a/pjsip-apps/src/pjsua/pjsua_app_legacy.c +++ b/pjsip-apps/src/pjsua/pjsua_app_legacy.c @@ -606,7 +606,7 @@ on_error: static void ui_make_new_call() { char buf[128]; - pjsua_msg_data msg_data; + pjsua_msg_data msg_data_; input_result result; pj_str_t tmp; @@ -631,10 +631,10 @@ static void ui_make_new_call() tmp.slen = 0; } - pjsua_msg_data_init(&msg_data); - TEST_MULTIPART(&msg_data); + pjsua_msg_data_init(&msg_data_); + TEST_MULTIPART(&msg_data_); pjsua_call_make_call(current_acc, &tmp, &call_opt, NULL, - &msg_data, ¤t_call); + &msg_data_, ¤t_call); } static void ui_make_multi_call() @@ -757,7 +757,7 @@ static void ui_answer_call() { pjsua_call_info call_info; char buf[128]; - pjsua_msg_data msg_data; + pjsua_msg_data msg_data_; if (current_call != -1) { pjsua_call_get_info(current_call, &call_info); @@ -789,7 +789,7 @@ static void ui_answer_call() if (st_code < 100) return; - pjsua_msg_data_init(&msg_data); + pjsua_msg_data_init(&msg_data_); if (st_code/100 == 3) { if (!simple_input("Enter URL to be put in Contact", @@ -798,7 +798,7 @@ static void ui_answer_call() hvalue = pj_str(contact); pjsip_generic_string_hdr_init2(&hcontact, &hname, &hvalue); - pj_list_push_back(&msg_data.hdr_list, &hcontact); + pj_list_push_back(&msg_data_.hdr_list, &hcontact); } /* @@ -812,7 +812,7 @@ static void ui_answer_call() return; } - pjsua_call_answer2(current_call, &call_opt, st_code, NULL, &msg_data); + pjsua_call_answer2(current_call, &call_opt, st_code, NULL, &msg_data_); } } @@ -1079,7 +1079,7 @@ static void ui_call_transfer(pj_bool_t no_refersub) pj_str_t STR_FALSE = { "false", 5 }; pjsua_call_info ci; input_result result; - pjsua_msg_data msg_data; + pjsua_msg_data msg_data_; pjsua_call_get_info(current_call, &ci); printf("Transferring current call [%d] %.*s\n", current_call, @@ -1094,12 +1094,12 @@ static void ui_call_transfer(pj_bool_t no_refersub) return; } - pjsua_msg_data_init(&msg_data); + pjsua_msg_data_init(&msg_data_); if (no_refersub) { /* Add Refer-Sub: false in outgoing REFER request */ pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, &STR_FALSE); - pj_list_push_back(&msg_data.hdr_list, &refer_sub); + pj_list_push_back(&msg_data_.hdr_list, &refer_sub); } if (result.nb_result != PJSUA_APP_NO_NB) { if (result.nb_result == -1 || result.nb_result == 0) { @@ -1107,13 +1107,13 @@ static void ui_call_transfer(pj_bool_t no_refersub) } else { pjsua_buddy_info binfo; pjsua_buddy_get_info(result.nb_result-1, &binfo); - pjsua_call_xfer( current_call, &binfo.uri, &msg_data); + pjsua_call_xfer( current_call, &binfo.uri, &msg_data_); } } else if (result.uri_result) { pj_str_t tmp; tmp = pj_str(result.uri_result); - pjsua_call_xfer( current_call, &tmp, &msg_data); + pjsua_call_xfer( current_call, &tmp, &msg_data_); } } } @@ -1130,7 +1130,7 @@ static void ui_call_transfer_replaces(pj_bool_t no_refersub) pj_str_t STR_FALSE = { "false", 5 }; pjsua_call_id ids[PJSUA_MAX_CALLS]; pjsua_call_info ci; - pjsua_msg_data msg_data; + pjsua_msg_data msg_data_; char buf[128]; unsigned i, count; @@ -1189,17 +1189,17 @@ static void ui_call_transfer_replaces(pj_bool_t no_refersub) return; } - pjsua_msg_data_init(&msg_data); + pjsua_msg_data_init(&msg_data_); if (no_refersub) { /* Add Refer-Sub: false in outgoing REFER request */ pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, &STR_FALSE); - pj_list_push_back(&msg_data.hdr_list, &refer_sub); + pj_list_push_back(&msg_data_.hdr_list, &refer_sub); } pjsua_call_xfer_replaces(call, dst_call, PJSUA_XFER_NO_REQUIRE_REPLACES, - &msg_data); + &msg_data_); } } @@ -1262,19 +1262,19 @@ static void ui_send_dtmf_info() digits = pj_str(buf); for (i=0; iversion.slen, resp->version.ptr, resp->status_code, (int)resp->reason.slen, resp->reason.ptr)); @@ -65,9 +65,9 @@ static void on_response(pj_http_req *http_req, const pj_http_resp *resp) } } -static void on_send_data(pj_http_req *http_req, void **data, pj_size_t *size) +static void on_send_data(pj_http_req *req, void **data, pj_size_t *size) { - PJ_UNUSED_ARG(http_req); + PJ_UNUSED_ARG(req); PJ_UNUSED_ARG(size); PJ_UNUSED_ARG(data); } diff --git a/pjsip-apps/src/samples/mix.c b/pjsip-apps/src/samples/mix.c index cc139f76..da2dd6d8 100644 --- a/pjsip-apps/src/samples/mix.c +++ b/pjsip-apps/src/samples/mix.c @@ -195,14 +195,14 @@ int main(int argc, char *argv[]) processed = 0; while (processed < longest + clock_rate * APPEND * 2 / 1000) { pj_int16_t framebuf[PTIME * 48000 / 1000]; - pjmedia_port *cp = pjmedia_conf_get_master_port(conf); + pjmedia_port *mp = pjmedia_conf_get_master_port(conf); pjmedia_frame frame; frame.buf = framebuf; - frame.size = PJMEDIA_PIA_SPF(&cp->info) * 2; + frame.size = PJMEDIA_PIA_SPF(&mp->info) * 2; pj_assert(frame.size <= sizeof(framebuf)); - CHECK( pjmedia_port_get_frame(cp, &frame) ); + CHECK( pjmedia_port_get_frame(mp, &frame) ); if (frame.type != PJMEDIA_FRAME_TYPE_AUDIO) { pj_bzero(frame.buf, frame.size); diff --git a/pjsip-apps/src/samples/pcaputil.c b/pjsip-apps/src/samples/pcaputil.c index 86a58010..ad1022f7 100644 --- a/pjsip-apps/src/samples/pcaputil.c +++ b/pjsip-apps/src/samples/pcaputil.c @@ -371,8 +371,6 @@ static void pcap2wav(const pj_str_t *codec, /* Decode and write to WAV file */ samples_cnt = 0; for (i=0; imod_data[mod_tu.id]; - if (uas_data->uac_tsx && uas_data->uac_tsx->status_code < 200) { + uas_data2 = (struct uas_data*) invite_uas->mod_data[mod_tu.id]; + if (uas_data2->uac_tsx && uas_data2->uac_tsx->status_code < 200) { pjsip_tx_data *cancel; - pj_grp_lock_acquire(uas_data->uac_tsx->grp_lock); + pj_grp_lock_acquire(uas_data2->uac_tsx->grp_lock); - pjsip_endpt_create_cancel(global.endpt, uas_data->uac_tsx->last_tx, + pjsip_endpt_create_cancel(global.endpt, uas_data2->uac_tsx->last_tx, &cancel); pjsip_endpt_send_request(global.endpt, cancel, -1, NULL, NULL); - pj_grp_lock_release(uas_data->uac_tsx->grp_lock); + pj_grp_lock_release(uas_data2->uac_tsx->grp_lock); } /* Unlock UAS tsx because it is locked in find_tsx() */ -- cgit v1.2.3