kernel/acpica/compiler/cvcompiler.c
/*******************************************************************************
 *
 * FUNCTION:    CvProcessCommentType2
 *
 * PARAMETERS:  CurrentState      Current comment parse state
 *              StringBuffer      Buffer containing the comment being processed
 *
 * RETURN:      none
 *
 * DESCRIPTION: Process a single line comment. This function captures a comment
 *              in a char* and places the comment in the approperiate global
 *              buffer through CvPlaceComment
 *
 ******************************************************************************/
CvProcessCommentType2
PARAMETERS:  CurrentState      Current comment parse state
StringBuffer      Buffer containing the comment being processed

none

Process a single line comment. This function captures a comment
in a char* and places the comment in the approperiate global
buffer through CvPlaceComment
CvProcessCommentType2 PARAMETERS : CurrentState Current comment parse state StringBuffer Buffer containing the comment being processed none Process a single line comment . This function captures a comment in a char * and places the comment in the approperiate global buffer through CvPlaceComment
void
CvProcessCommentType2 (
    ASL_COMMENT_STATE       CurrentState,
    char                    *StringBuffer)
{
    UINT32                  i;
    char                    *CommentString;
    char                    *FinalCommentString;
    if (Gbl_CaptureComments && CurrentState.CaptureComments)
    {
        *StringBuffer = 0; 
        CvDbgPrint ("Single-line comment\n");
        CommentString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
        strcpy (CommentString, MsgBuffer);
        FinalCommentString = UtStringCacheCalloc (CurrentState.SpacesBefore +
            strlen (CommentString) + 3 + 1);
        for (i = 0; (CurrentState.CommentType != 1) &&
            (i < CurrentState.SpacesBefore); i++)
        {
            FinalCommentString[i] = ' ';
        }
        strcat (FinalCommentString, CommentString);
        strcat (FinalCommentString, " */");
        FinalCommentString [CurrentState.SpacesBefore +
            strlen (CommentString) + 3] = 0;
        if (FinalCommentString[strlen (FinalCommentString) - 1] == 0x0D)
        {
            FinalCommentString[strlen(FinalCommentString) - 1] = 0;
        }
        CvPlaceComment (CurrentState.CommentType, FinalCommentString);
    }
}
void CvProcessCommentType2 ( ASL_COMMENT_STATE CurrentState , char * StringBuffer ) { UINT32 i ; char * CommentString ; char * FinalCommentString ; if ( Gbl_CaptureComments && CurrentState . CaptureComments ) { * StringBuffer = 0 ; CvDbgPrint ( " \n " ) ; CommentString = UtStringCacheCalloc ( strlen ( MsgBuffer ) + 1 ) ; strcpy ( CommentString , MsgBuffer ) ; FinalCommentString = UtStringCacheCalloc ( CurrentState . SpacesBefore + strlen ( CommentString ) + 3 + 1 ) ; for ( i = 0 ; ( CurrentState . CommentType != 1 ) && ( i < CurrentState . SpacesBefore ) ; i ++ ) { FinalCommentString [ i ] = ' ' ; } strcat ( FinalCommentString , CommentString ) ; strcat ( FinalCommentString , " " ) ; FinalCommentString [ CurrentState . SpacesBefore + strlen ( CommentString ) + 3 ] = 0 ; if ( FinalCommentString [ strlen ( FinalCommentString ) - 1 ] == 0x0D ) { FinalCommentString [ strlen ( FinalCommentString ) - 1 ] = 0 ; } CvPlaceComment ( CurrentState . CommentType , FinalCommentString ) ; } }
FUNCTION:    CvProcessCommentType2
 PARAMETERS:  CurrentState      Current comment parse state
              StringBuffer      Buffer containing the comment being processed
FUNCTION : CvProcessCommentType2 PARAMETERS : CurrentState Current comment parse state StringBuffer Buffer containing the comment being processed
/* null terminate */ /* If this comment lies on the same line as the latest parse op,
         * assign it to that op's CommentAfter field. Saving in this field
         * will allow us to support comments that come after code on the
         * same line as the code itself. For example,
         * Name(A,"") //comment
         *
         * will be retained rather than transformed into
         *
         * Name(A,"")
         * //comment
         *
         * For this case, we only need to add one comment since
         *
         * Name(A,"") //comment1 //comment2 ... more comments here.
         *
         * would be lexically analyzed as a single comment.
         *
         * Create a new string with the approperiate spaces. Since we need
         * to account for the proper spacing, the actual comment,
         * extra 2 spaces so that this comment can be converted to the "/ *"
         * style and the null terminator, the string would look something
         * like:
         *
         * [ (spaces) (comment)  ( * /) ('\0') ]
         *
         */ /* convert to a "/ *" style comment  */ /* get rid of the carriage return */