Author: hbelusca
Date: Tue Dec 25 00:53:23 2012
New Revision: 58002
URL:
http://svn.reactos.org/svn/reactos?rev=58002&view=rev
Log:
[FREELDR]
Use NULL string pointers as separators instead of a special "SEPARATOR" string.
Modified:
trunk/reactos/boot/freeldr/freeldr/options.c
trunk/reactos/boot/freeldr/freeldr/ui/directui.c
trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c
Modified: trunk/reactos/boot/freeldr/freeldr/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/optio…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/options.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/options.c [iso-8859-1] Tue Dec 25 00:53:23 2012
@@ -26,7 +26,7 @@
"Safe Mode with Networking",
"Safe Mode with Command Prompt",
- "SEPARATOR",
+ NULL,
"Enable Boot Logging",
"Enable VGA Mode",
@@ -35,7 +35,7 @@
"Debugging Mode",
"FreeLdr debugging",
- "SEPARATOR",
+ NULL,
#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
"Custom Boot",
Modified: trunk/reactos/boot/freeldr/freeldr/ui/directui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/di…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] Tue Dec 25 00:53:23
2012
@@ -297,7 +297,7 @@
for (i = 0; i < MenuInfo->MenuItemCount; i++)
{
/* Check if it's a separator */
- if (!(_stricmp(MenuInfo->MenuItemList[i], "SEPARATOR")))
+ if (MenuInfo->MenuItemList[i] == NULL)
{
/* Draw the separator line */
UiDrawText(MenuInfo->Left,
@@ -325,10 +325,11 @@
strcat(MenuLineText, " ");
/* Now append the text string */
- strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]);
+ if (MenuInfo->MenuItemList[MenuItemNumber])
+ strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]);
/* If it is a separator */
- if (!(_stricmp(MenuInfo->MenuItemList[MenuItemNumber], "SEPARATOR")))
+ if (MenuInfo->MenuItemList[MenuItemNumber] == NULL)
{
/* Make it a separator line and use menu colors */
memset(MenuLineText, 0, 80);
@@ -436,7 +437,7 @@
/* Skip past any separators */
if ((Selected) &&
- !(_stricmp(MenuInfo->MenuItemList[Selected],
"SEPARATOR")))
+ (MenuInfo->MenuItemList[Selected] == NULL))
{
MenuInfo->SelectedMenuItem--;
}
@@ -450,7 +451,7 @@
/* Skip past any separators */
if ((Selected < Count) &&
- !(_stricmp(MenuInfo->MenuItemList[Selected],
"SEPARATOR")))
+ (MenuInfo->MenuItemList[Selected] == NULL))
{
MenuInfo->SelectedMenuItem++;
}
@@ -479,8 +480,11 @@
for (i = 0; i < MenuInfo->MenuItemCount; i++)
{
/* Get the string length and make it become the new width if necessary */
- Length = strlen(MenuInfo->MenuItemList[i]);
- if (Length > Width) Width = Length;
+ if (MenuInfo->MenuItemList[i])
+ {
+ Length = (ULONG)strlen(MenuInfo->MenuItemList[i]);
+ if (Length > Width) Width = Length;
+ }
}
/* Allow room for left & right borders, plus 8 spaces on each side */
Modified: trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] Tue Dec 25 00:53:23 2012
@@ -157,8 +157,11 @@
//
// Get the string length and make it become the new width if necessary
//
- Length = (ULONG)strlen(MenuInfo->MenuItemList[i]);
- if (Length > Width) Width = Length;
+ if (MenuInfo->MenuItemList[i])
+ {
+ Length = (ULONG)strlen(MenuInfo->MenuItemList[i]);
+ if (Length > Width) Width = Length;
+ }
}
//
@@ -334,7 +337,7 @@
//
// Check if it's a separator
//
- if (!(_stricmp(MenuInfo->MenuItemList[i], "SEPARATOR")))
+ if (MenuInfo->MenuItemList[i] == NULL)
{
//
// Draw the separator line
@@ -373,7 +376,8 @@
// how many spaces will be to the left and right
//
SpaceTotal = (MenuInfo->Right - MenuInfo->Left - 2) -
- (ULONG)strlen(MenuInfo->MenuItemList[MenuItemNumber]);
+ (ULONG)(MenuInfo->MenuItemList[MenuItemNumber] ?
+ strlen(MenuInfo->MenuItemList[MenuItemNumber]) : 0);
SpaceLeft = (SpaceTotal / 2) + 1;
SpaceRight = (SpaceTotal - SpaceLeft) + 1;
@@ -395,7 +399,8 @@
//
// Now append the text string
//
- strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]);
+ if (MenuInfo->MenuItemList[MenuItemNumber])
+ strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]);
//
// Check if using centered menu, and add spaces on the right if so
@@ -405,7 +410,7 @@
//
// If it is a separator
//
- if (!(_stricmp(MenuInfo->MenuItemList[MenuItemNumber], "SEPARATOR")))
+ if (MenuInfo->MenuItemList[MenuItemNumber] == NULL)
{
//
// Make it a separator line and use menu colors
@@ -504,7 +509,7 @@
// Skip past any separators
if ((Selected) &&
- !(_stricmp(MenuInfo->MenuItemList[Selected],
"SEPARATOR")))
+ (MenuInfo->MenuItemList[Selected] == NULL))
{
MenuInfo->SelectedMenuItem--;
}
@@ -520,7 +525,7 @@
// Skip past any separators
if ((Selected < Count) &&
- !(_stricmp(MenuInfo->MenuItemList[Selected],
"SEPARATOR")))
+ (MenuInfo->MenuItemList[Selected] == NULL))
{
MenuInfo->SelectedMenuItem++;
}