From e78a487010d3b81b21b05f100772df37a414107f Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 29 Aug 2017 15:00:26 +0200 Subject: qdoc: Fix compilation warnings on MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Martin Smith --- src/qdoc/clangcodeparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qdoc/clangcodeparser.cpp') 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(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(args_.size()), nullptr, 0, flags_, &tu); if (err || !tu) { qWarning() << "(qdoc) Could not parse source file" << filePath << " error code:" << err; clang_disposeIndex(index_); -- cgit v1.2.1