Diff for /embedaddon/rsync/zlib/zutil.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/17 15:09:30 version 1.1.1.2, 2013/10/14 07:51:14
Line 1 Line 1
 /* zutil.c -- target dependent utility functions for the compression library  /* zutil.c -- target dependent utility functions for the compression library
 * Copyright (C) 1995-2005 Jean-loup Gailly. * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h   * For conditions of distribution and use, see copyright notice in zlib.h
  */   */
   
 /* @(#) $Id$ */  /* @(#) $Id$ */
   
 #include "zutil.h"  #include "zutil.h"
   #ifndef Z_SOLO
   #  include "gzguts.h"
   #endif
   
 #ifndef NO_DUMMY_DECL  #ifndef NO_DUMMY_DECL
 struct internal_state      {int dummy;}; /* for buggy compilers */  struct internal_state      {int dummy;}; /* for buggy compilers */
 #endif  #endif
   
const char * const z_errmsg[10] = {z_const char * const z_errmsg[10] = {
 "need dictionary",     /* Z_NEED_DICT       2  */  "need dictionary",     /* Z_NEED_DICT       2  */
 "stream end",          /* Z_STREAM_END      1  */  "stream end",          /* Z_STREAM_END      1  */
 "",                    /* Z_OK              0  */  "",                    /* Z_OK              0  */
Line 34  uLong ZEXPORT zlibCompileFlags() Line 37  uLong ZEXPORT zlibCompileFlags()
     uLong flags;      uLong flags;
   
     flags = 0;      flags = 0;
    switch (sizeof(uInt)) {    switch ((int)(sizeof(uInt))) {
     case 2:     break;                          /* CONSTANT CONDITION */      case 2:     break;                          /* CONSTANT CONDITION */
     case 4:     flags += 1;     break;          /* CONSTANT CONDITION */      case 4:     flags += 1;     break;          /* CONSTANT CONDITION */
     case 8:     flags += 2;     break;          /* CONSTANT CONDITION */      case 8:     flags += 2;     break;          /* CONSTANT CONDITION */
     default:    flags += 3;      default:    flags += 3;
     }      }
    switch (sizeof(uLong)) {    switch ((int)(sizeof(uLong))) {
     case 2:     break;                          /* CONSTANT CONDITION */      case 2:     break;                          /* CONSTANT CONDITION */
     case 4:     flags += 1 << 2;        break;  /* CONSTANT CONDITION */      case 4:     flags += 1 << 2;        break;  /* CONSTANT CONDITION */
     case 8:     flags += 2 << 2;        break;  /* CONSTANT CONDITION */      case 8:     flags += 2 << 2;        break;  /* CONSTANT CONDITION */
     default:    flags += 3 << 2;      default:    flags += 3 << 2;
     }      }
    switch (sizeof(voidpf)) {    switch ((int)(sizeof(voidpf))) {
     case 2:     break;                          /* CONSTANT CONDITION */      case 2:     break;                          /* CONSTANT CONDITION */
     case 4:     flags += 1 << 4;        break;  /* CONSTANT CONDITION */      case 4:     flags += 1 << 4;        break;  /* CONSTANT CONDITION */
     case 8:     flags += 2 << 4;        break;  /* CONSTANT CONDITION */      case 8:     flags += 2 << 4;        break;  /* CONSTANT CONDITION */
     default:    flags += 3 << 4;      default:    flags += 3 << 4;
     }      }
    switch (sizeof(z_off_t)) {    switch ((int)(sizeof(z_off_t))) {
     case 2:     break;                          /* CONSTANT CONDITION */      case 2:     break;                          /* CONSTANT CONDITION */
     case 4:     flags += 1 << 6;        break;  /* CONSTANT CONDITION */      case 4:     flags += 1 << 6;        break;  /* CONSTANT CONDITION */
     case 8:     flags += 2 << 6;        break;  /* CONSTANT CONDITION */      case 8:     flags += 2 << 6;        break;  /* CONSTANT CONDITION */
Line 85  uLong ZEXPORT zlibCompileFlags() Line 88  uLong ZEXPORT zlibCompileFlags()
 #ifdef FASTEST  #ifdef FASTEST
     flags += 1L << 21;      flags += 1L << 21;
 #endif  #endif
#ifdef STDC#if defined(STDC) || defined(Z_HAVE_STDARG_H)
 #  ifdef NO_vsnprintf  #  ifdef NO_vsnprintf
        flags += 1L << 25;    flags += 1L << 25;
 #    ifdef HAS_vsprintf_void  #    ifdef HAS_vsprintf_void
        flags += 1L << 26;    flags += 1L << 26;
 #    endif  #    endif
 #  else  #  else
 #    ifdef HAS_vsnprintf_void  #    ifdef HAS_vsnprintf_void
        flags += 1L << 26;    flags += 1L << 26;
 #    endif  #    endif
 #  endif  #  endif
 #else  #else
        flags += 1L << 24;    flags += 1L << 24;
 #  ifdef NO_snprintf  #  ifdef NO_snprintf
        flags += 1L << 25;    flags += 1L << 25;
 #    ifdef HAS_sprintf_void  #    ifdef HAS_sprintf_void
        flags += 1L << 26;    flags += 1L << 26;
 #    endif  #    endif
 #  else  #  else
 #    ifdef HAS_snprintf_void  #    ifdef HAS_snprintf_void
        flags += 1L << 26;    flags += 1L << 26;
 #    endif  #    endif
 #  endif  #  endif
 #endif  #endif
Line 117  uLong ZEXPORT zlibCompileFlags() Line 120  uLong ZEXPORT zlibCompileFlags()
 #  ifndef verbose  #  ifndef verbose
 #    define verbose 0  #    define verbose 0
 #  endif  #  endif
int z_verbose = verbose;int ZLIB_INTERNAL z_verbose = verbose;
   
void z_error (m)void ZLIB_INTERNAL z_error (m)
     char *m;      char *m;
 {  {
     fprintf(stderr, "%s\n", m);      fprintf(stderr, "%s\n", m);
Line 146  const char * ZEXPORT zError(err) Line 149  const char * ZEXPORT zError(err)
   
 #ifndef HAVE_MEMCPY  #ifndef HAVE_MEMCPY
   
void zmemcpy(dest, source, len)void ZLIB_INTERNAL zmemcpy(dest, source, len)
     Bytef* dest;      Bytef* dest;
     const Bytef* source;      const Bytef* source;
     uInt  len;      uInt  len;
Line 157  void zmemcpy(dest, source, len) Line 160  void zmemcpy(dest, source, len)
     } while (--len != 0);      } while (--len != 0);
 }  }
   
int zmemcmp(s1, s2, len)int ZLIB_INTERNAL zmemcmp(s1, s2, len)
     const Bytef* s1;      const Bytef* s1;
     const Bytef* s2;      const Bytef* s2;
     uInt  len;      uInt  len;
Line 170  int zmemcmp(s1, s2, len) Line 173  int zmemcmp(s1, s2, len)
     return 0;      return 0;
 }  }
   
