diff options
Diffstat (limited to 'source/compiler/cvdisasm.c')
-rw-r--r-- | source/compiler/cvdisasm.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/source/compiler/cvdisasm.c b/source/compiler/cvdisasm.c index 6e9b73f0a367..8682f04e5178 100644 --- a/source/compiler/cvdisasm.c +++ b/source/compiler/cvdisasm.c @@ -156,6 +156,8 @@ #include "acconvert.h" +/* Local prototypes */ + static void CvPrintInclude( ACPI_FILE_NODE *FNode, @@ -198,6 +200,7 @@ CvPrintOneCommentList ( AcpiOsPrintf("%s\n", Current->Comment); Current->Comment = NULL; } + Current = Current->Next; AcpiOsReleaseObject(AcpiGbl_RegCommentCache, Previous); } @@ -208,7 +211,7 @@ CvPrintOneCommentList ( * * FUNCTION: CvListIsSingleton * - * PARAMETERS: CommentList -- check to see if this is a single item list. + * PARAMETERS: CommentList - check to see if this is a single item list. * * RETURN: BOOLEAN * @@ -221,16 +224,17 @@ CvListIsSingleton ( ACPI_COMMENT_NODE *CommentList) { + if (!CommentList) { - return FALSE; + return (FALSE); } else if (CommentList->Next) { - return FALSE; + return (FALSE); } - return TRUE; + return (TRUE); } @@ -275,6 +279,7 @@ CvPrintOneCommentType ( { CvPrintOneCommentList (Op->Common.CommentList, Level); } + Op->Common.CommentList = NULL; return; @@ -333,7 +338,7 @@ CvPrintOneCommentType ( * PARAMETERS: Op * Level * - * RETURN: none + * RETURN: None * * DESCRIPTION: Print a close brace } and any open brace comments associated * with this parse object. @@ -346,6 +351,7 @@ CvCloseBraceWriteComment( ACPI_PARSE_OBJECT *Op, UINT32 Level) { + if (!Gbl_CaptureComments) { AcpiOsPrintf ("}"); @@ -365,7 +371,7 @@ CvCloseBraceWriteComment( * PARAMETERS: Op * Level * - * RETURN: none + * RETURN: None * * DESCRIPTION: Print a closing paren ) and any end node comments associated * with this parse object. @@ -378,6 +384,7 @@ CvCloseParenWriteComment( ACPI_PARSE_OBJECT *Op, UINT32 Level) { + if (!Gbl_CaptureComments) { AcpiOsPrintf (")"); @@ -427,13 +434,15 @@ BOOLEAN CvFileHasSwitched( ACPI_PARSE_OBJECT *Op) { + if (Op->Common.CvFilename && AcpiGbl_CurrentFilename && AcpiUtStricmp(Op->Common.CvFilename, AcpiGbl_CurrentFilename)) { - return TRUE; + return (TRUE); } - return FALSE; + + return (FALSE); } @@ -459,17 +468,21 @@ CvPrintInclude( ACPI_FILE_NODE *FNode, UINT32 Level) { + if (!FNode || FNode->IncludeWritten) { return; } - CvDbgPrint ("Writing include for %s within %s\n", FNode->Filename, FNode->Parent->Filename); + CvDbgPrint ("Writing include for %s within %s\n", + FNode->Filename, FNode->Parent->Filename); AcpiOsRedirectOutput (FNode->Parent->File); CvPrintOneCommentList (FNode->IncludeComment, Level); + AcpiDmIndent (Level); AcpiOsPrintf ("Include (\"%s\")\n", FNode->Filename); - CvDbgPrint ("emitted the following: Include (\"%s\")\n", FNode->Filename); + CvDbgPrint ("emitted the following: Include (\"%s\")\n", + FNode->Filename); FNode->IncludeWritten = TRUE; } @@ -478,7 +491,7 @@ CvPrintInclude( * * FUNCTION: CvSwitchFiles * - * PARAMETERS: Level - indentation level + * PARAMETERS: Level - indentation level * Op * * RETURN: None @@ -498,7 +511,9 @@ CvSwitchFiles( ACPI_FILE_NODE *FNode; ACPI_FILE_NODE *Current; - CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename, Filename); + + CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename, + Filename); FNode = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot); if (!FNode) { @@ -507,10 +522,13 @@ CvSwitchFiles( * if it does not exist, then abort. */ FlDeleteFile (ASL_FILE_AML_OUTPUT); - sprintf (MsgBuffer, "\"Cannot find %s\" - %s", Filename, strerror (errno)); - AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer); + sprintf (MsgBuffer, "\"Cannot find %s\" - %s", + Filename, strerror (errno)); + AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, + NULL, MsgBuffer); AslAbort (); } + Current = FNode; /* |