diff --git a/ChangeLog b/ChangeLog index b670781d6..a3256a30f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-07-31 suzuki toshiya + + 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 otvalid: Count the table size on memory by ptrdiff_t. diff --git a/src/lzw/ftzopen.c b/src/lzw/ftzopen.c index 91ac0a377..8bc65c8f5 100644 --- 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; diff --git a/src/lzw/ftzopen.h b/src/lzw/ftzopen.h index dd602402a..f7d2936be 100644 --- 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 */