MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / OcStrniCmp

Function OcStrniCmp

Library/OcStringLib/OcUnicodeLib.c:53–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53INTN
54EFIAPI
55OcStrniCmp (
56 IN CONST CHAR16 *FirstString,
57 IN CONST CHAR16 *SecondString,
58 IN UINTN Length
59 )
60{
61 CHAR16 UpperFirstString;
62 CHAR16 UpperSecondString;
63
64 if (Length == 0) {
65 return 0;
66 }
67
68 //
69 // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.
70 // Length tests are performed inside StrLen().
71 //
72 ASSERT (StrSize (FirstString) != 0);
73 ASSERT (StrSize (SecondString) != 0);
74
75 if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
76 ASSERT (Length <= PcdGet32 (PcdMaximumUnicodeStringLength));
77 }
78
79 UpperFirstString = CharToUpper (*FirstString);
80 UpperSecondString = CharToUpper (*SecondString);
81 while ((*FirstString != L'\0') &&
82 (*SecondString != L'\0') &&
83 (UpperFirstString == UpperSecondString) &&
84 (Length > 1)) {
85 FirstString++;
86 SecondString++;
87 UpperFirstString = CharToUpper (*FirstString);
88 UpperSecondString = CharToUpper (*SecondString);
89 Length--;
90 }
91
92 return UpperFirstString - UpperSecondString;
93}
94
95CHAR16 *
96EFIAPI

Callers 1

OcGetBootDevicePathTypeFunction · 0.85

Calls 2

CharToUpperFunction · 0.85
StrSizeFunction · 0.50

Tested by

no test coverage detected