[BACK]Return to dtutils.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / external / bsd / acpica / dist / compiler

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/external/bsd/acpica/dist/compiler/dtutils.c between version 1.1.1.8 and 1.1.1.9

version 1.1.1.8, 2016/01/09 19:54:52 version 1.1.1.9, 2016/11/11 19:17:47
Line 197  DtFatal (
Line 197  DtFatal (
   
 /******************************************************************************  /******************************************************************************
  *   *
  * FUNCTION:    DtStrtoul64  
  *  
  * PARAMETERS:  String              - Null terminated string  
  *              ReturnInteger       - Where the converted integer is returned  
  *  
  * RETURN:      Status  
  *  
  * DESCRIPTION: Simple conversion of a string hex integer constant to unsigned  
  *              value. Assumes no leading "0x" for the constant.  
  *  
  * Portability note: The reason this function exists is because a 64-bit  
  * sscanf is not available in all environments.  
  *  
  *****************************************************************************/  
   
 ACPI_STATUS  
 DtStrtoul64 (  
     char                    *String,  
     UINT64                  *ReturnInteger)  
 {  
     char                    *ThisChar = String;  
     UINT32                  ThisDigit;  
     UINT64                  ReturnValue = 0;  
     int                     DigitCount = 0;  
   
   
     /* Skip over any white space in the buffer */  
   
     while ((*ThisChar == ' ') || (*ThisChar == '\t'))  
     {  
         ThisChar++;  
     }  
   
     /* Skip leading zeros */  
   
     while ((*ThisChar) == '0')  
     {  
         ThisChar++;  
     }  
   
     /* Convert character-by-character */  
   
     while (*ThisChar)  
     {  
         if (isdigit ((int) *ThisChar))  
         {  
             /* Convert ASCII 0-9 to Decimal value */  
   
             ThisDigit = ((UINT8) *ThisChar) - '0';  
         }  
         else /* Letter */  
         {  
             ThisDigit = (UINT32) toupper ((int) *ThisChar);  
             if (!isxdigit ((int) ThisDigit))  
             {  
                 /* Not A-F */  
   
                 return (AE_BAD_CHARACTER);  
             }  
   
             /* Convert ASCII Hex char (A-F) to value */  
   
             ThisDigit = (ThisDigit - 'A') + 10;  
         }  
   
         /* Insert the 4-bit hex digit */  
   
         ReturnValue <<= 4;  
         ReturnValue += ThisDigit;  
   
         ThisChar++;  
         DigitCount++;  
         if (DigitCount > 16)  
         {  
             /* Value is too large (> 64 bits/8 bytes/16 hex digits) */  
   
             return (AE_LIMIT);  
         }  
     }  
   
     *ReturnInteger = ReturnValue;  
     return (AE_OK);  
 }  
   
   
 /******************************************************************************  
  *  
  * FUNCTION:    DtGetFieldValue   * FUNCTION:    DtGetFieldValue
  *   *
  * PARAMETERS:  Field               - Current field list pointer   * PARAMETERS:  Field               - Current field list pointer
Line 367  DtGetFieldType (
Line 280  DtGetFieldType (
     case ACPI_DMT_RAW_BUFFER:      case ACPI_DMT_RAW_BUFFER:
     case ACPI_DMT_BUF7:      case ACPI_DMT_BUF7:
     case ACPI_DMT_BUF10:      case ACPI_DMT_BUF10:
       case ACPI_DMT_BUF12:
     case ACPI_DMT_BUF16:      case ACPI_DMT_BUF16:
     case ACPI_DMT_BUF128:      case ACPI_DMT_BUF128:
     case ACPI_DMT_PCI_PATH:      case ACPI_DMT_PCI_PATH:
Line 616  DtGetFieldLength (
Line 530  DtGetFieldLength (
         ByteLength = 10;          ByteLength = 10;
         break;          break;
   
       case ACPI_DMT_BUF12:
   
           ByteLength = 12;
           break;
   
     case ACPI_DMT_BUF16:      case ACPI_DMT_BUF16:
     case ACPI_DMT_UUID:      case ACPI_DMT_UUID:
   

Legend:
Removed from v.1.1.1.8  
changed lines
  Added in v.1.1.1.9

CVSweb <webmaster@jp.NetBSD.org>