Merge "acm_random,Rand9Signed: correct cast"

This commit is contained in:
James Zern 2016-05-27 18:32:05 +00:00 committed by Gerrit Code Review
commit f6ac6cf5bd

View File

@ -35,7 +35,7 @@ class ACMRandom {
int16_t Rand9Signed(void) {
// Use 9 bits: values between 255 (0x0FF) and -256 (0x100).
const uint32_t value = random_.Generate(512);
return static_cast<int16_t>(value - 256);
return static_cast<int16_t>(value) - 256;
}
uint8_t Rand8(void) {