Fix some errors to pass VS2015 compiler.
1. warning C4456: declaration of xxx hides previous local declaration
2. warning C4005: 'UINT8_MAX': macro redefinition
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19768
6f19259b-4bc3-4df7-8a09-
765794883524
/** @file\r
Elf32 Convert solution\r
\r
/** @file\r
Elf32 Convert solution\r
\r
-Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
\r
FoundRelocations = TRUE;\r
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {\r
\r
FoundRelocations = TRUE;\r
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {\r
- Elf_Rel *Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);\r
+ Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);\r
\r
if (mEhdr->e_machine == EM_386) { \r
switch (ELF_R_TYPE(Rel->r_info)) {\r
\r
if (mEhdr->e_machine == EM_386) { \r
switch (ELF_R_TYPE(Rel->r_info)) {\r
This file contains functions required to generate a boot strap file (BSF) also \r
known as the Volume Top File (VTF)\r
\r
This file contains functions required to generate a boot strap file (BSF) also \r
known as the Volume Top File (VTF)\r
\r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at\r
SymFileName = VTF_SYM_FILE;\r
} else {\r
INTN OutFileNameLen = strlen(OutFileName1);\r
SymFileName = VTF_SYM_FILE;\r
} else {\r
INTN OutFileNameLen = strlen(OutFileName1);\r
- for (Index = OutFileNameLen; Index > 0; --Index) {\r
- if (OutFileName1[Index] == '/' || OutFileName1[Index] == '\\') {\r
+ for (NewIndex = OutFileNameLen; NewIndex > 0; --NewIndex) {\r
+ if (OutFileName1[NewIndex] == '/' || OutFileName1[NewIndex] == '\\') {\r
SymFileName = VTF_SYM_FILE;\r
} else {\r
SymFileName = VTF_SYM_FILE;\r
} else {\r
- INTN SymFileNameLen = Index + 1 + strlen(VTF_SYM_FILE);\r
+ INTN SymFileNameLen = NewIndex + 1 + strlen(VTF_SYM_FILE);\r
SymFileName = malloc(SymFileNameLen + 1);\r
SymFileName = malloc(SymFileNameLen + 1);\r
- memcpy(SymFileName, OutFileName1, Index + 1);\r
- memcpy(SymFileName + Index + 1, VTF_SYM_FILE, strlen(VTF_SYM_FILE));\r
+ memcpy(SymFileName, OutFileName1, NewIndex + 1);\r
+ memcpy(SymFileName + NewIndex + 1, VTF_SYM_FILE, strlen(VTF_SYM_FILE));\r
SymFileName[SymFileNameLen] = '\0';\r
}\r
if (DebugMode) {\r
SymFileName[SymFileNameLen] = '\0';\r
}\r
if (DebugMode) {\r
prob = probs + RepLenCoder;\r
}\r
{\r
prob = probs + RepLenCoder;\r
}\r
{\r
- unsigned limit, offset;\r
CLzmaProb *probLen = prob + LenChoice;\r
IF_BIT_0(probLen)\r
{\r
CLzmaProb *probLen = prob + LenChoice;\r
IF_BIT_0(probLen)\r
{\r
LzmaEnc.c -- LZMA Encoder\r
2009-02-02 : Igor Pavlov : Public domain\r
\r
LzmaEnc.c -- LZMA Encoder\r
2009-02-02 : Igor Pavlov : Public domain\r
\r
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
-#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \\r
+#define BSR2_RET(pos, res) { UInt32 ij = 6 + ((kNumLogBits - 1) & \\r
(0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \\r
(0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \\r
- res = p->g_FastPos[pos >> i] + (i * 2); }\r
+ res = p->g_FastPos[pos >> ij] + (ij * 2); }\r
/*\r
#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \\r
p->g_FastPos[pos >> 6] + 12 : \\r
/*\r
#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \\r
p->g_FastPos[pos >> 6] + 12 : \\r
#ifdef SHOW_STAT2\r
if (position >= 0)\r
{\r
#ifdef SHOW_STAT2\r
if (position >= 0)\r
{\r
printf("\n pos = %4X", position);\r
printf("\n pos = %4X", position);\r
- for (i = cur; i <= lenEnd; i++)\r
- printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price);\r
+ for (ii = cur; ii <= lenEnd; ii++)\r
+ printf("\nprice[%4X] = %d", position - cur + ii, p->opt[ii].price);\r
}\r
#endif\r
\r
for (;;)\r
{\r
}\r
#endif\r
\r
for (;;)\r
{\r
- UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen;\r
- UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice;\r
+ UInt32 numAvailFull, newLen, posPrev, state, startLen;\r
+ UInt32 curPrice, curAnd1Price;\r
- Byte curByte, matchByte;\r
- const Byte *data;\r
COptimal *curOpt;\r
COptimal *nextOpt;\r
\r
COptimal *curOpt;\r
COptimal *nextOpt;\r
\r
prevOpt = &p->opt[posPrev];\r
if (pos < LZMA_NUM_REPS)\r
{\r
prevOpt = &p->opt[posPrev];\r
if (pos < LZMA_NUM_REPS)\r
{\r
reps[0] = prevOpt->backs[pos];\r
for (i = 1; i <= pos; i++)\r
reps[i] = prevOpt->backs[i - 1];\r
reps[0] = prevOpt->backs[pos];\r
for (i = 1; i <= pos; i++)\r
reps[i] = prevOpt->backs[i - 1];\r
reps[0] = (pos - LZMA_NUM_REPS);\r
for (i = 1; i < LZMA_NUM_REPS; i++)\r
reps[i] = prevOpt->backs[i - 1];\r
reps[0] = (pos - LZMA_NUM_REPS);\r
for (i = 1; i < LZMA_NUM_REPS; i++)\r
reps[i] = prevOpt->backs[i - 1];\r
GET_PRICE_1(p->isRep[state2]);\r
/* for (; lenTest2 >= 2; lenTest2--) */\r
{\r
GET_PRICE_1(p->isRep[state2]);\r
/* for (; lenTest2 >= 2; lenTest2--) */\r
{\r
- UInt32 curAndLenPrice;\r
COptimal *opt;\r
UInt32 offset = cur + 1 + lenTest2;\r
while (lenEnd < offset)\r
p->opt[++lenEnd].price = kInfinityPrice;\r
COptimal *opt;\r
UInt32 offset = cur + 1 + lenTest2;\r
while (lenEnd < offset)\r
p->opt[++lenEnd].price = kInfinityPrice;\r
- curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);\r
+ UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);\r
opt = &p->opt[offset];\r
if (curAndLenPrice < opt->price)\r
{\r
opt = &p->opt[offset];\r
if (curAndLenPrice < opt->price)\r
{\r
}\r
if (newLen >= startLen)\r
{\r
}\r
if (newLen >= startLen)\r
{\r
- UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);\r
+ normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);\r
UInt32 offs, curBack, posSlot;\r
UInt32 lenTest;\r
while (lenEnd < cur + newLen)\r
UInt32 offs, curBack, posSlot;\r
UInt32 lenTest;\r
while (lenEnd < cur + newLen)\r
GetPosSlot2(curBack, posSlot);\r
for (lenTest = /*2*/ startLen; ; lenTest++)\r
{\r
GetPosSlot2(curBack, posSlot);\r
for (lenTest = /*2*/ startLen; ; lenTest++)\r
{\r
- UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN];\r
+ UInt32 curAndLenPrice;\r
+ curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN];\r
UInt32 lenToPosState = GetLenToPosState(lenTest);\r
COptimal *opt;\r
if (curBack < kNumFullDistances)\r
UInt32 lenToPosState = GetLenToPosState(lenTest);\r
COptimal *opt;\r
if (curBack < kNumFullDistances)\r
/* for (; lenTest2 >= 2; lenTest2--) */\r
{\r
UInt32 offset = cur + lenTest + 1 + lenTest2;\r
/* for (; lenTest2 >= 2; lenTest2--) */\r
{\r
UInt32 offset = cur + lenTest + 1 + lenTest2;\r
- UInt32 curAndLenPrice;\r
- COptimal *opt;\r
while (lenEnd < offset)\r
p->opt[++lenEnd].price = kInfinityPrice;\r
curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);\r
while (lenEnd < offset)\r
p->opt[++lenEnd].price = kInfinityPrice;\r
curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);\r
\r
{\r
UInt32 *distancesPrices = p->distancesPrices[lenToPosState];\r
\r
{\r
UInt32 *distancesPrices = p->distancesPrices[lenToPosState];\r
for (i = 0; i < kStartPosModelIndex; i++)\r
distancesPrices[i] = posSlotPrices[i];\r
for (; i < kNumFullDistances; i++)\r
for (i = 0; i < kStartPosModelIndex; i++)\r
distancesPrices[i] = posSlotPrices[i];\r
for (; i < kNumFullDistances; i++)\r
/*++ @file\r
Vfr Syntax\r
\r
/*++ @file\r
Vfr Syntax\r
\r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
+#ifdef UINT8_MAX\r
+#undef UINT8_MAX\r
+#endif\r
#include "stdio.h"\r
#include "PBlackBox.h"\r
#include "DLexerBase.h"\r
#include "stdio.h"\r
#include "PBlackBox.h"\r
#include "DLexerBase.h"\r