diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2018-01-23 12:43:50 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2018-01-24 17:20:08 +0000 |
commit | 8e8ed1dc10f909941d7b8a5cffbcb54414c530c7 (patch) | |
tree | eb0cc83b794676c8086371f31cdfc683569f54cf /src | |
parent | 6655d563c3cac6dbfd61bfb3dd15ae5b9467d5ae (diff) |
Fix MSVC warnings
signed/unsigned, cast from size_t to uint, and warning 4251[1].
Warning 4251 is disabled in qglobal.h, which is no longer included by Qbs
headers. Disable it in qbs_export.h instead.
[1] https://stackoverflow.com/q/32098001/764870
Change-Id: I98c14c4108715c753e3fb2382e9366d9dda0b1de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/buildgraph/buildgraph.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/qtmocscanner.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/tools/qbs_export.h | 4 | ||||
-rw-r--r-- | src/lib/corelib/tools/set.h | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp index 0b54e6d3a..f36426075 100644 --- a/src/lib/corelib/buildgraph/buildgraph.cpp +++ b/src/lib/corelib/buildgraph/buildgraph.cpp @@ -128,7 +128,7 @@ template<class ProductOrModule> static QScriptValue js_artifactsForFileTag( return !isRelevantArtifact(productOrModule, a); }; artifacts.erase(std::remove_if(artifacts.begin(), artifacts.end(), filter), artifacts.end()); - result = engine->newArray(artifacts.size()); + result = engine->newArray(uint(artifacts.size())); ctx->callee().setProperty(CachedValueKey, result); int k = 0; for (const Artifact * const artifact : artifacts) diff --git a/src/lib/corelib/buildgraph/qtmocscanner.cpp b/src/lib/corelib/buildgraph/qtmocscanner.cpp index 0f247ba52..6ecfbffa4 100644 --- a/src/lib/corelib/buildgraph/qtmocscanner.cpp +++ b/src/lib/corelib/buildgraph/qtmocscanner.cpp @@ -204,7 +204,7 @@ QScriptValue QtMocScanner::js_apply(QScriptContext *ctx, QScriptEngine *engine, return that->apply(engine, attachedPointer<Artifact>(input)); } -static QScriptValue scannerCountError(QScriptEngine *engine, int scannerCount, +static QScriptValue scannerCountError(QScriptEngine *engine, size_t scannerCount, const QString &fileTag) { return engine->currentContext()->throwError( diff --git a/src/lib/corelib/tools/qbs_export.h b/src/lib/corelib/tools/qbs_export.h index f92e6d510..164aa4184 100644 --- a/src/lib/corelib/tools/qbs_export.h +++ b/src/lib/corelib/tools/qbs_export.h @@ -68,4 +68,8 @@ # endif #endif +#if defined(_MSC_VER) && !defined(__clang__) +#pragma warning(disable: 4251) +#endif + #endif // Include guard. diff --git a/src/lib/corelib/tools/set.h b/src/lib/corelib/tools/set.h index 23d537568..8301246eb 100644 --- a/src/lib/corelib/tools/set.h +++ b/src/lib/corelib/tools/set.h @@ -288,7 +288,7 @@ template<typename T> void Set<T>::store(PersistentPool &pool) const template<typename T> QStringList Set<T>::toStringList() const { QStringList sl; - sl.reserve(size()); + sl.reserve(int(size())); std::transform(cbegin(), cend(), std::back_inserter(sl), [this](const T &e) { return toString(e); }); return sl; |