Skip to content

Commit

Permalink
Fix -Werror=vla-parameter errors with GCC 11.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jbms committed Sep 14, 2021
1 parent 62662f8 commit 27dd726
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion c/common/shared_dictionary.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ void BrotliSharedDictionaryDestroyInstance(

BROTLI_BOOL BrotliSharedDictionaryAttach(
BrotliSharedDictionary* dict, BrotliSharedDictionaryType type,
size_t data_size, const uint8_t* data) {
size_t data_size, const uint8_t data[BROTLI_ARRAY_PARAM(data_size)]) {
if (!dict) {
return BROTLI_FALSE;
}
Expand Down
5 changes: 3 additions & 2 deletions c/dec/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,8 +1494,9 @@ static int CopyFromCompoundDictionary(BrotliDecoderState* s, int pos) {
return pos - orig_pos;
}

BROTLI_BOOL BrotliDecoderAttachDictionary(BrotliDecoderState* state,
BrotliSharedDictionaryType type, size_t data_size, const uint8_t* data) {
BROTLI_BOOL BrotliDecoderAttachDictionary(
BrotliDecoderState* state, BrotliSharedDictionaryType type,
size_t data_size, const uint8_t data[BROTLI_ARRAY_PARAM(data_size)]) {
uint32_t i;
uint32_t num_prefix_before = state->dictionary->num_prefix;
if (state->state != BROTLI_STATE_UNINITED) return BROTLI_FALSE;
Expand Down
4 changes: 2 additions & 2 deletions c/enc/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,8 +1974,8 @@ uint32_t BrotliEncoderVersion(void) {
}

BrotliEncoderPreparedDictionary* BrotliEncoderPrepareDictionary(
BrotliSharedDictionaryType type, size_t size, const uint8_t* data,
int quality,
BrotliSharedDictionaryType type, size_t size,
const uint8_t data[BROTLI_ARRAY_PARAM(size)], int quality,
brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque) {
ManagedDictionary* managed_dictionary = NULL;
if (type != BROTLI_SHARED_DICTIONARY_RAW &&
Expand Down

0 comments on commit 27dd726

Please sign in to comment.