[Xorg-commit] xc/extras/freetype2/src/gzip ftgzip.c,1.1,1.1.4.1 infblock.c,1.1,1.1.4.1 inffixed.h,1.1,1.1.4.1 inftrees.c,1.1,1.1.4.1 inftrees.h,1.1,1.1.4.1 infutil.c,1.1,1.1.4.1 infutil.h,1.1,1.1.4.1 rules.mk,1.1,1.1.4.1 zutil.h,1.1,1.1.4.1

Kaleb Keithley xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007


Committed by: kaleb

Update of /cvs/xorg/xc/extras/freetype2/src/gzip
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/extras/freetype2/src/gzip

Modified Files:
      Tag: XORG-CURRENT
	ftgzip.c infblock.c inffixed.h inftrees.c inftrees.h infutil.c 
	infutil.h rules.mk zutil.h 
Log Message:
merge most of XFree86 RC3 (4.3.99.903) from vendor branch.
bug #214


Index: ftgzip.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/ftgzip.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/ftgzip.c	25 Nov 2003 19:27:19 -0000	1.1
+++ b/ftgzip.c	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -2,13 +2,13 @@
 /*                                                                         */
 /*  ftgzip.c                                                               */
 /*                                                                         */
-/*    FreeType support for .gz compressed fileds                           */
+/*    FreeType support for .gz compressed files.                           */
 /*                                                                         */
 /*  this optional component relies on zlib. It should mainly be used to    */
 /*  parse compressed PCF fonts, as found with many X11 server              */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -18,49 +18,68 @@
 /*  understand and accept it fully.                                        */
 /*                                                                         */
 /***************************************************************************/
-/* $XFree86: xc/extras/freetype2/src/gzip/ftgzip.c,v 1.2 2003/05/29 14:53:28 dawes Exp $ */
+
 
 #include <ft2build.h>
 #include FT_INTERNAL_MEMORY_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_DEBUG_H
-#if 0
 #include <string.h>
-#endif
+
+
+#include FT_MODULE_ERRORS_H
+
+#undef __FTERRORS_H__
+
+#define FT_ERR_PREFIX  Gzip_Err_
+#define FT_ERR_BASE    FT_Mod_Err_Gzip
+
+#include FT_ERRORS_H
+
 
 #ifdef FT_CONFIG_OPTION_USE_ZLIB
 
 #ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
 
-#  include <zlib.h>
+#include <zlib.h>
 
-#else /* !SYSTEM_ZLIB */
+#else /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
- /* in this case, we include our own modified sources of the ZLib   */
- /* within the "ftgzip" component. The modifications were necessary */
- /* to #include all files without conflicts, as well as preventing  */
- /* the definition of "extern" functions that may cause linking     */
- /* conflicts when a program is linked with both FreeType and the   */
- /* original ZLib                                                   */
+ /* In this case, we include our own modified sources of the ZLib    */
+ /* within the "ftgzip" component.  The modifications were necessary */
+ /* to #include all files without conflicts, as well as preventing   */
+ /* the definition of "extern" functions that may cause linking      */
+ /* conflicts when a program is linked with both FreeType and the    */
+ /* original ZLib.                                                   */
 
-#  define  NO_DUMMY_DECL
-#  define  BUILDFIXED    /* save code size */
-#  define  MY_ZCALLOC
+#define NO_DUMMY_DECL
+#define MY_ZCALLOC
 
-#  include "zlib.h"
+#include "zlib.h"
 
-#    undef   SLOW
-#    define  SLOW  1  /* we can't use asm-optimized sources here !! */
+#undef  SLOW
+#define SLOW  1  /* we can't use asm-optimized sources here! */
 
