Fix VLA parameter warning (#893)

Make VLA buffer types consistent in declarations and definitions.
Resolves build crash when using -Werror due to "vla-parameter" warning.

Signed-off-by: Adrian Herrera <adr.her.arc.95@gmail.com>
This commit is contained in:
Adrián Herrera Arcila 2021-06-23 08:53:59 +01:00 committed by GitHub
parent bdcfb123c8
commit 0a3944c8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -2033,8 +2033,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
} }
BrotliDecoderResult BrotliDecoderDecompress( BrotliDecoderResult BrotliDecoderDecompress(
size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size, size_t encoded_size,
uint8_t* decoded_buffer) { const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
size_t* decoded_size,
uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
BrotliDecoderState s; BrotliDecoderState s;
BrotliDecoderResult result; BrotliDecoderResult result;
size_t total_out = 0; size_t total_out = 0;

View File

@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
BROTLI_BOOL BrotliEncoderCompress( BROTLI_BOOL BrotliEncoderCompress(
int quality, int lgwin, BrotliEncoderMode mode, size_t input_size, int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
const uint8_t* input_buffer, size_t* encoded_size, const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
uint8_t* encoded_buffer) { size_t* encoded_size,
uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
BrotliEncoderState* s; BrotliEncoderState* s;
size_t out_size = *encoded_size; size_t out_size = *encoded_size;
const uint8_t* input_start = input_buffer; const uint8_t* input_start = input_buffer;