ref: f420757c73543e3d57060a5394eb76004d959e4b
parent: 88c95bab744667219bec90c733b2b1b68ecc57de
author: suzuki toshiya <[email protected]>
date: Fri Jul 31 20:30:14 EDT 2009
lzw: Count the size of the memory object by ptrdiff_t.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2009-07-31 suzuki toshiya <[email protected]>
+ lzw: Count the size of the memory object by ptrdiff_t.
+
+ * src/lzw/ftzopen.h: The types of FT_LzwState->{buf_total,
+ stack_size} are changed from FT_UInt to FT_Offset, to match
+ with size_t, which is appropriate type for the object in
+ the memory buffer.
+
+ * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): The types of
+ `old_size' and `new_size' are changed from FT_UInt to
+ FT_Offset, to match with size_t, which is appropriate type
+ for the object in the memory buffer.
+
+2009-07-31 suzuki toshiya <[email protected]>
+
otvalid: Count the table size on memory by ptrdiff_t.
* src/otvalid/otvgpos.c (otv_ValueRecord_validate):
--- a/src/lzw/ftzopen.c
+++ b/src/lzw/ftzopen.c
@@ -113,8 +113,8 @@
{
FT_Memory memory = state->memory;
FT_Error error;
- FT_UInt old_size = state->stack_size;
- FT_UInt new_size = old_size;
+ FT_Offset old_size = state->stack_size;
+ FT_Offset new_size = old_size;
new_size = new_size + ( new_size >> 1 ) + 4;
--- a/src/lzw/ftzopen.h
+++ b/src/lzw/ftzopen.h
@@ -118,7 +118,7 @@
FT_Int buf_offset;
FT_Int buf_size;
FT_Bool buf_clear;
- FT_Int buf_total;
+ FT_Offset buf_total;
FT_UInt max_bits; /* max code bits, from file header */
FT_Int block_mode; /* block mode flag, from file header */
@@ -137,7 +137,7 @@
FT_Byte* stack; /* character stack */
FT_UInt stack_top;
- FT_UInt stack_size;
+ FT_Offset stack_size;
FT_Byte stack_0[FT_LZW_DEFAULT_STACK_SIZE]; /* minimize heap alloc */
FT_Stream source; /* source stream */