History

quantize test: promote RandRange() result to signed

Avoid unsigned overflow warning: unsigned integer overflow: 19974 - 32703 cannot be represented in type 'unsigned int'

Johann committed 9 years ago

Commit af08fbb1 parent c782f271 file · +4 −4Browse files

Unified · Split

test/vp9_quantize_test.cc+4−4
@@ -115,7 +115,7 @@ TEST_P(VP9QuantizeTest, OperationCheck) { · 114 unmodified lines
115115 // round may be up to 685 for Y values or 914 for U/V.
116116 round_ptr[j] = rnd.RandRange(914);
117117 // quant ranges from 1 to -32703
118− quant_ptr[j] = rnd.RandRange(32704) - 32703;
118+ quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
119119 // quant_shift goes up to 1 << 16.
120120 quant_shift_ptr[j] = rnd.RandRange(16384);
121121 // dequant maxes out at 1828 for all cases.
@@ -181,7 +181,7 @@ TEST_P(VP9Quantize32Test, OperationCheck) { · 59 unmodified lines
181181 for (int j = 0; j < 2; j++) {
182182 zbin_ptr[j] = rnd.RandRange(1200);
183183 round_ptr[j] = rnd.RandRange(914);
184− quant_ptr[j] = rnd.RandRange(32704) - 32703;
184+ quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
185185 quant_shift_ptr[j] = rnd.RandRange(16384);
186186 dequant_ptr[j] = rnd.RandRange(1828);
187187 }
@@ -248,7 +248,7 @@ TEST_P(VP9QuantizeTest, EOBCheck) { · 60 unmodified lines
248248 for (int j = 0; j < 2; j++) {
249249 zbin_ptr[j] = rnd.RandRange(1200);
250250 round_ptr[j] = rnd.RandRange(914);
251− quant_ptr[j] = rnd.RandRange(32704) - 32703;
251+ quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
252252 quant_shift_ptr[j] = rnd.RandRange(16384);
253253 dequant_ptr[j] = rnd.RandRange(1828);
254254 }
@@ -315,7 +315,7 @@ TEST_P(VP9Quantize32Test, EOBCheck) { · 60 unmodified lines
315315 for (int j = 0; j < 2; j++) {
316316 zbin_ptr[j] = rnd.RandRange(1200);
317317 round_ptr[j] = rnd.RandRange(914);
318− quant_ptr[j] = rnd.RandRange(32704) - 32703;
318+ quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
319319 quant_shift_ptr[j] = rnd.RandRange(16384);
320320 dequant_ptr[j] = rnd.RandRange(1828);
321321 }

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