/* Function to determine whether a string is decimal or hex representation of a number and return the number converted from the string. Spaces are always skipped. */
UINTN EFIAPI ShellStrToUintn(IN CONST CHAR16 *String)
/* Function to determine whether a string is decimal or hex representation of a number and return the number converted from the string. Spaces are always skipped. */
UINTN EFIAPI ShellStrToUintn(IN CONST CHAR16 *String)
{
  UINT64   RetVal;
  BOOLEAN  Hex;
  Hex = FALSE;
  if (!InternalShellIsHexOrDecimalNumber (String, Hex, TRUE, FALSE)) {
    Hex = TRUE;
  }
  if (!EFI_ERROR (ShellConvertStringToUint64 (String, &RetVal, Hex, TRUE))) {
    return ((UINTN)RetVal);
  }
  return ((UINTN)(-1));
}