Remove undefined behaviors

This commit is contained in:
Justine Tunney 2021-05-16 11:16:28 -07:00
parent 4864565198
commit b3838173ec
51 changed files with 756 additions and 1302 deletions

View file

@ -25,15 +25,10 @@
* @mayalias
*/
void(psrawv)(int16_t a[8], const int16_t b[8], const uint64_t c[2]) {
unsigned i;
unsigned char k;
unsigned i, x, m;
k = c[0] > 15 ? 15 : c[0];
for (i = 0; i < 8; ++i) {
m = 0;
x = b[i];
if (x & 0x8000) m = ~(0xffffu >> k);
x >>= k;
x |= m;
a[i] = x & 0xffffu;
a[i] = b[i] >> k;
}
}