MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
7c7184e201
commit
1436aea4d5
@@ -11,13 +11,12 @@
|
||||
#include "Sdk/C/7zVersion.h"
|
||||
#include "Sdk/C/LzmaDec.h"
|
||||
|
||||
#define SCRATCH_BUFFER_REQUEST_SIZE SIZE_64KB
|
||||
#define SCRATCH_BUFFER_REQUEST_SIZE SIZE_64KB
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ISzAlloc Functions;
|
||||
VOID *Buffer;
|
||||
UINTN BufferSize;
|
||||
typedef struct {
|
||||
ISzAlloc Functions;
|
||||
VOID *Buffer;
|
||||
UINTN BufferSize;
|
||||
} ISzAllocWithData;
|
||||
|
||||
/**
|
||||
@@ -30,18 +29,18 @@ typedef struct
|
||||
**/
|
||||
VOID *
|
||||
SzAlloc (
|
||||
CONST ISzAlloc *P,
|
||||
size_t Size
|
||||
CONST ISzAlloc *P,
|
||||
size_t Size
|
||||
)
|
||||
{
|
||||
VOID *Addr;
|
||||
ISzAllocWithData *Private;
|
||||
VOID *Addr;
|
||||
ISzAllocWithData *Private;
|
||||
|
||||
Private = (ISzAllocWithData*) P;
|
||||
Private = (ISzAllocWithData *)P;
|
||||
|
||||
if (Private->BufferSize >= Size) {
|
||||
Addr = Private->Buffer;
|
||||
Private->Buffer = (VOID*) ((UINT8*)Addr + Size);
|
||||
Addr = Private->Buffer;
|
||||
Private->Buffer = (VOID *)((UINT8 *)Addr + Size);
|
||||
Private->BufferSize -= Size;
|
||||
return Addr;
|
||||
} else {
|
||||
@@ -58,8 +57,8 @@ SzAlloc (
|
||||
**/
|
||||
VOID
|
||||
SzFree (
|
||||
CONST ISzAlloc *P,
|
||||
VOID *Address
|
||||
CONST ISzAlloc *P,
|
||||
VOID *Address
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -69,7 +68,7 @@ SzFree (
|
||||
//
|
||||
}
|
||||
|
||||
#define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8)
|
||||
#define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8)
|
||||
|
||||
/**
|
||||
Get the size of the uncompressed buffer by parsing EncodeData header.
|
||||
@@ -79,17 +78,18 @@ SzFree (
|
||||
@return The size of the uncompressed buffer.
|
||||
**/
|
||||
UINT64
|
||||
GetDecodedSizeOfBuf(
|
||||
UINT8 *EncodedData
|
||||
GetDecodedSizeOfBuf (
|
||||
UINT8 *EncodedData
|
||||
)
|
||||
{
|
||||
UINT64 DecodedSize;
|
||||
INTN Index;
|
||||
UINT64 DecodedSize;
|
||||
INTN Index;
|
||||
|
||||
/* Parse header */
|
||||
DecodedSize = 0;
|
||||
for (Index = LZMA_PROPS_SIZE + 7; Index >= LZMA_PROPS_SIZE; Index--)
|
||||
DecodedSize = LShiftU64(DecodedSize, 8) + EncodedData[Index];
|
||||
for (Index = LZMA_PROPS_SIZE + 7; Index >= LZMA_PROPS_SIZE; Index--) {
|
||||
DecodedSize = LShiftU64 (DecodedSize, 8) + EncodedData[Index];
|
||||
}
|
||||
|
||||
return DecodedSize;
|
||||
}
|
||||
@@ -143,15 +143,15 @@ LzmaUefiDecompressGetInfo (
|
||||
{
|
||||
UInt64 DecodedSize;
|
||||
|
||||
ASSERT(SourceSize >= LZMA_HEADER_SIZE);
|
||||
ASSERT (SourceSize >= LZMA_HEADER_SIZE);
|
||||
|
||||
DecodedSize = GetDecodedSizeOfBuf((UINT8*)Source);
|
||||
DecodedSize = GetDecodedSizeOfBuf ((UINT8 *)Source);
|
||||
if (DecodedSize > MAX_UINT32) {
|
||||
return RETURN_UNSUPPORTED;
|
||||
}
|
||||
|
||||
*DestinationSize = (UINT32)DecodedSize;
|
||||
*ScratchSize = SCRATCH_BUFFER_REQUEST_SIZE;
|
||||
*ScratchSize = SCRATCH_BUFFER_REQUEST_SIZE;
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -192,25 +192,25 @@ LzmaUefiDecompress (
|
||||
SizeT EncodedDataSize;
|
||||
ISzAllocWithData AllocFuncs;
|
||||
|
||||
AllocFuncs.Functions.Alloc = SzAlloc;
|
||||
AllocFuncs.Functions.Free = SzFree;
|
||||
AllocFuncs.Buffer = Scratch;
|
||||
AllocFuncs.BufferSize = SCRATCH_BUFFER_REQUEST_SIZE;
|
||||
AllocFuncs.Functions.Alloc = SzAlloc;
|
||||
AllocFuncs.Functions.Free = SzFree;
|
||||
AllocFuncs.Buffer = Scratch;
|
||||
AllocFuncs.BufferSize = SCRATCH_BUFFER_REQUEST_SIZE;
|
||||
|
||||
DecodedBufSize = (SizeT)GetDecodedSizeOfBuf((UINT8*)Source);
|
||||
EncodedDataSize = (SizeT) (SourceSize - LZMA_HEADER_SIZE);
|
||||
DecodedBufSize = (SizeT)GetDecodedSizeOfBuf ((UINT8 *)Source);
|
||||
EncodedDataSize = (SizeT)(SourceSize - LZMA_HEADER_SIZE);
|
||||
|
||||
LzmaResult = LzmaDecode(
|
||||
Destination,
|
||||
&DecodedBufSize,
|
||||
(Byte*)((UINT8*)Source + LZMA_HEADER_SIZE),
|
||||
&EncodedDataSize,
|
||||
Source,
|
||||
LZMA_PROPS_SIZE,
|
||||
LZMA_FINISH_END,
|
||||
&Status,
|
||||
&(AllocFuncs.Functions)
|
||||
);
|
||||
LzmaResult = LzmaDecode (
|
||||
Destination,
|
||||
&DecodedBufSize,
|
||||
(Byte *)((UINT8 *)Source + LZMA_HEADER_SIZE),
|
||||
&EncodedDataSize,
|
||||
Source,
|
||||
LZMA_PROPS_SIZE,
|
||||
LZMA_FINISH_END,
|
||||
&Status,
|
||||
&(AllocFuncs.Functions)
|
||||
);
|
||||
|
||||
if (LzmaResult == SZ_OK) {
|
||||
return RETURN_SUCCESS;
|
||||
@@ -218,4 +218,3 @@ LzmaUefiDecompress (
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user