Fix ECC errors:1.Update the comments in function headers to follow the Doxygen special documentation. 2.Make the first line of text in a comment block end with a period. 3.Update the member variable name for SHELL_OPERATION_TYPES to follow the rules "Must contain lower case characters". 4. Return type of a function should exist and in the first line.

Signed-off-by: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Dong, Eric <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15019 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Shumin Qiu 2013-12-25 00:55:33 +00:00 committed by shenshushi
parent 6fa0da7d52
commit 5142926433
2 changed files with 45 additions and 48 deletions

View File

@ -71,9 +71,9 @@ STATIC CONST CHAR16 mExecutableExtensions[] = L".NSH;.EFI";
STATIC CONST CHAR16 mStartupScript[] = L"startup.nsh"; STATIC CONST CHAR16 mStartupScript[] = L"startup.nsh";
/** /**
Cleans off leading and trailing spaces and tabs Cleans off leading and trailing spaces and tabs.
@param[in] String pointer to the string to trim them off @param[in] String pointer to the string to trim them off.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -107,8 +107,7 @@ TrimSpaces(
@retval A pointer to the | character in CmdLine or NULL if not present. @retval A pointer to the | character in CmdLine or NULL if not present.
**/ **/
CONST CONST CHAR16*
CHAR16*
EFIAPI EFIAPI
FindSplit( FindSplit(
IN CONST CHAR16 *CmdLine IN CONST CHAR16 *CmdLine
@ -1432,13 +1431,12 @@ RunSplitCommand(
/** /**
Take the original command line, substitute any variables, free Take the original command line, substitute any variables, free
the original string, return the modified copy the original string, return the modified copy.
@param[in,out] CmdLine pointer to the command line to update @param[in] CmdLine pointer to the command line to update.
@param[out]CmdName upon successful return the name of the command to be run
@retval EFI_SUCCESS the function was successful @retval EFI_SUCCESS the function was successful.
@retval EFI_OUT_OF_RESOURCES a memory allocation failed @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -1458,13 +1456,12 @@ ShellSubstituteVariables(
/** /**
Take the original command line, substitute any alias in the first group of space delimited characters, free Take the original command line, substitute any alias in the first group of space delimited characters, free
the original string, return the modified copy the original string, return the modified copy.
@param[in] CmdLine pointer to the command line to update @param[in] CmdLine pointer to the command line to update.
@param[out]CmdName upon successful return the name of the command to be run
@retval EFI_SUCCESS the function was successful @retval EFI_SUCCESS the function was successful.
@retval EFI_OUT_OF_RESOURCES a memory allocation failed @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -1530,13 +1527,13 @@ ShellSubstituteAliases(
/** /**
Takes the Argv[0] part of the command line and determine the meaning of it. Takes the Argv[0] part of the command line and determine the meaning of it.
@param[in] CmdLine pointer to the command line to update @param[in] CmdName pointer to the command line to update.
@retval INTERNAL_COMMAND The name is an internal command @retval Internal_Command The name is an internal command.
@retval FILE_SYS_CHANGE the name is a file system change @retval File_Sys_Change the name is a file system change.
@retval SCRIPT_FILE_NAME the name is a NSH script file @retval Script_File_Name the name is a NSH script file.
@retval UNKNOWN_INVALID the name is unknown @retval Unknown_Invalid the name is unknown.
@retval EFI_APPLICATION the name is an application (.EFI) @retval Efi_Application the name is an application (.EFI).
**/ **/
SHELL_OPERATION_TYPES SHELL_OPERATION_TYPES
EFIAPI EFIAPI
@ -1553,7 +1550,7 @@ GetOperationType(
// test for an internal command. // test for an internal command.
// //
if (ShellCommandIsCommandOnList(CmdName)) { if (ShellCommandIsCommandOnList(CmdName)) {
return (INTERNAL_COMMAND); return (Internal_Command);
} }
// //
@ -1561,9 +1558,9 @@ GetOperationType(
// //
if (CmdName[(StrLen(CmdName)-1)] == L':') { if (CmdName[(StrLen(CmdName)-1)] == L':') {
if (StrStr(CmdName, L" ") != NULL) { if (StrStr(CmdName, L" ") != NULL) {
return (UNKNOWN_INVALID); return (Unknown_Invalid);
} }
return (FILE_SYS_CHANGE); return (File_Sys_Change);
} }
// //
@ -1578,7 +1575,7 @@ GetOperationType(
TempLocation2 = mScriptExtension; TempLocation2 = mScriptExtension;
if (StringNoCaseCompare((VOID*)(&TempLocation), (VOID*)(&TempLocation2)) == 0) { if (StringNoCaseCompare((VOID*)(&TempLocation), (VOID*)(&TempLocation2)) == 0) {
SHELL_FREE_NON_NULL(FileWithPath); SHELL_FREE_NON_NULL(FileWithPath);
return (SCRIPT_FILE_NAME); return (Script_File_Name);
} }
} }
@ -1586,14 +1583,14 @@ GetOperationType(
// Was a file, but not a script. we treat this as an application. // Was a file, but not a script. we treat this as an application.
// //
SHELL_FREE_NON_NULL(FileWithPath); SHELL_FREE_NON_NULL(FileWithPath);
return (EFI_APPLICATION); return (Efi_Application);
} }
SHELL_FREE_NON_NULL(FileWithPath); SHELL_FREE_NON_NULL(FileWithPath);
// //
// No clue what this is... return invalid flag... // No clue what this is... return invalid flag...
// //
return (UNKNOWN_INVALID); return (Unknown_Invalid);
} }
EFI_STATUS EFI_STATUS
@ -1635,7 +1632,7 @@ IsValidSplit(
TempWalker = (CHAR16*)Temp; TempWalker = (CHAR16*)Temp;
GetNextParameter(&TempWalker, &FirstParameter); GetNextParameter(&TempWalker, &FirstParameter);
if (GetOperationType(FirstParameter) == UNKNOWN_INVALID) { if (GetOperationType(FirstParameter) == Unknown_Invalid) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);
SetLastError(SHELL_NOT_FOUND); SetLastError(SHELL_NOT_FOUND);
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
@ -1648,7 +1645,7 @@ IsValidSplit(
} }
/** /**
Determine if a command line contains with a split contains only valid commands Determine if a command line contains with a split contains only valid commands.
@param[in] CmdLine The command line to parse. @param[in] CmdLine The command line to parse.
@ -1729,11 +1726,11 @@ ProcessNewSplitCommandLine(
} }
/** /**
Handle a request to change the current file system Handle a request to change the current file system.
@param[in] CmdLine The passed in command line @param[in] CmdLine The passed in command line.
@retval EFI_SUCCESS The operation was successful @retval EFI_SUCCESS The operation was successful.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -1816,9 +1813,9 @@ DoHelpUpdate(
} }
/** /**
Function to update the shell variable "lasterror" Function to update the shell variable "lasterror".
@param[in] ErrorCode the error code to put into lasterror @param[in] ErrorCode the error code to put into lasterror.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -2006,11 +2003,11 @@ RunCommandOrFile(
DevPath = NULL; DevPath = NULL;
switch (Type) { switch (Type) {
case INTERNAL_COMMAND: case Internal_Command:
Status = RunInternalCommand(CmdLine, FirstParameter, ParamProtocol); Status = RunInternalCommand(CmdLine, FirstParameter, ParamProtocol);
break; break;
case SCRIPT_FILE_NAME: case Script_File_Name:
case EFI_APPLICATION: case Efi_Application:
// //
// Process a fully qualified path // Process a fully qualified path
// //
@ -2041,10 +2038,10 @@ RunCommandOrFile(
SetLastError(SHELL_NOT_FOUND); SetLastError(SHELL_NOT_FOUND);
} }
switch (Type) { switch (Type) {
case SCRIPT_FILE_NAME: case Script_File_Name:
Status = RunScriptFile (CommandWithPath); Status = RunScriptFile (CommandWithPath);
break; break;
case EFI_APPLICATION: case Efi_Application:
// //
// Get the device path of the application image // Get the device path of the application image
// //
@ -2221,12 +2218,12 @@ RunCommand(
// Depending on the first parameter we change the behavior // Depending on the first parameter we change the behavior
// //
switch (Type = GetOperationType(FirstParameter)) { switch (Type = GetOperationType(FirstParameter)) {
case FILE_SYS_CHANGE: case File_Sys_Change:
Status = ChangeMappedDrive(CleanOriginal); Status = ChangeMappedDrive(CleanOriginal);
break; break;
case INTERNAL_COMMAND: case Internal_Command:
case SCRIPT_FILE_NAME: case Script_File_Name:
case EFI_APPLICATION: case Efi_Application:
Status = SetupAndRunCommandOrFile(Type, CleanOriginal, FirstParameter, ShellInfoObject.NewShellParametersProtocol); Status = SetupAndRunCommandOrFile(Type, CleanOriginal, FirstParameter, ShellInfoObject.NewShellParametersProtocol);
break; break;
default: default:

View File

@ -125,11 +125,11 @@ typedef struct {
extern SHELL_INFO ShellInfoObject; extern SHELL_INFO ShellInfoObject;
typedef enum { typedef enum {
INTERNAL_COMMAND, Internal_Command,
SCRIPT_FILE_NAME, Script_File_Name,
EFI_APPLICATION, Efi_Application,
FILE_SYS_CHANGE, File_Sys_Change,
UNKNOWN_INVALID Unknown_Invalid
} SHELL_OPERATION_TYPES; } SHELL_OPERATION_TYPES;
/** /**
@ -148,7 +148,7 @@ ProcessCommandLineToFinal(
); );
/** /**
Function to update the shell variable "lasterror" Function to update the shell variable "lasterror".
@param[in] ErrorCode the error code to put into lasterror @param[in] ErrorCode the error code to put into lasterror
**/ **/