~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug in utoi(), which made it ignore a leading minus sign when
[sgt/halibut]
/
deflate.c
diff --git
a/deflate.c
b/deflate.c
index
33c70cc
..
ecae0d0
100644
(file)
--- a/
deflate.c
+++ b/
deflate.c
@@
-95,7
+95,7
@@
#define debug_int(x...) ( fprintf(stderr, x) )
#define debug(x) ( debug_int x )
#else
#define debug_int(x...) ( fprintf(stderr, x) )
#define debug(x) ( debug_int x )
#else
-#define debug(x)
+#define debug(x)
((void)0)
#endif
#ifdef STANDALONE
#endif
#ifdef STANDALONE
@@
-651,8
+651,8
@@
struct deflate_compress_ctx {
unsigned long datasize;
int lastblock;
int finished;
unsigned long datasize;
int lastblock;
int finished;
- unsigned char static_len1[28
6
], static_len2[30];
- int static_code1[28
6
], static_code2[30];
+ unsigned char static_len1[28
8
], static_len2[30];
+ int static_code1[28
8
], static_code2[30];
struct huftrees sht;
#ifdef STATISTICS
unsigned long bitcount;
struct huftrees sht;
#ifdef STATISTICS
unsigned long bitcount;
@@
-912,7
+912,8
@@
static void deflate_buildhuf(int *freqs, unsigned char *lengths,
* assert()-level confident that the resulting code lengths
* contain nothing outside the permitted range.
*/
* assert()-level confident that the resulting code lengths
* contain nothing outside the permitted range.
*/
- maxprob = (limit == 16 ? 2584 : 55); /* no point in computing full F_n */
+ assert(limit == 15 || limit == 7);
+ maxprob = (limit == 15 ? 2584 : 55); /* no point in computing full F_n */
totalfreq = nactivesyms = 0;
smallestfreq = -1;
for (i = 0; i < nsyms; i++) {
totalfreq = nactivesyms = 0;
smallestfreq = -1;
for (i = 0; i < nsyms; i++) {
@@
-1575,11
+1576,11
@@
deflate_compress_ctx *deflate_compress_new(int type)
{
int i;
{
int i;
- for (i = 0; i < lenof(out->static_len1); i++)
+ for (i = 0; i <
(int)
lenof(out->static_len1); i++)
out->static_len1[i] = (i < 144 ? 8 :
i < 256 ? 9 :
i < 280 ? 7 : 8);
out->static_len1[i] = (i < 144 ? 8 :
i < 256 ? 9 :
i < 280 ? 7 : 8);
- for (i = 0; i < lenof(out->static_len2); i++)
+ for (i = 0; i <
(int)
lenof(out->static_len2); i++)
out->static_len2[i] = 5;
}
hufcodes(out->static_len1, out->static_code1, lenof(out->static_code1));
out->static_len2[i] = 5;
}
hufcodes(out->static_len1, out->static_code1, lenof(out->static_code1));
@@
-2040,7
+2041,8
@@
int deflate_decompress_data(deflate_decompress_ctx *dctx,
{
const coderecord *rec;
const unsigned char *block = (const unsigned char *)vblock;
{
const coderecord *rec;
const unsigned char *block = (const unsigned char *)vblock;
- int code, bfinal, btype, rep, dist, nlen, header, cksum;
+ int code, bfinal, btype, rep, dist, nlen, header;
+ unsigned long cksum;
int error = 0;
if (len == 0) {
int error = 0;
if (len == 0) {