audk/MdePkg/Library
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
..
BaseCacheMaintenanceLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseCpuLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseDebugLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseDebugLibSerialPort MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseDebugPrintErrorLevelLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseExtractGuidedSectionLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseIoLibIntrinsic MdePkg/BaseIoLibIntrinsic: Remove IoLibIcc.c 2019-04-24 10:23:21 +08:00
BaseLib MdePkg/BaseLib: Base64Decode(): don't declare variables in nested blocks 2019-07-17 16:36:57 +02:00
BaseMemoryLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseMemoryLibMmx MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseMemoryLibOptDxe MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseMemoryLibOptPei MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseMemoryLibRepStr MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseMemoryLibSse2 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseOrderedCollectionRedBlackTreeLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePcdLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePciCf8Lib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePciExpressLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePciLibCf8 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePciLibPciExpress MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePciSegmentInfoLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePciSegmentLibPci MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePeCoffExtraActionLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePeCoffGetEntryPointLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePeCoffLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePerformanceLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePostCodeLibDebug MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePostCodeLibPort80 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BasePrintLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseReportStatusCodeLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseRngLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseS3BootScriptLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseS3IoLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseS3PciLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseS3PciSegmentLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseS3SmbusLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseS3StallLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseSafeIntLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseSerialPortLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseSmbusLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseStackCheckLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseSynchronizationLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseTimerLibNullTemplate MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
BaseUefiDecompressLib MdePkg: Merge TianoCustomDecompress algorithm into 2019-05-15 20:48:26 +08:00
DxeCoreEntryPoint MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeCoreHobLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeExtractGuidedSectionLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeHobLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeHstiLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeIoLibCpuIo2 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxePcdLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeRuntimeDebugLibSerialPort MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeRuntimePciExpressLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeServicesLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeServicesTableLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
DxeSmbusLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
MmServicesTableLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PciSegmentLibSegmentInfo MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiCoreEntryPoint MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiDxePostCodeLibReportStatusCode MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiExtractGuidedSectionLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiHobLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiIoLibCpuIo MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiMemoryAllocationLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiMemoryLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiPcdLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiPciLibPciCfg2 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiPciSegmentLibPciCfg2 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiResourcePublicationLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiServicesLib MdePkg/PeiServicesLib.c: Change comments of PeiServicesResetSystem2 2019-04-28 09:40:12 +08:00
PeiServicesTablePointerLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiServicesTablePointerLibIdt MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeiSmbusLibSmbus2Ppi MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
PeimEntryPoint MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SecPeiDxeTimerLibCpu MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmiHandlerProfileLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmIoLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmIoLibSmmCpuIo2 MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmLibNull MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmMemLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmMemoryAllocationLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmPciExpressLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmPciLibPciRootBridgeIo MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmPeriodicSmiLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
SmmServicesTableLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
StandaloneMmDriverEntryPoint MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
StandaloneMmServicesTableLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiApplicationEntryPoint MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiBootServicesTableLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiDebugLibConOut MdePkg/UefiDebugLibConOut: make global variable static 2019-04-28 10:54:27 +08:00
UefiDebugLibDebugPortProtocol MdePkg/UefiDebugLibDebugPortProtocol: make global variable static 2019-04-28 10:54:27 +08:00
UefiDebugLibStdErr MdePkg/UefiDebugLibStdErr: make global variable static 2019-04-28 10:54:27 +08:00
UefiDevicePathLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiDevicePathLibDevicePathProtocol MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiDriverEntryPoint MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiFileHandleLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiMemoryAllocationLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiMemoryLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiPciLibPciRootBridgeIo MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiPciSegmentLibPciRootBridgeIo MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiRuntimeLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiRuntimeServicesTableLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiScsiLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00
UefiUsbLib MdePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:13 -07:00