* src/gzip/ftgzip.c (zcalloc) [!FT_CONFIG_OPTION_SYSTEM_ZLIB]: Convert K&R format to modern C usage. (FT_Stream_OpenGzip): Use long constant. Cleanups.
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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692
diff --git a/ChangeLog b/ChangeLog
index 37734bc..e7eabe1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-22 Werner Lemberg <wl@gnu.org>
+
+ * src/gzip/ftgzip.c (zcalloc) [!FT_CONFIG_OPTION_SYSTEM_ZLIB]:
+ Convert K&R format to modern C usage.
+ (FT_Stream_OpenGzip): Use long constant.
+
2003-04-21 Werner Lemberg <wl@gnu.org>
* src/cache/ftccache.c (ftc_cache_lookup): Remove shadow declaration
@@ -165,9 +171,10 @@
2003-02-25 David Turner <david@freetype.org>
- * src/gzip/ftgzip.c: Fixed a bug that caused FreeType to loop
- endlessly when trying to read certain compressed gzip files. The
- following test could be used to reveal the bug:
+ * src/gzip/ftgzip.c (ft_gzip_file_fill_output): Fixed a bug that
+ caused FreeType to loop endlessly when trying to read certain
+ compressed gzip files. The following test could be used to reveal
+ the bug:
touch 0123456789 ; gzip 0123456789 ; ftdump 0123456789.gz
@@ -216,7 +223,9 @@
* src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_INCREMENTAL]:
Allow metrics to be overridden.
- * src/cid/cidgload.c, src/truetype/ttgload.c, src/type1/t1gload.c
+ * src/cid/cidgload.c (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL]:
+ Ditto.
+ * src/truetype/ttgload.c, src/type1/t1gload.c
[FT_CONFIG_OPTION_INCREMENTAL]:
* include/freetype/ftincrem.h: Updated.
@@ -311,8 +320,8 @@
2003-01-15 James Su <suzhe@turbolinux.com.cn>
- * src/gzip/ftgzip.c: Bugfix: couldn't read certain gzip-ed font
- files.
+ * src/gzip/ftgzip.c (ft_gzip_check_header): Bugfix: couldn't read
+ certain gzip-ed font files (typo: `&&' -> `&').
2003-01-15 Huw D M Davies <h.davies1@physics.ox.ac.uk>
@@ -507,12 +516,12 @@
* include/freetype/ftgzip.h: Correct the name of the controlling
macro (was __FTXF86_H__ ...).
-2002-11-27 Vincent Caron <v.caron@zerodeux.net>
+2002-11-27 Vincent Caron <v.caron@zerodeux.net>
* builds/unix/unix-def.in, builds/unix/freetype-config.in,
- builds/unix/configure.ac, src/gzip/rules.mk, src/gzip/ftgzip.c:
- Adding support for system zlib installations if available on the
- target platform (Unix only).
+ builds/unix/configure.ac, src/gzip/rules.mk, src/gzip/ftgzip.c
+ [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Adding support for system zlib
+ installations if available on the target platform (Unix only).
2002-11-23 David Turner <david@freetype.org>
@@ -618,6 +627,9 @@
2002-10-31 David Turner <david@freetype.org>
+ * src/gzip/*: New files, taken from the zlib package (except
+ ftgzip.c).
+
* include/freetype/ftgzip.h, src/gzip/ftgzip.c: New files, adding
support for gzip compressed streams.
* include/freetype/config/ftheader.h (FT_GZIP_H): New macro for
@@ -649,7 +661,7 @@
* include/freetype/ftcache.h (FT_POINTER_TO_ULONG): New macro.
(FTC_FACE_ID_HASH): Rewritten, using FT_POINTER_TO_ULONG.
-2002-10-22 Giuseppe Ghibò <ghibo@mandrakesoft.com>
+2002-10-22 Giuseppe Ghibò <ghibo@mandrakesoft.com>
* include/freetype/freetype.h (FT_Encoding): Fix entry for latin-2.
@@ -3721,7 +3733,7 @@
computation of auto-hinted glyphs. This noticeably improves the
spacing of letters in KDE and Gnome.
-2001-12-25 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
+2001-12-25 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
* builds/dos/detect.mk: Correcting the order for Borland compilers:
16-bit bcc was never selected, always overridden by 32-bit bcc32.
@@ -3924,7 +3936,7 @@
* src/truetype/ttgload.c (load_truetype_glyph): Fixing crash when
dealing with invalid fonts (i.e. glyph size < 10 bytes).
-2001-12-14 Sam Latinga <slouken@devolution.com>
+2001-12-14 Sam Latinga <slouken@devolution.com>
* builds/mac/freetype.make: A new Makefile to build with MPW on
MacOS classic.
@@ -4603,7 +4615,7 @@
* src/psaux/psobjs.c (T1_Decrypt): Ditto.
* src/type1/t1parse.c (T1_Get_Private_Dict): Ditto.
-2001-06-28 David Turner <david@freetype.org>
+2001-06-28 David Turner <david@freetype.org>
* include/internal/ftstream.h: Modified the definitions
of the FT_GET_XXXX and NEXT_XXXX macros for 16-bit correctness.
@@ -4624,7 +4636,7 @@
=========================
-2001-06-27 David Turner <david@freetype.org>
+2001-06-27 David Turner <david@freetype.org>
* builds/unix/ftconfig.in: Changed the definition of the
FT_CALLBACK_DEF macro.
@@ -4653,7 +4665,7 @@
* debian/*: Added Debian package build directory for 2.0.4.
-2001-06-22 David Turner <david@freetype.org>
+2001-06-22 David Turner <david@freetype.org>
* docs/PATENTS: Added patents disclaimer. This one was missing!
@@ -5137,13 +5149,13 @@
2001-04-02 Tom Kacvinsky <tkacvins@freetype.org>
* src/sfnt/ttload.c (TT_Load_Metrics): Fix an improper pointer
- dereference. Submitted by Herbert Duerr <duerr@sun.com>
+ dereference. Submitted by Herbert Duerr <duerr@sun.com>.
2001-03-26 Tom Kacvinsky <tkacvins@freetype.org>
* include/freetype/config/ftconfig.h: Changed hexadecimal
constants to use suffix U to avoid problems with HP-UX's c89
- compiler. Submitted by G.W. Lucas <glucas@sonalysts.com>
+ compiler. Submitted by G.W. Lucas <glucas@sonalysts.com>.
2001-03-24 David Turner <david.turner@freetype.org>
@@ -5232,17 +5244,17 @@
(cff_get_interface): Added support for getting a glyph name via the
"glyph_name" module interface. Uses the new function
get_cff_glyph_name().
- Submitted by Sander van der Wal <svdwal@xs4all.nl>
+ Submitted by Sander van der Wal <svdwal@xs4all.nl>.
* src/cff/cffobjs.c (CFF_Init_Face): Logical or the face flags with
FT_FACE_FLAG_GLYPH_NAMES only if FT_CONFIG_OPTION_NO_GLYPH_NAMES is
not defined. This is to add support for getting a glyph name from a
glyph index via FT_Get_Glyph_Name().
- Submitted by Sander van der Wal <svdwal@xs4all.nl>
+ Submitted by Sander van der Wal <svdwal@xs4all.nl>.
* src/cff/cffgload.c (CFF_Parse_CharStrings): Added support for
deprecated operator "dotsection".
- Submitted by Sander van der Wal <svdwal@xs4all.nl>
+ Submitted by Sander van der Wal <svdwal@xs4all.nl>.
2001-03-12 Werner Lemberg <wl@gnu.org>
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 15231f8..9d953d5 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -158,12 +158,13 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* Incremental fonts can optionally override the metrics. */
- if ( !error &&
- face->root.internal->incremental_interface &&
+ if ( !error &&
+ face->root.internal->incremental_interface &&
face->root.internal->incremental_interface->funcs->get_glyph_metrics )
{
FT_Incremental_MetricsRec metrics;
+
metrics.bearing_x = decoder->builder.left_bearing.x;
metrics.bearing_y = decoder->builder.left_bearing.y;
metrics.advance = decoder->builder.advance.x;
diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c
index 45f934b..c9bd4a5 100644
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -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, */
@@ -19,6 +19,7 @@
/* */
/***************************************************************************/
+
#include <ft2build.h>
#include FT_INTERNAL_MEMORY_H
#include FT_INTERNAL_STREAM_H
@@ -29,35 +30,35 @@
#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 BUILDFIXED /* save code size */
+#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"
+#include "zutil.c"
+#include "inftrees.c"
+#include "infcodes.c"
+#include "infutil.c"
+#include "infblock.c"
+#include "inflate.c"
+#include "adler32.c"
-#endif /* !SYSTEM_ZLIB */
+#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
/***************************************************************************/
@@ -68,48 +69,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 void
- zcfree( voidpf opaque,
- voidpf ptr )
- {
- ft_gzip_free( opaque, ptr );
- }
+ local voidpf
+ zcalloc ( voidpf opaque,
+ unsigned items,
+ unsigned size )
+ {
+ return ft_gzip_alloc( opaque, items, size );
+ }
+
+ local void
+ zcfree( voidpf opaque,
+ voidpf ptr )
+ {
+ ft_gzip_free( opaque, ptr );
+ }
#endif /* !SYSTEM_ZLIB */
@@ -124,25 +125,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 */
@@ -151,18 +152,19 @@
#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 ||
@@ -181,6 +183,7 @@
{
FT_UInt len;
+
if ( FT_READ_USHORT_LE( len ) ||
FT_STREAM_SKIP( len ) )
goto Exit;
@@ -192,7 +195,8 @@
{
FT_UInt c;
- if ( FT_READ_BYTE( c) )
+
+ if ( FT_READ_BYTE( c ) )
goto Exit;
if ( c == 0 )
@@ -205,7 +209,8 @@
{
FT_UInt c;
- if ( FT_READ_BYTE( c) )
+
+ if ( FT_READ_BYTE( c ) )
goto Exit;
if ( c == 0 )
@@ -222,15 +227,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;
@@ -244,7 +249,7 @@
stream = source;
error = ft_gzip_check_header( stream );
- if (error)
+ if ( error )
goto Exit;
zip->start = FT_STREAM_POS();
@@ -270,7 +275,6 @@
}
-
static void
ft_gzip_file_done( FT_GZipFile zip )
{
@@ -299,10 +303,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;
@@ -325,9 +331,11 @@
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;
}
@@ -338,7 +346,7 @@
size = FT_GZIP_BUFFER_SIZE;
if ( size == 0 )
- return FT_Err_Invalid_Stream_Operation;
+ return FT_Err_Invalid_Stream_Operation;
FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
}
@@ -351,13 +359,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;
@@ -366,6 +374,7 @@
{
int err;
+
if ( zstream->avail_in == 0 )
{
error = ft_gzip_file_fill_input( zip );
@@ -391,7 +400,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 )
@@ -399,6 +408,7 @@
FT_Error error = 0;
FT_ULong delta;
+
for (;;)
{
delta = (FT_ULong)( zip->limit - zip->cursor );
@@ -422,27 +432,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;
}
@@ -452,7 +464,8 @@
/* now read the data */
for (;;)
{
- FT_ULong delta;
+ FT_ULong delta;
+
delta = (FT_ULong)( zip->limit - zip->cursor );
if ( delta >= count )
@@ -469,7 +482,7 @@
break;
error = ft_gzip_file_fill_output( zip );
- if (error)
+ if ( error )
break;
}
@@ -492,6 +505,7 @@
FT_GZipFile zip = stream->descriptor.pointer;
FT_Memory memory = stream->memory;
+
if ( zip )
{
/* finalize gzip file descriptor */
@@ -505,25 +519,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;
+
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;
@@ -539,7 +555,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;
@@ -552,8 +568,8 @@
#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 );
@@ -562,3 +578,6 @@
}
#endif /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+
+/* END */