Hash :
60b32e16
        
        Author :
  
        
        Date :
2002-11-06T22:32:54
        
      
2002-11-05  David Turner  <david@freetype.org>
        * include/freetype/config/ftoption.h, src/gzip/ftgzip.c: added
        support for the FT_CONFIG_OPTION_SYSTEM_ZLIB option, used to specify
        the use of system-wide zlib.
        Note that this macro, as well as FT_CONFIG_OPTION_BYTECODE_INTERPRETER,
        is not #undef-ed anymore. This allows the build system to define them
        depending on the configuration (typically by adding -D flags at
        compile time).
        * src/sfnt/ttcmap0.c (tt_face_build_cmaps): removed compiler warnings
        in optimized mode relative to the "volatile" local variables. This was
        not a compiler bug after all, but the fact that a pointer to a volatile
        variable is not the same than a volatile pointer to a variable :-)
        the fix was to change  "volatile FT_Byte*  p"
        into                   "FT_Byte* volatile  p"
        * src/pfr/pfrload.c, src/pfr/pfrdrivr.c, src/gzip/inftrees.c: removed
        compiler warnings in optimized modes
        * src/gzip/*.[hc]: modified our ZLib copy in order to prevent exporting
        any zlib function names outside of the component. This prevents linking
        problems on some platforms, when applications want to link FreeType
        _and_ ZLib together.
2002-11-05  Juliusz  <jch@pps.jussieu.fr>
        * src/psaux/psobjs.c (ps_table_add): modified increment loop in
        order to implement exponential behaviour
      
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
/* inflate_util.c -- data and routines common to blocks and codes
 * Copyright (C) 1995-2002 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h
 */
#include "zutil.h"
#include "infblock.h"
#include "inftrees.h"
#include "infcodes.h"
#include "infutil.h"
/* And'ing with mask[n] masks the lower n bits */
local uInt inflate_mask[17] = {
    0x0000,
    0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
    0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
/* copy as much as possible from the sliding window to the output area */
local int inflate_flush(s, z, r)
inflate_blocks_statef *s;
z_streamp z;
int r;
{
  uInt n;
  Bytef *p;
  Bytef *q;
  /* local copies of source and destination pointers */
  p = z->next_out;
  q = s->read;
  /* compute number of bytes to copy as far as end of window */
  n = (uInt)((q <= s->write ? s->write : s->end) - q);
  if (n > z->avail_out) n = z->avail_out;
  if (n && r == Z_BUF_ERROR) r = Z_OK;
  /* update counters */
  z->avail_out -= n;
  z->total_out += n;
  /* update check information */
  if (s->checkfn != Z_NULL)
    z->adler = s->check = (*s->checkfn)(s->check, q, n);
  /* copy as far as end of window */
  zmemcpy(p, q, n);
  p += n;
  q += n;
  /* see if more to copy at beginning of window */
  if (q == s->end)
  {
    /* wrap pointers */
    q = s->window;
    if (s->write == s->end)
      s->write = s->window;
    /* compute bytes to copy */
    n = (uInt)(s->write - q);
    if (n > z->avail_out) n = z->avail_out;
    if (n && r == Z_BUF_ERROR) r = Z_OK;
    /* update counters */
    z->avail_out -= n;
    z->total_out += n;
    /* update check information */
    if (s->checkfn != Z_NULL)
      z->adler = s->check = (*s->checkfn)(s->check, q, n);
    /* copy */
    zmemcpy(p, q, n);
    p += n;
    q += n;
  }
  /* update pointers */
  z->next_out = p;
  s->read = q;
  /* done */
  return r;
}