Fix: Ensure 31-bit shifts are unsigned. (#10128)

Shifting a signed 32-bit integer by 31 bits is undefined behaviour.
A few more than necessary are switched to unsigned for consistentency.
This commit is contained in:
PeterN
2022-11-04 07:15:59 +00:00
committed by GitHub
parent accbfd502e
commit f24286a1ae
6 changed files with 92 additions and 92 deletions

View File

@@ -60,10 +60,10 @@ struct TileIndexDiffC {
};
/** Minimal and maximal map width and height */
static const uint MIN_MAP_SIZE_BITS = 6; ///< Minimal size of map is equal to 2 ^ MIN_MAP_SIZE_BITS
static const uint MAX_MAP_SIZE_BITS = 12; ///< Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS
static const uint MIN_MAP_SIZE = 1 << MIN_MAP_SIZE_BITS; ///< Minimal map size = 64
static const uint MAX_MAP_SIZE = 1 << MAX_MAP_SIZE_BITS; ///< Maximal map size = 4096
static const uint MIN_MAP_SIZE_BITS = 6; ///< Minimal size of map is equal to 2 ^ MIN_MAP_SIZE_BITS
static const uint MAX_MAP_SIZE_BITS = 12; ///< Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS
static const uint MIN_MAP_SIZE = 1U << MIN_MAP_SIZE_BITS; ///< Minimal map size = 64
static const uint MAX_MAP_SIZE = 1U << MAX_MAP_SIZE_BITS; ///< Maximal map size = 4096
/**
* Approximation of the length of a straight track, relative to a diagonal