1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Replace the compiler dependent signed right shifts with a universal version

This commit is contained in:
Martin Tůma 2024-05-21 20:57:21 +02:00
parent de76eafdfb
commit da2b6661f6

View File

@ -184,7 +184,10 @@ bool JLS::readLine(BitStream &bs)
_b[1] = _b[1] + mes; _b[1] = _b[1] + mes;
if (_n[1] == 0x40) { if (_n[1] == 0x40) {
_a[1] = _a[1] >> 1; _a[1] = _a[1] >> 1;
_b[1] = _b[1] >> 1; if (_b[1] >= 0)
_b[1] = _b[1] >> 1;
else
_b[1] = -((1 - _b[1]) >> 1);
_n[1] = 0x21; _n[1] = 0x21;
} else { } else {
_n[1] = _n[1] + 1; _n[1] = _n[1] + 1;
@ -273,7 +276,10 @@ bool JLS::readLine(BitStream &bs)
_a[ictx] = _a[ictx] + (evh - rctx); _a[ictx] = _a[ictx] + (evh - rctx);
if (_n[ictx] == 0x40) { if (_n[ictx] == 0x40) {
_a[ictx] = _a[ictx] >> 1; _a[ictx] = _a[ictx] >> 1;
_b[ictx] = _b[ictx] >> 1; if (_b[ictx] >= 0)
_b[ictx] = _b[ictx] >> 1;
else
_b[ictx] = -((1 - _b[ictx]) >> 1);
_n[ictx] = 0x21; _n[ictx] = 0x21;
} else } else
_n[ictx] = _n[ictx] + 1; _n[ictx] = _n[ictx] + 1;