Previously, the same variable 'i' was sometimes declared within a for loop and sometimes outside of the loop, all within the same function. This avoids spurious warnings in MSVC 2005.
Showing the changes to test/encoder/EncUT_GetIntraPredictor.cpp (1 of 1 file). Show all
Unified · Split
| @@ -477,15 +477,16 @@ TEST(GetIntraPredictorTest, TestGetIChormaPredV) { · 476 unmodified lines | ||
| 477 | 477 | TEST(GetIntraPredictorTest, TestGetI16x16LumaPredPlane) { |
| 478 | 478 | const int32_t kiStride = rand()%16+16; |
| 479 | 479 | |
| 480 | + int32_t i, j; | |
| 481 | + | |
| 480 | 482 | uint8_t *pPred = new uint8_t[16*kiStride]; |
| 481 | 483 | uint8_t *pRef = new uint8_t[16*kiStride+1]; |
| 482 | − for (int i=0; i<16*kiStride+1; i++) | |
| 484 | + for (i=0; i<16*kiStride+1; i++) | |
| 483 | 485 | pRef[i]=rand()%256+1; |
| 484 | 486 | |
| 485 | 487 | pRef += kiStride + 1; |
| 486 | 488 | |
| 487 | 489 | int32_t iA=0, iB=0, iC=0, iH=0, iV=0; |
| 488 | − int32_t i, j; | |
| 489 | 490 | uint8_t *pTop = &pRef[-kiStride]; |
| 490 | 491 | uint8_t *pLeft = &pRef[-1]; |
| 491 | 492 | int32_t iPredStride = 16; |
| @@ -514,16 +515,18 @@ TEST(GetIntraPredictorTest, TestGetI16x16LumaPredPlane) { · 22 unmodified lines | ||
| 514 | 515 | TEST(GetIntraPredictorTest, TestGetI16x16LumaPredDc) { |
| 515 | 516 | const int32_t kiStride = rand()%16+16; |
| 516 | 517 | |
| 518 | + int i; | |
| 519 | + | |
| 517 | 520 | uint8_t *pPred = new uint8_t[256]; |
| 518 | 521 | uint8_t *pRef = new uint8_t[16*kiStride]; |
| 519 | − for (int i=0; i<16*kiStride; i++) | |
| 522 | + for (i=0; i<16*kiStride; i++) | |
| 520 | 523 | pRef[i] = rand() % 256 + 1; |
| 521 | 524 | |
| 522 | 525 | pRef += kiStride; |
| 523 | 526 | |
| 524 | 527 | int32_t iTmp = (kiStride << 4) - kiStride; |
| 525 | 528 | int32_t iSum = 0; |
| 526 | − uint8_t i = 15; | |
| 529 | + i = 15; | |
| 527 | 530 | uint8_t uiMean = 0; |
| 528 | 531 | |
| 529 | 532 | do { |
| @@ -533,7 +536,7 @@ TEST(GetIntraPredictorTest, TestGetI16x16LumaPredDc) { · 3 unmodified lines | ||
| 533 | 536 | uiMean = ( 16 + iSum ) >> 5; |
| 534 | 537 | |
| 535 | 538 | WelsI16x16LumaPredDc_c(pPred, pRef, kiStride); |
| 536 | − for (int i=0; i<256; i++) | |
| 539 | + for (i=0; i<256; i++) | |
| 537 | 540 | EXPECT_EQ(pPred[i],uiMean); |
| 538 | 541 | |
| 539 | 542 | pRef -= kiStride; |
| @@ -545,15 +548,17 @@ TEST(GetIntraPredictorTest, TestGetI16x16LumaPredDc) { · 5 unmodified lines | ||
| 545 | 548 | TEST(GetIntraPredictorTest, TestGetI16x16LumaPredDcTop) { |
| 546 | 549 | const int32_t kiStride = rand()%16+16; |
| 547 | 550 | |
| 551 | + int i; | |
| 552 | + | |
| 548 | 553 | uint8_t *pPred = new uint8_t[256]; |
| 549 | 554 | uint8_t *pRef = new uint8_t[16*kiStride]; |
| 550 | − for (int i=0; i<16*kiStride; i++) | |
| 555 | + for (i=0; i<16*kiStride; i++) | |
| 551 | 556 | pRef[i] = rand() % 256 + 1; |
| 552 | 557 | |
| 553 | 558 | pRef += kiStride; |
| 554 | 559 | |
| 555 | 560 | int32_t iSum = 0; |
| 556 | − uint8_t i = 15; | |
| 561 | + i = 15; | |
| 557 | 562 | uint8_t uiMean = 0; |
| 558 | 563 | do { |
| 559 | 564 | iSum += pRef[-kiStride+i]; |
| @@ -561,7 +566,7 @@ TEST(GetIntraPredictorTest, TestGetI16x16LumaPredDcTop) { · 1 unmodified line | ||
| 561 | 566 | uiMean = ( 8 + iSum ) >> 4; |
| 562 | 567 | |
| 563 | 568 | WelsI16x16LumaPredDcTop_c(pPred, pRef, kiStride); |
| 564 | − for (int i=0; i<256; i++) | |
| 569 | + for (i=0; i<256; i++) | |
| 565 | 570 | EXPECT_EQ(pPred[i],uiMean); |
| 566 | 571 | |
| 567 | 572 | pRef -= kiStride; |