projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Backport changes from the grammar branch
[SXSI/XMLTree.git]
/
libcds
/
src
/
coders
/
huffman_codes.cpp
diff --git
a/libcds/src/coders/huffman_codes.cpp
b/libcds/src/coders/huffman_codes.cpp
index
a3ccf1a
..
d11458d
100644
(file)
--- a/
libcds/src/coders/huffman_codes.cpp
+++ b/
libcds/src/coders/huffman_codes.cpp
@@
-20,6
+20,7
@@
*/
#include <huffman_codes.h>
*/
#include <huffman_codes.h>
+using std::max;
huffman_codes::huffman_codes(uint * symb, uint n) {
uint max_v = 0;
huffman_codes::huffman_codes(uint * symb, uint n) {
uint max_v = 0;
@@
-39,7
+40,7
@@
huffman_codes::huffman_codes(uchar * symb, uint n) {
for(uint i=0;i<n;i++)
max_v = max(max_v,symb[i]);
uint * occ = new uint[max_v+1];
for(uint i=0;i<n;i++)
max_v = max(max_v,symb[i]);
uint * occ = new uint[max_v+1];
- for(uint i=0;i<max_v+1;i++)
+ for(uint i=0;i<
(uint)
max_v+1;i++)
occ[i] = 0;
for(uint i=0;i<n;i++)
occ[symb[i]]++;
occ[i] = 0;
for(uint i=0;i<n;i++)
occ[symb[i]]++;