diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 6db8136cf..9b23045ef 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 f5ad2874d..e862780ed 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;