diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2014-03-05 15:34:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-07 11:00:45 +0100 |
commit | 90487ebb7584bde9283e154228b9494e3b7bd8fe (patch) | |
tree | acf5e57172e48feaf69cda001ec69f554c85f155 /src/3rdparty/masm/yarr/YarrPattern.cpp | |
parent | 1ca5e82cccae04b3f0e91f6445811b967018b477 (diff) |
Fix more MSVC2012 compiler warnings.
All are conversions from size_t to int or to unsigned.
Change-Id: Ic94c938dcad6d50a32dd6ec62da2341869cf994d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/3rdparty/masm/yarr/YarrPattern.cpp')
-rw-r--r-- | src/3rdparty/masm/yarr/YarrPattern.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/3rdparty/masm/yarr/YarrPattern.cpp b/src/3rdparty/masm/yarr/YarrPattern.cpp index 3ce0216e5f..ae527f065f 100644 --- a/src/3rdparty/masm/yarr/YarrPattern.cpp +++ b/src/3rdparty/masm/yarr/YarrPattern.cpp @@ -191,7 +191,8 @@ private: void addSorted(Vector<UChar>& matches, UChar ch) { unsigned pos = 0; - unsigned range = matches.size(); + ASSERT(matches.size() <= UINT_MAX); + unsigned range = static_cast<unsigned>(matches.size()); // binary chop, find position to insert char. while (range) { @@ -216,7 +217,8 @@ private: void addSortedRange(Vector<CharacterRange>& ranges, UChar lo, UChar hi) { - unsigned end = ranges.size(); + ASSERT(ranges.size() <= UINT_MAX); + unsigned end = static_cast<unsigned>(ranges.size()); // Simple linear scan - I doubt there are that many ranges anyway... // feel free to fix this with something faster (eg binary chop). @@ -427,7 +429,8 @@ public: PatternTerm& lastTerm = m_alternative->lastTerm(); - unsigned numParenAlternatives = parenthesesDisjunction->m_alternatives.size(); + ASSERT(parenthesesDisjunction->m_alternatives.size() <= UINT_MAX); + unsigned numParenAlternatives = static_cast<unsigned>(parenthesesDisjunction->m_alternatives.size()); unsigned numBOLAnchoredAlts = 0; for (unsigned i = 0; i < numParenAlternatives; i++) { |