Removed #ifdef SNP_DEBUG and used debug lib to output information.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2490 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2007-03-20 06:59:54 +00:00
parent 231f8bfb92
commit 9cc655d5a9
2 changed files with 45 additions and 47 deletions

View File

@ -546,9 +546,7 @@ Returns:
if (Index >= MAX_MAP_LENGTH) if (Index >= MAX_MAP_LENGTH)
{ {
#if SNP_DEBUG DEBUG ((EFI_D_ERROR, "SNP could not find a mapping, failed to unmap.\n"));
Print (L"SNP could not find a mapping, failed to unmap.\n");
#endif
return ; return ;
} }

View File

@ -1,14 +1,14 @@
/**@file /**@file
Implementation for handling the User Interface option processing. Implementation for handling the User Interface option processing.
Copyright (c) 2006 - 2007 Intel Corporation. <BR> Copyright (c) 2006 - 2007 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
@ -616,9 +616,9 @@ ProcessOptions (
Number = *NvRamMap; Number = *NvRamMap;
} }
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Number, (UINTN) Number,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -634,9 +634,9 @@ ProcessOptions (
Number = Tag->Default; Number = Tag->Default;
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Number, (UINTN) Number,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -722,9 +722,9 @@ ProcessOptions (
*OptionString[0] = LEFT_NUMERIC_DELIMITER; *OptionString[0] = LEFT_NUMERIC_DELIMITER;
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Time.Month, (UINTN) Time.Month,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -765,9 +765,9 @@ ProcessOptions (
SetUnicodeMem (OptionString[0], 4, L' '); SetUnicodeMem (OptionString[0], 4, L' ');
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Time.Day, (UINTN) Time.Day,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -807,9 +807,9 @@ ProcessOptions (
VariableDefinition->FakeNvRamMap[Tag->Id + 1] = (UINT8) (Tag->Value >> 8); VariableDefinition->FakeNvRamMap[Tag->Id + 1] = (UINT8) (Tag->Value >> 8);
SetUnicodeMem (OptionString[0], 7, L' '); SetUnicodeMem (OptionString[0], 7, L' ');
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Time.Year, (UINTN) Time.Year,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -932,9 +932,9 @@ ProcessOptions (
case 0: case 0:
*OptionString[0] = LEFT_NUMERIC_DELIMITER; *OptionString[0] = LEFT_NUMERIC_DELIMITER;
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Time.Hour, (UINTN) Time.Hour,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -953,9 +953,9 @@ ProcessOptions (
case 1: case 1:
SetUnicodeMem (OptionString[0], 4, L' '); SetUnicodeMem (OptionString[0], 4, L' ');
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Time.Minute, (UINTN) Time.Minute,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -974,9 +974,9 @@ ProcessOptions (
case 2: case 2:
SetUnicodeMem (OptionString[0], 7, L' '); SetUnicodeMem (OptionString[0], 7, L' ');
UnicodeValueToString ( UnicodeValueToString (
FormattedNumber, FormattedNumber,
FALSE, FALSE,
(UINTN) Time.Second, (UINTN) Time.Second,
(sizeof (FormattedNumber) / sizeof (FormattedNumber[0])) (sizeof (FormattedNumber) / sizeof (FormattedNumber[0]))
); );
Number = (UINT16) GetStringWidth (FormattedNumber); Number = (UINT16) GetStringWidth (FormattedNumber);
@ -1193,13 +1193,13 @@ ProcessOptions (
} }
/** /**
Split StringPtr to several lines of strings stored in FormattedString and the glyph width of Split StringPtr to several lines of strings stored in FormattedString and the glyph width of
each line cannot exceed gHelpBlockWidth. each line cannot exceed gHelpBlockWidth.
@param StringPtr The pointer of string @param StringPtr The pointer of string
@param FormattedString The pointer of format string @param FormattedString The pointer of format string
@param RowCount The count of row @param RowCount The count of row
**/ **/
VOID VOID
ProcessHelpString ( ProcessHelpString (
@ -1245,7 +1245,7 @@ ProcessHelpString (
// every three elements of IndexArray form a screen-line of string:[ IndexArray[i*3], IndexArray[i*3+1] ) // every three elements of IndexArray form a screen-line of string:[ IndexArray[i*3], IndexArray[i*3+1] )
// IndexArray[i*3+2] stores the initial glyph width of single character. to save this is because we want // IndexArray[i*3+2] stores the initial glyph width of single character. to save this is because we want
// to bring the width directive of the last line to current screen-line. // to bring the width directive of the last line to current screen-line.
// e.g.: "\wideabcde ... fghi", if "fghi" also has width directive but is splitted to the next screen-line // e.g.: "\wideabcde ... fghi", if "fghi" also has width directive but is splitted to the next screen-line
// different from that of "\wideabcde", we should remember the width directive. // different from that of "\wideabcde", we should remember the width directive.
// //
AllocateSize = 0x20; AllocateSize = 0x20;
@ -1256,9 +1256,9 @@ ProcessHelpString (
*FormattedString = NULL; *FormattedString = NULL;
} }
for (PrevCurrIndex = 0, CurrIndex = 0, LineCount = 0, LastSpaceIndex = 0, for (PrevCurrIndex = 0, CurrIndex = 0, LineCount = 0, LastSpaceIndex = 0,
IndexArray[0] = 0, GlyphWidth = 1, GlyphOffset = 0, LastSpaceGlyphWidth = 1, LineStartGlyphWidth = 1; IndexArray[0] = 0, GlyphWidth = 1, GlyphOffset = 0, LastSpaceGlyphWidth = 1, LineStartGlyphWidth = 1;
(StringPtr[CurrIndex] != CHAR_NULL); (StringPtr[CurrIndex] != CHAR_NULL);
CurrIndex ++) { CurrIndex ++) {
if (LineCount == AllocateSize) { if (LineCount == AllocateSize) {
@ -1272,7 +1272,7 @@ ProcessHelpString (
} }
switch (StringPtr[CurrIndex]) { switch (StringPtr[CurrIndex]) {
case NARROW_CHAR: case NARROW_CHAR:
case WIDE_CHAR: case WIDE_CHAR:
GlyphWidth = ((StringPtr[CurrIndex] == WIDE_CHAR) ? 2 : 1); GlyphWidth = ((StringPtr[CurrIndex] == WIDE_CHAR) ? 2 : 1);
@ -1337,12 +1337,12 @@ ProcessHelpString (
GlyphWidth = LastSpaceGlyphWidth; GlyphWidth = LastSpaceGlyphWidth;
} else if (GlyphOffset > BlockWidth) { } else if (GlyphOffset > BlockWidth) {
// //
// the word is too long to fit one screen-line and we don't get the chance // the word is too long to fit one screen-line and we don't get the chance
// of GlyphOffset == BlockWidth because GlyphWidth = 2 // of GlyphOffset == BlockWidth because GlyphWidth = 2
// //
CurrIndex --; CurrIndex --;
} }
IndexArray[LineCount*3] = PrevCurrIndex; IndexArray[LineCount*3] = PrevCurrIndex;
IndexArray[LineCount*3+1] = CurrIndex + 1; IndexArray[LineCount*3+1] = CurrIndex + 1;
IndexArray[LineCount*3+2] = LineStartGlyphWidth; IndexArray[LineCount*3+2] = LineStartGlyphWidth;
@ -1392,8 +1392,8 @@ ProcessHelpString (
for (CurrIndex = 0; CurrIndex < LineCount; CurrIndex ++) { for (CurrIndex = 0; CurrIndex < LineCount; CurrIndex ++) {
*(*FormattedString + CurrIndex * 2 * (BlockWidth + 1)) = (CHAR16)((IndexArray[CurrIndex*3+2] == 2) ? WIDE_CHAR : NARROW_CHAR); *(*FormattedString + CurrIndex * 2 * (BlockWidth + 1)) = (CHAR16)((IndexArray[CurrIndex*3+2] == 2) ? WIDE_CHAR : NARROW_CHAR);
StrnCpy ( StrnCpy (
*FormattedString + CurrIndex * 2 * (BlockWidth + 1) + 1, *FormattedString + CurrIndex * 2 * (BlockWidth + 1) + 1,
StringPtr + IndexArray[CurrIndex*3], StringPtr + IndexArray[CurrIndex*3],
IndexArray[CurrIndex*3+1]-IndexArray[CurrIndex*3] IndexArray[CurrIndex*3+1]-IndexArray[CurrIndex*3]
); );
} }