Menu

#1 Doesn't work if MAX_SYMBOLS > 256

open
nobody
None
5
2010-12-02
2010-12-02
No

If MAX_SYMBOLS is #define'd greater than 256 the Huffman table isnt' built correctly. In huffman_node struct, 'symbol' is defined as 'unsigned char', and in new_leaf_node the 'symbol' parameter is also defined as 'unsigned char' which limits the symbol values to be within 0...255. I just redefined 'symbol' at those two places to be 'unsigned int' and it (seems to) work.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB