From e91435553f8ef0d86f5ac01c298071dd3ea28bb2 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 14 Apr 2008 04:04:30 +0000 Subject: Fixed miscellaneous compile warnings/errors when built with C++ mode git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1929 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia/conference.c | 6 ++++-- pjmedia/src/pjmedia/g711.c | 6 +++--- pjmedia/src/pjmedia/stereo_port.c | 12 ++++++++---- pjmedia/src/pjmedia/transport_srtp.c | 17 +++++++++-------- 4 files changed, 24 insertions(+), 17 deletions(-) (limited to 'pjmedia') diff --git a/pjmedia/src/pjmedia/conference.c b/pjmedia/src/pjmedia/conference.c index 9930bc75..c766cdf0 100644 --- a/pjmedia/src/pjmedia/conference.c +++ b/pjmedia/src/pjmedia/conference.c @@ -1373,14 +1373,16 @@ static pj_status_t read_port( pjmedia_conf *conf, /* Adjust channels */ if (cport->channel_count != conf->channel_count) { if (cport->channel_count == 1) { - pjmedia_convert_channel_1ton(f.buf, f.buf, + pjmedia_convert_channel_1ton((pj_int16_t*)f.buf, + (const pj_int16_t*)f.buf, conf->channel_count, cport->samples_per_frame, 0); cport->rx_buf_count += (cport->samples_per_frame * conf->channel_count); } else { /* conf->channel_count == 1 */ - pjmedia_convert_channel_nto1(f.buf, f.buf, + pjmedia_convert_channel_nto1((pj_int16_t*)f.buf, + (const pj_int16_t*)f.buf, cport->channel_count, cport->samples_per_frame, PJMEDIA_STEREO_MIX, 0); diff --git a/pjmedia/src/pjmedia/g711.c b/pjmedia/src/pjmedia/g711.c index afc4a1db..6d64deab 100644 --- a/pjmedia/src/pjmedia/g711.c +++ b/pjmedia/src/pjmedia/g711.c @@ -583,7 +583,7 @@ static pj_status_t g711_decode(pjmedia_codec *codec, #if !PLC_DISABLED if (priv->plc_enabled) - pjmedia_plc_save( priv->plc, output->buf); + pjmedia_plc_save( priv->plc, (pj_int16_t*)output->buf); #endif return PJ_SUCCESS; @@ -594,7 +594,7 @@ static pj_status_t g711_recover( pjmedia_codec *codec, unsigned output_buf_len, struct pjmedia_frame *output) { - struct g711_private *priv = codec->codec_data; + struct g711_private *priv = (struct g711_private*) codec->codec_data; if (!priv->plc_enabled) return PJ_EINVALIDOP; @@ -602,7 +602,7 @@ static pj_status_t g711_recover( pjmedia_codec *codec, PJ_ASSERT_RETURN(output_buf_len >= SAMPLES_PER_FRAME * 2, PJMEDIA_CODEC_EPCMTOOSHORT); - pjmedia_plc_generate(priv->plc, output->buf); + pjmedia_plc_generate(priv->plc, (pj_int16_t*)output->buf); output->size = SAMPLES_PER_FRAME * 2; return PJ_SUCCESS; diff --git a/pjmedia/src/pjmedia/stereo_port.c b/pjmedia/src/pjmedia/stereo_port.c index 0e636420..1d38512c 100644 --- a/pjmedia/src/pjmedia/stereo_port.c +++ b/pjmedia/src/pjmedia/stereo_port.c @@ -118,13 +118,15 @@ static pj_status_t stereo_put_frame(pjmedia_port *this_port, if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) { tmp_frame.buf = sport->put_buf; if (sport->dn_port->info.channel_count == 1) { - pjmedia_convert_channel_nto1(tmp_frame.buf, frame->buf, + pjmedia_convert_channel_nto1((pj_int16_t*)tmp_frame.buf, + (const pj_int16_t*)frame->buf, sport->base.info.channel_count, sport->base.info.samples_per_frame, (sport->options & PJMEDIA_STEREO_MIX), 0); } else { - pjmedia_convert_channel_1ton(tmp_frame.buf, frame->buf, + pjmedia_convert_channel_1ton((pj_int16_t*)tmp_frame.buf, + (const pj_int16_t*)frame->buf, sport->dn_port->info.channel_count, sport->base.info.samples_per_frame, sport->options); @@ -175,12 +177,14 @@ static pj_status_t stereo_get_frame(pjmedia_port *this_port, } if (sport->base.info.channel_count == 1) { - pjmedia_convert_channel_nto1(frame->buf, tmp_frame.buf, + pjmedia_convert_channel_nto1((pj_int16_t*)frame->buf, + (const pj_int16_t*)tmp_frame.buf, sport->dn_port->info.channel_count, sport->dn_port->info.samples_per_frame, (sport->options & PJMEDIA_STEREO_MIX), 0); } else { - pjmedia_convert_channel_1ton(frame->buf, tmp_frame.buf, + pjmedia_convert_channel_1ton((pj_int16_t*)frame->buf, + (const pj_int16_t*)tmp_frame.buf, sport->base.info.channel_count, sport->dn_port->info.samples_per_frame, sport->options); diff --git a/pjmedia/src/pjmedia/transport_srtp.c b/pjmedia/src/pjmedia/transport_srtp.c index 13149213..03470d20 100644 --- a/pjmedia/src/pjmedia/transport_srtp.c +++ b/pjmedia/src/pjmedia/transport_srtp.c @@ -211,7 +211,7 @@ const char* get_libsrtp_errstr(int err) "error while using semaphores", /* err_status_semaphore_err = 23 */ "error while using pfkey" /* err_status_pfkey_err = 24 */ }; - if (err >= 0 && err < PJ_ARRAY_SIZE(liberr)) { + if (err >= 0 && err < (int)PJ_ARRAY_SIZE(liberr)) { return liberr[err]; } else { static char msg[32]; @@ -263,7 +263,7 @@ static int get_crypto_idx(const pj_str_t* crypto_name) PJ_DEF(void) pjmedia_srtp_setting_default(pjmedia_srtp_setting *opt) { - int i; + unsigned i; pj_bzero(opt, sizeof(pjmedia_srtp_setting)); opt->close_member_tp = PJ_TRUE; @@ -288,7 +288,7 @@ PJ_DEF(pj_status_t) pjmedia_transport_srtp_create( pj_pool_t *pool; transport_srtp *srtp; pj_status_t status; - int i; + unsigned i; PJ_ASSERT_RETURN(endpt && p_tp, PJ_EINVAL); @@ -820,7 +820,7 @@ static pj_status_t generate_crypto_attr_value(pj_pool_t *pool, pj_bool_t key_ok; char key[MAX_KEY_LEN]; err_status_t err; - int i; + unsigned i; PJ_ASSERT_RETURN(MAX_KEY_LEN >= crypto_suites[cs_idx].cipher_key_len, PJ_ETOOSMALL); @@ -839,7 +839,8 @@ static pj_status_t generate_crypto_attr_value(pj_pool_t *pool, if (key[i] == 0) key_ok = PJ_FALSE; } while (!key_ok); - crypto->key.ptr = pj_pool_zalloc(pool, + crypto->key.ptr = (char*) + pj_pool_zalloc(pool, crypto_suites[cs_idx].cipher_key_len); pj_memcpy(crypto->key.ptr, key, crypto_suites[cs_idx].cipher_key_len); crypto->key.slen = crypto_suites[cs_idx].cipher_key_len; @@ -922,7 +923,7 @@ static pj_status_t parse_attr_crypto(pj_pool_t *pool, return PJMEDIA_SDP_EINATTR; } tmp = pj_str(token); - crypto->key.ptr = pj_pool_zalloc(pool, MAX_KEY_LEN); + crypto->key.ptr = (char*) pj_pool_zalloc(pool, MAX_KEY_LEN); /* Decode key */ itmp = MAX_KEY_LEN; @@ -952,7 +953,7 @@ static pj_status_t transport_media_create(pjmedia_transport *tp, pj_status_t status; pjmedia_sdp_attr *attr; pj_str_t attr_value; - int i, j; + unsigned i, j; unsigned member_tp_option; PJ_ASSERT_RETURN(tp && pool && sdp_local, PJ_EINVAL); @@ -1233,7 +1234,7 @@ static pj_status_t transport_media_start(pjmedia_transport *tp, /* our offer tag is always ordered by setting */ - if (rem_tag < 1 || rem_tag > srtp->setting.crypto_count) { + if (rem_tag < 1 || rem_tag > (int)srtp->setting.crypto_count) { DEACTIVATE_MEDIA(pool, m_loc); return PJMEDIA_SRTP_ESDPINCRYPTOTAG; } -- cgit v1.2.3