aboutsummaryrefslogtreecommitdiffstats
path: root/core/deco.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-25 23:01:03 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-25 16:23:46 -0700
commite7b56c2d315c31ec64696dbaca9550071633aef4 (patch)
tree104cb7e9381239c934829a6499f4113eb4e5754b /core/deco.h
parentb984839836e0ee38fb8e09680d69f34593b9300f (diff)
downloadsubsurface-e7b56c2d315c31ec64696dbaca9550071633aef4.tar.gz
filter: use 64-bit integer literal for generating bit fields
For multiple-choice constraints we use a bit field of type uint64_t. This means we theoretically support up to 64 items. Currently use at most seven. Coverity complained (correctly) that we use the expression "1 << x" to generate the bitfields. However 1 is a 32-bit literal on most platforms, which makes this undefined behavior for x >= 32. Change the integer literal to 64-bit 1ULL. Moreover, when detecting items with an index >= 64, don't even attempt to set the according bit, since this is undefined behavior and the compiler is free to do as it pleases in such a case. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/deco.h')
0 files changed, 0 insertions, 0 deletions