Author: hbelusca
Date: Thu Aug 31 18:31:52 2017
New Revision: 75722
URL:
http://svn.reactos.org/svn/reactos?rev=75722&view=rev
Log:
[USETUP]: Adaptations 1:
- Transform some do{}while() loops into while(){} ones, since the lists on which we work
may only contain one single {NULL} element.
- Modify MUIGetOEMCodePage() call after r75719.
- Use PCWSTR where needed.
Modified:
branches/setup_improvements/base/setup/usetup/mui.c
branches/setup_improvements/base/setup/usetup/mui.h
Modified: branches/setup_improvements/base/setup/usetup/mui.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/mui.c [iso-8859-1] Thu Aug 31 18:31:52
2017
@@ -30,13 +30,6 @@
#define NDEBUG
#include <debug.h>
-extern
-VOID
-PopupError(IN PCCH Text,
- IN PCCH Status,
- IN PINPUT_RECORD Ir,
- IN ULONG WaitEvent);
-
static
ULONG
FindLanguageIndex(VOID)
@@ -45,11 +38,12 @@
if (SelectedLanguageId == NULL)
{
- /* default to english */
- return 0;
- }
-
- do
+ /* Default to en-US */
+ return 0; // FIXME!!
+ // SelectedLanguageId = L"00000409";
+ }
+
+ while (ResourceList[lngIndex].MuiPages != NULL)
{
if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
{
@@ -57,7 +51,7 @@
}
lngIndex++;
- } while (ResourceList[lngIndex].MuiPages != NULL);
+ }
return 0;
}
@@ -70,13 +64,13 @@
{
ULONG lngIndex = 0;
- do
+ while (ResourceList[lngIndex].MuiPages != NULL)
{
if (_wcsicmp(ResourceList[lngIndex].LanguageID, LanguageId) == 0)
return TRUE;
lngIndex++;
- } while (ResourceList[lngIndex].MuiPages != NULL);
+ }
return FALSE;
}
@@ -95,13 +89,13 @@
lngIndex = max(FindLanguageIndex(), 0);
Pages = ResourceList[lngIndex].MuiPages;
- do
+ while (Pages[muiIndex].MuiEntry != NULL)
{
if (Pages[muiIndex].Number == PageNumber)
return Pages[muiIndex].MuiEntry;
muiIndex++;
- } while (Pages[muiIndex].MuiEntry != NULL);
+ }
return NULL;
}
@@ -128,7 +122,7 @@
IN ULONG page)
{
const MUI_ENTRY * entry;
- int index;
+ ULONG index;
entry = FindMUIEntriesOfPage(page);
if (!entry)
@@ -141,7 +135,7 @@
}
index = 0;
- do
+ while (entry[index].Buffer != NULL)
{
CONSOLE_ClearStyledText(entry[index].X,
entry[index].Y,
@@ -149,7 +143,6 @@
strlen(entry[index].Buffer));
index++;
}
- while (entry[index].Buffer != NULL);
}
VOID
@@ -157,7 +150,7 @@
IN ULONG page)
{
const MUI_ENTRY * entry;
- int index;
+ ULONG index;
entry = FindMUIEntriesOfPage(page);
if (!entry)
@@ -170,7 +163,7 @@
}
index = 0;
- do
+ while (entry[index].Buffer != NULL)
{
CONSOLE_SetStyledText(entry[index].X,
entry[index].Y,
@@ -179,7 +172,6 @@
index++;
}
- while (entry[index].Buffer != NULL);
}
VOID
@@ -261,7 +253,7 @@
#if 0
ULONG lngIndex = 0;
- do
+ while (ResourceList[lngIndex].MuiPages != NULL)
{
if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
{
@@ -272,9 +264,8 @@
lngIndex++;
}
- while (ResourceList[lngIndex].MuiPages != NULL);
#else
- wCodePage = (UINT)wcstoul(MUIGetOEMCodePage(), NULL, 10);
+ wCodePage = (UINT)wcstoul(MUIGetOEMCodePage(SelectedLanguageId), NULL, 10);
SetConsoleOutputCP(wCodePage);
#endif
}
Modified: branches/setup_improvements/base/setup/usetup/mui.h
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/mui.h [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/mui.h [iso-8859-1] Thu Aug 31 18:31:52
2017
@@ -28,8 +28,8 @@
typedef struct
{
- PWCHAR LanguageID;
- PWCHAR LanguageDescriptor;
+ PCWSTR LanguageID;
+ PCWSTR LanguageDescriptor;
const MUI_PAGE * MuiPages;
const MUI_ERROR * MuiErrors;
const MUI_STRING * MuiStrings;