|
From: <jlj...@us...> - 2011-10-26 04:15:31
|
Revision: 2379
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2379&view=rev
Author: jljusten
Date: 2011-10-26 04:15:24 +0000 (Wed, 26 Oct 2011)
Log Message:
-----------
BaseTools/Source/C: Fix warnings generated by GCC 4.6
GCC 4.6 generates a warning when a variable is set,
but never used.
This patch cleans up these cases in our BaseTools C
based tools.
Signed-off-by: jljusten
Reviewed-by: gikidy
Modified Paths:
--------------
trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
trunk/BaseTools/Source/C/GenFw/Elf64Convert.c
trunk/BaseTools/Source/C/GenSec/GenSec.c
trunk/BaseTools/Source/C/GenVtf/GenVtf.c
trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
trunk/BaseTools/Source/C/Split/Split.c
Modified: trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
===================================================================
--- trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2011, 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
@@ -181,7 +181,6 @@
CHAR8* OutputFileName = NULL;
CHAR8* InputFileNames[MAX_PE_IMAGES + 1];
UINT8 InputFileCount = 0;
- BOOLEAN QuietFlag = FALSE;
UINT64 DebugLevel = 0;
UINT64 VerboseLevel = 0;
EFI_STATUS Status = EFI_SUCCESS;
@@ -220,7 +219,6 @@
}
if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- QuietFlag = TRUE;
argc --;
argv ++;
continue;
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, 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
@@ -2801,7 +2801,6 @@
PE_COFF_LOADER_IMAGE_CONTEXT OrigImageContext;
EFI_PHYSICAL_ADDRESS XipBase;
EFI_PHYSICAL_ADDRESS NewPe32BaseAddress;
- EFI_PHYSICAL_ADDRESS *BaseToUpdate;
UINTN Index;
EFI_FILE_SECTION_POINTER CurrentPe32Section;
EFI_FFS_FILE_STATE SavedState;
@@ -2818,7 +2817,6 @@
Index = 0;
MemoryImagePointer = NULL;
- BaseToUpdate = NULL;
TEImageHeader = NULL;
ImgHdr = NULL;
SectionHeader = NULL;
@@ -2992,7 +2990,6 @@
}
NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- BaseToUpdate = &XipBase;
break;
case EFI_FV_FILETYPE_DRIVER:
@@ -3008,7 +3005,6 @@
return EFI_ABORTED;
}
NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- BaseToUpdate = &XipBase;
break;
default:
Modified: trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -738,10 +738,6 @@
UINT8 *Targ;
Elf32_Phdr *DynamicSegment;
Elf32_Phdr *TargetSegment;
- Elf_Sym *Sym;
- Elf_Shdr *SymtabShdr;
- UINT8 *Symtab;
-
for (Index = 0, FoundRelocations = FALSE; Index < mEhdr->e_shnum; Index++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Index);
@@ -750,16 +746,10 @@
if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
UINT32 RelIdx;
- SymtabShdr = GetShdrByIndex (RelShdr->sh_link);
- Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
FoundRelocations = TRUE;
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
Elf_Rel *Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
- Elf_Shdr *SymShdr;
- Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
- SymShdr = GetShdrByIndex (Sym->st_shndx);
-
if (mEhdr->e_machine == EM_386) {
switch (ELF_R_TYPE(Rel->r_info)) {
case R_386_NONE:
Modified: trunk/BaseTools/Source/C/GenFw/Elf64Convert.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/Elf64Convert.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFw/Elf64Convert.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -637,29 +637,17 @@
UINT32 Index;
EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
EFI_IMAGE_DATA_DIRECTORY *Dir;
- BOOLEAN FoundRelocations;
- Elf_Sym *Sym;
- Elf_Shdr *SymtabShdr;
- UINT8 *Symtab;
-
- for (Index = 0, FoundRelocations = FALSE; Index < mEhdr->e_shnum; Index++) {
+ for (Index = 0; Index < mEhdr->e_shnum; Index++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Index);
if ((RelShdr->sh_type == SHT_REL) || (RelShdr->sh_type == SHT_RELA)) {
Elf_Shdr *SecShdr = GetShdrByIndex (RelShdr->sh_info);
if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
UINT64 RelIdx;
- SymtabShdr = GetShdrByIndex (RelShdr->sh_link);
- Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
- FoundRelocations = TRUE;
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
Elf_Rela *Rel = (Elf_Rela *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
- Elf_Shdr *SymShdr;
- Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
- SymShdr = GetShdrByIndex (Sym->st_shndx);
-
if (mEhdr->e_machine == EM_X86_64) {
switch (ELF_R_TYPE(Rel->r_info)) {
case R_X86_64_NONE:
Modified: trunk/BaseTools/Source/C/GenSec/GenSec.c
===================================================================
--- trunk/BaseTools/Source/C/GenSec/GenSec.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenSec/GenSec.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, 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
@@ -915,7 +915,6 @@
{
UINT32 Index;
UINT32 InputFileNum;
- FILE *InFile;
FILE *OutFile;
CHAR8 **InputFileName;
CHAR8 *OutputFileName;
@@ -944,7 +943,6 @@
SectionName = NULL;
CompressionName = NULL;
StringBuffer = "";
- InFile = NULL;
OutFile = NULL;
VersionNumber = 0;
InputFileNum = 0;
Modified: trunk/BaseTools/Source/C/GenVtf/GenVtf.c
===================================================================
--- trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/**
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, 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
@@ -1141,7 +1141,6 @@
EFI_STATUS Status;
UINT64 CompStartAddress;
UINT64 FileSize;
- UINT64 NumByteRead;
UINT64 NumAdjustByte;
UINT8 *Buffer;
FILE *Fp;
@@ -1189,7 +1188,7 @@
//
// Read first 64 bytes of PAL header and use it to find version info
//
- NumByteRead = fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
+ fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
//
// PAL header contains the version info. Currently, we will use the header
@@ -1200,7 +1199,7 @@
}
}
- NumByteRead = fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
fclose (Fp);
//
@@ -1329,7 +1328,6 @@
UINT64 AbsAddress;
UINTN RelativeAddress;
UINT64 FileSize;
- UINT64 NumByteRead;
UINT8 *Buffer;
FILE *Fp;
FIT_TABLE *PalFitPtr;
@@ -1367,7 +1365,7 @@
//
// Read, Get version Info and discard the PAL header.
//
- NumByteRead = fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
+ fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
//
// Extract the version info from header of PAL_A. Once done, discrad this buffer
@@ -1379,7 +1377,7 @@
//
// Read PAL_A file in a buffer
//
- NumByteRead = fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
fclose (Fp);
PalStartAddress = Fv1EndAddress - (SIZE_TO_OFFSET_PAL_A_END + FileSize);
@@ -1759,7 +1757,6 @@
UINT8 *Buffer;
UINT8 *LocalVtfBuffer;
UINTN FileSize;
- UINTN NumByteRead;
FILE *Fp;
if (!strcmp (FileName, "")) {
@@ -1784,7 +1781,7 @@
return EFI_OUT_OF_RESOURCES;
}
- NumByteRead = fread (Buffer, sizeof (UINT8), FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), FileSize, Fp);
LocalVtfBuffer = (UINT8 *) Vtf1EndBuffer - SIZE_IA32_RESET_VECT;
memcpy (LocalVtfBuffer, Buffer, FileSize);
@@ -2121,7 +2118,6 @@
FILE *Fp;
UINT64 *StartAddressPtr;
UINTN FirstFwVSize;
- UINTN NumByte;
StartAddressPtr = malloc (sizeof (UINT64));
if (StartAddressPtr == NULL) {
@@ -2141,7 +2137,7 @@
FirstFwVSize = _filelength (fileno (Fp));
fseek (Fp, (long) (FirstFwVSize - (UINTN) (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT)), SEEK_SET);
- NumByte = fwrite ((VOID *) StartAddressPtr, sizeof (UINT64), 1, Fp);
+ fwrite ((VOID *) StartAddressPtr, sizeof (UINT64), 1, Fp);
if (Fp) {
fclose (Fp);
Modified: trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
===================================================================
--- trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2011, 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
@@ -305,7 +305,6 @@
char *argv[]
)
{
- CHAR8 *AppName;
INTN Index;
BOOLEAN ProcessMbr;
ERROR_STATUS Status;
@@ -319,7 +318,6 @@
ZeroMem(&InputPathInfo, sizeof(PATH_INFO));
ZeroMem(&OutputPathInfo, sizeof(PATH_INFO));
- AppName = *argv;
argv ++;
argc --;
Modified: trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
===================================================================
--- trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,19 @@
-/* LzmaEnc.c -- LZMA Encoder
-2009-02-02 : Igor Pavlov : Public domain */
+/** @file
+ Based on LZMA SDK 4.65:
+ LzmaEnc.c -- LZMA Encoder
+ 2009-02-02 : Igor Pavlov : Public domain
+ Copyright (c) 2011, 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
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
#include <string.h>
/* #define SHOW_STAT */
@@ -1919,11 +1932,13 @@
static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
{
UInt32 beforeSize = kNumOpts;
+ #ifdef COMPRESS_MF_MT
Bool btMode;
+ #endif
if (!RangeEnc_Alloc(&p->rc, alloc))
return SZ_ERROR_MEM;
+ #ifdef COMPRESS_MF_MT
btMode = (p->matchFinderBase.btMode != 0);
- #ifdef COMPRESS_MF_MT
p->mtMode = (p->multiThread && !p->fastMode && btMode);
#endif
Modified: trunk/BaseTools/Source/C/Split/Split.c
===================================================================
--- trunk/BaseTools/Source/C/Split/Split.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/Split/Split.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -2,7 +2,7 @@
Split a file into two pieces at the request offset.
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, 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
@@ -229,7 +229,6 @@
CHAR8 *CurrentDir = NULL;
UINT64 Index;
CHAR8 CharC;
- BOOLEAN QuietFlag = TRUE;
UINT64 DebugLevel = 0;
UINT64 VerboseLevel = 0;
@@ -307,7 +306,6 @@
}
if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- QuietFlag = TRUE;
argc --;
argv ++;
continue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|