-#    include "zutil.c"
-#    include "inftrees.c"
-#    include "infcodes.c"
-#    include "infutil.c"
-#    include "infblock.c"
-#    include "inflate.c"
-#    include "adler32.c"
+  /* Urgh.  `inflate_mask' must not be declared twice -- C++ doesn't like
+     this.  We temporarily disable it and load all necessary header files. */
+#define NO_INFLATE_MASK
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#undef  NO_INFLATE_MASK
 
-#endif /* !SYSTEM_ZLIB */
+  /* infutil.c must be included before infcodes.c */
+#include "zutil.c"
+#include "inftrees.c"
+#include "infutil.c"
+#include "infcodes.c"
+#include "infblock.c"
+#include "inflate.c"
+#include "adler32.c"
+
+#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
 /***************************************************************************/
@@ -71,48 +90,48 @@
 /***************************************************************************/
 /***************************************************************************/
 
- /* it's better to use FreeType memory routines instead of raw 'malloc/free' */
+  /* it is better to use FreeType memory routines instead of raw
+     'malloc/free' */
 
+  static voidpf
+  ft_gzip_alloc( FT_Memory  memory,
+                 uInt       items,
+                 uInt       size )
+  {
+    FT_ULong    sz = (FT_ULong)size * items;
+    FT_Pointer  p;
 
- static voidpf
- ft_gzip_alloc( FT_Memory  memory,
-                uInt       items,
-                uInt       size )
- {
-   FT_ULong    sz = (FT_ULong)size * items;
-   FT_Pointer  p;
 
-   FT_MEM_ALLOC( p, sz );
+    FT_MEM_ALLOC( p, sz );
 
-   return (voidpf) p;
- }
+    return (voidpf) p;
+  }
 
 
- static void
- ft_gzip_free( FT_Memory  memory,
-               voidpf     address )
- {
-   FT_MEM_FREE( address );
- }
+  static void
+  ft_gzip_free( FT_Memory  memory,
+                voidpf     address )
+  {
+    FT_MEM_FREE( address );
+  }
 
 
 #ifndef FT_CONFIG_OPTION_SYSTEM_ZLIB
 
- local voidpf
- zcalloc ( /* opaque, items, size) */
-    voidpf opaque,
-    unsigned items,
-    unsigned size )
- {
-   return ft_gzip_alloc( opaque, items, size );
- }
+  local voidpf
+  zcalloc ( voidpf    opaque,
+            unsigned  items,
+            unsigned  size )
+  {
+    return ft_gzip_alloc( (FT_Memory)opaque, items, size );
+  }
 
- local void
- zcfree( voidpf  opaque,
-         voidpf  ptr )
- {
-   ft_gzip_free( opaque, ptr );
- }
+  local void
+  zcfree( voidpf  opaque,
+          voidpf  ptr )
+  {
+    ft_gzip_free( (FT_Memory)opaque, ptr );
+  }
 
 #endif /* !SYSTEM_ZLIB */
 
@@ -127,25 +146,25 @@
 
 #define  FT_GZIP_BUFFER_SIZE          4096
 
-  typedef struct FT_GZipFileRec_
+  typedef struct  FT_GZipFileRec_
   {
-    FT_Stream    source;         /* parent/source stream        */
-    FT_Stream    stream;         /* embedding stream            */
-    FT_Memory    memory;         /* memory allocator            */
-    z_stream     zstream;        /* zlib input stream           */
+    FT_Stream  source;         /* parent/source stream        */
+    FT_Stream  stream;         /* embedding stream            */
+    FT_Memory  memory;         /* memory allocator            */
+    z_stream   zstream;        /* zlib input stream           */
 
-    FT_ULong     start;          /* starting position, after .gz header */
-    FT_Byte      input[ FT_GZIP_BUFFER_SIZE ];  /* input read buffer */
+    FT_ULong   start;          /* starting position, after .gz header */
+    FT_Byte    input[FT_GZIP_BUFFER_SIZE];  /* input read buffer */
 
-    FT_Byte      buffer[ FT_GZIP_BUFFER_SIZE ];  /* output buffer      */
-    FT_ULong     pos;                            /* position in output */
-    FT_Byte*     cursor;
-    FT_Byte*     limit;
+    FT_Byte    buffer[FT_GZIP_BUFFER_SIZE];  /* output buffer      */
+    FT_ULong   pos;                          /* position in output */
+    FT_Byte*   cursor;
+    FT_Byte*   limit;
 
   } FT_GZipFileRec, *FT_GZipFile;
 
 
