Skip to content

Commit 895499e

Browse files
committed
MdeModulePkg/BrotliCustomDecompressLib: Correct BrotliDecompress
DestSize should have been received and passed as a pointer in order to successfully pass the output value. The existence of this error was spotted by XCODE5 toolchain, which gave: BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used As discussed in tianocore/edk2#11729, since the method is in fact internal and only called in one place, and since the DestSize return value is in fact unused, instead of fixing the parameter and method call we instead remove the parameter, also marking the method STATIC and renaming it to ...Internal. Signed-off-by: Mike Beaton <[email protected]>
1 parent 67e679b commit 895499e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ BrFree (
6868
@param Source The source buffer containing the compressed data.
6969
@param SourceSize The size of source buffer.
7070
@param Destination The destination buffer to store the decompressed data.
71-
@param DestSize The destination buffer size.
7271
@param BuffInfo The pointer to the BROTLI_BUFF instance.
7372
7473
@retval EFI_SUCCESS Decompression completed successfully, and
@@ -77,12 +76,12 @@ BrFree (
7776
The source buffer specified by Source is corrupted
7877
(not in a valid compressed format).
7978
**/
79+
STATIC
8080
EFI_STATUS
81-
BrotliDecompress (
81+
BrotliDecompressInternal (
8282
IN CONST VOID *Source,
8383
IN UINTN SourceSize,
8484
IN OUT VOID *Destination,
85-
IN OUT UINTN *DestSize,
8685
IN VOID *BuffInfo
8786
)
8887
{
@@ -157,8 +156,6 @@ BrotliDecompress (
157156
CopyMem (Temp, Output, (size_t)(NextOut - Output));
158157
}
159158

160-
*DestSize = TotalOut;
161-
162159
BrFree (BuffInfo, Input);
163160
BrFree (BuffInfo, Output);
164161
BrotliDecoderDestroyInstance (BroState);
@@ -276,7 +273,6 @@ BrotliUefiDecompress (
276273
IN OUT VOID *Scratch
277274
)
278275
{
279-
UINTN DestSize = 0;
280276
EFI_STATUS Status;
281277
BROTLI_BUFF BroBuff;
282278
UINT64 GetSize;
@@ -288,11 +284,10 @@ BrotliUefiDecompress (
288284
BroBuff.Buff = Scratch;
289285
BroBuff.BuffSize = (UINTN)GetSize;
290286

291-
Status = BrotliDecompress (
287+
Status = BrotliDecompressInternal (
292288
(VOID *)((UINT8 *)Source + BROTLI_SCRATCH_MAX),
293289
SourceSize - BROTLI_SCRATCH_MAX,
294290
Destination,
295-
&DestSize,
296291
(VOID *)(&BroBuff)
297292
);
298293

0 commit comments

Comments
 (0)