forked from qt-creator/qt-creator
Fix excessive warnings by MSVC 2013 64bit about size_t->int truncation
C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data Change-Id: I91979c685bbbd84359f7f4e19911a21a408f5d23 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -70,7 +70,7 @@ void InvokerBase::invoke(QObject *t, const char *slot)
|
|||||||
if (paramCount)
|
if (paramCount)
|
||||||
sig.append(',');
|
sig.append(',');
|
||||||
const char *type = arg[paramCount].name();
|
const char *type = arg[paramCount].name();
|
||||||
sig.append(type, strlen(type));
|
sig.append(type, int(strlen(type)));
|
||||||
}
|
}
|
||||||
sig.append(')');
|
sig.append(')');
|
||||||
sig.append('\0');
|
sig.append('\0');
|
||||||
|
@@ -210,7 +210,7 @@ void DetailedErrorDelegate::onVerticalScroll()
|
|||||||
// Expects "file://some/path[:line[:column]]" - the line/column part is optional
|
// Expects "file://some/path[:line[:column]]" - the line/column part is optional
|
||||||
void DetailedErrorDelegate::openLinkInEditor(const QString &link)
|
void DetailedErrorDelegate::openLinkInEditor(const QString &link)
|
||||||
{
|
{
|
||||||
const QString linkWithoutPrefix = link.mid(strlen("file://"));
|
const QString linkWithoutPrefix = link.mid(int(strlen("file://")));
|
||||||
const QChar separator = QLatin1Char(':');
|
const QChar separator = QLatin1Char(':');
|
||||||
const int lineColon = linkWithoutPrefix.indexOf(separator, /*after drive letter + colon =*/ 2);
|
const int lineColon = linkWithoutPrefix.indexOf(separator, /*after drive letter + colon =*/ 2);
|
||||||
const QString path = linkWithoutPrefix.left(lineColon);
|
const QString path = linkWithoutPrefix.left(lineColon);
|
||||||
|
@@ -52,7 +52,7 @@ static QString pathFromId(Core::Id id)
|
|||||||
QByteArray idStr = id.name();
|
QByteArray idStr = id.name();
|
||||||
if (!idStr.startsWith(BareMetalRunConfiguration::IdPrefix))
|
if (!idStr.startsWith(BareMetalRunConfiguration::IdPrefix))
|
||||||
return QString();
|
return QString();
|
||||||
return QString::fromUtf8(idStr.mid(strlen(BareMetalRunConfiguration::IdPrefix)));
|
return QString::fromUtf8(idStr.mid(int(strlen(BareMetalRunConfiguration::IdPrefix))));
|
||||||
}
|
}
|
||||||
|
|
||||||
BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory(QObject *parent) :
|
BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory(QObject *parent) :
|
||||||
|
@@ -1859,7 +1859,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
|
|||||||
if (found)
|
if (found)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const int len = strlen(str);
|
const int len = int(strlen(str));
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
break;
|
break;
|
||||||
str += len + 1;
|
str += len + 1;
|
||||||
|
@@ -148,7 +148,7 @@ void DebuggerItem::reinitializeFromFile()
|
|||||||
|
|
||||||
// Version
|
// Version
|
||||||
if (ba.startsWith(("lldb version "))) { // Linux typically.
|
if (ba.startsWith(("lldb version "))) { // Linux typically.
|
||||||
int pos1 = strlen("lldb version ");
|
int pos1 = int(strlen("lldb version "));
|
||||||
int pos2 = ba.indexOf(' ', pos1);
|
int pos2 = ba.indexOf(' ', pos1);
|
||||||
m_version = QString::fromLatin1(ba.mid(pos1, pos2 - pos1));
|
m_version = QString::fromLatin1(ba.mid(pos1, pos2 - pos1));
|
||||||
} else if (ba.startsWith("lldb-") || ba.startsWith("LLDB-")) { // Mac typically.
|
} else if (ba.startsWith("lldb-") || ba.startsWith("LLDB-")) { // Mac typically.
|
||||||
|
@@ -368,7 +368,7 @@ void GdbMi::fromStringMultiple(const QByteArray &ba)
|
|||||||
|
|
||||||
GdbMi GdbMi::operator[](const char *name) const
|
GdbMi GdbMi::operator[](const char *name) const
|
||||||
{
|
{
|
||||||
for (int i = 0, n = m_children.size(); i < n; ++i)
|
for (int i = 0, n = int(m_children.size()); i < n; ++i)
|
||||||
if (m_children.at(i).m_name == name)
|
if (m_children.at(i).m_name == name)
|
||||||
return m_children.at(i);
|
return m_children.at(i);
|
||||||
return GdbMi();
|
return GdbMi();
|
||||||
|
@@ -159,7 +159,7 @@ public:
|
|||||||
|
|
||||||
inline QByteArray data() const { return m_data; }
|
inline QByteArray data() const { return m_data; }
|
||||||
inline const std::vector<GdbMi> &children() const { return m_children; }
|
inline const std::vector<GdbMi> &children() const { return m_children; }
|
||||||
inline int childCount() const { return m_children.size(); }
|
inline int childCount() const { return int(m_children.size()); }
|
||||||
|
|
||||||
const GdbMi &childAt(int index) const { return m_children[index]; }
|
const GdbMi &childAt(int index) const { return m_children[index]; }
|
||||||
GdbMi &childAt(int index) { return m_children[index]; }
|
GdbMi &childAt(int index) { return m_children[index]; }
|
||||||
|
@@ -3900,7 +3900,7 @@ void GdbEngine::handleFetchMemory(const DebuggerResponse &response, MemoryAgentC
|
|||||||
return;
|
return;
|
||||||
GdbMi memory0 = memory.children().at(0); // we asked for only one 'row'
|
GdbMi memory0 = memory.children().at(0); // we asked for only one 'row'
|
||||||
GdbMi data = memory0["data"];
|
GdbMi data = memory0["data"];
|
||||||
for (int i = 0, n = data.children().size(); i != n; ++i) {
|
for (int i = 0, n = int(data.children().size()); i != n; ++i) {
|
||||||
const GdbMi &child = data.children().at(i);
|
const GdbMi &child = data.children().at(i);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
unsigned char c = '?';
|
unsigned char c = '?';
|
||||||
|
@@ -609,7 +609,7 @@ void LldbEngine::updateBreakpointData(const GdbMi &bkpt, bool added)
|
|||||||
response.lineNumber = bkpt["line"].toInt();
|
response.lineNumber = bkpt["line"].toInt();
|
||||||
|
|
||||||
GdbMi locations = bkpt["locations"];
|
GdbMi locations = bkpt["locations"];
|
||||||
const int numChild = locations.children().size();
|
const int numChild = int(locations.children().size());
|
||||||
if (numChild > 1) {
|
if (numChild > 1) {
|
||||||
foreach (const GdbMi &location, locations.children()) {
|
foreach (const GdbMi &location, locations.children()) {
|
||||||
const int locid = location["locid"].toInt();
|
const int locid = location["locid"].toInt();
|
||||||
|
@@ -462,7 +462,7 @@ void ThreadsHandler::updateThreads(const GdbMi &data)
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
const std::vector<GdbMi> items = data["threads"].children();
|
const std::vector<GdbMi> items = data["threads"].children();
|
||||||
const int n = items.size();
|
const int n = int(items.size());
|
||||||
for (int index = 0; index != n; ++index) {
|
for (int index = 0; index != n; ++index) {
|
||||||
const GdbMi item = items[index];
|
const GdbMi item = items[index];
|
||||||
const GdbMi frame = item["frame"];
|
const GdbMi frame = item["frame"];
|
||||||
|
@@ -665,7 +665,7 @@ void parseChildrenData(const WatchData &data0, const GdbMi &item,
|
|||||||
childtemplate.address = addressBase;
|
childtemplate.address = addressBase;
|
||||||
arrayDecoder(childtemplate, mi.data(), encoding);
|
arrayDecoder(childtemplate, mi.data(), encoding);
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0, n = children.children().size(); i != n; ++i) {
|
for (int i = 0, n = int(children.children().size()); i != n; ++i) {
|
||||||
const GdbMi &child = children.children().at(i);
|
const GdbMi &child = children.children().at(i);
|
||||||
WatchData data1 = childtemplate;
|
WatchData data1 = childtemplate;
|
||||||
data1.sortId = i;
|
data1.sortId = i;
|
||||||
|
@@ -96,7 +96,7 @@ bool SearchFunction::visit(CPlusPlus::Function * f)
|
|||||||
if (const CPlusPlus::Name *name = f->name())
|
if (const CPlusPlus::Name *name = f->name())
|
||||||
if (const CPlusPlus::Identifier *id = name->identifier())
|
if (const CPlusPlus::Identifier *id = name->identifier())
|
||||||
if (id->size() == m_length)
|
if (id->size() == m_length)
|
||||||
if (!qstrncmp(m_name, id->chars(), m_length))
|
if (!qstrncmp(m_name, id->chars(), uint(m_length)))
|
||||||
m_matches.push_back(f);
|
m_matches.push_back(f);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -61,8 +61,8 @@ public:
|
|||||||
|
|
||||||
FormatToken(Format format, size_t position, size_t length)
|
FormatToken(Format format, size_t position, size_t length)
|
||||||
:m_format(format)
|
:m_format(format)
|
||||||
,m_position(position)
|
,m_position(int(position))
|
||||||
,m_length(length)
|
,m_length(int(length))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline Format format() const { return m_format; }
|
inline Format format() const { return m_format; }
|
||||||
|
@@ -52,7 +52,7 @@ QString stringFromId(Core::Id id)
|
|||||||
QByteArray idStr = id.name();
|
QByteArray idStr = id.name();
|
||||||
if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
|
if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
|
||||||
return QString();
|
return QString();
|
||||||
return QString::fromUtf8(idStr.mid(strlen(RemoteLinuxRunConfiguration::IdPrefix)));
|
return QString::fromUtf8(idStr.mid(int(strlen(RemoteLinuxRunConfiguration::IdPrefix))));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Reference in New Issue
Block a user