[前][次][番号順一覧][スレッド一覧]

ruby-changes:7527

From: akr <ko1@a...>
Date: Tue, 2 Sep 2008 04:02:42 +0900 (JST)
Subject: [ruby-changes:7527] Ruby:r19048 (trunk): * transcode_data.h (o3): prevent sign extension on 64bit environment.

akr	2008-09-02 04:01:27 +0900 (Tue, 02 Sep 2008)

  New Revision: 19048

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19048

  Log:
    * transcode_data.h (o3): prevent sign extension on 64bit environment.
      (o4): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/transcode_data.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19047)
+++ ChangeLog	(revision 19048)
@@ -1,3 +1,8 @@
+Tue Sep  2 04:00:37 2008  Tanaka Akira  <akr@f...>
+
+	* transcode_data.h (o3): prevent sign extension on 64bit environment.
+	  (o4): ditto.
+
 Tue Sep  2 03:26:24 2008  Tanaka Akira  <akr@f...>
 
 	* tool/transcode-tblgen.rb: comment removed in generated code.
Index: transcode_data.h
===================================================================
--- transcode_data.h	(revision 19047)
+++ transcode_data.h	(revision 19048)
@@ -41,8 +41,8 @@
 
 #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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]