Landing pkasting's webrtc fixes for MSVC level 4 warnings in WebRTC.

---

Fixes for re-enabling more MSVC level 4 warnings: webrtc/ edition

This contains fixes for the following sorts of issues:
* Possibly-uninitialized local variable
* Signedness mismatch
* Assignment inside conditional

This also contains a small number of other cleanups to nearby code. In
particular several warning-disables for MSVC are removed because they don't seem
to be necessary (either that warning is not enabled or the code does not trigger
it).

BUG=crbug.com/81439
TEST=none
R=henrika@webrtc.org, pkasting@chromium.org

Review URL: https://webrtc-codereview.appspot.com/18769004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6667 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tommi@webrtc.org
2014-07-11 19:09:59 +00:00
parent 180e516bef
commit eec6ecdb1e
14 changed files with 193 additions and 226 deletions

View File

@@ -2243,8 +2243,6 @@ int16_t WebRtcIsac_SetEncSampRate(ISACStruct* ISAC_main_inst,
} else {
ISACUBStruct* instUB = &(instISAC->instUB);
ISACLBStruct* instLB = &(instISAC->instLB);
double bottleneckLB;
double bottleneckUB;
int32_t bottleneck = instISAC->bottleneck;
int16_t codingMode = instISAC->codingMode;
int16_t frameSizeMs = instLB->ISACencLB_obj.new_framelength /
@@ -2263,6 +2261,8 @@ int16_t WebRtcIsac_SetEncSampRate(ISACStruct* ISAC_main_inst,
instISAC->maxRateBytesPer30Ms = STREAM_SIZE_MAX_30;
} else if ((encoder_operational_rate == kIsacSuperWideband) &&
(instISAC->encoderSamplingRateKHz == kIsacWideband)) {
double bottleneckLB = 0;
double bottleneckUB = 0;
if (codingMode == 1) {
WebRtcIsac_RateAllocation(bottleneck, &bottleneckLB, &bottleneckUB,
&(instISAC->bandwidthKHz));

View File

@@ -838,7 +838,7 @@ int16_t ACMGenericCodec::ProcessFrameVADDTX(uint8_t* bitstream,
// Calculate number of samples in 10 ms blocks, and number ms in one frame.
int16_t samples_in_10ms = static_cast<int16_t>(freq_hz / 100);
int32_t frame_len_ms = static_cast<int32_t>(frame_len_smpl_) * 1000 / freq_hz;
int16_t status;
int16_t status = -1;
// Vector for storing maximum 30 ms of mono audio at 48 kHz.
int16_t audio[1440];

View File

@@ -80,7 +80,7 @@ ACMOpus::ACMOpus(int16_t codec_id)
if (codec_id_ != ACMCodecDB::kOpus) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, unique_id_,
"Wrong codec id for Opus.");
sample_freq_ = -1;
sample_freq_ = 0xFFFF;
bitrate_ = -1;
}
return;

View File

@@ -30,7 +30,7 @@ ACMSPEEX::ACMSPEEX(int16_t /* codec_id */)
vbr_enabled_(false),
encoding_rate_(-1),
sampling_frequency_(-1),
samples_in_20ms_audio_(-1) {
samples_in_20ms_audio_(0xFFFF) {
return;
}