summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-27 10:42:08 +0200
committerLiang Qi <liang.qi@qt.io>2017-03-27 10:42:08 +0200
commit7702fe86029c771e641a918baa221b9737c0f18e (patch)
tree8e0795bc4c701518e1c66922f8e8b0cb359da155 /src/corelib
parent1dd54b5647d33416c39fb41fdab560c815356951 (diff)
parent38550c562d918e783bb609622bc8fb46de1bfec4 (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qnamespace.qdoc4
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp2
-rw-r--r--src/corelib/json/qjsonwriter.cpp9
-rw-r--r--src/corelib/tools/qvarlengtharray.h1
4 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index b8588b3f98..404bbfe65a 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1163,8 +1163,8 @@
and Windows) the window will take a modified appearance. This flag is set
or cleared by QWidget::setWindowModified().
- \value WA_WindowPropagation Makes a toplevel window inherit font and
- palette from its parent.
+ \value WA_WindowPropagation Makes a toplevel window inherit font, palette
+ and locale from its parent.
\value WA_MacAlwaysShowToolWindow On \macos, show the tool window even
when the application is not active. By default, all tool windows are
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 7974dc8cca..f0ff46fe7f 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -117,7 +117,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
}
case RuntimeLocation:
{
- const uid_t myUid = geteuid();
+ const uint myUid = uint(geteuid());
// http://standards.freedesktop.org/basedir-spec/latest/
QFileInfo fileInfo;
QString xdgRuntimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR"));
diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp
index b1544c749d..12ce20ef09 100644
--- a/src/corelib/json/qjsonwriter.cpp
+++ b/src/corelib/json/qjsonwriter.cpp
@@ -38,6 +38,7 @@
**
****************************************************************************/
+#include <cmath>
#include <qlocale.h>
#include "qjsonwriter_p.h"
#include "qjson_p.h"
@@ -129,10 +130,12 @@ static void valueToJson(const QJsonPrivate::Base *b, const QJsonPrivate::Value &
break;
case QJsonValue::Double: {
const double d = v.toDouble(b);
- if (qIsFinite(d)) // +2 to format to ensure the expected precision
- json += QByteArray::number(d, 'g', QLocale::FloatingPointShortest);
- else
+ if (qIsFinite(d)) { // +2 to format to ensure the expected precision
+ const double abs = std::abs(d);
+ json += QByteArray::number(d, abs == static_cast<quint64>(abs) ? 'f' : 'g', QLocale::FloatingPointShortest);
+ } else {
json += "null"; // +INF || -INF || NaN (see RFC4627#section2.4)
+ }
break;
}
case QJsonValue::String:
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 5d0231417b..d99eebd4b9 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -361,6 +361,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
int osize = s;
const int copySize = qMin(asize, osize);
+ Q_ASSUME(copySize >= 0);
if (aalloc != a) {
if (aalloc > Prealloc) {
T* newPtr = reinterpret_cast<T *>(malloc(aalloc * sizeof(T)));