Debugger: Fix MSVC warning

warning: C4305: '/=': truncation from 'int' to 'IntType'

with q[u]int8 template argument.

Change-Id: I0f0063191b0e51ab79f94073ead65da86ea82440
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2022-01-04 08:55:52 +02:00
committed by Orgad Shaneh
parent 14f40f3cdf
commit 28334638ab

View File

@@ -624,7 +624,7 @@ template <class IntType> QString reformatInteger(IntType value, int format)
QString res = "\"";
while (value > 0) {
res = QChar(ushort(value & 255)) + res;
value /= 256;
value >>= 8;
}
return "\"" + res;
}
@@ -641,25 +641,20 @@ static QString reformatInteger(quint64 value, int format, int size, bool isSigne
switch (size) {
case 1:
value = value & 0xff;
return isSigned
? reformatInteger<qint8>(value, format)
: reformatInteger<quint8>(value, format);
break;
case 2:
value = value & 0xffff;
return isSigned
? reformatInteger<qint16>(value, format)
: reformatInteger<quint16>(value, format);
break;
case 4:
value = value & 0xffffffff;
return isSigned
? reformatInteger<qint32>(value, format)
: reformatInteger<quint32>(value, format);
break;
default:
case 8: return isSigned
break;
}
return isSigned
? reformatInteger<qint64>(value, format)
: reformatInteger<quint64>(value, format);
}
}
// Format printable (char-type) characters
static QString reformatCharacter(int code, int size, bool isSigned)