-/* gzip flag byte */
+  /* gzip flag byte */
 #define FT_GZIP_ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
 #define FT_GZIP_HEAD_CRC     0x02 /* bit 1 set: header CRC present */
 #define FT_GZIP_EXTRA_FIELD  0x04 /* bit 2 set: extra field present */
@@ -154,25 +173,26 @@
 #define FT_GZIP_RESERVED     0xE0 /* bits 5..7: reserved */
 
 
- /* check and skip .gz header - we don't support "transparent" compression */
+  /* check and skip .gz header - we don't support "transparent" compression */
   static FT_Error
   ft_gzip_check_header( FT_Stream  stream )
   {
     FT_Error  error;
     FT_Byte   head[4];
 
+
     if ( FT_STREAM_SEEK( 0 )       ||
          FT_STREAM_READ( head, 4 ) )
       goto Exit;
 
-    /* head[0] && head[1] are the magic numbers     */
+    /* head[0] && head[1] are the magic numbers;    */
     /* head[2] is the method, and head[3] the flags */
     if ( head[0] != 0x1f              ||
          head[1] != 0x8b              ||
          head[2] != Z_DEFLATED        ||
         (head[3] & FT_GZIP_RESERVED)  )
     {
-      error = FT_Err_Invalid_File_Format;
+      error = Gzip_Err_Invalid_File_Format;
       goto Exit;
     }
 
@@ -184,6 +204,7 @@
     {
       FT_UInt  len;
 
+
       if ( FT_READ_USHORT_LE( len ) ||
            FT_STREAM_SKIP( len )    )
         goto Exit;
@@ -195,7 +216,8 @@
       {
         FT_UInt  c;
 
-        if ( FT_READ_BYTE( c) )
+
+        if ( FT_READ_BYTE( c ) )
           goto Exit;
 
         if ( c == 0 )
@@ -208,7 +230,8 @@
       {
         FT_UInt  c;
 
-        if ( FT_READ_BYTE( c) )
+
+        if ( FT_READ_BYTE( c ) )
           goto Exit;
 
         if ( c == 0 )
@@ -225,15 +248,15 @@
   }
 
 
-
   static FT_Error
-  ft_gzip_file_init( FT_GZipFile   zip,
-                     FT_Stream     stream,
-                     FT_Stream     source )
+  ft_gzip_file_init( FT_GZipFile  zip,
+                     FT_Stream    stream,
+                     FT_Stream    source )
   {
     z_stream*  zstream = &zip->zstream;
     FT_Error   error   = 0;
 
+
     zip->stream = stream;
     zip->source = source;
     zip->memory = stream->memory;
@@ -247,7 +270,7 @@
       stream = source;
 
       error = ft_gzip_check_header( stream );
-      if (error)
+      if ( error )
         goto Exit;
 
       zip->start = FT_STREAM_POS();
@@ -264,7 +287,7 @@
     if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK ||
          zstream->next_in == NULL                     )
     {
-      error = FT_Err_Invalid_File_Format;
+      error = Gzip_Err_Invalid_File_Format;
       goto Exit;
     }
 
@@ -273,7 +296,6 @@
   }
 
 
-
   static void
   ft_gzip_file_done( FT_GZipFile  zip )
   {
@@ -302,10 +324,12 @@
     FT_Stream  stream = zip->source;
     FT_Error   error;
 
+
     if ( !FT_STREAM_SEEK( zip->start ) )
     {
       z_stream*  zstream = &zip->zstream;
 
+
       inflateReset( zstream );
 
       zstream->avail_in  = 0;
@@ -328,11 +352,13 @@
     FT_Stream  stream  = zip->source;
     FT_ULong   size;
 
+
     if ( stream->read )
     {
-      size = stream->read( stream, stream->pos, zip->input, FT_GZIP_BUFFER_SIZE );
+      size = stream->read( stream, stream->pos, zip->input,
+                           FT_GZIP_BUFFER_SIZE );
       if ( size == 0 )
-        return FT_Err_Invalid_Stream_Operation;
+        return Gzip_Err_Invalid_Stream_Operation;
     }
     else
     {
@@ -341,7 +367,7 @@
         size = FT_GZIP_BUFFER_SIZE;
 
       if ( size == 0 )
-       return FT_Err_Invalid_Stream_Operation;
+        return Gzip_Err_Invalid_Stream_Operation;
 
       FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
     }
@@ -354,13 +380,13 @@
   }
 
 
-
   static FT_Error
   ft_gzip_file_fill_output( FT_GZipFile  zip )
   {
     z_stream*  zstream = &zip->zstream;
     FT_Error   error   = 0;
 
+
     zip->cursor        = zip->buffer;
     zstream->next_out  = zip->cursor;
     zstream->avail_out = FT_GZIP_BUFFER_SIZE;
@@ -369,6 +395,7 @@
     {
       int  err;
 
+
       if ( zstream->avail_in == 0 )
       {
         error = ft_gzip_file_fill_input( zip );
@@ -381,12 +408,13 @@
       if ( err == Z_STREAM_END )
       {
         zip->limit = zstream->next_out;
-        error      = FT_Err_Invalid_Stream_Operation;
+        if ( zip->limit == zip->cursor )
+          error = Gzip_Err_Invalid_Stream_Operation;
         break;
       }
       else if ( err != Z_OK )
       {
-        error = FT_Err_Invalid_Stream_Operation;
+        error = Gzip_Err_Invalid_Stream_Operation;
         break;
       }
     }
@@ -394,7 +422,7 @@
   }
 
 
- /* fill output buffer, 'count' must be <= FT_GZIP_BUFFER_SIZE */
+  /* fill output buffer; `count' must be <= FT_GZIP_BUFFER_SIZE */
   static FT_Error
   ft_gzip_file_skip_output( FT_GZipFile  zip,
                             FT_ULong     count )
@@ -402,6 +430,7 @@
     FT_Error   error   = 0;
     FT_ULong   delta;
 
+
     for (;;)
     {
       delta = (FT_ULong)( zip->limit - zip->cursor );
@@ -425,27 +454,29 @@
 
 
   static FT_ULong
-  ft_gzip_file_io( FT_GZipFile   zip,
-                   FT_ULong      pos,
-                   FT_Byte*      buffer,
-                   FT_ULong      count )
+  ft_gzip_file_io( FT_GZipFile  zip,
+                   FT_ULong     pos,
+                   FT_Byte*     buffer,
+                   FT_ULong     count )
   {
-    FT_ULong   result = 0;
-    FT_Error   error;
+    FT_ULong  result = 0;
+    FT_Error  error;
 
-    /* reset inflate stream if we're seeking backwards        */
-    /* yes, that's not too efficient, but it saves memory :-) */
+
+    /* Reset inflate stream if we're seeking backwards.        */
+    /* Yes, that is not too efficient, but it saves memory :-) */
     if ( pos < zip->pos )
     {
       error = ft_gzip_file_reset( zip );
-      if ( error ) goto Exit;
+      if ( error )
+        goto Exit;
     }
 
     /* skip unwanted bytes */
     if ( pos > zip->pos )
     {
       error = ft_gzip_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );
-      if (error)
+      if ( error )
         goto Exit;
     }
 
@@ -455,7 +486,8 @@
     /* now read the data */
     for (;;)
     {
-      FT_ULong   delta;
+      FT_ULong  delta;
+
 
       delta = (FT_ULong)( zip->limit - zip->cursor );
       if ( delta >= count )
@@ -472,7 +504,7 @@
         break;
 
       error = ft_gzip_file_fill_output( zip );
-      if (error)
+      if ( error )
         break;
     }
 
@@ -492,9 +524,10 @@
   static void
   ft_gzip_stream_close( FT_Stream  stream )
   {
-    FT_GZipFile  zip    = stream->descriptor.pointer;
+    FT_GZipFile  zip    = (FT_GZipFile)stream->descriptor.pointer;
     FT_Memory    memory = stream->memory;
 
+
     if ( zip )
     {
       /* finalize gzip file descriptor */
@@ -508,25 +541,27 @@
 
 
   static FT_ULong
-  ft_gzip_stream_io( FT_Stream   stream,
-                     FT_ULong    pos,
-                     FT_Byte*    buffer,
-                     FT_ULong    count )
+  ft_gzip_stream_io( FT_Stream  stream,
+                     FT_ULong   pos,
+                     FT_Byte*   buffer,
+                     FT_ULong   count )
   {
-    FT_GZipFile  zip = stream->descriptor.pointer;
+    FT_GZipFile  zip = (FT_GZipFile)stream->descriptor.pointer;
+
 
     return ft_gzip_file_io( zip, pos, buffer, count );
   }
 
 
   FT_EXPORT_DEF( FT_Error )
-  FT_Stream_OpenGzip( FT_Stream    stream,
-                      FT_Stream    source )
+  FT_Stream_OpenGzip( FT_Stream  stream,
+                      FT_Stream  source )
   {
     FT_Error     error;
     FT_Memory    memory = source->memory;
     FT_GZipFile  zip;
 
+
     FT_ZERO( stream );
     stream->memory = memory;
 
@@ -542,7 +577,7 @@
       stream->descriptor.pointer = zip;
     }
 
-     stream->size = 0x7FFFFFFF;  /* don't know the real size !! */
+    stream->size  = 0x7FFFFFFFL;  /* don't know the real size! */
     stream->pos   = 0;
     stream->base  = 0;
     stream->read  = ft_gzip_stream_io;
@@ -555,13 +590,16 @@
 #else  /* !FT_CONFIG_OPTION_USE_ZLIB */
 
   FT_EXPORT_DEF( FT_Error )
-  FT_Stream_OpenGzip( FT_Stream    stream,
-                      FT_Stream    source )
+  FT_Stream_OpenGzip( FT_Stream  stream,
+                      FT_Stream  source )
   {
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
-    return FT_Err_Unimplemented_Feature;
+    return Gzip_Err_Unimplemented_Feature;
   }
 
 #endif /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+
+/* END */

Index: infblock.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/infblock.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/infblock.c	25 Nov 2003 19:27:19 -0000	1.1
+++ b/infblock.c	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -156,7 +156,8 @@
             uInt bl, bd;
             inflate_huft *tl, *td;
 
-            inflate_trees_fixed(&bl, &bd, &tl, &td, z);
+            inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl,
+                                          (const inflate_huft**)&td, z);
             s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
             if (s->sub.decode.codes == Z_NULL)
             {

Index: inffixed.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/inffixed.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/inffixed.h	25 Nov 2003 19:27:19 -0000	1.1
+++ b/inffixed.h	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -7,9 +7,9 @@
    subject to change. Applications should only use zlib.h.
  */
 
-local uInt fixed_bl = 9;
-local uInt fixed_bd = 5;
-local inflate_huft fixed_tl[] = {
+local const uInt fixed_bl = 9;
+local const uInt fixed_bd = 5;
+local const inflate_huft fixed_tl[] = {
     {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
     {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
     {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
@@ -139,7 +139,7 @@
     {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
     {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
   };
-local inflate_huft fixed_td[] = {
+local const inflate_huft fixed_td[] = {
     {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
     {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
     {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},

Index: inftrees.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/inftrees.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/inftrees.c	25 Nov 2003 19:27:19 -0000	1.1
+++ b/inftrees.c	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -401,11 +401,11 @@
 
 
 local int inflate_trees_fixed( /* bl, bd, tl, td, z) */
-uIntf *bl,               /* literal desired/actual bit depth */
-uIntf *bd,               /* distance desired/actual bit depth */
-inflate_huft * FAR *tl,  /* literal/length tree result */
-inflate_huft * FAR *td,  /* distance tree result */
-z_streamp z              /* for memory allocation */
+uIntf *bl,                      /* literal desired/actual bit depth */
+uIntf *bd,                      /* distance desired/actual bit depth */
+const inflate_huft * FAR *tl,   /* literal/length tree result */
+const inflate_huft * FAR *td,   /* distance tree result */
+z_streamp z                     /* for memory allocation */
 )
 {
 #ifdef BUILDFIXED
@@ -451,6 +451,8 @@
     ZFREE(z, c);
     fixed_built = 1;
   }
+#else
+  FT_UNUSED(z);
 #endif
   *bl = fixed_bl;
   *bd = fixed_bd;

Index: inftrees.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/inftrees.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/inftrees.h	25 Nov 2003 19:27:19 -0000	1.1
+++ b/inftrees.h	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -56,8 +56,8 @@
 local  int inflate_trees_fixed OF((
     uIntf *,                    /* literal desired/actual bit depth */
     uIntf *,                    /* distance desired/actual bit depth */
-    inflate_huft * FAR *,       /* literal/length tree result */
-    inflate_huft * FAR *,       /* distance tree result */
+    const inflate_huft * FAR *, /* literal/length tree result */
+    const inflate_huft * FAR *, /* distance tree result */
     z_streamp));                /* for memory allocation */
 
 #endif /* _INFTREES_H */

Index: infutil.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/infutil.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/infutil.c	25 Nov 2003 19:27:19 -0000	1.1
+++ b/infutil.c	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -11,7 +11,7 @@
 
 
 /* And'ing with mask[n] masks the lower n bits */
-local uInt inflate_mask[17] = {
+local const uInt inflate_mask[17] = {
     0x0000,
     0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
     0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff

Index: infutil.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/infutil.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/infutil.h	25 Nov 2003 19:27:19 -0000	1.1
+++ b/infutil.h	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -85,7 +85,9 @@
 #define LOAD {LOADIN LOADOUT}
 
 /* masks for lower bits (size given to avoid silly warnings with Visual C++) */
+#ifndef NO_INFLATE_MASK
 local uInt inflate_mask[17];
+#endif
 
 /* copy as much as possible from the sliding window to the output area */
 local int inflate_flush OF((

Index: rules.mk
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/rules.mk,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/rules.mk	25 Nov 2003 19:27:19 -0000	1.1
+++ b/rules.mk	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 2002 by
+# Copyright 2002, 2003 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -15,14 +15,13 @@
 
 # gzip driver directory
 #
-GZIP_DIR  := $(SRC_)gzip
-GZIP_DIR_ := $(GZIP_DIR)$(SEP)
+GZIP_DIR := $(SRC_DIR)/gzip
 
 
 # compilation flags for the driver
 #
 ifeq ($(SYSTEM_ZLIB),)
-  GZIP_COMPILE := $(FT_COMPILE) $I$(GZIP_DIR)
+  GZIP_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR))
 else
   GZIP_COMPILE := $(FT_COMPILE)
 endif
@@ -30,7 +29,7 @@
 
 # gzip support sources (i.e., C files)
 #
-GZIP_DRV_SRC := $(GZIP_DIR_)ftgzip.c
+GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c
 
 # gzip support headers
 #
@@ -43,27 +42,28 @@
 #   GZIP_DRV_OBJ_S is used during `single' builds
 #
 ifeq ($(SYSTEM_ZLIB),)
-  GZIP_DRV_OBJ_M := $(GZIP_DRV_SRC:$(GZIP_DIR_)%.c=$(OBJ_)%.$O)
+  GZIP_DRV_OBJ_M := $(GZIP_DRV_SRC:$(GZIP_DIR)/%.c=$(OBJ_DIR)/%.$O)
 else
-  GZIP_DRV_OBJ_M := $(OBJ_)ftgzip.$O
+  GZIP_DRV_OBJ_M := $(OBJ_DIR)/ftgzip.$O
 endif
-GZIP_DRV_OBJ_S := $(OBJ_)ftgzip.$O
+GZIP_DRV_OBJ_S := $(OBJ_DIR)/ftgzip.$O
 
 # gzip support source file for single build
 #
-GZIP_DRV_SRC_S := $(GZIP_DIR_)ftgzip.c
+GZIP_DRV_SRC_S := $(GZIP_DIR)/ftgzip.c
 
 
 # gzip support - single object
 #
-$(GZIP_DRV_OBJ_S): $(GZIP_DRV_SRC_S) $(GZIP_DRV_SRC) $(FREETYPE_H) $(GZIP_DRV_H)
-	$(GZIP_COMPILE) $T$@ $(GZIP_DRV_SRC_S)
+$(GZIP_DRV_OBJ_S): $(GZIP_DRV_SRC_S) $(GZIP_DRV_SRC) $(FREETYPE_H) \
+                   $(GZIP_DRV_H)
+	$(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC_S))
 
 
 # gzip support - multiple objects
 #
-$(OBJ_)%.$O: $(GZIP_DIR_)%.c $(FREETYPE_H) $(GZIP_DRV_H)
-	$(GZIP_COMPILE) $T$@ $<
+$(OBJ_DIR)/%.$O: $(GZIP_DIR)/%.c $(FREETYPE_H) $(GZIP_DRV_H)
+	$(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
 
 
 # update main driver object lists
@@ -71,4 +71,5 @@
 DRV_OBJS_S += $(GZIP_DRV_OBJ_S)
 DRV_OBJS_M += $(GZIP_DRV_OBJ_M)
 
+
 # EOF

Index: zutil.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/gzip/zutil.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/zutil.h	25 Nov 2003 19:27:19 -0000	1.1
+++ b/zutil.h	23 Feb 2004 21:32:49 -0000	1.1.4.1
@@ -8,16 +8,13 @@
    subject to change. Applications should only use zlib.h.
  */
 
-/* @(#) $Id: zutil.h,v 1.3 2002/12/26 20:50:40 davidT Exp $ */
-
-/* $XFree86: xc/extras/freetype2/src/gzip/zutil.h,v 1.2 2003/05/29 14:53:28 dawes Exp $ */
+/* @(#) $Id: zutil.h,v 1.4 2003/05/21 07:39:42 werner Exp $ */
 
 #ifndef _Z_UTIL_H
 #define _Z_UTIL_H
 
 #include "zlib.h"
 
-#if 0
 #ifdef STDC
 #  include <stddef.h>
 #  include <string.h>
@@ -28,7 +25,6 @@
 #else
 #   include <errno.h>
 #endif
-#endif
 
 #ifndef local
 #  define local static
@@ -177,8 +173,8 @@
 #    define zmemzero(dest, len) _fmemset(dest, 0, len)
 #  else
 #    define zmemcpy ft_memcpy
-#    define zmemcmp memcmp
-#    define zmemzero(dest, len) memset(dest, 0, len)
+#    define zmemcmp ft_memcmp
+#    define zmemzero(dest, len) ft_memset(dest, 0, len)
 #  endif
 #else
    extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));





More information about the xorg-commit mailing list