diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-03-19 11:54:22 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-03-19 14:13:02 +0100 |
commit | f5fd9c40cd2db59e2f4eb0f588407658d8a161e6 (patch) | |
tree | 0551c215ca4c1f1d83620d2faa46cecbc0e40539 /src/corelib/tools/qcontiguouscache.h | |
parent | 2d955428ae04de3f73f653bcc8bd10aff68261dc (diff) |
Fix warnings when building with MSVC2017
qstring.cpp(10210): warning C4267: 'argument': conversion from 'size_t'
to 'uint', possible loss of data
qcontiguouscache.h(141): warning C4003: not enough arguments for
function-like macro invocation 'max'
Change-Id: I01f1fc1c85341ea61c86dcffb1b01fe4cde50eea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/corelib/tools/qcontiguouscache.h')
-rw-r--r-- | src/corelib/tools/qcontiguouscache.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h index df76c9fb50..81361f219a 100644 --- a/src/corelib/tools/qcontiguouscache.h +++ b/src/corelib/tools/qcontiguouscache.h @@ -137,8 +137,9 @@ public: void removeLast(); T takeLast(); + // Use extra parentheses around max to avoid expanding it if it is a macro. inline bool areIndexesValid() const - { return d->offset >= 0 && d->offset < std::numeric_limits<qsizetype>::max() - d->count && (d->offset % d->alloc) == d->start; } + { return d->offset >= 0 && d->offset < (std::numeric_limits<qsizetype>::max)() - d->count && (d->offset % d->alloc) == d->start; } inline void normalizeIndexes() { d->offset = d->start; } |