uiIntraPeriod is unsigned, and thus can't ever be negative. The subtraction on the line above can't ever make the value wrap around either, since param_.uiIntraPeriod % uiGOPSize always is smaller than or equal to param_.uiIntraPeriod. Thus, the check never is necessary even if the value would be signed either. This fixes warnings when building with clang.
Showing the changes to test/api/encode_decode_api_test.cpp (1 of 1 file). Show all
Unified · Split
| @@ -282,9 +282,6 @@ void EncodeDecodeTestAPI::ValidateParamExtCombination() { · 281 unmodified lines | |||
| 282 | //IntraPeriod | 282 | //IntraPeriod |
| 283 | uiGOPSize = 1 << (param_.iTemporalLayerNum - 1); | 283 | uiGOPSize = 1 << (param_.iTemporalLayerNum - 1); |
| 284 | param_.uiIntraPeriod -= param_.uiIntraPeriod % uiGOPSize; | 284 | param_.uiIntraPeriod -= param_.uiIntraPeriod % uiGOPSize; |
| 285 | if (param_.uiIntraPeriod < 0) { | ||
| 286 | param_.uiIntraPeriod = 0; | ||
| 287 | } | ||
| 288 | 285 | ||
| 289 | //RefNum | 286 | //RefNum |
| 290 | int32_t iRefUpperBound = (param_.iUsageType == CAMERA_VIDEO_REAL_TIME) ? | 287 | int32_t iRefUpperBound = (param_.iUsageType == CAMERA_VIDEO_REAL_TIME) ? |