Skip to content

Commit

Permalink
Fix C++ ODR Violations
Browse files Browse the repository at this point in the history
**Issue:**
aws/aws-sdk-cpp#2137

**Description of Changes:**
Rename `decoder_state` -> `huffman_decoder_state` to avoid collision with same-named struct in aws-c-http.
  • Loading branch information
graebm committed Nov 8, 2022
1 parent ba9a6a5 commit 828e4f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/huffman.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ int aws_huffman_encode(

/* Decode's reading is written in a helper function,
so this struct helps avoid passing all the parameters through by hand */
struct decoder_state {
struct huffman_decoder_state {
struct aws_huffman_decoder *decoder;
struct aws_byte_cursor *input_cursor;
};

static void decode_fill_working_bits(struct decoder_state *state) {
static void decode_fill_working_bits(struct huffman_decoder_state *state) {

/* Read from bytes in the buffer until there are enough bytes to process */
while (state->decoder->num_bits < MAX_PATTERN_BITS && state->input_cursor->len) {
Expand All @@ -220,7 +220,7 @@ int aws_huffman_decode(
AWS_ASSERT(to_decode);
AWS_ASSERT(output);

struct decoder_state state;
struct huffman_decoder_state state;
state.decoder = decoder;
state.input_cursor = to_decode;

Expand Down

0 comments on commit 828e4f8

Please sign in to comment.