summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:41 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:41 +0900
commitac079164bd49df8e7ddd42772d2dc9113978acdd (patch)
tree9f1ef8917f07693be9b1ccc612f3a8c874a76a22
parent8114d2d6847783021eef82fa7f1e07ee5f041acd (diff)
downloadfreetype2-ac079164bd49df8e7ddd42772d2dc9113978acdd.tar.gz
cff: Type large constants > 0x7FFF as long for 16-bit systems.
-rw-r--r--ChangeLog9
-rw-r--r--src/cff/cffload.c8
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ab1d35b9..3ec73c697 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ cff: Type large constants > 0x7FFF as long for 16-bit systems.
+
+ * src/cff/cffload.c (cff_charset_load): Type large
+ constants > 0x7FFF as long, because normal constants
+ are typed signed integer that is less than 0x8000 on
+ 16-bit systems.
+
+2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
base: Remove an unused variable.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove an
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 1675ee4e5..f66d4e1a8 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -847,7 +847,7 @@
/* this constant is given in the CFF specification */
- if ( sid < 65000 )
+ if ( sid < 65000L )
charset->sids[j] = sid;
else
{
@@ -890,16 +890,16 @@
/* check whether the range contains at least one valid glyph; */
/* the constant is given in the CFF specification */
- if ( glyph_sid >= 65000 ) {
+ if ( glyph_sid >= 65000L ) {
FT_ERROR(( "cff_charset_load: invalid SID range\n" ));
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
/* try to rescue some of the SIDs if `nleft' is too large */
- if ( nleft > 65000 - 1 || glyph_sid >= 65000 - nleft ) {
+ if ( nleft > 65000L - 1L || glyph_sid >= 65000L - nleft ) {
FT_ERROR(( "cff_charset_load: invalid SID range trimmed\n" ));
- nleft = 65000 - 1 - glyph_sid;
+ nleft = ( FT_UInt )( 65000L - 1L - glyph_sid );
}
/* Fill in the range of sids -- `nleft + 1' glyphs. */