summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qbytearray.cpp4
-rw-r--r--src/corelib/tools/qstring.cpp2
-rw-r--r--src/corelib/tools/qtimezoneprivate.cpp9
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h2
-rw-r--r--src/corelib/tools/qtools_p.h8
-rw-r--r--src/corelib/tools/qvector.h4
6 files changed, 21 insertions, 8 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index d94167466d..eb96757457 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -786,7 +786,7 @@ static inline char qToLower(char c)
occurrences of a particular value with another, use one of the
two-parameter replace() overloads.
- {QByteArray}s can be compared using overloaded operators such as
+ \l{QByteArray}s can be compared using overloaded operators such as
operator<(), operator<=(), operator==(), operator>=(), and so on.
The comparison is based exclusively on the numeric values
of the characters and is very fast, but is not what a human would
@@ -831,7 +831,7 @@ static inline char qToLower(char c)
lastIndexOf(), operator<(), operator<=(), operator>(),
operator>=(), toLower() and toUpper().
- This issue does not apply to {QString}s since they represent
+ This issue does not apply to \l{QString}s since they represent
characters using Unicode.
\sa QString, QBitArray
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index aa35d764fa..beda0f4919 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -240,7 +240,7 @@ void qt_from_latin1(ushort *dst, const char *str, size_t size)
dst += offset;
str += offset;
# ifdef Q_COMPILER_LAMBDA
- return UnrollTailLoop<15>::exec(size, [=](int i) { dst[i] = (uchar)str[i]; });
+ return UnrollTailLoop<15>::exec(int(size), [=](int i) { dst[i] = (uchar)str[i]; });
# endif
#endif
#if defined(__mips_dsp)
diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp
index 164db5ed0c..8e6a0a0578 100644
--- a/src/corelib/tools/qtimezoneprivate.cpp
+++ b/src/corelib/tools/qtimezoneprivate.cpp
@@ -625,6 +625,15 @@ QTimeZonePrivate *QUtcTimeZonePrivate::clone()
return new QUtcTimeZonePrivate(*this);
}
+QTimeZonePrivate::Data QUtcTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
+{
+ Data d = invalidData();
+ d.abbreviation = m_abbreviation;
+ d.atMSecsSinceEpoch = forMSecsSinceEpoch;
+ d.offsetFromUtc = m_offsetFromUtc;
+ return d;
+}
+
void QUtcTimeZonePrivate::init(const QByteArray &zoneId)
{
m_id = zoneId;
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index 803ba1f57a..e15ac801bc 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -186,6 +186,8 @@ public:
QTimeZonePrivate *clone() Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+
QLocale::Country country() const Q_DECL_OVERRIDE;
QString comment() const Q_DECL_OVERRIDE;
diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h
index b48ed94236..3a407aea5b 100644
--- a/src/corelib/tools/qtools_p.h
+++ b/src/corelib/tools/qtools_p.h
@@ -63,9 +63,9 @@ Q_DECL_CONSTEXPR inline char toHexLower(uint value) Q_DECL_NOTHROW
Q_DECL_CONSTEXPR inline int fromHex(uint c) Q_DECL_NOTHROW
{
- return ((c >= '0') && (c <= '9')) ? c - '0' :
- ((c >= 'A') && (c <= 'F')) ? c - 'A' + 10 :
- ((c >= 'a') && (c <= 'f')) ? c - 'a' + 10 :
+ return ((c >= '0') && (c <= '9')) ? int(c - '0') :
+ ((c >= 'A') && (c <= 'F')) ? int(c - 'A' + 10) :
+ ((c >= 'a') && (c <= 'f')) ? int(c - 'a' + 10) :
/* otherwise */ -1;
}
@@ -76,7 +76,7 @@ Q_DECL_CONSTEXPR inline char toOct(uint value) Q_DECL_NOTHROW
Q_DECL_CONSTEXPR inline int fromOct(uint c) Q_DECL_NOTHROW
{
- return ((c >= '0') && (c <= '7')) ? c - '0' : -1;
+ return ((c >= '0') && (c <= '7')) ? int(c - '0') : -1;
}
}
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 5245c4ed10..9d5b749e79 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -154,7 +154,9 @@ public:
const const_iterator ce = this->cend(), cit = std::find(this->cbegin(), ce, t);
if (cit == ce)
return 0;
- const iterator e = end(), it = std::remove(c2m(cit), e, t);
+ // next operation detaches, so ce, cit may become invalidated:
+ const int firstFoundIdx = std::distance(this->cbegin(), cit);
+ const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, t);
const int result = std::distance(it, e);
erase(it, e);
return result;