From 32669005e5809e7f0825bf3b0d0e79a7e30e0abf Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Fri, 27 Mar 2015 06:17:27 +0000 Subject: Re #1828: Fixed misc compile warnings (on iOS). git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5035 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/pjsystest/main_console.c | 2 +- pjsip-apps/src/samples/pcaputil.c | 2 +- pjsip-apps/src/samples/pjsip-perf.c | 6 +----- pjsip-apps/src/samples/siprtp.c | 5 +++-- 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'pjsip-apps/src') diff --git a/pjsip-apps/src/pjsystest/main_console.c b/pjsip-apps/src/pjsystest/main_console.c index 6c1aa6e8..122cdc72 100644 --- a/pjsip-apps/src/pjsystest/main_console.c +++ b/pjsip-apps/src/pjsystest/main_console.c @@ -99,7 +99,7 @@ pj_status_t gui_start(gui_menu *menu) choice = menu; while (*p && *p!='\r' && *p!='\n') { unsigned d = (*p - '0'); - if (d < 0 || d >= choice->submenu_cnt) { + if (d >= choice->submenu_cnt) { puts("Invalid selection"); choice = NULL; break; diff --git a/pjsip-apps/src/samples/pcaputil.c b/pjsip-apps/src/samples/pcaputil.c index bb231127..86a58010 100644 --- a/pjsip-apps/src/samples/pcaputil.c +++ b/pjsip-apps/src/samples/pcaputil.c @@ -307,7 +307,7 @@ static void pcap2wav(const pj_str_t *codec, /* Get codec info and param for the specified payload type */ app.pt = pkt0.rtp->pt; - if (app.pt >=0 && app.pt < 96) { + if (app.pt < 96) { T( pjmedia_codec_mgr_get_codec_info(cmgr, pkt0.rtp->pt, &ci) ); } else { unsigned cnt = 2; diff --git a/pjsip-apps/src/samples/pjsip-perf.c b/pjsip-apps/src/samples/pjsip-perf.c index 2a435cfe..974e9337 100644 --- a/pjsip-apps/src/samples/pjsip-perf.c +++ b/pjsip-apps/src/samples/pjsip-perf.c @@ -1215,10 +1215,6 @@ static pj_status_t init_options(int argc, char *argv[]) case 'c': app.client.job_count = my_atoi(pj_optarg); - if (app.client.job_count < 0) { - PJ_LOG(3,(THIS_FILE, "Invalid --local-port %s", pj_optarg)); - return -1; - } if (app.client.job_count > pjsip_cfg()->tsx.max_count) PJ_LOG(3,(THIS_FILE, "Warning: --count value (%d) exceeds maximum " @@ -1259,7 +1255,7 @@ static pj_status_t init_options(int argc, char *argv[]) case 't': app.client.timeout = my_atoi(pj_optarg); - if (app.client.timeout < 0 || app.client.timeout > 600) { + if (app.client.timeout > 600) { PJ_LOG(3,(THIS_FILE, "Invalid --timeout %s", pj_optarg)); return -1; } diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c index f783b6aa..1bee1f5c 100644 --- a/pjsip-apps/src/samples/siprtp.c +++ b/pjsip-apps/src/samples/siprtp.c @@ -914,8 +914,9 @@ static pj_status_t init_options(int argc, char *argv[]) switch (c) { case 'c': app.max_calls = atoi(pj_optarg); - if (app.max_calls < 0 || app.max_calls > MAX_CALLS) { - PJ_LOG(3,(THIS_FILE, "Invalid max calls value %s", pj_optarg)); + if (app.max_calls > MAX_CALLS) { + PJ_LOG(3,(THIS_FILE,"Invalid max calls value %s " + "(must be <= %d)", pj_optarg, MAX_CALLS)); return 1; } break; -- cgit v1.2.3