https://git.reactos.org/?p=reactos.git;a=commitdiff;h=043307624f84881737738…
commit 043307624f84881737738f68c0ea9003d6329783
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Wed Jul 31 15:39:59 2019 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jan 1 21:12:24 2020 +0100
[FREELDR] xboxcons.c, i386bug.c: Formatting and whitespace fixes.
Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
---
boot/freeldr/freeldr/arch/i386/i386bug.c | 21 +++++++-------
boot/freeldr/freeldr/arch/i386/xboxcons.c | 47 +++++++++++++++----------------
2 files changed, 33 insertions(+), 35 deletions(-)
diff --git a/boot/freeldr/freeldr/arch/i386/i386bug.c
b/boot/freeldr/freeldr/arch/i386/i386bug.c
index fd89ddf7873..b0052d7e4b1 100644
--- a/boot/freeldr/freeldr/arch/i386/i386bug.c
+++ b/boot/freeldr/freeldr/arch/i386/i386bug.c
@@ -9,7 +9,7 @@ typedef struct _FRAME
void *Address;
} FRAME;
-static const char *i386ExceptionDescriptionText[] =
+static const CHAR *i386ExceptionDescriptionText[] =
{
"Exception 00: DIVIDE BY ZERO\n\n",
"Exception 01: DEBUG EXCEPTION\n\n",
@@ -34,20 +34,20 @@ static const char *i386ExceptionDescriptionText[] =
#define SCREEN_ATTR 0x1F // Bright white on blue background
+/* Used to store the current X and Y position on the screen */
+static ULONG i386_ScreenPosX = 0;
+static ULONG i386_ScreenPosY = 0;
+
#if 0
static void
-i386PrintChar(char chr, ULONG x, ULONG y)
+i386PrintChar(CHAR chr, ULONG x, ULONG y)
{
MachVideoPutChar(chr, SCREEN_ATTR, x, y);
}
#endif
-/* Used to store the current X and Y position on the screen */
-ULONG i386_ScreenPosX = 0;
-ULONG i386_ScreenPosY = 0;
-
static void
-i386PrintText(char *pszText)
+i386PrintText(CHAR *pszText)
{
char chr;
while (1)
@@ -68,15 +68,16 @@ i386PrintText(char *pszText)
}
static void
-PrintText(const char *format, ...)
+PrintText(const CHAR *format, ...)
{
va_list argptr;
- char buffer[256];
+ CHAR buffer[256];
va_start(argptr, format);
_vsnprintf(buffer, sizeof(buffer), format, argptr);
- buffer[sizeof(buffer) - 1] = 0;
+ buffer[sizeof(buffer) - 1] = ANSI_NULL;
va_end(argptr);
+
i386PrintText(buffer);
}
diff --git a/boot/freeldr/freeldr/arch/i386/xboxcons.c
b/boot/freeldr/freeldr/arch/i386/xboxcons.c
index 769a8f16b6d..8baba25b5cc 100644
--- a/boot/freeldr/freeldr/arch/i386/xboxcons.c
+++ b/boot/freeldr/freeldr/arch/i386/xboxcons.c
@@ -25,53 +25,50 @@ static unsigned CurrentAttr = 0x0f;
VOID
XboxConsPutChar(int c)
{
- ULONG Width;
- ULONG Height;
- ULONG Depth;
+ ULONG Width, Unused;
- if ('\r' == c)
+ if (c == '\r')
{
- CurrentCursorX = 0;
+ CurrentCursorX = 0;
}
- else if ('\n' == c)
+ else if (c == '\n')
{
- CurrentCursorX = 0;
- CurrentCursorY++;
+ CurrentCursorX = 0;
+ CurrentCursorY++;
}
- else if ('\t' == c)
+ else if (c == '\t')
{
- CurrentCursorX = (CurrentCursorX + 8) & ~ 7;
+ CurrentCursorX = (CurrentCursorX + 8) & ~ 7;
}
- else
+ else
{
- XboxVideoPutChar(c, CurrentAttr, CurrentCursorX, CurrentCursorY);
- CurrentCursorX++;
+ XboxVideoPutChar(c, CurrentAttr, CurrentCursorX, CurrentCursorY);
+ CurrentCursorX++;
}
- XboxVideoGetDisplaySize(&Width, &Height, &Depth);
- if (Width <= CurrentCursorX)
+
+ XboxVideoGetDisplaySize(&Width, &Unused, &Unused);
+ if (CurrentCursorX >= Width)
{
- CurrentCursorX = 0;
- CurrentCursorY++;
+ CurrentCursorX = 0;
+ CurrentCursorY++;
}
+ // FIXME: Implement vertical screen scrolling if we are at the end of the screen.
}
BOOLEAN
XboxConsKbHit(VOID)
{
- /* No keyboard support yet */
- return FALSE;
+ /* No keyboard support yet */
+ return FALSE;
}
int
XboxConsGetCh(void)
{
- /* No keyboard support yet */
- while (1)
- {
- ;
- }
+ /* No keyboard support yet */
+ while (1) ;
- return 0;
+ return 0;
}
/* EOF */