summaryrefslogtreecommitdiff
path: root/source/compiler
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2010-01-08 08:14:05 -0800
committerRobert Moore <Robert.Moore@intel.com>2010-01-08 08:14:05 -0800
commitcdfcc7cfce4180fb40cf68acea68ef6c01e8be6a (patch)
treec11cd22973f2407e4488fa9062f55bfac27f0d30 /source/compiler
parent24a732b0d5a89db446850573c510266aa067f8d2 (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.
Diffstat (limited to 'source/compiler')
-rw-r--r--source/compiler/aslanalyze.c6
-rw-r--r--source/compiler/aslerror.c14
-rw-r--r--source/compiler/aslload.c12
-rw-r--r--source/compiler/aslopcodes.c6
-rw-r--r--source/compiler/asloperands.c2
-rw-r--r--source/compiler/aslutils.c12
6 files changed, 23 insertions, 29 deletions
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;
}