Skip to content

Commit

Permalink
MdePkg/BaseFdtLib: Rename standard functions
Browse files Browse the repository at this point in the history
Rename the standard functions in the LibFdtSupport to remove conflicts
with other libraries that define them.

Jira TEGRAUEFI-3105

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Change-Id: Ib0683a29f9aeb7e9c7fa179e9d495c3e979f1261
  • Loading branch information
jbrasen committed Dec 7, 2023
1 parent eccdab6 commit e65749c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
16 changes: 16 additions & 0 deletions MdePkg/Library/BaseFdtLib/LibFdtSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,26 @@ strrchr (
int
);

char *
fdt_strrchr (
const char *,
int
);

unsigned long
strtoul (
const char *,
char **,
int
);

unsigned long
fdt_strtoul (
const char *,
char **,
int
);

char *
strcpy (
char *strDest,
Expand All @@ -93,7 +106,10 @@ strcpy (
#define strnlen(str, count) (size_t)(AsciiStrnLenS(str, count))
#define strncpy(strDest, strSource, count) AsciiStrnCpyS(strDest, MAX_STRING_SIZE, strSource, (UINTN)count)
#define strcat(strDest, strSource) AsciiStrCatS(strDest, MAX_STRING_SIZE, strSource)
#define strchr(str, ch) ScanMem8(str, AsciiStrSize (str), (UINT8)ch)
#define strcmp(string1, string2, count) (int)(AsciiStrCmp(string1, string2))
#define strncmp(string1, string2, count) (int)(AsciiStrnCmp(string1, string2, (UINTN)(count)))
#define strrchr(str, ch) fdt_strrchr(str, ch)
#define strtoul(ptr, end_ptr, base) fdt_strtoul(ptr, end_ptr, base)

#endif /* FDT_LIB_SUPPORT_H_ */
25 changes: 2 additions & 23 deletions MdePkg/Library/BaseFdtLib/LibFdtWrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,7 @@
// so the code gets a bit clunky to handle that case specifically.

char *
strchr (
const char *Str,
int Char
)
{
char *S;

S = (char *)Str;

for ( ; ; S++) {
if (*S == Char) {
return S;
}

if (*S == '\0') {
return NULL;
}
}
}

char *
strrchr (
fdt_strrchr (
const char *Str,
int Char
)
Expand Down Expand Up @@ -71,7 +50,7 @@ __isspace (
}

unsigned long
strtoul (
fdt_strtoul (
const char *Nptr,
char **EndPtr,
int Base
Expand Down

0 comments on commit e65749c

Please sign in to comment.