mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Remove undefined behaviors
This commit is contained in:
parent
4864565198
commit
b3838173ec
51 changed files with 756 additions and 1302 deletions
|
@ -26,14 +26,9 @@
|
|||
* @mayalias
|
||||
*/
|
||||
void(psraw)(int16_t a[8], const int16_t b[8], unsigned char k) {
|
||||
unsigned i, x, m;
|
||||
unsigned i;
|
||||
if (k > 15) k = 15;
|
||||
for (i = 0; i < 8; ++i) {
|
||||
m = 0;
|
||||
x = b[i];
|
||||
if (x & 0x8000) m = ~(0xffff >> k);
|
||||
x >>= k;
|
||||
x |= m;
|
||||
a[i] = x;
|
||||
a[i] = b[i] >> k;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue