Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct format specifiers #810

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
CHECK_ERR(err, "inflateEnd");

if (d_stream.total_out != 2*uncomprLen + comprLen/2) {
fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
fprintf(stderr, "bad large inflate: %lu\n", d_stream.total_out);
exit(1);
} else {
printf("large_inflate(): OK\n");
Expand Down
2 changes: 1 addition & 1 deletion test/minigzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static char *strwinerror (error)
LocalFree(msgbuf);
}
else {
sprintf(buf, "unknown win32 error (%ld)", error);
sprintf(buf, "unknown win32 error (%u)", error);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%u or %lu?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DWORD is unsigned int (yeah I know) on windows

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DWORD is unsigned int

DWORD is unsigned long

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

SetLastError(lasterr);
Expand Down
12 changes: 6 additions & 6 deletions trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ local int build_bl_tree(s)
}
/* Update opt_len to include the bit length tree and counts */
s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
Tracev((stderr, "\ndyn trees: dyn %lu, stat %lu",
s->opt_len, s->static_len));

return max_blindex;
Expand Down Expand Up @@ -848,13 +848,13 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
}
Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
Tracev((stderr, "\nbl tree: sent %lu", s->bits_sent));

send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1); /* literal tree */
Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
Tracev((stderr, "\nlit tree: sent %lu", s->bits_sent));

send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1); /* distance tree */
Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
Tracev((stderr, "\ndist tree: sent %lu", s->bits_sent));
}

/* ===========================================================================
Expand Down Expand Up @@ -927,11 +927,11 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)

/* Construct the literal and distance trees */
build_tree(s, (tree_desc *)(&(s->l_desc)));
Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
Tracev((stderr, "\nlit data: dyn %lu, stat %lu", s->opt_len,
s->static_len));

build_tree(s, (tree_desc *)(&(s->d_desc)));
Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
Tracev((stderr, "\ndist data: dyn %lu, stat %lu", s->opt_len,
s->static_len));
/* At this point, opt_len and static_len are the total bit lengths of
* the compressed block data, excluding the tree representations.
Expand Down