summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/tools/qarraydataops.h10
-rw-r--r--src/corelib/tools/qbytearray.cpp18
-rw-r--r--src/corelib/tools/qstring.cpp8
4 files changed, 15 insertions, 25 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 21f22a32ba..2ca627e851 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2856,7 +2856,7 @@ enum {
};
/*!
- \since 5.10
+ \since 5.11
Returns a unique ID for this machine, if one can be determined. If no
unique ID could be determined, this function returns an empty byte array.
@@ -2929,7 +2929,7 @@ QByteArray QSysInfo::machineUniqueId()
}
/*!
- \since 5.10
+ \since 5.11
Returns a unique ID for this machine's boot, if one can be determined. If
no unique ID could be determined, this function returns an empty byte
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index d0f83d2b6a..7e1b43f9b1 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -65,7 +65,7 @@ struct QPodArrayOps
Q_ASSERT(newSize > uint(this->size));
Q_ASSERT(newSize <= this->alloc);
- ::memset(this->end(), 0, (newSize - this->size) * sizeof(T));
+ ::memset(static_cast<void *>(this->end()), 0, (newSize - this->size) * sizeof(T));
this->size = int(newSize);
}
@@ -121,8 +121,9 @@ struct QPodArrayOps
Q_ASSERT(e <= where || b > this->end()); // No overlap
Q_ASSERT(size_t(e - b) <= this->alloc - uint(this->size));
- ::memmove(where + (e - b), where, (static_cast<const T*>(this->end()) - where) * sizeof(T));
- ::memcpy(where, b, (e - b) * sizeof(T));
+ ::memmove(static_cast<void *>(where + (e - b)), static_cast<void *>(where),
+ (static_cast<const T*>(this->end()) - where) * sizeof(T));
+ ::memcpy(static_cast<void *>(where), static_cast<const void *>(b), (e - b) * sizeof(T));
this->size += (e - b);
}
@@ -133,7 +134,8 @@ struct QPodArrayOps
Q_ASSERT(b >= this->begin() && b < this->end());
Q_ASSERT(e > this->begin() && e < this->end());
- ::memmove(b, e, (static_cast<T *>(this->end()) - e) * sizeof(T));
+ ::memmove(static_cast<void *>(b), static_cast<void *>(e),
+ (static_cast<T *>(this->end()) - e) * sizeof(T));
this->size -= (e - b);
}
};
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index d9cd20ffbf..3468580bf1 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -782,19 +782,6 @@ QByteArray qUncompress(const uchar* data, int nbytes)
}
#endif
-static inline bool qIsUpper(char c)
-{
- return c >= 'A' && c <= 'Z';
-}
-
-static inline char qToLower(char c)
-{
- if (c >= 'A' && c <= 'Z')
- return c - 'A' + 'a';
- else
- return c;
-}
-
/*!
\class QByteArray
\inmodule QtCore
@@ -4208,9 +4195,10 @@ QByteArray &QByteArray::setNum(double n, char f, int prec)
QLocaleData::DoubleForm form = QLocaleData::DFDecimal;
uint flags = QLocaleData::ZeroPadExponent;
- if (qIsUpper(f))
+ char lower = latin1_lowercased[uchar(f)];
+ if (f != lower)
flags |= QLocaleData::CapitalEorX;
- f = qToLower(f);
+ f = lower;
switch (f) {
case 'f':
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 46ec8b072c..51bc8359a0 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -259,7 +259,7 @@ static bool simdTestMask(const char *&ptr, const char *end, quint32 maskval)
# if defined(__AVX2__)
// AVX2 implementation: test 32 bytes at a time
const __m256i mask256 = _mm256_broadcastd_epi32(_mm_cvtsi32_si128(maskval));
- while (ptr + 32 < end) {
+ while (ptr + 32 <= end) {
__m256i data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(ptr));
if (!_mm256_testz_si256(mask256, data))
return false;
@@ -271,7 +271,7 @@ static bool simdTestMask(const char *&ptr, const char *end, quint32 maskval)
// SSE 4.1 implementation: test 32 bytes at a time (two 16-byte
// comparisons, unrolled)
const __m128i mask = _mm_set1_epi32(maskval);
- while (ptr + 32 < end) {
+ while (ptr + 32 <= end) {
__m128i data1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(ptr));
__m128i data2 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(ptr + 16));
if (!_mm_testz_si128(mask, data1))
@@ -283,7 +283,7 @@ static bool simdTestMask(const char *&ptr, const char *end, quint32 maskval)
# endif
# if defined(__SSE4_1__)
// AVX2 and SSE4.1: final 16-byte comparison
- if (ptr + 16 < end) {
+ if (ptr + 16 <= end) {
__m128i data1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(ptr));
if (!_mm_testz_si128(mask, data1))
return false;
@@ -325,7 +325,7 @@ bool QtPrivate::isAscii(QLatin1String s) Q_DECL_NOTHROW
}
#endif
- while (ptr + 4 < end) {
+ while (ptr + 4 <= end) {
quint32 data = qFromUnaligned<quint32>(ptr);
if (data & 0x80808080U)
return false;