summaryrefslogtreecommitdiff
path: root/transcode_data.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 19:01:27 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 19:01:27 +0000
commit784ccb5806051c0fc66cc1ab12ed3ca94a1bd0ed (patch)
treea5600c407a625203227e8cca46c410f5f71d47a0 /transcode_data.h
parent5727e9c980873115c6acc1a725da8ee9c9083d14 (diff)
* transcode_data.h (o3): prevent sign extension on 64bit environment.
(o4): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r--transcode_data.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/transcode_data.h b/transcode_data.h
index 78f72f890a..14fb1336d1 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)