[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] int-not32-changes-2017 c6569d4 20/25: Insert casts to some b
From: |
suzuki toshiya |
Subject: |
[freetype2] int-not32-changes-2017 c6569d4 20/25: Insert casts to some bitshifting, to fit the types of destination variables. |
Date: |
Wed, 13 Sep 2017 04:15:07 -0400 (EDT) |
branch: int-not32-changes-2017
commit c6569d4423b99b6935ec90bbd067f848c327c6fa
Author: suzuki toshiya <address@hidden>
Commit: suzuki toshiya <address@hidden>
Insert casts to some bitshifting, to fit the types of destination variables.
---
src/base/ftobjs.c | 8 ++++----
src/base/ftrfork.c | 48 ++++++++++++++++++++++++------------------------
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 6db8136..9b23045 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1992,10 +1992,10 @@
header[0x53] > 0x7F )
return FT_THROW( Unknown_File_Format );
- dlen = ( header[0x53] << 24 ) |
- ( header[0x54] << 16 ) |
- ( header[0x55] << 8 ) |
- header[0x56];
+ dlen = ( (FT_Long)header[0x53] << 24 ) |
+ ( (FT_Long)header[0x54] << 16 ) |
+ ( (FT_Long)header[0x55] << 8 ) |
+ (FT_Long)header[0x56];
#if 0
rlen = ( header[0x57] << 24 ) |
( header[0x58] << 16 ) |
diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index f5ad287..e862780 100644
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -78,22 +78,22 @@
head[12] >= 0x80 )
return FT_THROW( Unknown_File_Format );
- *rdata_pos = ( head[ 0] << 24 ) |
- ( head[ 1] << 16 ) |
- ( head[ 2] << 8 ) |
- head[ 3];
- map_pos = ( head[ 4] << 24 ) |
- ( head[ 5] << 16 ) |
- ( head[ 6] << 8 ) |
- head[ 7];
- rdata_len = ( head[ 8] << 24 ) |
- ( head[ 9] << 16 ) |
- ( head[10] << 8 ) |
- head[11];
- map_len = ( head[12] << 24 ) |
- ( head[13] << 16 ) |
- ( head[14] << 8 ) |
- head[15];
+ *rdata_pos = ( (FT_Long)head[ 0] << 24 ) |
+ ( (FT_Long)head[ 1] << 16 ) |
+ ( (FT_Long)head[ 2] << 8 ) |
+ (FT_Long)head[ 3];
+ map_pos = ( (FT_Long)head[ 4] << 24 ) |
+ ( (FT_Long)head[ 5] << 16 ) |
+ ( (FT_Long)head[ 6] << 8 ) |
+ (FT_Long)head[ 7];
+ rdata_len = ( (FT_Long)head[ 8] << 24 ) |
+ ( (FT_Long)head[ 9] << 16 ) |
+ ( (FT_Long)head[10] << 8 ) |
+ (FT_Long)head[11];
+ map_len = ( (FT_Long)head[12] << 24 ) |
+ ( (FT_Long)head[13] << 16 ) |
+ ( (FT_Long)head[14] << 8 ) |
+ (FT_Long)head[15];
/* the map must not be empty */
if ( !map_pos )
@@ -519,10 +519,10 @@
char **result_file_name,
FT_Long *result_offset )
{
- FT_Int32 magic = ( 0x00 << 24 ) |
- ( 0x05 << 16 ) |
- ( 0x16 << 8 ) |
- 0x07;
+ FT_Int32 magic = ( (FT_Int32)0x00 << 24 ) |
+ ( (FT_Int32)0x05 << 16 ) |
+ ( (FT_Int32)0x16 << 8 ) |
+ (FT_Int32)0x07;
*result_file_name = NULL;
@@ -541,10 +541,10 @@
char **result_file_name,
FT_Long *result_offset )
{
- FT_Int32 magic = ( 0x00 << 24 ) |
- ( 0x05 << 16 ) |
- ( 0x16 << 8 ) |
- 0x00;
+ FT_Int32 magic = ( (FT_Int32)0x00 << 24 ) |
+ ( (FT_Int32)0x05 << 16 ) |
+ ( (FT_Int32)0x16 << 8 ) |
+ (FT_Int32)0x00;
*result_file_name = NULL;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] int-not32-changes-2017 c6569d4 20/25: Insert casts to some bitshifting, to fit the types of destination variables.,
suzuki toshiya <=