lzw: Count the size of the memory object by ptrdiff_t.

This commit is contained in:
suzuki toshiya 2009-08-01 00:30:14 +09:00
parent 88c95bab74
commit f420757c73
3 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,17 @@
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
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 <mpsuzuki@hiroshima-u.ac.jp>
otvalid: Count the table size on memory by ptrdiff_t.

View File

@ -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;

View File

@ -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 */