- Use MAX/MINSHORT instead of CRT macros.
- Include only the relevant headers.

svn path=/branches/ntvdm/; revision=61014
This commit is contained in:
Hermès Bélusca-Maïto 2013-11-16 23:11:54 +00:00
parent 4b005f11bf
commit da7d643e51
2 changed files with 11 additions and 6 deletions

View file

@ -16,7 +16,12 @@
#include <conio.h> #include <conio.h>
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include <windows.h> #include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <wincon.h>
#include <winnls.h>
#include <winuser.h>
#include <debug.h> #include <debug.h>

View file

@ -132,17 +132,17 @@ static inline INT VgaGetAddressSize(VOID)
if (VgaCrtcRegisters[VGA_CRTC_UNDERLINE_REG] & VGA_CRTC_UNDERLINE_DWORD) if (VgaCrtcRegisters[VGA_CRTC_UNDERLINE_REG] & VGA_CRTC_UNDERLINE_DWORD)
{ {
/* Double-word addressing */ /* Double-word addressing */
return 4; return 4; // sizeof(DWORD)
} }
if (VgaCrtcRegisters[VGA_CRTC_MODE_CONTROL_REG] & VGA_CRTC_MODE_CONTROL_BYTE) if (VgaCrtcRegisters[VGA_CRTC_MODE_CONTROL_REG] & VGA_CRTC_MODE_CONTROL_BYTE)
{ {
/* Byte addressing */ /* Byte addressing */
return 1; return 1; // sizeof(BYTE)
} }
/* Word addressing */ /* Word addressing */
return 2; return 2; // sizeof(WORD)
} }
static inline DWORD VgaTranslateReadAddress(DWORD Address) static inline DWORD VgaTranslateReadAddress(DWORD Address)
@ -265,8 +265,8 @@ static inline VOID VgaMarkForUpdate(SHORT Row, SHORT Column)
/* Check if this is the first time the rectangle is updated */ /* Check if this is the first time the rectangle is updated */
if (!NeedsUpdate) if (!NeedsUpdate)
{ {
UpdateRectangle.Left = UpdateRectangle.Top = SHRT_MAX; UpdateRectangle.Left = UpdateRectangle.Top = MAXSHORT;
UpdateRectangle.Right = UpdateRectangle.Bottom = SHRT_MIN; UpdateRectangle.Right = UpdateRectangle.Bottom = MINSHORT;
} }
/* Expand the rectangle to include the point */ /* Expand the rectangle to include the point */