mirror of https://github.com/acidanthera/audk.git
ShellPkg: Fixed build error 'variable set but not used'
GCC toolchain cannot build ShellPkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Harry Liebel <Harry.Liebel@arm.com> Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Jaben Carsey <Jaben.Carsey@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14326 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5e5bb2a9ba
commit
e755a4ca10
|
@ -994,7 +994,6 @@ InternalOpenFileDevicePath(
|
|||
SHELL_FILE_HANDLE ShellHandle;
|
||||
EFI_FILE_PROTOCOL *Handle1;
|
||||
EFI_FILE_PROTOCOL *Handle2;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DpCopy;
|
||||
FILEPATH_DEVICE_PATH *AlignedNode;
|
||||
|
||||
if (FileHandle == NULL) {
|
||||
|
@ -1004,7 +1003,6 @@ InternalOpenFileDevicePath(
|
|||
Handle1 = NULL;
|
||||
Handle2 = NULL;
|
||||
Handle = NULL;
|
||||
DpCopy = DevicePath;
|
||||
ShellHandle = NULL;
|
||||
FilePathNode = NULL;
|
||||
AlignedNode = NULL;
|
||||
|
|
|
@ -293,7 +293,7 @@ BcfgAddDebug1(
|
|||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *FilePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *FileNode;
|
||||
/* EFI_DEVICE_PATH_PROTOCOL *FileNode; */
|
||||
CHAR16 *Str;
|
||||
UINT8 *TempByteBuffer;
|
||||
UINT8 *TempByteStart;
|
||||
|
@ -328,7 +328,7 @@ BcfgAddDebug1(
|
|||
|
||||
Str = NULL;
|
||||
FilePath = NULL;
|
||||
FileNode = NULL;
|
||||
/* FileNode = NULL; */
|
||||
FileList = NULL;
|
||||
Handles = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
|
|
|
@ -133,8 +133,6 @@ InputBarRefresh (
|
|||
UINTN Size;
|
||||
EFI_STATUS Status;
|
||||
BOOLEAN NoDisplay;
|
||||
UINTN Limit;
|
||||
UINTN mPromptLen;
|
||||
UINTN EventIndex;
|
||||
UINTN CursorRow;
|
||||
UINTN CursorCol;
|
||||
|
@ -164,12 +162,6 @@ InputBarRefresh (
|
|||
gST->ConOut->SetCursorPosition (gST->ConOut, 0, LastRow - 1);
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBINPUTBAR_MAININPUTBAR), gShellDebug1HiiHandle, mPrompt);
|
||||
|
||||
//
|
||||
// that's the maximum input length that can be displayed on screen
|
||||
//
|
||||
mPromptLen = StrLen (mPrompt);
|
||||
Limit = LastColumn - mPromptLen;
|
||||
|
||||
//
|
||||
// this is a selection mPrompt, cursor will stay in edit area
|
||||
// actually this is for search , search/replace
|
||||
|
|
|
@ -752,7 +752,6 @@ HBufferImageRefresh (
|
|||
UINTN StartRow;
|
||||
UINTN EndRow;
|
||||
UINTN FStartRow;
|
||||
UINTN FEndRow;
|
||||
UINTN Tmp;
|
||||
|
||||
Orig = HMainEditor.ColorAttributes;
|
||||
|
@ -821,7 +820,6 @@ HBufferImageRefresh (
|
|||
}
|
||||
|
||||
FStartRow = StartRow;
|
||||
FEndRow = EndRow;
|
||||
|
||||
StartRow = 2 + StartRow - HBufferImage.LowVisibleRow;
|
||||
EndRow = 2 + EndRow - HBufferImage.LowVisibleRow;
|
||||
|
@ -1750,14 +1748,11 @@ HBufferImagePageUp (
|
|||
VOID
|
||||
)
|
||||
{
|
||||
HEFI_EDITOR_LINE *Line;
|
||||
UINTN FRow;
|
||||
UINTN FCol;
|
||||
UINTN Gap;
|
||||
INTN Retreat;
|
||||
|
||||
Line = HBufferImage.CurrentLine;
|
||||
|
||||
FRow = HBufferImage.BufferPosition.Row;
|
||||
FCol = HBufferImage.BufferPosition.Column;
|
||||
|
||||
|
@ -1776,11 +1771,6 @@ HBufferImagePageUp (
|
|||
Retreat = Gap;
|
||||
Retreat = -Retreat;
|
||||
|
||||
//
|
||||
// get correct line
|
||||
//
|
||||
Line = HMoveLine (Retreat);
|
||||
|
||||
FRow -= Gap;
|
||||
|
||||
HBufferImageMovePosition (FRow, FCol, HBufferImage.HighBits);
|
||||
|
@ -1798,13 +1788,10 @@ HBufferImageHome (
|
|||
VOID
|
||||
)
|
||||
{
|
||||
HEFI_EDITOR_LINE *Line;
|
||||
UINTN FRow;
|
||||
UINTN FCol;
|
||||
BOOLEAN HighBits;
|
||||
|
||||
Line = HBufferImage.CurrentLine;
|
||||
|
||||
//
|
||||
// curosr will at the high bit
|
||||
//
|
||||
|
@ -1918,7 +1905,6 @@ HBufferImageDeleteCharacterFromBuffer (
|
|||
|
||||
HEFI_EDITOR_LINE *Line;
|
||||
LIST_ENTRY *Link;
|
||||
UINTN StartRow;
|
||||
|
||||
UINTN OldFCol;
|
||||
UINTN OldFRow;
|
||||
|
@ -1928,11 +1914,6 @@ HBufferImageDeleteCharacterFromBuffer (
|
|||
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// get the line that start position is at
|
||||
//
|
||||
StartRow = Pos / 0x10;
|
||||
|
||||
Size = HBufferImageGetTotalSize ();
|
||||
|
||||
if (Size < Count) {
|
||||
|
@ -2054,7 +2035,6 @@ HBufferImageAddCharacterToBuffer (
|
|||
HEFI_EDITOR_LINE *Line;
|
||||
|
||||
LIST_ENTRY *Link;
|
||||
UINTN StartRow;
|
||||
|
||||
UINTN OldFCol;
|
||||
UINTN OldFRow;
|
||||
|
@ -2062,11 +2042,6 @@ HBufferImageAddCharacterToBuffer (
|
|||
|
||||
UINTN NewPos;
|
||||
|
||||
//
|
||||
// get the line that start position is at
|
||||
//
|
||||
StartRow = Pos / 0x10;
|
||||
|
||||
Size = HBufferImageGetTotalSize ();
|
||||
|
||||
//
|
||||
|
|
|
@ -181,11 +181,7 @@ HDiskImageRead (
|
|||
UINTN Bytes;
|
||||
|
||||
HEFI_EDITOR_LINE *Line;
|
||||
UINT64 ByteOffset;
|
||||
|
||||
EDIT_FILE_TYPE BufferTypeBackup;
|
||||
|
||||
BufferTypeBackup = HBufferImage.BufferType;
|
||||
HBufferImage.BufferType = FileTypeDiskBuffer;
|
||||
|
||||
DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
|
||||
|
@ -226,8 +222,6 @@ HDiskImageRead (
|
|||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
ByteOffset = MultU64x32 (Offset, BlkIo->Media->BlockSize);
|
||||
|
||||
//
|
||||
// read from disk
|
||||
//
|
||||
|
@ -355,10 +349,6 @@ HDiskImageSave (
|
|||
VOID *Buffer;
|
||||
UINTN Bytes;
|
||||
|
||||
UINT64 ByteOffset;
|
||||
|
||||
EDIT_FILE_TYPE BufferTypeBackup;
|
||||
|
||||
//
|
||||
// if not modified, directly return
|
||||
//
|
||||
|
@ -366,7 +356,6 @@ HDiskImageSave (
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
BufferTypeBackup = HBufferImage.BufferType;
|
||||
HBufferImage.BufferType = FileTypeDiskBuffer;
|
||||
|
||||
DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
|
||||
|
@ -406,8 +395,6 @@ HDiskImageSave (
|
|||
return Status;
|
||||
}
|
||||
|
||||
ByteOffset = MultU64x32 (Offset, BlkIo->Media->BlockSize);
|
||||
|
||||
//
|
||||
// write the buffer to disk
|
||||
//
|
||||
|
|
|
@ -43,25 +43,19 @@ ShellCommandRunHexEdit (
|
|||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
LIST_ENTRY *Package;
|
||||
CONST CHAR16 *Cwd;
|
||||
CHAR16 *NewName;
|
||||
CHAR16 *Spot;
|
||||
CONST CHAR16 *Name;
|
||||
UINTN Offset;
|
||||
UINTN Size;
|
||||
UINT64 LastOffset;
|
||||
EDIT_FILE_TYPE WhatToDo;
|
||||
|
||||
Buffer = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
NewName = NULL;
|
||||
Cwd = NULL;
|
||||
Buffer = NULL;
|
||||
Name = NULL;
|
||||
Spot = NULL;
|
||||
Offset = 0;
|
||||
Size = 0;
|
||||
LastOffset = 0;
|
||||
WhatToDo = FileTypeNone;
|
||||
|
||||
//
|
||||
|
|
|
@ -598,7 +598,6 @@ HMainCommandCut (
|
|||
)
|
||||
{
|
||||
UINTN Index;
|
||||
HEFI_EDITOR_LINE *Line;
|
||||
LIST_ENTRY *Link;
|
||||
UINT8 *Buffer;
|
||||
UINTN Count;
|
||||
|
@ -623,8 +622,6 @@ HMainCommandCut (
|
|||
Link = Link->ForwardLink;
|
||||
}
|
||||
|
||||
Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
|
||||
|
||||
Count = HMainEditor.SelectEnd - HMainEditor.SelectStart + 1;
|
||||
Buffer = AllocateZeroPool (Count);
|
||||
if (Buffer == NULL) {
|
||||
|
|
|
@ -190,9 +190,6 @@ HMemImageRead (
|
|||
CHAR16 *Str;
|
||||
HEFI_EDITOR_LINE *Line;
|
||||
|
||||
EDIT_FILE_TYPE BufferTypeBackup;
|
||||
|
||||
BufferTypeBackup = HBufferImage.BufferType;
|
||||
HBufferImage.BufferType = FileTypeMemBuffer;
|
||||
|
||||
Buffer = AllocateZeroPool (Size);
|
||||
|
@ -301,8 +298,6 @@ HMemImageSave (
|
|||
EFI_STATUS Status;
|
||||
VOID *Buffer;
|
||||
|
||||
EDIT_FILE_TYPE BufferTypeBackup;
|
||||
|
||||
//
|
||||
// not modified, so directly return
|
||||
//
|
||||
|
@ -310,7 +305,6 @@ HMemImageSave (
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
BufferTypeBackup = HBufferImage.BufferType;
|
||||
HBufferImage.BufferType = FileTypeMemBuffer;
|
||||
|
||||
Buffer = AllocateZeroPool (Size);
|
||||
|
|
|
@ -217,7 +217,6 @@ ShellCommandRunMm (
|
|||
UINT64 Buffer;
|
||||
UINTN Index;
|
||||
UINTN Size;
|
||||
CHAR16 *AddressStr;
|
||||
// CHAR16 *ValueStr;
|
||||
BOOLEAN Complete;
|
||||
CHAR16 *InputStr;
|
||||
|
@ -245,7 +244,6 @@ ShellCommandRunMm (
|
|||
Width = EfiPciWidthUint8;
|
||||
Size = 1;
|
||||
AccessType = EfiMemory;
|
||||
AddressStr = NULL;
|
||||
// ValueStr = NULL;
|
||||
Interactive = TRUE;
|
||||
Package = NULL;
|
||||
|
|
|
@ -2054,13 +2054,11 @@ ShellCommandRunPci (
|
|||
LIST_ENTRY *Package;
|
||||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
UINTN Size;
|
||||
CONST CHAR16 *Temp;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
Status = EFI_SUCCESS;
|
||||
Address = 0;
|
||||
Size = 0;
|
||||
IoDev = NULL;
|
||||
HandleBuf = NULL;
|
||||
Package = NULL;
|
||||
|
|
|
@ -490,11 +490,9 @@ EditGetDefaultFileName (
|
|||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN Suffix;
|
||||
BOOLEAN FoundNewFile;
|
||||
CHAR16 *FileNameTmp;
|
||||
|
||||
Suffix = 0;
|
||||
FoundNewFile = FALSE;
|
||||
|
||||
do {
|
||||
FileNameTmp = CatSPrint (NULL, L"NewFile%d.%s", Suffix, Extension);
|
||||
|
|
|
@ -674,9 +674,7 @@ DoDhByHandle(
|
|||
{
|
||||
CHAR16 *ProtocolInfoString;
|
||||
SHELL_STATUS ShellStatus;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
ProtocolInfoString = NULL;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for bcfg shell Install1 function.
|
||||
|
||||
Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2013, 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
|
||||
|
@ -293,7 +293,6 @@ BcfgAddInstall1(
|
|||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *FilePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *FileNode;
|
||||
CHAR16 *Str;
|
||||
UINT8 *TempByteBuffer;
|
||||
UINT8 *TempByteStart;
|
||||
|
@ -328,7 +327,6 @@ BcfgAddInstall1(
|
|||
|
||||
Str = NULL;
|
||||
FilePath = NULL;
|
||||
FileNode = NULL;
|
||||
FileList = NULL;
|
||||
Handles = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
|
|
|
@ -662,12 +662,9 @@ BuildNextStatement (
|
|||
OUT END_TAG_TYPE *EndTag
|
||||
)
|
||||
{
|
||||
CHAR16 *Buffer;
|
||||
UINTN BufferSize;
|
||||
|
||||
*EndTag = EndTagMax;
|
||||
|
||||
for(Buffer = NULL, BufferSize = 0
|
||||
for(
|
||||
; ParameterNumber < gEfiShellParametersProtocol->Argc
|
||||
; ParameterNumber++
|
||||
) {
|
||||
|
|
|
@ -87,6 +87,7 @@ CopySingleFile(
|
|||
Response = *Resp;
|
||||
List = NULL;
|
||||
DestVolumeInfo = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
|
||||
ReadSize = PcdGet16(PcdShellFileOperationSize);
|
||||
// Why bother copying a file to itself
|
||||
|
@ -255,7 +256,7 @@ CopySingleFile(
|
|||
//
|
||||
// return
|
||||
//
|
||||
return (SHELL_SUCCESS);
|
||||
return ShellStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -537,12 +538,11 @@ ProcessValidateAndCopyFiles(
|
|||
{
|
||||
SHELL_STATUS ShellStatus;
|
||||
EFI_SHELL_FILE_INFO *List;
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_INFO *FileInfo;
|
||||
|
||||
List = NULL;
|
||||
|
||||
Status = ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_READ, &List);
|
||||
ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_READ, &List);
|
||||
if (List != NULL && List->Link.ForwardLink != List->Link.BackLink) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, DestDir);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
|
|
|
@ -81,13 +81,11 @@ LoadDriver(
|
|||
{
|
||||
EFI_HANDLE LoadedDriverHandle;
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *Node;
|
||||
EFI_DEVICE_PATH_PROTOCOL *FilePath;
|
||||
EFI_LOADED_IMAGE_PROTOCOL *LoadedDriverImage;
|
||||
|
||||
LoadedDriverImage = NULL;
|
||||
FilePath = NULL;
|
||||
Node = NULL;
|
||||
LoadedDriverHandle = NULL;
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
|
|
|
@ -1025,7 +1025,6 @@ ShellCommandRunMap (
|
|||
CONST CHAR16 *SName;
|
||||
CONST CHAR16 *Mapping;
|
||||
EFI_HANDLE MapAsHandle;
|
||||
CONST EFI_DEVICE_PATH_PROTOCOL *DevPath;
|
||||
SHELL_STATUS ShellStatus;
|
||||
BOOLEAN SfoMode;
|
||||
BOOLEAN ConstMode;
|
||||
|
@ -1037,7 +1036,6 @@ ShellCommandRunMap (
|
|||
ProblemParam = NULL;
|
||||
Mapping = NULL;
|
||||
SName = NULL;
|
||||
DevPath = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
MapAsHandle = NULL;
|
||||
|
||||
|
|
|
@ -135,7 +135,6 @@ GetDestinationLocation(
|
|||
{
|
||||
EFI_SHELL_FILE_INFO *DestList;
|
||||
EFI_SHELL_FILE_INFO *Node;
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *DestPath;
|
||||
CHAR16 *TempLocation;
|
||||
UINTN NewSize;
|
||||
|
@ -159,7 +158,7 @@ GetDestinationLocation(
|
|||
//
|
||||
// get the destination path
|
||||
//
|
||||
Status = ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ|EFI_FILE_MODE_CREATE, &DestList);
|
||||
ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ|EFI_FILE_MODE_CREATE, &DestList);
|
||||
if (DestList == NULL || IsListEmpty(&DestList->Link)) {
|
||||
//
|
||||
// Not existing... must be renaming
|
||||
|
|
|
@ -33,7 +33,6 @@ IsDirectoryEmpty (
|
|||
IN EFI_HANDLE FileHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_INFO *FileInfo;
|
||||
BOOLEAN NoFile;
|
||||
BOOLEAN RetVal;
|
||||
|
@ -41,9 +40,9 @@ IsDirectoryEmpty (
|
|||
RetVal = TRUE;
|
||||
NoFile = FALSE;
|
||||
|
||||
for (Status = FileHandleFindFirstFile(FileHandle, &FileInfo)
|
||||
for (FileHandleFindFirstFile(FileHandle, &FileInfo)
|
||||
; !NoFile
|
||||
; Status = FileHandleFindNextFile(FileHandle, FileInfo, &NoFile)
|
||||
; FileHandleFindNextFile(FileHandle, FileInfo, &NoFile)
|
||||
){
|
||||
if (StrStr(FileInfo->FileName, L".") != FileInfo->FileName
|
||||
&&StrStr(FileInfo->FileName, L"..") != FileInfo->FileName) {
|
||||
|
|
|
@ -378,7 +378,6 @@ ShellCommandRunTime (
|
|||
{
|
||||
EFI_STATUS Status;
|
||||
LIST_ENTRY *Package;
|
||||
CHAR16 *Message;
|
||||
EFI_TIME TheTime;
|
||||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
|
@ -387,13 +386,11 @@ ShellCommandRunTime (
|
|||
CONST CHAR16 *TempLocation;
|
||||
UINTN TzMinutes;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
ProblemParam = NULL;
|
||||
|
||||
//
|
||||
// Initialize variables
|
||||
//
|
||||
Message = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
ProblemParam = NULL;
|
||||
|
||||
//
|
||||
// initialize the shell lib (we must be in non-auto-init...)
|
||||
|
|
|
@ -29,21 +29,18 @@ ShellCommandRunCls (
|
|||
{
|
||||
EFI_STATUS Status;
|
||||
LIST_ENTRY *Package;
|
||||
CHAR16 *Message;
|
||||
UINTN Background;
|
||||
UINTN ForeColor;
|
||||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
CONST CHAR16 *Param1;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
ProblemParam = NULL;
|
||||
Background = 0;
|
||||
|
||||
//
|
||||
// Initialize variables
|
||||
//
|
||||
Message = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
ProblemParam = NULL;
|
||||
Background = 0;
|
||||
|
||||
//
|
||||
// initialize the shell lib (we must be in non-auto-init...)
|
||||
|
|
|
@ -41,7 +41,6 @@ ShellCommandRunHelp (
|
|||
LIST_ENTRY *Package;
|
||||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
CHAR16 *OutText;
|
||||
CONST COMMAND_LIST *CommandList;
|
||||
CONST COMMAND_LIST *Node;
|
||||
CHAR16 *CommandToGetHelpOn;
|
||||
|
@ -53,7 +52,6 @@ ShellCommandRunHelp (
|
|||
PrintCommandText = TRUE;
|
||||
ProblemParam = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
OutText = NULL;
|
||||
CommandToGetHelpOn = NULL;
|
||||
SectionToGetHelpOn = NULL;
|
||||
Found = FALSE;
|
||||
|
|
Loading…
Reference in New Issue