summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qstring.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 983d1213d9..6bbaf05fef 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -705,8 +705,8 @@ static int findChar(const QChar *str, int len, QChar ch, int from,
}
#define REHASH(a) \
- if (sl_minus_1 < (int)sizeof(int) * CHAR_BIT) \
- hashHaystack -= (a) << sl_minus_1; \
+ if (sl_minus_1 < sizeof(uint) * CHAR_BIT) \
+ hashHaystack -= uint(a) << sl_minus_1; \
hashHaystack <<= 1
inline bool qIsUpper(char ch)
@@ -3072,8 +3072,9 @@ int qFindString(
const ushort *needle = (const ushort *)needle0;
const ushort *haystack = (const ushort *)haystack0 + from;
const ushort *end = (const ushort *)haystack0 + (l-sl);
- const int sl_minus_1 = sl-1;
- int hashNeedle = 0, hashHaystack = 0, idx;
+ const uint sl_minus_1 = sl - 1;
+ uint hashNeedle = 0, hashHaystack = 0;
+ int idx;
if (cs == Qt::CaseSensitive) {
for (idx = 0; idx < sl; ++idx) {
@@ -3148,10 +3149,11 @@ static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *nee
const ushort *end = haystack;
haystack += from;
- const int sl_minus_1 = sl-1;
+ const uint sl_minus_1 = sl - 1;
const ushort *n = needle+sl_minus_1;
const ushort *h = haystack+sl_minus_1;
- int hashNeedle = 0, hashHaystack = 0, idx;
+ uint hashNeedle = 0, hashHaystack = 0;
+ int idx;
if (cs == Qt::CaseSensitive) {
for (idx = 0; idx < sl; ++idx) {