summaryrefslogtreecommitdiff
path: root/src/qdoc/clangcodeparser.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2017-08-29 15:00:26 +0200
committerTopi Reiniö <topi.reinio@qt.io>2017-10-11 11:29:43 +0000
commite78a487010d3b81b21b05f100772df37a414107f (patch)
treec8429e0cc6f155f17d3a77497b206931db6c7dde /src/qdoc/clangcodeparser.cpp
parent74a742cf33abb07a02fb69580df4425eb2d02ca3 (diff)
downloadqttools-e78a487010d3b81b21b05f100772df37a414107f.tar.gz
qdoc: Fix compilation warnings on MSVC
We pass the size_t of an std::vector to a clang function taking an int as an argument, which on MSVC resulted in warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data To fix this, cast explicitly. Change-Id: I3636f7ced600c387c678aa59012274db490d8f8d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r--src/qdoc/clangcodeparser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index 55e0cb573..44da9d7ed 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -1163,7 +1163,7 @@ void ClangCodeParser::buildPCH()
}
CXErrorCode err = clang_parseTranslationUnit2(index_,
tmpHeader.toLatin1().data(),
- args_.data(), args_.size(), nullptr, 0,
+ args_.data(), static_cast<int>(args_.size()), nullptr, 0,
flags_ | CXTranslationUnit_ForSerialization, &tu);
if (!err && tu) {
pchName_ = pchFileDir_->path().toUtf8() + "/" + module + ".pch";
@@ -1231,7 +1231,7 @@ void ClangCodeParser::parseSourceFile(const Location& /*location*/, const QStrin
CXTranslationUnit tu;
CXErrorCode err = clang_parseTranslationUnit2(index_, filePath.toLocal8Bit(), args_.data(),
- args_.size(), nullptr, 0, flags_, &tu);
+ static_cast<int>(args_.size()), nullptr, 0, flags_, &tu);
if (err || !tu) {
qWarning() << "(qdoc) Could not parse source file" << filePath << " error code:" << err;
clang_disposeIndex(index_);