MdeModulePkg/TerminalDxe: Fix IA32 VS2015x86 build break

https://bugzilla.tianocore.org/show_bug.cgi?id=190

The issue is with signed/unsigned comparisons between
Mode->CursorRow and Row and Mode->CursorColumn and Column.

The fix is to add typecast to UINTN for comparisons.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Brian Johnson <bjohnson@sgi.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Brian Johnson <bjohnson@sgi.com>
This commit is contained in:
Michael Kinney 2016-10-26 20:13:27 -07:00
parent bb47667aa7
commit d1b757e2cd
1 changed files with 3 additions and 3 deletions

View File

@ -790,13 +790,13 @@ TerminalConOutSetCursorPosition (
// it isn't necessary. // it isn't necessary.
// //
if (TerminalDevice->TerminalType == TTYTERMTYPE && if (TerminalDevice->TerminalType == TTYTERMTYPE &&
Mode->CursorRow == Row) { (UINTN)Mode->CursorRow == Row) {
if (Mode->CursorColumn > Column) { if ((UINTN)Mode->CursorColumn > Column) {
mCursorBackwardString[FW_BACK_OFFSET + 0] = (CHAR16) ('0' + ((Mode->CursorColumn - Column) / 10)); mCursorBackwardString[FW_BACK_OFFSET + 0] = (CHAR16) ('0' + ((Mode->CursorColumn - Column) / 10));
mCursorBackwardString[FW_BACK_OFFSET + 1] = (CHAR16) ('0' + ((Mode->CursorColumn - Column) % 10)); mCursorBackwardString[FW_BACK_OFFSET + 1] = (CHAR16) ('0' + ((Mode->CursorColumn - Column) % 10));
String = mCursorBackwardString; String = mCursorBackwardString;
} }
else if (Column > Mode->CursorColumn) { else if (Column > (UINTN)Mode->CursorColumn) {
mCursorForwardString[FW_BACK_OFFSET + 0] = (CHAR16) ('0' + ((Column - Mode->CursorColumn) / 10)); mCursorForwardString[FW_BACK_OFFSET + 0] = (CHAR16) ('0' + ((Column - Mode->CursorColumn) / 10));
mCursorForwardString[FW_BACK_OFFSET + 1] = (CHAR16) ('0' + ((Column - Mode->CursorColumn) % 10)); mCursorForwardString[FW_BACK_OFFSET + 1] = (CHAR16) ('0' + ((Column - Mode->CursorColumn) % 10));
String = mCursorForwardString; String = mCursorForwardString;