* src/bdf/bdflib.c: removing compiler warnings
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
diff --git a/ChangeLog b/ChangeLog
index 0095ce4..42dcd2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2005-03-15 David Turner <david@freetype.org>
+ * src/bdf/bdflib.c: removing compiler warnings
+
+ * docs/CHANGES: updating
+
+ * src/type1/t1parse.c (T1_New_Parser), src/type42/t42parse.c
+ (t42_parser_init): modifying functions to check the font header before
+ allocating anything on the heap.
+
+ * internal/freetype/ftmemory.h: introducing the new macros FT_ARRAY_MAX
+ and FT_ARRAY_CHECK
+
+ * src/pcf/pcfread.c, src/pcf/pcfutil.c: minor fixes and simplifications.
+ try to protect the PCF driver from doing stupid things with broken fonts.
+
* src/lzw/ftlzw.c (FT_Stream_OpenLZW): modified the function to check
the LZW header before doing anything else. This helps avoid un-necessary
heap allocations (400 Kb of heap memory for the LZW decoder ! Oh my !)
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index 9ac50be..e14fd65 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -415,7 +415,7 @@
{
FT_Error error = 0;
- if ( num_items > list->size )
+ if ( num_items > (int)list->size )
{
int oldsize = list->size;
int newsize = oldsize + (oldsize >> 1) + 4;
@@ -637,12 +637,13 @@
cursor = 0;
refill = 1;
to_skip = NO_SKIP;
+ bytes = 0; /* make compiler happy */
for (;;)
{
if ( refill )
{
- bytes = (int) FT_Stream_TryRead( stream, buf + cursor,
+ bytes = (int) FT_Stream_TryRead( stream, (FT_Byte*)buf + cursor,
(FT_ULong)(buf_size - cursor) );
avail = cursor + bytes;
cursor = 0;