void zmemzero(dest, len)void ZLIB_INTERNAL zmemzero(dest, len)
     Bytef* dest;      Bytef* dest;
     uInt  len;      uInt  len;
 {  {
Line 181  void zmemzero(dest, len) Line 184  void zmemzero(dest, len)
 }  }
 #endif  #endif
   
   #ifndef Z_SOLO
   
 #ifdef SYS16BIT  #ifdef SYS16BIT
   
Line 213  local ptr_table table[MAX_PTR]; Line 217  local ptr_table table[MAX_PTR];
  * a protected system like OS/2. Use Microsoft C instead.   * a protected system like OS/2. Use Microsoft C instead.
  */   */
   
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
 {  {
     voidpf buf = opaque; /* just to make some compilers happy */      voidpf buf = opaque; /* just to make some compilers happy */
     ulg bsize = (ulg)items*size;      ulg bsize = (ulg)items*size;
Line 237  voidpf zcalloc (voidpf opaque, unsigned items, unsigne Line 241  voidpf zcalloc (voidpf opaque, unsigned items, unsigne
     return buf;      return buf;
 }  }
   
void  zcfree (voidpf opaque, voidpf ptr)void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
 {  {
     int n;      int n;
     if (*(ush*)&ptr != 0) { /* object < 64K */      if (*(ush*)&ptr != 0) { /* object < 64K */
Line 272  void  zcfree (voidpf opaque, voidpf ptr) Line 276  void  zcfree (voidpf opaque, voidpf ptr)
 #  define _hfree   hfree  #  define _hfree   hfree
 #endif  #endif
   
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
 {  {
     if (opaque) opaque = 0; /* to make compiler happy */      if (opaque) opaque = 0; /* to make compiler happy */
     return _halloc((long)items, size);      return _halloc((long)items, size);
 }  }
   
void  zcfree (voidpf opaque, voidpf ptr)void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
 {  {
     if (opaque) opaque = 0; /* to make compiler happy */      if (opaque) opaque = 0; /* to make compiler happy */
     _hfree(ptr);      _hfree(ptr);
Line 297  extern voidp  calloc OF((uInt items, uInt size)); Line 301  extern voidp  calloc OF((uInt items, uInt size));
 extern void   free   OF((voidpf ptr));  extern void   free   OF((voidpf ptr));
 #endif  #endif
   
voidpf zcalloc (opaque, items, size)voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
     voidpf opaque;      voidpf opaque;
     unsigned items;      unsigned items;
     unsigned size;      unsigned size;
Line 307  voidpf zcalloc (opaque, items, size) Line 311  voidpf zcalloc (opaque, items, size)
                               (voidpf)calloc(items, size);                                (voidpf)calloc(items, size);
 }  }
   
void  zcfree (opaque, ptr)void ZLIB_INTERNAL zcfree (opaque, ptr)
     voidpf opaque;      voidpf opaque;
     voidpf ptr;      voidpf ptr;
 {  {
Line 316  void  zcfree (opaque, ptr) Line 320  void  zcfree (opaque, ptr)
 }  }
   
 #endif /* MY_ZCALLOC */  #endif /* MY_ZCALLOC */
   
   #endif /* !Z_SOLO */

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>