MdePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Provides interface to EFI_FILE_HANDLE functionality.
|
||||
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -391,8 +391,8 @@ FileHandleFlush (
|
||||
@param[in] DirHandle Handle to open file.
|
||||
|
||||
@retval EFI_SUCCESS DirHandle is a directory.
|
||||
@retval EFI_INVALID_PARAMETER DirHandle is NULL.
|
||||
The file information returns from FileHandleGetInfo is NULL.
|
||||
@retval EFI_INVALID_PARAMETER DirHandle is NULL.
|
||||
The file information returns from FileHandleGetInfo is NULL.
|
||||
@retval EFI_NOT_FOUND DirHandle is not a directory.
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -769,8 +769,8 @@ StrnCatGrowLeft (
|
||||
|
||||
/**
|
||||
Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the
|
||||
directory 'stack'. If the file is a directory, then append the '\' char at the
|
||||
end of name string. If it's not a directory, then the last '\' should not be
|
||||
directory 'stack'. If the file is a directory, then append the '\' char at the
|
||||
end of name string. If it's not a directory, then the last '\' should not be
|
||||
added.
|
||||
|
||||
if Handle is NULL, return EFI_INVALID_PARAMETER
|
||||
@@ -858,8 +858,8 @@ FileHandleGetFileName (
|
||||
*FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);
|
||||
}
|
||||
|
||||
if (*FullFileName != NULL &&
|
||||
(*FullFileName)[StrLen(*FullFileName) - 1] == L'\\' &&
|
||||
if (*FullFileName != NULL &&
|
||||
(*FullFileName)[StrLen(*FullFileName) - 1] == L'\\' &&
|
||||
StrLen(*FullFileName) > 1 &&
|
||||
FileHandleIsDirectory(Handle) == EFI_NOT_FOUND
|
||||
) {
|
||||
@@ -969,20 +969,20 @@ FileHandleReadLine(
|
||||
||(Buffer==NULL&&*Size!=0)
|
||||
){
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Buffer != NULL && *Size != 0) {
|
||||
*Buffer = CHAR_NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Status = FileHandleGetSize (Handle, &FileSize);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
} else if (FileSize == 0) {
|
||||
*Ascii = TRUE;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileHandleGetPosition(Handle, &OriginalFilePosition);
|
||||
if (OriginalFilePosition == 0) {
|
||||
CharSize = sizeof(CHAR16);
|
||||
@@ -1050,11 +1050,11 @@ FileHandleReadLine(
|
||||
|
||||
/**
|
||||
Function to write a line of text to a file.
|
||||
|
||||
If the file is a Unicode file (with UNICODE file tag) then write the unicode
|
||||
|
||||
If the file is a Unicode file (with UNICODE file tag) then write the unicode
|
||||
text.
|
||||
If the file is an ASCII file then write the ASCII text.
|
||||
If the size of file is zero (without file tag at the beginning) then write
|
||||
If the size of file is zero (without file tag at the beginning) then write
|
||||
ASCII text as default.
|
||||
|
||||
@param[in] Handle FileHandle to write to.
|
||||
@@ -1064,7 +1064,7 @@ FileHandleReadLine(
|
||||
@retval EFI_SUCCESS The data was written.
|
||||
Buffer is NULL.
|
||||
@retval EFI_INVALID_PARAMETER Handle is NULL.
|
||||
@retval EFI_OUT_OF_RESOURCES Unable to allocate temporary space for ASCII
|
||||
@retval EFI_OUT_OF_RESOURCES Unable to allocate temporary space for ASCII
|
||||
string due to out of resources.
|
||||
|
||||
@sa FileHandleWrite
|
||||
@@ -1093,25 +1093,25 @@ FileHandleWriteLine(
|
||||
if (Handle == NULL) {
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
|
||||
Ascii = FALSE;
|
||||
AsciiBuffer = NULL;
|
||||
|
||||
|
||||
Status = FileHandleGetPosition(Handle, &OriginalFilePosition);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Status = FileHandleSetPosition(Handle, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Status = FileHandleGetSize(Handle, &FileSize);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
if (FileSize == 0) {
|
||||
Ascii = TRUE;
|
||||
} else {
|
||||
@@ -1124,12 +1124,12 @@ FileHandleWriteLine(
|
||||
Ascii = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Status = FileHandleSetPosition(Handle, OriginalFilePosition);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
if (Ascii) {
|
||||
Size = ( StrSize(Buffer) / sizeof(CHAR16) ) * sizeof(CHAR8);
|
||||
AsciiBuffer = (CHAR8 *)AllocateZeroPool(Size);
|
||||
@@ -1143,7 +1143,7 @@ FileHandleWriteLine(
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Size = AsciiStrSize(AsciiBuffer) - sizeof(CHAR8);
|
||||
Status = FileHandleWrite(Handle, &Size, AsciiBuffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
@@ -1167,7 +1167,7 @@ FileHandleWriteLine(
|
||||
Size = StrSize(L"\r\n") - sizeof(CHAR16);
|
||||
Status = FileHandleWrite(Handle, &Size, L"\r\n");
|
||||
}
|
||||
|
||||
|
||||
if (AsciiBuffer != NULL) {
|
||||
FreePool (AsciiBuffer);
|
||||
}
|
||||
|
Reference in New Issue
Block a user