Fix MSVC warnings.


svn path=/branches/ntvdm/; revision=59666
This commit is contained in:
Aleksandar Andrejevic 2013-08-07 15:01:38 +00:00
parent f66525ee02
commit 5e69cb4dcb
5 changed files with 15 additions and 15 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -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;

View file

@ -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 */