summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:31 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:31 +0900
commit8ffff6864415733659bb9da932f44aece18b1a7b (patch)
treee46efebee893e7fb1ae844ab23d88d1ab81214a4
parentdaebaaa81509da2141af694a8999e93d4bb39fff (diff)
downloadfreetype2-8ffff6864415733659bb9da932f44aece18b1a7b.tar.gz
pcf: Handle the string length by size_t variables.
-rw-r--r--ChangeLog18
-rw-r--r--src/pcf/pcfdrivr.c2
-rw-r--r--src/pcf/pcfread.c8
-rw-r--r--src/pcf/pcfutil.c8
-rw-r--r--src/pcf/pcfutil.h6
5 files changed, 30 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f7968f95..26f15a632 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ pcf: Handle the string length by size_t variables.
+
+ * src/pcf/pcfread.c (pcf_interpret_style): The types
+ of nn, len, lengths[4] are changed to size_t, because
+ they are loaded by (or compared with) ft_strlen().
+
+ * src/pcf/pcfutil.c (BitOrderInvert, TwoByteSwap,
+ FourByteSwap): The type of the 2nd argument `nbytes'
+ is changed to size_t, for similarity with ANSI C
+ string functions.
+
+ * src/pcf/pcfdrivr.c (PCF_Glyph_Load): The type of
+ `bytes' is changed to FT_Offset, because it is passed
+ to FT_ALLOC(), via ft_glyphslot_alloc_bitmap(). At
+ least, using unsigned type is better.
+
+2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
pcf: Fix some data types mismatching with their sources.
* src/pcf/pcfread.c (pcf_seek_to_table_type,
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index 799b498c0..b34e542ae 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -455,7 +455,7 @@ THE SOFTWARE.
FT_Error error = PCF_Err_Ok;
FT_Bitmap* bitmap = &slot->bitmap;
PCF_Metric metric;
- int bytes;
+ FT_Offset bytes;
FT_UNUSED( load_flags );
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index 4ec4db895..cbbd10589 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -992,9 +992,9 @@ THE SOFTWARE.
PCF_Property prop;
- int nn, len;
- char* strings[4] = { NULL, NULL, NULL, NULL };
- int lengths[4];
+ size_t nn, len;
+ char* strings[4] = { NULL, NULL, NULL, NULL };
+ size_t lengths[4];
face->style_flags = 0;
@@ -1076,7 +1076,7 @@ THE SOFTWARE.
/* add_style_name and setwidth_name */
if ( nn == 0 || nn == 3 )
{
- int mm;
+ size_t mm;
for ( mm = 0; mm < len; mm++ )
diff --git a/src/pcf/pcfutil.c b/src/pcf/pcfutil.c
index 67ddbe889..b91274f93 100644
--- a/src/pcf/pcfutil.c
+++ b/src/pcf/pcfutil.c
@@ -42,9 +42,9 @@ in this Software without prior written authorization from The Open Group.
FT_LOCAL_DEF( void )
BitOrderInvert( unsigned char* buf,
- int nbytes )
+ size_t nbytes )
{
- for ( ; --nbytes >= 0; buf++ )
+ for ( ; nbytes > 0; nbytes--, buf++ )
{
unsigned int val = *buf;
@@ -64,7 +64,7 @@ in this Software without prior written authorization from The Open Group.
FT_LOCAL_DEF( void )
TwoByteSwap( unsigned char* buf,
- int nbytes )
+ size_t nbytes )
{
unsigned char c;
@@ -83,7 +83,7 @@ in this Software without prior written authorization from The Open Group.
FT_LOCAL_DEF( void )
FourByteSwap( unsigned char* buf,
- int nbytes )
+ size_t nbytes )
{
unsigned char c;
diff --git a/src/pcf/pcfutil.h b/src/pcf/pcfutil.h
index 1557be3e8..ce10fb541 100644
--- a/src/pcf/pcfutil.h
+++ b/src/pcf/pcfutil.h
@@ -37,15 +37,15 @@ FT_BEGIN_HEADER
FT_LOCAL( void )
BitOrderInvert( unsigned char* buf,
- int nbytes );
+ size_t nbytes );
FT_LOCAL( void )
TwoByteSwap( unsigned char* buf,
- int nbytes );
+ size_t nbytes );
FT_LOCAL( void )
FourByteSwap( unsigned char* buf,
- int nbytes );
+ size_t nbytes );
FT_END_HEADER