diff options
author | Friedemann Kleint <[email protected]> | 2013-09-12 09:54:27 +0200 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2013-09-12 15:34:09 +0200 |
commit | 1901a1c7d402cd4fe1eaf3a9107fe6d56348acb5 (patch) | |
tree | bbaee31a20c7464b67f1203e3d2df7c26cfd527f /src/libs/cplusplus/pp-engine.cpp | |
parent | 5c33742375219d86572dd989e3be07595a162a7b (diff) |
Fix MSVC-64 warnings about size_t -> int truncations in C++-lib.
Change-Id: Ibe6f41ac15df1ec685b0d0766ff568abf6f3ae7e
Reviewed-by: Nikolai Kosjar <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/pp-engine.cpp')
-rw-r--r-- | src/libs/cplusplus/pp-engine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 0f678adf025..15beba17714 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -1064,7 +1064,7 @@ bool Preprocessor::handleIdentifier(PPToken *tk) // This is not the most beautiful approach but it's quite reasonable. What we do here // is to create a fake identifier token which is only composed by whitespaces. It's // also not marked as expanded so it it can be treated as a regular token. - QByteArray content(idTk.f.length + computeDistance(idTk), ' '); + const QByteArray content(int(idTk.f.length + computeDistance(idTk)), ' '); PPToken fakeIdentifier = generateToken(T_IDENTIFIER, content.constData(), content.length(), idTk.lineno, false, false); @@ -1131,7 +1131,7 @@ bool Preprocessor::handleFunctionLikeMacro(const Macro *macro, for (size_t i = 0; i < bodySize && expanded.size() < MAX_TOKEN_EXPANSION_COUNT; ++i) { int expandedSize = expanded.size(); - PPToken bodyTk = body.at(i); + PPToken bodyTk = body.at(int(i)); if (bodyTk.is(T_IDENTIFIER)) { const ByteArrayRef id = bodyTk.asByteArrayRef(); @@ -1152,7 +1152,7 @@ bool Preprocessor::handleFunctionLikeMacro(const Macro *macro, const int actualsSize = actualsForThisParam.size(); - if (i > 0 && body[i - 1].is(T_POUND)) { + if (i > 0 && body[int(i) - 1].is(T_POUND)) { QByteArray enclosedString; enclosedString.reserve(256); @@ -1205,7 +1205,7 @@ bool Preprocessor::handleFunctionLikeMacro(const Macro *macro, expanded.push_back(bodyTk); } - if (i > 1 && body[i - 1].is(T_POUND_POUND)) { + if (i > 1 && body[int(i) - 1].is(T_POUND_POUND)) { if (expandedSize < 1 || expanded.size() == expandedSize) //### TODO: [cpp.concat] placemarkers continue; const PPToken &leftTk = expanded[expandedSize - 1]; @@ -1414,7 +1414,7 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source, unsigned trackedColumn = 0; if (tk.expanded() && !tk.generated()) { trackedLine = tk.lineno; - trackedColumn = computeDistance(tk, true); + trackedColumn = unsigned(computeDistance(tk, true)); } m_state.m_expandedTokensInfo.append(qMakePair(trackedLine, trackedColumn)); } else if (m_state.m_expansionStatus == JustFinishedExpansion) { @@ -1985,7 +1985,7 @@ PPToken Preprocessor::generateToken(enum Kind kind, else if (kind == T_NUMERIC_LITERAL) tk.number = m_state.m_lexer->control()->numericLiteral(m_scratchBuffer.constData() + pos, length); } - tk.offset = pos; + tk.offset = unsigned(pos); tk.f.length = length; tk.f.generated = true; tk.f.expanded = true; |