From f769ba85bf1544f6662821d5b90cd4efbb6ea813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 26 Oct 2015 21:04:12 +0100 Subject: [PATCH 1/2] Fix function prototypes --- dec/streams.c | 2 +- dec/streams.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dec/streams.c b/dec/streams.c index f7060a9..007c513 100644 --- a/dec/streams.c +++ b/dec/streams.c @@ -99,7 +99,7 @@ int BrotliNullOutputFunction(void* data , const uint8_t* buf, size_t count) { return (int)count; } -BrotliOutput BrotliNullOutput() { +BrotliOutput BrotliNullOutput(void) { BrotliOutput out; out.cb_ = BrotliNullOutputFunction; out.data_ = NULL; diff --git a/dec/streams.h b/dec/streams.h index decfa7e..99eb125 100644 --- a/dec/streams.h +++ b/dec/streams.h @@ -95,7 +95,7 @@ BrotliOutput BrotliFileOutput(FILE* f); /* Output callback that does nothing, always consumes the whole input. */ int BrotliNullOutputFunction(void* data, const uint8_t* buf, size_t count); -BrotliOutput BrotliNullOutput(); +BrotliOutput BrotliNullOutput(void); #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ From b9e413faa690048a1334a786fa206fb6428bd458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 26 Oct 2015 21:20:22 +0100 Subject: [PATCH 2/2] Make internal decoder functions static Affected functions: WriteRingBuffer, CopyUncompressedBlockToOutput, BrotliAllocateRingBuffer --- dec/decode.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dec/decode.c b/dec/decode.c index eb91ce3..eec0914 100644 --- a/dec/decode.c +++ b/dec/decode.c @@ -762,8 +762,8 @@ static void DecodeBlockTypeWithContext(BrotliState* s, s->context_lookup2 = &kContextLookup[kContextLookupOffsets[context_mode + 1]]; } -BrotliResult WriteRingBuffer(BrotliOutput output, - BrotliState* s) { +static BrotliResult WriteRingBuffer(BrotliOutput output, + BrotliState* s) { int num_written; if (s->meta_block_remaining_len < 0) { return BROTLI_FAILURE(); @@ -784,9 +784,8 @@ BrotliResult WriteRingBuffer(BrotliOutput output, return BROTLI_RESULT_SUCCESS; } -BrotliResult BROTLI_NOINLINE CopyUncompressedBlockToOutput(BrotliOutput output, - int pos, - BrotliState* s) { +static BrotliResult BROTLI_NOINLINE CopyUncompressedBlockToOutput( + BrotliOutput output, int pos, BrotliState* s) { BrotliResult result; int num_read; int nbytes; @@ -918,8 +917,8 @@ int BrotliDecompressedSize(size_t encoded_size, processed. When this method is called, metablock size and flags MUST be decoded. */ -int BROTLI_NOINLINE BrotliAllocateRingBuffer(BrotliState* s, - BrotliBitReader* br) { +static int BROTLI_NOINLINE BrotliAllocateRingBuffer(BrotliState* s, + BrotliBitReader* br) { static const int kRingBufferWriteAheadSlack = BROTLI_READ_SIZE; int is_last = s->is_last_metablock; s->ringbuffer_size = 1 << s->window_bits;