diff options
author | Robert Moore <Robert.Moore@intel.com> | 2010-01-08 08:14:05 -0800 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2010-01-08 08:14:05 -0800 |
commit | cdfcc7cfce4180fb40cf68acea68ef6c01e8be6a (patch) | |
tree | c11cd22973f2407e4488fa9062f55bfac27f0d30 | |
parent | 24a732b0d5a89db446850573c510266aa067f8d2 (diff) |
Update for new gcc-4 warning options.
Added several new options for the gcc-4 generation, and updated the source
accordingly. This includes some code restructuring to eliminate unreachable
code, elimination of some gotos, elimination of unused return values, and
some additional casting.
-rw-r--r-- | generate/unix/Makefile.config | 4 | ||||
-rw-r--r-- | source/compiler/aslanalyze.c | 6 | ||||
-rw-r--r-- | source/compiler/aslerror.c | 14 | ||||
-rw-r--r-- | source/compiler/aslload.c | 12 | ||||
-rw-r--r-- | source/compiler/aslopcodes.c | 6 | ||||
-rw-r--r-- | source/compiler/asloperands.c | 2 | ||||
-rw-r--r-- | source/compiler/aslutils.c | 12 | ||||
-rw-r--r-- | source/components/debugger/dbfileio.c | 5 | ||||
-rw-r--r-- | source/components/executer/exconfig.c | 12 | ||||
-rw-r--r-- | source/components/hardware/hwgpe.c | 7 | ||||
-rw-r--r-- | source/components/namespace/nspredef.c | 23 | ||||
-rw-r--r-- | source/components/namespace/nsrepair2.c | 22 | ||||
-rw-r--r-- | source/components/utilities/utmutex.c | 18 | ||||
-rw-r--r-- | source/include/platform/accygwin.h | 3 | ||||
-rw-r--r-- | source/include/platform/acenv.h | 8 | ||||
-rw-r--r-- | source/os_specific/service_layers/osunixdir.c | 4 | ||||
-rw-r--r-- | source/tools/acpiexec/aemain.c | 10 | ||||
-rw-r--r-- | source/tools/acpisrc/ascase.c | 40 | ||||
-rw-r--r-- | source/tools/acpisrc/asconvrt.c | 6 | ||||
-rw-r--r-- | source/tools/acpisrc/asmain.c | 4 | ||||
-rw-r--r-- | source/tools/acpixtract/acpixtract.c | 4 |
21 files changed, 98 insertions, 124 deletions
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index 119fd2dc8..63be0df86 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -24,7 +24,7 @@ ACPICA_CORE = $(ACPICA_SRC)/components ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? -COPYPROG = @mkdir -p ../bin; cp --remove-destination $(PROG) ../bin +COPYPROG = @mkdir -p ../bin; rm -f ../bin/$(PROG); cp --remove-destination $(PROG) ../bin # # Common compiler flags. The warning flags in addition to -Wall are not @@ -50,9 +50,9 @@ CWARNINGFLAGS = \ # gcc 4+ flags # CWARNINGFLAGS+= \ + -Waddress \ -Waggregate-return \ -Wchar-subscripts \ - -Waddress \ -Wempty-body \ -Wlogical-op \ -Wmissing-declarations \ diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c index d44adda8f..441aa29d7 100644 --- a/source/compiler/aslanalyze.c +++ b/source/compiler/aslanalyze.c @@ -667,8 +667,8 @@ AnCheckForReservedName ( { /* The next two characters must be hex digits */ - if ((isxdigit (Name[2])) && - (isxdigit (Name[3]))) + if ((isxdigit ((int) Name[2])) && + (isxdigit ((int) Name[3]))) { return (ACPI_EVENT_RESERVED_NAME); } @@ -1236,7 +1236,7 @@ AnMethodAnalysisWalkBegin ( */ for (i = 0; Next->Asl.Value.String[i]; i++) { - if (!isalnum (Next->Asl.Value.String[i])) + if (!isalnum ((int) Next->Asl.Value.String[i])) { AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, Next, Next->Asl.Value.String); diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c index 5aa9e8c36..b640b6048 100644 --- a/source/compiler/aslerror.c +++ b/source/compiler/aslerror.c @@ -169,13 +169,7 @@ AeAddToErrorLog ( ASL_ERROR_MSG *Prev; - if (!Gbl_ErrorLog) - { - Gbl_ErrorLog = Enode; - return; - } - - /* List is sorted according to line number */ + /* If Gbl_ErrorLog is null, this is the first error node */ if (!Gbl_ErrorLog) { @@ -183,8 +177,10 @@ AeAddToErrorLog ( return; } - /* Walk error list until we find a line number greater than ours */ - + /* + * Walk error list until we find a line number greater than ours. + * List is sorted according to line number. + */ Prev = NULL; Next = Gbl_ErrorLog; diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c index fab67ccca..a01255aae 100644 --- a/source/compiler/aslload.c +++ b/source/compiler/aslload.c @@ -534,7 +534,7 @@ LdNamespace1Begin ( if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC) { Status = LdLoadResourceElements (Op, WalkState); - goto Exit; + return_ACPI_STATUS (Status); } ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); @@ -578,7 +578,7 @@ LdNamespace1Begin ( AslCoreSubsystemError (Op, Status, "Failure from namespace lookup", FALSE); - goto Exit; + return_ACPI_STATUS (Status); } /* We found a node with this name, now check the type */ @@ -713,15 +713,14 @@ LdNamespace1Begin ( AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, Op->Asl.ExternalName); - Status = AE_OK; - goto Exit; + return_ACPI_STATUS (AE_OK); } } else { AslCoreSubsystemError (Op, Status, "Failure from namespace lookup", FALSE); - goto Exit; + return_ACPI_STATUS (Status); } } @@ -759,8 +758,7 @@ FinishNode: Node->Value = (UINT32) Op->Asl.Extra; } -Exit: - return (Status); + return_ACPI_STATUS (Status); } diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c index e38626642..4414a91f5 100644 --- a/source/compiler/aslopcodes.c +++ b/source/compiler/aslopcodes.c @@ -568,7 +568,7 @@ OpcDoEisaId ( if (i < 3) { - if (!isupper (InString[i])) + if (!isupper ((int) InString[i])) { Status = AE_BAD_PARAMETER; } @@ -576,7 +576,7 @@ OpcDoEisaId ( /* Last 4 characters must be hex digits */ - else if (!isxdigit (InString[i])) + else if (!isxdigit ((int) InString[i])) { Status = AE_BAD_PARAMETER; } @@ -666,7 +666,7 @@ OpcDoUuId ( } else { - if (!isxdigit (InString[i])) + if (!isxdigit ((int) InString[i])) { Status = AE_BAD_PARAMETER; } diff --git a/source/compiler/asloperands.c b/source/compiler/asloperands.c index 8f2388e36..c7b7357cb 100644 --- a/source/compiler/asloperands.c +++ b/source/compiler/asloperands.c @@ -1007,7 +1007,7 @@ OpnDoDefinitionBlock ( for (i = 0; i < 4; i++) { - if (!isalnum (Gbl_TableSignature[i])) + if (!isalnum ((int) Gbl_TableSignature[i])) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, "Contains non-alphanumeric characters"); diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c index ecba7c32c..1b24d931c 100644 --- a/source/compiler/aslutils.c +++ b/source/compiler/aslutils.c @@ -916,7 +916,7 @@ UtStrtoul64 ( /* Skip over any white space in the buffer: */ - while (isspace (*String) || *String == '\t') + while (isspace ((int) *String) || *String == '\t') { ++String; } @@ -948,7 +948,7 @@ UtStrtoul64 ( { if (*String == '0') { - if (tolower (*(++String)) == 'x') + if (tolower ((int) *(++String)) == 'x') { Base = 16; ++String; @@ -975,7 +975,7 @@ UtStrtoul64 ( if (Base == 16 && *String == '0' && - tolower (*(++String)) == 'x') + tolower ((int) *(++String)) == 'x') { String++; } @@ -984,14 +984,14 @@ UtStrtoul64 ( while (*String) { - if (isdigit (*String)) + if (isdigit ((int) *String)) { Index = ((UINT8) *String) - '0'; } else { - Index = (UINT8) toupper (*String); - if (isupper ((char) Index)) + Index = (UINT8) toupper ((int) *String); + if (isupper ((int) Index)) { Index = Index - 'A' + 10; } diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c index d52a72caa..cdc2990e0 100644 --- a/source/components/debugger/dbfileio.c +++ b/source/components/debugger/dbfileio.c @@ -150,9 +150,6 @@ AcpiDbCheckTextModeCorruption ( UINT32 TableLength, UINT32 FileLength); -static ACPI_STATUS -AeLocalLoadTable ( - ACPI_TABLE_HEADER *TablePtr); #endif /******************************************************************************* @@ -424,7 +421,7 @@ AcpiDbReadTable ( { /* Now validate the checksum */ - Status = AcpiTbChecksum ((void *) *Table, + Status = AcpiTbVerifyChecksum ((void *) *Table, ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length); if (Status == AE_BAD_CHECKSUM) diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index d0acdd5f8..7024a71f2 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -610,7 +610,10 @@ AcpiExLoadOp ( Status = AcpiTbAddTable (&TableDesc, &TableIndex); if (ACPI_FAILURE (Status)) { - goto Cleanup; + /* Delete allocated table buffer */ + + AcpiTbDeleteTable (&TableDesc); + return_ACPI_STATUS (Status); } /* @@ -653,13 +656,6 @@ AcpiExLoadOp ( AcpiGbl_TableHandlerContext); } -Cleanup: - if (ACPI_FAILURE (Status)) - { - /* Delete allocated table buffer */ - - AcpiTbDeleteTable (&TableDesc); - } return_ACPI_STATUS (Status); } diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c index a45603d9d..fc2816da3 100644 --- a/source/components/hardware/hwgpe.c +++ b/source/components/hardware/hwgpe.c @@ -320,7 +320,7 @@ AcpiHwGetGpeStatus ( Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + return (Status); } if (RegisterBit & InByte) @@ -331,10 +331,7 @@ AcpiHwGetGpeStatus ( /* Set return value */ (*EventStatus) = LocalEventStatus; - - -UnlockAndExit: - return (Status); + return (AE_OK); } diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c index d979c43e9..7a43bdfb7 100644 --- a/source/components/namespace/nspredef.c +++ b/source/components/namespace/nspredef.c @@ -1133,28 +1133,27 @@ AcpiNsCheckObjectType ( /* Is the object one of the expected types? */ - if (!(ReturnBtype & ExpectedBtypes)) + if (ReturnBtype & ExpectedBtypes) { - /* Type mismatch -- attempt repair of the returned object */ + /* For reference objects, check that the reference type is correct */ - Status = AcpiNsRepairObject (Data, ExpectedBtypes, - PackageIndex, ReturnObjectPtr); - if (ACPI_SUCCESS (Status)) + if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) { - return (AE_OK); /* Repair was successful */ + Status = AcpiNsCheckReference (Data, ReturnObject); } - goto TypeErrorExit; + + return (Status); } - /* For reference objects, check that the reference type is correct */ + /* Type mismatch -- attempt repair of the returned object */ - if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) + Status = AcpiNsRepairObject (Data, ExpectedBtypes, + PackageIndex, ReturnObjectPtr); + if (ACPI_SUCCESS (Status)) { - Status = AcpiNsCheckReference (Data, ReturnObject); + return (AE_OK); /* Repair was successful */ } - return (Status); - TypeErrorExit: diff --git a/source/components/namespace/nsrepair2.c b/source/components/namespace/nsrepair2.c index c08028452..537406e74 100644 --- a/source/components/namespace/nsrepair2.c +++ b/source/components/namespace/nsrepair2.c @@ -177,7 +177,7 @@ AcpiNsCheckSortedList ( UINT8 SortDirection, char *SortKeyName); -static ACPI_STATUS +static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, UINT32 Count, @@ -557,7 +557,6 @@ AcpiNsCheckSortedList ( ACPI_OPERAND_OBJECT *ObjDesc; UINT32 i; UINT32 PreviousValue; - ACPI_STATUS Status; ACPI_FUNCTION_NAME (NsCheckSortedList); @@ -616,19 +615,15 @@ AcpiNsCheckSortedList ( /* * The list must be sorted in the specified order. If we detect a - * discrepancy, issue a warning and sort the entire list + * discrepancy, sort the entire list. */ if (((SortDirection == ACPI_SORT_ASCENDING) && (ObjDesc->Integer.Value < PreviousValue)) || ((SortDirection == ACPI_SORT_DESCENDING) && (ObjDesc->Integer.Value > PreviousValue))) { - Status = AcpiNsSortList (ReturnObject->Package.Elements, - OuterElementCount, SortIndex, SortDirection); - if (ACPI_FAILURE (Status)) - { - return (Status); - } + AcpiNsSortList (ReturnObject->Package.Elements, + OuterElementCount, SortIndex, SortDirection); Data->Flags |= ACPI_OBJECT_REPAIRED; @@ -748,15 +743,16 @@ AcpiNsRemoveNullElements ( * Index - Sort by which package element * SortDirection - Ascending or Descending sort * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Sort the objects that are in a package element list. * - * NOTE: Assumes that all NULL elements have been removed from the package. + * NOTE: Assumes that all NULL elements have been removed from the package, + * and that all elements have been verified to be of type Integer. * *****************************************************************************/ -static ACPI_STATUS +static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, UINT32 Count, @@ -791,6 +787,4 @@ AcpiNsSortList ( } } } - - return (AE_OK); } diff --git a/source/components/utilities/utmutex.c b/source/components/utilities/utmutex.c index f6e7cc365..208475a86 100644 --- a/source/components/utilities/utmutex.c +++ b/source/components/utilities/utmutex.c @@ -128,7 +128,7 @@ static ACPI_STATUS AcpiUtCreateMutex ( ACPI_MUTEX_HANDLE MutexId); -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId); @@ -216,7 +216,7 @@ AcpiUtMutexTerminate ( for (i = 0; i < ACPI_NUM_MUTEX; i++) { - (void) AcpiUtDeleteMutex (i); + AcpiUtDeleteMutex (i); } /* Delete the spinlocks */ @@ -253,11 +253,6 @@ AcpiUtCreateMutex ( ACPI_FUNCTION_TRACE_U32 (UtCreateMutex, MutexId); - if (MutexId > ACPI_MAX_MUTEX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - if (!AcpiGbl_MutexInfo[MutexId].Mutex) { Status = AcpiOsCreateMutex (&AcpiGbl_MutexInfo[MutexId].Mutex); @@ -281,7 +276,7 @@ AcpiUtCreateMutex ( * ******************************************************************************/ -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId) { @@ -289,17 +284,10 @@ AcpiUtDeleteMutex ( ACPI_FUNCTION_TRACE_U32 (UtDeleteMutex, MutexId); - if (MutexId > ACPI_MAX_MUTEX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - AcpiOsDeleteMutex (AcpiGbl_MutexInfo[MutexId].Mutex); AcpiGbl_MutexInfo[MutexId].Mutex = NULL; AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED; - - return_ACPI_STATUS (AE_OK); } diff --git a/source/include/platform/accygwin.h b/source/include/platform/accygwin.h index e9585b44b..ffe850714 100644 --- a/source/include/platform/accygwin.h +++ b/source/include/platform/accygwin.h @@ -155,6 +155,9 @@ #define inline #endif +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) if (GLptr) Acq=1; else Acq=0; +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 1 + /* Cygwin uses GCC */ diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index 58cb03bfc..3cea5f6e7 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -262,11 +262,11 @@ /* Global Lock acquire/release */ #ifndef ACPI_ACQUIRE_GLOBAL_LOCK -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) Acq = 1 +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = 1 #endif #ifndef ACPI_RELEASE_GLOBAL_LOCK -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) Acq = 0 +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 0 #endif /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ @@ -424,8 +424,8 @@ typedef char *va_list; #define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) #define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n)) #define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n)) -#define ACPI_TOUPPER AcpiUtToUpper -#define ACPI_TOLOWER AcpiUtToLower +#define ACPI_TOUPPER(c) AcpiUtToUpper ((int) (c)) +#define ACPI_TOLOWER(c) AcpiUtToLower ((int) (c)) #endif /* ACPI_USE_SYSTEM_CLIBRARY */ diff --git a/source/os_specific/service_layers/osunixdir.c b/source/os_specific/service_layers/osunixdir.c index d9c55a1ef..3beeeb980 100644 --- a/source/os_specific/service_layers/osunixdir.c +++ b/source/os_specific/service_layers/osunixdir.c @@ -295,11 +295,11 @@ strlwr ( int i; - length = strlen(str); + length = strlen (str); for (i = 0; i < length; i++) { - str[i] = tolower(str[i]); + str[i] = tolower ((int) str[i]); } return (str); diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 777c5741e..5369b6b75 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -336,9 +336,10 @@ FlSplitInputPathname ( * * FUNCTION: AsDoWildcard * - * PARAMETERS: None + * PARAMETERS: DirectoryPathname - Path to parent directory + * FileSpecifier - the wildcard specification (*.c, etc.) * - * RETURN: None + * RETURN: Pointer to a list of filenames * * DESCRIPTION: Process files via wildcards. This function is for the Windows * case only. @@ -393,6 +394,11 @@ AsDoWildcard ( return (FileList); #else + if (!FileSpecifier) + { + return (NULL); + } + /* * Linux/Unix cases - Wildcards are expanded by the shell automatically. * Just return the filename in a null terminated list diff --git a/source/tools/acpisrc/ascase.c b/source/tools/acpisrc/ascase.c index da1112d56..56889f495 100644 --- a/source/tools/acpisrc/ascase.c +++ b/source/tools/acpisrc/ascase.c @@ -197,7 +197,7 @@ AsLowerCaseString ( for (i = 0; i < TargetLength; i++) { - SubString1[i] = (char) tolower (SubString1[i]); + SubString1[i] = (char) tolower ((int) SubString1[i]); } SubBuffer = SubString1 + TargetLength; @@ -294,7 +294,7 @@ AsMixedCaseToUnderscores ( continue; } - if (islower (*SubBuffer)) + if (islower ((int) *SubBuffer)) { HasLowerCase = TRUE; } @@ -323,7 +323,7 @@ AsMixedCaseToUnderscores ( (SubBuffer[1] == 'X')) { SubBuffer += 2; - while (isxdigit (*SubBuffer)) + while (isxdigit ((int) *SubBuffer)) { SubBuffer++; } @@ -367,9 +367,9 @@ AsMixedCaseToUnderscores ( /* Check the rest of the identifier for any lower case letters */ SubString = SubBuffer; - while ((isalnum (*SubString)) || (*SubString == '_')) + while ((isalnum ((int) *SubString)) || (*SubString == '_')) { - if (islower (*SubString)) + if (islower ((int) *SubString)) { HasLowerCase = TRUE; } @@ -387,7 +387,7 @@ AsMixedCaseToUnderscores ( /* A capital letter may indicate the start of a token; save it */ - if (isupper (SubBuffer[0])) + if (isupper ((int) SubBuffer[0])) { TokenStart = SubBuffer; } @@ -399,15 +399,15 @@ AsMixedCaseToUnderscores ( * to * <LowerCase><Underscore><LowerCase> */ - else if ((islower (SubBuffer[0]) || isdigit (SubBuffer[0])) && - (isupper (SubBuffer[1]))) + else if ((islower ((int) SubBuffer[0]) || isdigit ((int) SubBuffer[0])) && + (isupper ((int) SubBuffer[1]))) { - if (isdigit (SubBuffer[0])) + if (isdigit ((int) SubBuffer[0])) { /* Ignore <UpperCase><Digit><UpperCase> */ /* Ignore <Underscore><Digit><UpperCase> */ - if (isupper (*(SubBuffer-1)) || + if (isupper ((int) *(SubBuffer-1)) || *(SubBuffer-1) == '_') { SubBuffer++; @@ -420,7 +420,7 @@ AsMixedCaseToUnderscores ( * Find the end of this identifier (token) */ TokenEnd = SubBuffer; - while ((isalnum (*TokenEnd)) || (*TokenEnd == '_')) + while ((isalnum ((int) *TokenEnd)) || (*TokenEnd == '_')) { TokenEnd++; } @@ -428,7 +428,7 @@ AsMixedCaseToUnderscores ( /* Force the UpperCase letter (#2) to lower case */ Gbl_MadeChanges = TRUE; - SubBuffer[1] = (char) tolower (SubBuffer[1]); + SubBuffer[1] = (char) tolower ((int) SubBuffer[1]); SubString = TokenEnd; Length = 0; @@ -463,7 +463,7 @@ AsMixedCaseToUnderscores ( if (TokenStart) { - *TokenStart = (char) tolower (*TokenStart); + *TokenStart = (char) tolower ((int) *TokenStart); TokenStart = NULL; } } @@ -554,11 +554,11 @@ AsLowerCaseIdentifiers ( * Only lower case if we have an upper followed by a lower * This leaves the all-uppercase things (macros, etc.) intact */ - if ((isupper (SubBuffer[0])) && - (islower (SubBuffer[1]))) + if ((isupper ((int) SubBuffer[0])) && + (islower ((int) SubBuffer[1]))) { Gbl_MadeChanges = TRUE; - *SubBuffer = (char) tolower (*SubBuffer); + *SubBuffer = (char) tolower ((int) *SubBuffer); } SubBuffer++; @@ -595,15 +595,15 @@ AsUppercaseTokens ( if (SubBuffer) { TokenEnd = SubBuffer; - while ((isalnum (*TokenEnd)) || (*TokenEnd == '_')) + while ((isalnum ((int) *TokenEnd)) || (*TokenEnd == '_')) { TokenEnd++; } for (i = 0; i < (TokenEnd - SubBuffer); i++) { - if ((islower (SubBuffer[i])) && - (isupper (SubBuffer[i+1]))) + if ((islower ((int) SubBuffer[i])) && + (isupper ((int) SubBuffer[i+1]))) { SubString = TokenEnd; @@ -635,7 +635,7 @@ AsUppercaseTokens ( for (i = 0; i < (TokenEnd - SubBuffer); i++) { - SubBuffer[i] = (char) toupper (SubBuffer[i]); + SubBuffer[i] = (char) toupper ((int) SubBuffer[i]); } SubBuffer = TokenEnd; diff --git a/source/tools/acpisrc/asconvrt.c b/source/tools/acpisrc/asconvrt.c index e17e51f1b..8d67b6f6d 100644 --- a/source/tools/acpisrc/asconvrt.c +++ b/source/tools/acpisrc/asconvrt.c @@ -153,9 +153,9 @@ AsMatchExactWord ( NextChar = Word[WordLength]; PrevChar = * (Word -1); - if (isalnum (NextChar) || + if (isalnum ((int) NextChar) || (NextChar == '_') || - isalnum (PrevChar) || + isalnum ((int) PrevChar) || (PrevChar == '_')) { return (FALSE); @@ -700,7 +700,7 @@ AsBracesOnSameLine ( * Check for digit will ignore initializer lists surrounded by braces. * This will work until we we need more complex detection. */ - if ((*SubBuffer == '{') && !isdigit (SubBuffer[1])) + if ((*SubBuffer == '{') && !isdigit ((int) SubBuffer[1])) { if (BlockBegin) { diff --git a/source/tools/acpisrc/asmain.c b/source/tools/acpisrc/asmain.c index c1fbb0cf1..eb21ce18f 100644 --- a/source/tools/acpisrc/asmain.c +++ b/source/tools/acpisrc/asmain.c @@ -191,8 +191,8 @@ AsStricmp ( do { - c1 = tolower (*String1); - c2 = tolower (*String2); + c1 = tolower ((int) *String1); + c2 = tolower ((int) *String2); String1++; String2++; diff --git a/source/tools/acpixtract/acpixtract.c b/source/tools/acpixtract/acpixtract.c index 044d55224..1b016dce9 100644 --- a/source/tools/acpixtract/acpixtract.c +++ b/source/tools/acpixtract/acpixtract.c @@ -122,7 +122,7 @@ /* Note: This is a 32-bit program only */ -#define VERSION 0x20091002 +#define VERSION 0x20100107 #define FIND_HEADER 0 #define EXTRACT_DATA 1 #define BUFFER_SIZE 256 @@ -250,7 +250,7 @@ CheckAscii ( for (i = 0; i < Count; i++) { - if (!Name[i] || !isprint (Name[i])) + if (!Name[i] || !isprint ((int) Name[i])) { Name[i] = ' '; } |