audk/MdePkg/Library/BaseLib
Laszlo Ersek cce01f538f MdePkg/BaseLib: Base64Decode(): don't declare variables in nested blocks
The EDK II C Coding Standards Specification (v2.20) strongly discourages
variable declarations in nested block scope:

5       Source Files
5.4     Code File Structure
5.4.1   Scoping Rules
5.4.1.1 Scope

> Block (local) Scope
>
> [...]
>
> Data declarations may follow the opening brace of a compound statement,
> regardless of nesting depth, and before any code generating statements
> have been entered. Other than at the outermost block of a function body,
> this type of declaration is strongly discouraged.

Hoist such variable declarations in Base64Decode() to the outermost
function scope.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Fixes: 35e242b698
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1980
Reported-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daude <philmd@redhat.com>
2019-07-17 16:36:57 +02:00
..
AArch64 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
Arm MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
Ebc MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
Ia32 MdePkg/BaseLib: Remove LongJump.c and SetJump.c 2019-04-15 09:12:44 +08:00
X64 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
ARShiftU64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseLib.inf MdePkg/BaseLib: Use PcdSpeculationBarrierType 2019-04-30 16:39:15 -07:00
BaseLib.uni MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseLibInternals.h MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BitField.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
CheckSum.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
ChkStkGcc.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
Cpu.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
CpuDeadLoop.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DivS64x64Remainder.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DivU64x32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DivU64x32Remainder.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DivU64x64Remainder.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
FilePaths.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
GetPowerOfTwo32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
GetPowerOfTwo64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
HighBitSet32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
HighBitSet64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
LRotU32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
LRotU64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
LShiftU64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
LinkedList.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
LongJump.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
LowBitSet32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
LowBitSet64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
Math64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
ModU64x32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
MultS64x64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
MultU64x32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
MultU64x64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
RRotU32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
RRotU64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
RShiftU64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SafeString.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SetJump.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
String.c MdePkg/BaseLib: Base64Decode(): don't declare variables in nested blocks 2019-07-17 16:36:57 +02:00
SwapBytes16.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SwapBytes32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SwapBytes64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SwitchStack.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
Unaligned.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86DisablePaging32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86DisablePaging64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86EnablePaging32.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86EnablePaging64.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86FxRestore.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86FxSave.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86GetInterruptState.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86MemoryFence.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86Msr.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86PatchInstruction.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86RdRand.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86ReadGdtr.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86ReadIdtr.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86SpeculationBarrier.c MdePkg/BaseLib: Use PcdSpeculationBarrierType 2019-04-30 16:39:15 -07:00
X86Thunk.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86WriteGdtr.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
X86WriteIdtr.c MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00