The R Project SVN R

Rev

Rev 17798 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17798 Rev 18679
Line 1... Line 1...
1
/* infcodes.c -- process literals and length/distance pairs
1
/* infcodes.c -- process literals and length/distance pairs
2
 * Copyright (C) 1995-1998 Mark Adler
2
 * Copyright (C) 1995-2002 Mark Adler
3
 * For conditions of distribution and use, see copyright notice in zlib.h 
3
 * For conditions of distribution and use, see copyright notice in zlib.h 
4
 */
4
 */
5
 
5
 
6
#include "zutil.h"
6
#include "zutil.h"
7
#include "inftrees.h"
7
#include "inftrees.h"
Line 194... Line 194...
194
      c->sub.copy.dist += (uInt)b & inflate_mask[j];
194
      c->sub.copy.dist += (uInt)b & inflate_mask[j];
195
      DUMPBITS(j)
195
      DUMPBITS(j)
196
      Tracevv((stderr, "inflate:         distance %u\n", c->sub.copy.dist));
196
      Tracevv((stderr, "inflate:         distance %u\n", c->sub.copy.dist));
197
      c->mode = COPY;
197
      c->mode = COPY;
198
    case COPY:          /* o: copying bytes in window, waiting for space */
198
    case COPY:          /* o: copying bytes in window, waiting for space */
199
#ifndef __TURBOC__ /* Turbo C bug for following expression */
-
 
200
      f = (uInt)(q - s->window) < c->sub.copy.dist ?
-
 
201
          s->end - (c->sub.copy.dist - (q - s->window)) :
-
 
202
          q - c->sub.copy.dist;
-
 
203
#else
-
 
204
      f = q - c->sub.copy.dist;
199
      f = q - c->sub.copy.dist;
205
      if ((uInt)(q - s->window) < c->sub.copy.dist)
200
      while (f < s->window)             /* modulo window size-"while" instead */
206
        f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
201
        f += s->end - s->window;        /* of "if" handles invalid distances */
207
#endif
-
 
208
      while (c->len)
202
      while (c->len)
209
      {
203
      {
210
        NEEDOUT
204
        NEEDOUT
211
        OUTBYTE(*f++)
205
        OUTBYTE(*f++)
212
        if (f == s->end)
206
        if (f == s->end)