Author: aandrejevic Date: Wed Aug 7 15:01:38 2013 New Revision: 59666
URL: http://svn.reactos.org/svn/reactos?rev=59666&view=rev Log: [NTVDM] Fix MSVC warnings.
Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/dos.c branches/ntvdm/subsystems/ntvdm/emulator.c branches/ntvdm/subsystems/ntvdm/ps2.c branches/ntvdm/subsystems/ntvdm/vga.c
Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?re... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Wed Aug 7 15:01:38 2013 @@ -529,7 +529,7 @@ BYTE Page, BYTE FillAttribute) { - INT i; + DWORD i; LPWORD WindowData; DWORD WindowSize = (Rectangle.Bottom - Rectangle.Top + 1) * (Rectangle.Right - Rectangle.Left + 1);
Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?rev... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Wed Aug 7 15:01:38 2013 @@ -74,7 +74,7 @@ TotalSize += strlen(ProgramName) + 1;
/* Allocate the memory for the environment block */ - DestSegment = DosAllocateMemory((TotalSize + 0x0F) >> 4, NULL); + DestSegment = DosAllocateMemory((WORD)((TotalSize + 0x0F) >> 4), NULL); if (!DestSegment) return 0;
Ptr = SourceBuffer; @@ -559,7 +559,7 @@ if (FileHandle == INVALID_HANDLE_VALUE) { /* Return the error code */ - return GetLastError(); + return (WORD)GetLastError(); }
/* Open the DOS handle */ @@ -632,7 +632,7 @@ if (FileHandle == INVALID_HANDLE_VALUE) { /* Return the error code */ - return GetLastError(); + return (WORD)GetLastError(); }
/* Open the DOS handle */ @@ -667,7 +667,7 @@ if (!ReadFile(Handle, Buffer, Count, &BytesRead32, NULL)) { /* Store the error code */ - Result = GetLastError(); + Result = (WORD)GetLastError(); }
/* The number of bytes read is always 16-bit */ @@ -694,7 +694,7 @@ if (!WriteFile(Handle, Buffer, Count, &BytesWritten32, NULL)) { /* Store the error code */ - Result = GetLastError(); + Result = (WORD)GetLastError(); }
/* The number of bytes written is always 16-bit */ @@ -731,7 +731,7 @@ if (FilePointer == INVALID_SET_FILE_POINTER) { /* Get the real error code */ - Result = GetLastError(); + Result = (WORD)GetLastError(); }
if (Result != ERROR_SUCCESS) @@ -877,7 +877,7 @@ LPSTR ProgramFilePath, Parameters[128]; CHAR CommandLineCopy[128]; INT ParamCount = 0; - DWORD Segment = 0; + WORD Segment = 0; WORD MaxAllocSize; DWORD i, FileSize, ExeSize; PIMAGE_DOS_HEADER Header; @@ -1027,7 +1027,7 @@ DosAllocateMemory(0xFFFF, &MaxAllocSize);
/* Make sure it's enough for the whole program and the PSP */ - if ((MaxAllocSize << 4) < (FileSize + sizeof(DOS_PSP))) goto Cleanup; + if (((DWORD)MaxAllocSize << 4) < (FileSize + sizeof(DOS_PSP))) goto Cleanup;
/* Allocate all of it */ Segment = DosAllocateMemory(MaxAllocSize, NULL);
Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator.... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Wed Aug 7 15:01:38 2013 @@ -469,7 +469,7 @@ } else { - EmulatorContext.state->segment_reg[Register - EMULATOR_REG_ES].val = Value; + EmulatorContext.state->segment_reg[Register - EMULATOR_REG_ES].val = (WORD)Value; } #else // TODO: NOT IMPLEMENTED
Modified: branches/ntvdm/subsystems/ntvdm/ps2.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ps2.c?rev... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] Wed Aug 7 15:01:38 2013 @@ -289,7 +289,7 @@ if (Buffer[i].EventType != KEY_EVENT) continue;
/* Get the scan code */ - ScanCode = Buffer[i].Event.KeyEvent.wVirtualScanCode; + ScanCode = (BYTE)Buffer[i].Event.KeyEvent.wVirtualScanCode;
/* If this is a key release, set the highest bit in the scan code */ if (!Buffer[i].Event.KeyEvent.bKeyDown) ScanCode |= 0x80;
Modified: branches/ntvdm/subsystems/ntvdm/vga.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?rev... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Wed Aug 7 15:01:38 2013 @@ -218,7 +218,7 @@
static VOID VgaEnterGraphicsMode(UINT Width, UINT Height, UINT BitDepth) { - INT i; + DWORD i; CONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo; BYTE BitmapInfoBuffer[VGA_BITMAP_INFO_SIZE]; LPBITMAPINFO BitmapInfo = (LPBITMAPINFO)BitmapInfoBuffer; @@ -640,7 +640,7 @@
VOID VgaReadMemory(DWORD Address, LPBYTE Buffer, DWORD Size) { - INT i; + DWORD i;
DPRINT("VgaReadMemory: Address 0x%08X, Size %lu\n", Address, @@ -661,7 +661,7 @@
VOID VgaWriteMemory(DWORD Address, LPBYTE Buffer, DWORD Size) { - INT i, j; + DWORD i, j;
DPRINT("VgaWriteMemory: Address 0x%08X, Size %lu\n", Address, @@ -961,7 +961,7 @@ VgaMemory[CurrentAddr] = CharBuffer[i * Resolution.X + j].Char.AsciiChar;
/* Store the attribute in plane 1 */ - VgaMemory[CurrentAddr + VGA_BANK_SIZE] = CharBuffer[i * Resolution.X + j].Attributes; + VgaMemory[CurrentAddr + VGA_BANK_SIZE] = (BYTE)CharBuffer[i * Resolution.X + j].Attributes; }
/* Move to the next scanline */