AnsiEscapeCodeHandler: Fix some Clang sign conversion warnings

Change-Id: I170054defc4c54d2bae4e936eb3c0c482c36e03d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2019-01-27 07:05:49 +01:00
committed by André Hartmann
parent 693e2649a4
commit 3b2b50f79f

View File

@@ -166,7 +166,7 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
}
for (int i = 0; i < numbers.size(); ++i) {
const int code = numbers.at(i).toInt();
const uint code = numbers.at(i).toUInt();
if (code >= TextColorStart && code <= TextColorEnd) {
charFormat.setForeground(ansiColor(code - TextColorStart));
@@ -214,7 +214,7 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
break;
case 5:
// 256 color mode with format: 38;5;<i>
uint index = numbers.at(i + 1).toInt();
uint index = numbers.at(i + 1).toUInt();
QColor color;
if (index < 8) {
@@ -229,7 +229,7 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
color = QColor((o / 36) * 51, ((o / 6) % 6) * 51, (o % 6) * 51);
} else {
// The last 24 colors are a greyscale gradient.
uint grey = (index - 232) * 11;
int grey = int((index - 232) * 11);
color = QColor(grey, grey, grey);
}