Lots of trivial tweaks to minimize compiler warnings, especially on 64-bit platform: Added missing type casts, changed types, added missing NULL checks.

This commit is contained in:
Peter Olsson committed 2014-01-22 22:30:23 +01:00
1 parent 643c88f49b
commit 084e245085
57 files changed
+226 -216

No files matched your search

+6 -6
View File
@@ -287,13 +287,13 @@ static switch_status_t switch_silk_encode(switch_codec_t *codec,
{
struct silk_context *context = codec->private_info;
SKP_int16 ret;
SKP_int16 pktsz = context->encoder_object.packetSize;
SKP_int16 pktsz = (SKP_int16)context->encoder_object.packetSize;
SKP_int16 nBytes = MAX_BYTES_PER_FRAME * MAX_INPUT_FRAMES;
SKP_int16 *lindata = (SKP_int16 *)decoded_data;
SKP_int16 samples = decoded_data_len /sizeof(SKP_int16);
SKP_int16 samples = (SKP_int16)(decoded_data_len /sizeof(SKP_int16));
*encoded_data_len = 0;
while (samples >= pktsz){
ret = SKP_Silk_SDK_Encode(context->enc_state,
ret = (SKP_int16)SKP_Silk_SDK_Encode(context->enc_state,
&context->encoder_object,
lindata,
pktsz,
@@ -345,9 +345,9 @@ static switch_status_t switch_silk_decode(switch_codec_t *codec,
}
if (jb && codec && codec->cur_frame) {
for (i = 1; i <= MAX_LBRR_DELAY; i++) {
found_frame = stfu_n_copy_next_frame(jb, codec->cur_frame->timestamp, codec->cur_frame->seq, i, &next_frame);
found_frame = stfu_n_copy_next_frame(jb, (uint32_t)codec->cur_frame->timestamp, codec->cur_frame->seq, (uint16_t)i, &next_frame);
if (found_frame) {
SKP_Silk_SDK_search_for_LBRR(next_frame.data, next_frame.dlen, i, (SKP_uint8*) &recbuff, &reclen);
SKP_Silk_SDK_search_for_LBRR(next_frame.data, (const int)next_frame.dlen, i, (SKP_uint8*) &recbuff, &reclen);
if (reclen) {
encoded_data = &recbuff;
encoded_data_len = reclen;
@@ -361,7 +361,7 @@ static switch_status_t switch_silk_decode(switch_codec_t *codec,
}
do {
ret = SKP_Silk_SDK_Decode(context->dec_state,
ret = (SKP_int16)SKP_Silk_SDK_Decode(context->dec_state,
&context->decoder_object,
lost_flag,
encoded_data,
+6 -6
View File
@@ -236,12 +236,12 @@ static switch_status_t switch_speex_fmtp_parse(const char *fmtp, switch_codec_fm
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "choosing speex/8000 mode %s\n", mode_str);
codec_settings->quality = codec_settings->quality;
codec_settings->vbr_quality = codec_settings->quality;
codec_settings->vbr_quality = (float)codec_settings->quality;
} else {
if (mode_num >= 0 && mode_num <= 10) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "choosing speex/%d mode %s\n", codec_fmtp->actual_samples_per_second, mode_str);
codec_settings->quality = mode_num;
codec_settings->vbr_quality = mode_num;
codec_settings->vbr_quality = (float)mode_num;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "ignoring invalid speex/%d mode %s\n", codec_fmtp->actual_samples_per_second, mode_str);
continue;
@@ -519,7 +519,7 @@ static void load_configuration()
default_codec_settings.vbr = switch_true(value);
} else if (!strcasecmp("vbr-quality", name)) {
/* variable bit rate quality, float 0-10 */
float tmp = atof(value);
float tmp = (float)atof(value);
if (switch_is_number(value) && tmp >= 0 && tmp <= 10) {
default_codec_settings.vbr_quality = tmp;
} else {
@@ -547,7 +547,7 @@ static void load_configuration()
default_codec_settings.pp_agc = switch_true(value);
} else if (!strcasecmp("pp-agc-level", name)) {
/* agc level, float */
float tmp = atof(value);
float tmp = (float)atof(value);
if (switch_is_number(value) && tmp >= 0.0f) {
default_codec_settings.pp_agc_level = tmp;
} else {
@@ -561,7 +561,7 @@ static void load_configuration()
default_codec_settings.pp_dereverb = switch_true(value);
} else if (!strcasecmp("pp-dereverb-decay", name)) {
/* reverberation removal decay, float */
float tmp = atof(value);
float tmp = (float)atof(value);
if (switch_is_number(value) && tmp >= 0.0f) {
default_codec_settings.pp_dereverb_decay = tmp;
} else {
@@ -569,7 +569,7 @@ static void load_configuration()
}
} else if (!strcasecmp("pp-dereverb-level", name)) {
/* reverberation removal level, float */
float tmp = atof(value);
float tmp = (float)atof(value);
if (switch_is_number(value) && tmp >= 0.0f) {
default_codec_settings.pp_dereverb_level = tmp;
} else {