summaryrefslogtreecommitdiffstats
path: root/libpng/infcodes.c
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-07 17:23:32 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-07 17:23:32 (GMT)
commit63962ead8b355c4c93d5e442ab0a26005e1b863f (patch)
treec38e1a43019260d8c13223b0bab64424c575dfcb /libpng/infcodes.c
parentde20cde3d47c58a69c25afe75e4c476d61dbe631 (diff)
downloadDoxygen-63962ead8b355c4c93d5e442ab0a26005e1b863f.zip
Doxygen-63962ead8b355c4c93d5e442ab0a26005e1b863f.tar.gz
Doxygen-63962ead8b355c4c93d5e442ab0a26005e1b863f.tar.bz2
Release-1.2.15-20020407
Diffstat (limited to 'libpng/infcodes.c')
-rw-r--r--libpng/infcodes.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/libpng/infcodes.c b/libpng/infcodes.c
index d4e5ee9..a6e6f9f 100644
--- a/libpng/infcodes.c
+++ b/libpng/infcodes.c
@@ -1,5 +1,5 @@
/* infcodes.c -- process literals and length/distance pairs
- * Copyright (C) 1995-1998 Mark Adler
+ * Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -56,11 +56,11 @@ struct inflate_codes_state {
};
-inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
-uInt bl, bd;
-inflate_huft *tl;
-inflate_huft *td; /* need separate declaration for Borland C++ */
-z_streamp z;
+inflate_codes_statef *inflate_codes_new(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, z_streamp z)
+
+
+ /* need separate declaration for Borland C++ */
+
{
inflate_codes_statef *c;
@@ -78,10 +78,7 @@ z_streamp z;
}
-int inflate_codes(s, z, r)
-inflate_blocks_statef *s;
-z_streamp z;
-int r;
+int inflate_codes(inflate_blocks_statef *s, z_streamp z, int r)
{
uInt j; /* temporary storage */
inflate_huft *t; /* temporary pointer */
@@ -196,15 +193,9 @@ int r;
Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
c->mode = COPY;
case COPY: /* o: copying bytes in window, waiting for space */
-#ifndef __TURBOC__ /* Turbo C bug for following expression */
- f = (uInt)(q - s->window) < c->sub.copy.dist ?
- s->end - (c->sub.copy.dist - (q - s->window)) :
- q - c->sub.copy.dist;
-#else
f = q - c->sub.copy.dist;
- if ((uInt)(q - s->window) < c->sub.copy.dist)
- f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
-#endif
+ while (f < s->window) /* modulo window size-"while" instead */
+ f += s->end - s->window; /* of "if" handles invalid distances */
while (c->len)
{
NEEDOUT
@@ -248,9 +239,7 @@ int r;
}
-void inflate_codes_free(c, z)
-inflate_codes_statef *c;
-z_streamp z;
+void inflate_codes_free(inflate_codes_statef *c, z_streamp z)
{
ZFREE(z, c);
Tracev((stderr, "inflate: codes free\n"));