Skip to content

Commit

Permalink
BuildHuffmanTable: clear int sanitizer warning
Browse files Browse the repository at this point in the history
clears a warning of the form:
implicit conversion from type 'int' of value -1 (32-bit, signed) to type
'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit,
unsigned)

Bug: b/229626362
Change-Id: I397fbd59bd3e6d787fcec1344b6230958b28d22c
  • Loading branch information
jzern committed Aug 9, 2022
1 parent 3a9a4d4 commit 892cf03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/huffman_utils.c
Expand Up @@ -142,7 +142,7 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,

{
int step; // step size to replicate values in current table
uint32_t low = -1; // low bits for current root entry
uint32_t low = 0xffffffffu; // low bits for current root entry
uint32_t mask = total_size - 1; // mask for low bits
uint32_t key = 0; // reversed prefix code
int num_nodes = 1; // number of Huffman tree nodes
Expand Down

0 comments on commit 892cf03

Please sign in to comment.