All pastes #815272 Raw Edit

Mine

public text v1 · immutable
·published 2007-12-13 22:41 UTC
rendered paste body
static inline int
__attribute__ ((unused, always_inline))
_dl_string_platform (const char *str)
{
  if (str == NULL)
    return -1;

  if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0)
    {
      int ret;
      str += 5;
      switch (*str)
        {
        case '4':
          ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
          break;
        case '5':
          ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5;
          if (str[1] == '+')
            {
              ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS;
              ++str;
            }
          break;
        case '6':
          ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6;
          if (str[1] == 'x')
            {
              ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X;
              ++str;
            }
          break;
        default:
          return -1;
        }
      if (str[1] == '\0')
        return ret;
    }
  else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970],
                    3) == 0)
    {
      if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970]
                           + 3) == 0)
        return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
      else if (strcmp (str + 3,
                       GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3)
               == 0)
        return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
    }
  
  return -1;
}