History

Don't try to use pow(int,int)

When building for android or older MSVC versions, this makes the build fail, when it is ambiguous which pow() overload to use, when there is no function matching pow(int, int).

Martin Storsjö committed 12 years ago

Commit c1b48641 parent c5029ef1 file · +2 −2Browse files

Showing the changes to test/api/encode_decode_api_test.cpp (1 of 1 file). Show all

Unified · Split

test/api/encode_decode_api_test.cpp+2−2
@@ -763,7 +763,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionLTR_ALLIDR) { · 762 unmodified lines
763763 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
764764 int32_t iSpsPpsIdAddition = 1;
765765 encoder_->SetOption (ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, &iSpsPpsIdAddition);
766− int32_t iIDRPeriod = pow(2,(param_.iTemporalLayerNum-1)) * ((rand() % 5) + 1);
766+ int32_t iIDRPeriod = pow(2.0f, (param_.iTemporalLayerNum-1)) * ((rand() % 5) + 1);
767767 encoder_->SetOption (ENCODER_OPTION_IDR_INTERVAL, &iIDRPeriod);
768768 SLTRConfig sLtrConfigVal;
769769 sLtrConfigVal.bEnableLongTermReference = 1;
@@ -1854,7 +1854,7 @@ TEST_F (EncodeDecodeTestAPI, Engine_SVC_Switch_I) { · 1084 unmodified lines
18541854 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
18551855 int32_t iSpsPpsIdAddition = 1;
18561856 encoder_->SetOption (ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, &iSpsPpsIdAddition);
1857− int32_t iIDRPeriod = pow(2,(param_.iTemporalLayerNum-1)) * ((rand() % 5) + 1);
1857+ int32_t iIDRPeriod = pow(2.0f, (param_.iTemporalLayerNum-1)) * ((rand() % 5) + 1);
18581858 encoder_->SetOption (ENCODER_OPTION_IDR_INTERVAL, &iIDRPeriod);
18591859 SLTRConfig sLtrConfigVal;
18601860 sLtrConfigVal.bEnableLongTermReference = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t