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:
Friedemann Kleint
2015-02-19 16:44:58 +01:00
parent 21e9893b4b
commit 143af2845d
14 changed files with 15 additions and 15 deletions

View File

@@ -1859,7 +1859,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
if (found)
break;
const int len = strlen(str);
const int len = int(strlen(str));
if (len == 0)
break;
str += len + 1;

View File

@@ -148,7 +148,7 @@ void DebuggerItem::reinitializeFromFile()
// Version
if (ba.startsWith(("lldb version "))) { // Linux typically.
int pos1 = strlen("lldb version ");
int pos1 = int(strlen("lldb version "));
int pos2 = ba.indexOf(' ', pos1);
m_version = QString::fromLatin1(ba.mid(pos1, pos2 - pos1));
} else if (ba.startsWith("lldb-") || ba.startsWith("LLDB-")) { // Mac typically.

View File

@@ -368,7 +368,7 @@ void GdbMi::fromStringMultiple(const QByteArray &ba)
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)
return m_children.at(i);
return GdbMi();

View File

@@ -159,7 +159,7 @@ public:
inline QByteArray data() const { return m_data; }
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]; }
GdbMi &childAt(int index) { return m_children[index]; }

View File

@@ -3900,7 +3900,7 @@ void GdbEngine::handleFetchMemory(const DebuggerResponse &response, MemoryAgentC
return;
GdbMi memory0 = memory.children().at(0); // we asked for only one 'row'
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);
bool ok = true;
unsigned char c = '?';

View File

@@ -609,7 +609,7 @@ void LldbEngine::updateBreakpointData(const GdbMi &bkpt, bool added)
response.lineNumber = bkpt["line"].toInt();
GdbMi locations = bkpt["locations"];
const int numChild = locations.children().size();
const int numChild = int(locations.children().size());
if (numChild > 1) {
foreach (const GdbMi &location, locations.children()) {
const int locid = location["locid"].toInt();

View File

@@ -462,7 +462,7 @@ void ThreadsHandler::updateThreads(const GdbMi &data)
// }
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) {
const GdbMi item = items[index];
const GdbMi frame = item["frame"];

View File

@@ -665,7 +665,7 @@ void parseChildrenData(const WatchData &data0, const GdbMi &item,
childtemplate.address = addressBase;
arrayDecoder(childtemplate, mi.data(), encoding);
} 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);
WatchData data1 = childtemplate;
data1.sortId = i;