From 3ce2b1a85f5b18cf53b3ccb80cb9018b98be0fc6 Mon Sep 17 00:00:00 2001 From: jwang36 Date: Sat, 17 Jun 2006 15:42:16 +0000 Subject: Fixed the issues which caused the gcc build on MacOs failed git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@552 6f19259b-4bc3-4df7-8a09-765794883524 --- Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c | 1 + Tools/Source/TianoTools/String/String.c | 116 +++++++++++------------ 2 files changed, 59 insertions(+), 58 deletions(-) diff --git a/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c b/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c index 7b48b67d24..94c0ded3df 100644 --- a/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c +++ b/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c @@ -31,6 +31,7 @@ Abstract: #include #include +#include "CommonLib.h" #include "ParseInf.h" #include "FvLib.h" #include "EfiUtilityMsgs.h" diff --git a/Tools/Source/TianoTools/String/String.c b/Tools/Source/TianoTools/String/String.c index 0e4993a4be..1f09dab724 100644 --- a/Tools/Source/TianoTools/String/String.c +++ b/Tools/Source/TianoTools/String/String.c @@ -20,6 +20,64 @@ #include "CommonLib.h" +/** + Returns the length of a Null-terminated Unicode string. + + This function returns the number of Unicode characters in the Null-terminated + Unicode string specified by String. + + If String is NULL, then ASSERT(). + + @param String Pointer to a Null-terminated Unicode string. + + @return The length of String. + +**/ +UINTN +EFIAPI +StrLen ( + IN CONST CHAR16 *String + ) +{ + UINTN Length; + + ASSERT (String != NULL); + + for (Length = 0; *String != L'\0'; String++, Length++) { + ; + } + return Length; +} + +/** + Returns the length of a Null-terminated ASCII string. + + This function returns the number of ASCII characters in the Null-terminated + ASCII string specified by String. + + If String is NULL, then ASSERT(). + + @param String Pointer to a Null-terminated ASCII string. + + @return The length of String. + +**/ +UINTN +EFIAPI +AsciiStrLen ( + IN CONST CHAR8 *String + ) +{ + UINTN Length; + + ASSERT (String != NULL); + + for (Length = 0; *String != '\0'; String++, Length++) { + ; + } + return Length; +} + /** Copies one Null-terminated Unicode string to another Null-terminated Unicode string and returns the new Unicode string. @@ -127,35 +185,6 @@ StrnCpy ( return ReturnValue; } -/** - Returns the length of a Null-terminated Unicode string. - - This function returns the number of Unicode characters in the Null-terminated - Unicode string specified by String. - - If String is NULL, then ASSERT(). - - @param String Pointer to a Null-terminated Unicode string. - - @return The length of String. - -**/ -UINTN -EFIAPI -StrLen ( - IN CONST CHAR16 *String - ) -{ - UINTN Length; - - ASSERT (String != NULL); - - for (Length = 0; *String != L'\0'; String++, Length++) { - ; - } - return Length; -} - /** Returns the size of a Null-terminated Unicode string in bytes, including the Null terminator. @@ -454,35 +483,6 @@ AsciiStrnCpy ( return ReturnValue; } -/** - Returns the length of a Null-terminated ASCII string. - - This function returns the number of ASCII characters in the Null-terminated - ASCII string specified by String. - - If String is NULL, then ASSERT(). - - @param String Pointer to a Null-terminated ASCII string. - - @return The length of String. - -**/ -UINTN -EFIAPI -AsciiStrLen ( - IN CONST CHAR8 *String - ) -{ - UINTN Length; - - ASSERT (String != NULL); - - for (Length = 0; *String != '\0'; String++, Length++) { - ; - } - return Length; -} - /** Returns the size of a Null-terminated ASCII string in bytes, including the Null terminator. -- cgit v1.2.3