diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-01 19:01:27 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-01 19:01:27 +0000 |
commit | dd9fbe8d775081ba8e5977aa11f13fbf80f9e3ab (patch) | |
tree | a5600c407a625203227e8cca46c410f5f71d47a0 /transcode_data.h | |
parent | dbc3a00242ac0a522b89fc280ab2634e9afd6456 (diff) | |
download | ruby-dd9fbe8d775081ba8e5977aa11f13fbf80f9e3ab.tar.gz ruby-dd9fbe8d775081ba8e5977aa11f13fbf80f9e3ab.tar.xz ruby-dd9fbe8d775081ba8e5977aa11f13fbf80f9e3ab.zip |
* transcode_data.h (o3): prevent sign extension on 64bit environment.
(o4): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r-- | transcode_data.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/transcode_data.h b/transcode_data.h index 78f72f890..14fb1336d 100644 --- a/transcode_data.h +++ b/transcode_data.h @@ -41,8 +41,8 @@ typedef uintptr_t BYTE_LOOKUP[2]; #define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt)) #define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt)) -#define o3(b1,b2,b3) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|THREEbt)) -#define o4(b0,b1,b2,b3) (PType((((unsigned char)(b1))<< 8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)) +#define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|THREEbt)&0xffffffffU)) +#define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<< 8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)&0xffffffffU)) #define getBT1(a) (((a)>> 8)&0xFF) #define getBT2(a) (((a)>>16)&0xFF) |