Ran source cleanup tool

date	2000.11.16.17.28.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 15:39:57 +00:00
parent 78198357cf
commit e2e060ff51
4 changed files with 78 additions and 134 deletions

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslanalyze.c - check for semantic errors
* $Revision: 1.10 $
* $Revision: 1.11 $
*
*****************************************************************************/
@ -122,16 +122,15 @@
#include <ctype.h>
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -143,7 +142,6 @@ AnCheckForReservedMethod (
UINT32 i;
/* All reserved names are prefixed with a single underscore */
if (Node->ExternalName[0] != '_')
@ -164,9 +162,9 @@ AnCheckForReservedMethod (
if (MethodInfo->NumArguments != ReservedMethods[i].NumArguments)
{
sprintf (MsgBuffer, "\n%32s requires %d arg(s) not %d",
sprintf (MsgBuffer, "\n%32s requires %d arg(s) not %d",
ReservedMethods[i].Name,
ReservedMethods[i].NumArguments,
ReservedMethods[i].NumArguments,
MethodInfo->NumArguments);
AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT, Node, MsgBuffer);
@ -175,7 +173,7 @@ AnCheckForReservedMethod (
if (MethodInfo->NumReturnNoValue &&
ReservedMethods[i].Flags & ASL_RSVD_RETURN_VALUE)
{
sprintf (MsgBuffer, "%s",
sprintf (MsgBuffer, "%s",
ReservedMethods[i].Name);
AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Node, MsgBuffer);
@ -205,9 +203,9 @@ AnCheckForReservedMethod (
(isxdigit (Node->ExternalName[3])) &&
(MethodInfo->NumArguments != 0))
{
sprintf (MsgBuffer, "\n%32s requires %d arg(s) not %d",
sprintf (MsgBuffer, "\n%32s requires %d arg(s) not %d",
Node->ExternalName,
0,
0,
MethodInfo->NumArguments);
AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT, Node, MsgBuffer);
@ -227,16 +225,15 @@ AnCheckForReservedMethod (
}
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -254,7 +251,6 @@ AnSemanticAnalysisWalkBegin (
char ArgName[] = "Arg0";
switch (Node->ParseOpcode)
{
case METHOD:
@ -311,7 +307,7 @@ AnSemanticAnalysisWalkBegin (
AslError (ASL_ERROR, ASL_MSG_ARG_INVALID, Node, ArgName);
}
break;
case RETURN:
@ -340,20 +336,20 @@ AnSemanticAnalysisWalkBegin (
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
BOOLEAN
AnLastStatementIsReturn (
ASL_PARSE_NODE *Node)
{
{
ASL_PARSE_NODE *Next;
@ -378,13 +374,13 @@ AnLastStatementIsReturn (
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -400,8 +396,6 @@ AnSemanticAnalysisWalkEnd (
ASL_PARSE_NODE *LastNode = NULL;
switch (Node->ParseOpcode)
{
case METHOD:
@ -410,7 +404,6 @@ AnSemanticAnalysisWalkEnd (
WalkInfo->MethodStack = MethodInfo->Next;
/*
* Check if there is no return statement at the end of the
* method AND we can actually get there -- i.e., the execution
@ -419,9 +412,9 @@ AnSemanticAnalysisWalkEnd (
if ((!AnLastStatementIsReturn (Node)) &&
(!(Node->Flags & NODE_HAS_NO_EXIT)))
{
/*
/*
* No return statement, and execution can possibly exit
* via this path. This is equivalent to Return ()
* via this path. This is equivalent to Return ()
*/
MethodInfo->NumReturnNoValue++;
@ -491,8 +484,3 @@ AnSemanticAnalysisWalkEnd (
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslcodegen - AML code generation
* $Revision: 1.17 $
* $Revision: 1.18 $
*
*****************************************************************************/
@ -123,16 +123,15 @@
#include "acparser.h"
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -165,16 +164,15 @@ CgGenerateAmlOutput (void)
}
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -215,7 +213,6 @@ CgAmlWriteWalk (
Node->Parent);
LsWriteNodeToListing (Node);
CgWriteNode (Node);
@ -225,13 +222,13 @@ CgAmlWriteWalk (
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -251,16 +248,15 @@ CgLocalWriteAmlData (
}
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -281,7 +277,6 @@ CgWriteAmlOpcode (
UINT32 i;
/* We expect some DEFAULT_ARGs, just ignore them */
if (Node->ParseOpcode == DEFAULT_ARG)
@ -305,7 +300,7 @@ CgWriteAmlOpcode (
/* Special opcodes for within a field definition */
Aml.Opcode = 0x00;
Aml.Opcode = 0x00;
break;
case AML_ACCESSFIELD_OP:
@ -361,7 +356,7 @@ CgWriteAmlOpcode (
else
{
/*
/*
* Encode the "bytes to follow" in the first byte, top two bits.
* The low-order nybble of the length is in the bottom 4 bits
*/
@ -381,7 +376,7 @@ CgWriteAmlOpcode (
{
CgLocalWriteAmlData (&PkgLen.LenBytes[i], 1);
}
}
}
}
switch (Aml.Opcode)
@ -410,13 +405,13 @@ CgWriteAmlOpcode (
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -425,7 +420,7 @@ CgWriteTableHeader (
ASL_PARSE_NODE *Node)
{
ASL_PARSE_NODE *Child;
/* AML filename */
@ -477,13 +472,13 @@ CgWriteTableHeader (
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -494,7 +489,6 @@ CgCloseTable (void)
UINT8 FileByte;
/* Calculate the checksum over the entire file */
fseek (Gbl_AmlOutputFile, 0, SEEK_SET);
@ -516,13 +510,13 @@ CgCloseTable (void)
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -533,19 +527,17 @@ CgWriteNode (
ASL_RESOURCE_NODE *Rnode;
/* TEMP FIX: always check for DEFAULT_ARG */
if ((Node->ParseOpcode == DEFAULT_ARG) ||
(Node->ParseOpcode == EXTERNAL) ||
(Node->ParseOpcode == INCLUDE) ||
(Node->ParseOpcode == EXTERNAL) ||
(Node->ParseOpcode == INCLUDE) ||
(Node->ParseOpcode == INCLUDE_END))
{
return;
}
switch (Node->AmlOpcode)
{
case AML_RAW_DATA_BYTE:
@ -564,7 +556,7 @@ CgWriteNode (
case AML_RAW_DATA_CHAIN:
Rnode = Node->Value.Pointer;
while (Rnode)
{
@ -575,8 +567,6 @@ CgWriteNode (
}
switch (Node->ParseOpcode)
{
case DEFAULT_ARG:
@ -599,8 +589,3 @@ CgWriteNode (
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslcompile - top level compile module
* $Revision: 1.3 $
* $Revision: 1.4 $
*
*****************************************************************************/
@ -123,7 +123,6 @@
#include <time.h>
/*
* Stubs
*/
@ -170,8 +169,8 @@ time_t Aclock;
* FUNCTION: Signon and FileHeader
*
* PARAMETERS: None
*
* RETURN: None
*
* RETURN: None
*
* DESCRIPTION: Display compiler signon
*
@ -194,21 +193,20 @@ AslCompilerFileHeader (
FILE *Where)
{
fprintf (Where, "Compilation of \"%s\" - %s\n", Gbl_InputFilename, asctime (NewTime));
fprintf (Where, "Compilation of \"%s\" - %s\n", Gbl_InputFilename, asctime (NewTime));
}
/*******************************************************************************
*
* FUNCTION:
* FUNCTION:
*
* PARAMETERS:
* PARAMETERS:
*
* RETURN:
* RETURN:
*
* DESCRIPTION:
* DESCRIPTION:
*
******************************************************************************/
@ -241,7 +239,7 @@ CmDoCompile (void)
/* Build the parse tree */
AslCompilerparse();
/* Generate AML opcodes corresponding to the parse tokens */
@ -256,9 +254,9 @@ CmDoCompile (void)
/* Semantic error checking */
AnalysisWalkInfo.MethodStack = NULL;
DbgPrint ("\nSemantic analysis\n\n");
TgWalkParseTree (ASL_WALK_VISIT_TWICE, AnSemanticAnalysisWalkBegin,
TgWalkParseTree (ASL_WALK_VISIT_TWICE, AnSemanticAnalysisWalkBegin,
AnSemanticAnalysisWalkEnd, &AnalysisWalkInfo);
@ -280,7 +278,7 @@ CmDoCompile (void)
/*
* Now that the input is parsed, we can open the AML output file.
* Note: by default, the name of this file comes from the table descriptor
* Note: by default, the name of this file comes from the table descriptor
* within the input file.
*/
Status = FlOpenAmlOutputFile (Gbl_InputFilename);
@ -333,4 +331,3 @@ CmDoCompile (void)
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslcompiler.h - common include file
* $Revision: 1.28 $
* $Revision: 1.29 $
*
*****************************************************************************/
@ -142,8 +142,6 @@
#define CompilerCreatorId "IASL"
typedef struct asl_method_info
{
UINT8 NumArguments;
@ -161,7 +159,6 @@ typedef struct asl_analysis_walk_info
} ASL_ANALYSIS_WALK_INFO;
/*
* Macros
*/
@ -173,9 +170,7 @@ typedef struct asl_analysis_walk_info
#define ASL_GET_PEER_NODE(a) (a)->Peer
#define ASL_PARSE_OPCODE_BASE ACCESSAS /* First Lex type */
#define ASL_PARSE_OPCODE_BASE ACCESSAS /* First Lex type */
/* TBD: Is this a real opcode? */
@ -210,10 +205,6 @@ typedef struct asl_analysis_walk_info
#define ASL_WALK_VISIT_TWICE 0x03
#define OP_TABLE_ENTRY(a,b,c) {b,a,c}
typedef struct asl_mapping_entry
@ -272,7 +263,7 @@ typedef struct asl_walk_info
typedef struct asl_error_msg
{
{
UINT32 LineNumber;
UINT32 LogicalLineNumber;
UINT32 Column;
@ -312,7 +303,6 @@ void (*ASL_WALK_CALLBACK) (
void *Context);
/*
* Global variables. Declared in aslmain.c only
*/
@ -403,8 +393,6 @@ EXTERN UINT32 INIT_GLOBAL (Gbl_SourceLine, 0);
EXTERN ASL_LISTING_NODE INIT_GLOBAL (*Gbl_ListingNode, NULL);
EXTERN UINT32 INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
EXTERN UINT32 INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
EXTERN UINT32 INIT_GLOBAL (Gbl_CurrentLine, 0);
@ -431,15 +419,11 @@ EXTERN char MsgBuffer[256];
EXTERN char StringBuffer[256];
#define ASL_ERROR 0
#define ASL_WARNING 1
typedef enum
typedef enum
{
ASL_MSG_NULL = 0,
ASL_MSG_MEMORY_ALLOCATION,
@ -570,8 +554,6 @@ ASL_LISTING_NODE *
LsPopNode (void);
void
CgGenerateAmlOutput (void);
@ -614,9 +596,6 @@ LnInitLengthsWalk (
void *Context);
void
CgAmlWriteWalk (
ASL_PARSE_NODE *Node,
@ -647,8 +626,6 @@ CgDoResourceTemplate (
ASL_PARSE_NODE *Node);
/* asltree */
void
@ -718,7 +695,6 @@ TgLinkPeerNodes (
...);
/* Analyze */
void
@ -734,7 +710,6 @@ AnSemanticAnalysisWalkEnd (
void *Context);
void
FlOpenIncludeFile (
ASL_PARSE_NODE *Node);
@ -848,7 +823,6 @@ UtAttachNamepathToOwner (
ASL_PARSE_NODE *NameNode);
/* Find */
void