aboutsummaryrefslogtreecommitdiff
path: root/application/pages
diff options
context:
space:
mode:
authorAbigailBuccaneer <AbigailBuccaneer@users.noreply.github.com>2020-08-24 18:04:37 +0100
committerAbigailBuccaneer <AbigailBuccaneer@users.noreply.github.com>2020-08-24 18:52:08 +0100
commit6995a2e1bac6812ec4f48b98cfaf321f75c320d8 (patch)
treee185dbb951524cc11ab33af90ddb20d412e92733 /application/pages
parent0f2757f0004e20503b2c4ee587e16f6775ee14bf (diff)
downloadPrismLauncher-6995a2e1bac6812ec4f48b98cfaf321f75c320d8.tar.gz
PrismLauncher-6995a2e1bac6812ec4f48b98cfaf321f75c320d8.tar.bz2
PrismLauncher-6995a2e1bac6812ec4f48b98cfaf321f75c320d8.zip
Avoid undefined behaviour when byteswapping
`a << b` is undefined when `a` is negative, and `a >> b` is implementation-defined. The correct thing to do here is to cast to unsigned, swap the bytes there and then swap back. This also improves performance on some compilers: Clang is smart enough to recognise that we're byteswapping here and reduce it to a single `bswap` instruction on x86_64, but only for the unsigned versions.
Diffstat (limited to 'application/pages')
0 files changed, 0 insertions, 0 deletions