From: Aleksandar Andrejevic Date: Wed, 7 Aug 2013 15:01:38 +0000 (+0000) Subject: [NTVDM] X-Git-Tag: backups/0.3.17@66124~1365^2~536 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=5e69cb4dcbf98b49515426c5bce1aa9dacbfda13 [NTVDM] Fix MSVC warnings. svn path=/branches/ntvdm/; revision=59666 --- diff --git a/subsystems/ntvdm/bios.c b/subsystems/ntvdm/bios.c index a1b56822419..8b142cad495 100644 --- a/subsystems/ntvdm/bios.c +++ b/subsystems/ntvdm/bios.c @@ -529,7 +529,7 @@ BOOLEAN BiosScrollWindow(INT Direction, BYTE Page, BYTE FillAttribute) { - INT i; + DWORD i; LPWORD WindowData; DWORD WindowSize = (Rectangle.Bottom - Rectangle.Top + 1) * (Rectangle.Right - Rectangle.Left + 1); diff --git a/subsystems/ntvdm/dos.c b/subsystems/ntvdm/dos.c index c3f4afdae32..df81cd79db5 100644 --- a/subsystems/ntvdm/dos.c +++ b/subsystems/ntvdm/dos.c @@ -74,7 +74,7 @@ static WORD DosCopyEnvironmentBlock(WORD SourceSegment, LPCSTR ProgramName) 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 @@ WORD DosCreateFile(LPWORD Handle, LPCSTR FilePath, WORD Attributes) if (FileHandle == INVALID_HANDLE_VALUE) { /* Return the error code */ - return GetLastError(); + return (WORD)GetLastError(); } /* Open the DOS handle */ @@ -632,7 +632,7 @@ WORD DosOpenFile(LPWORD Handle, LPCSTR FilePath, BYTE AccessMode) if (FileHandle == INVALID_HANDLE_VALUE) { /* Return the error code */ - return GetLastError(); + return (WORD)GetLastError(); } /* Open the DOS handle */ @@ -667,7 +667,7 @@ WORD DosReadFile(WORD FileHandle, LPVOID Buffer, WORD Count, LPWORD BytesRead) 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 @@ WORD DosWriteFile(WORD FileHandle, LPVOID Buffer, WORD Count, LPWORD BytesWritte 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 @@ WORD DosSeekFile(WORD FileHandle, LONG Offset, BYTE Origin, LPDWORD NewOffset) if (FilePointer == INVALID_SET_FILE_POINTER) { /* Get the real error code */ - Result = GetLastError(); + Result = (WORD)GetLastError(); } if (Result != ERROR_SUCCESS) @@ -877,7 +877,7 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock) 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 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock) 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); diff --git a/subsystems/ntvdm/emulator.c b/subsystems/ntvdm/emulator.c index 76ae477a089..56cabc8b494 100644 --- a/subsystems/ntvdm/emulator.c +++ b/subsystems/ntvdm/emulator.c @@ -469,7 +469,7 @@ VOID EmulatorSetRegister(ULONG Register, ULONG Value) } 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 diff --git a/subsystems/ntvdm/ps2.c b/subsystems/ntvdm/ps2.c index 7b51b5ba426..f5cbef6e71b 100644 --- a/subsystems/ntvdm/ps2.c +++ b/subsystems/ntvdm/ps2.c @@ -289,7 +289,7 @@ VOID CheckForInputEvents() 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; diff --git a/subsystems/ntvdm/vga.c b/subsystems/ntvdm/vga.c index ce98f3d1ddb..02f1fd727ff 100644 --- a/subsystems/ntvdm/vga.c +++ b/subsystems/ntvdm/vga.c @@ -218,7 +218,7 @@ static VOID VgaWriteAc(BYTE Data) 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 VgaHorizontalRetrace(VOID) 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 VgaReadMemory(DWORD Address, LPBYTE Buffer, DWORD Size) 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 @@ VOID VgaInitialize(HANDLE TextHandle) 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 */