aboutsummaryrefslogtreecommitdiffstats
path: root/transcode_data.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-12 09:16:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-12 09:16:15 +0000
commitd1abc53721a15bd545b60c875b05f28dd7e01e57 (patch)
tree44da5708baceb68988497901e3915fbcece7c02d /transcode_data.h
parent080525aa68c68df1fd4c1484bea1de88e3c1f79f (diff)
downloadruby-d1abc53721a15bd545b60c875b05f28dd7e01e57.tar.gz
* array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r--transcode_data.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/transcode_data.h b/transcode_data.h
index cbceb0c7ee..0966b7dcad 100644
--- a/transcode_data.h
+++ b/transcode_data.h
@@ -37,7 +37,7 @@
#define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */
#define GB4bt (PType 0x12) /* GB18030 four bytes payload */
-#define STR1_LENGTH(byte_addr) (*(byte_addr) + 4)
+#define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4)
#define STR1_BYTEINDEX(w) ((w) >> 6)
#define makeSTR1(bi) (((bi) << 6) | STR1)
#define makeSTR1LEN(len) ((len)-4)
@@ -48,15 +48,15 @@
#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 g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|(((unsigned char)(b2))<<16)|((((unsigned char)(b1))&0x0f)<<24)|((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|GB4bt)&0xffffffffU))
-#define getBT1(a) (((a)>> 8)&0xFF)
-#define getBT2(a) (((a)>>16)&0xFF)
-#define getBT3(a) (((a)>>24)&0xFF)
-#define getBT0(a) ((((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
+#define getBT1(a) ((unsigned char)((a)>> 8))
+#define getBT2(a) ((unsigned char)((a)>>16))
+#define getBT3(a) ((unsigned char)((a)>>24))
+#define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
-#define getGB4bt0(a) (((a)>> 8)&0xFF)
-#define getGB4bt1(a) (((a)>>24)&0x0F|0x30)
-#define getGB4bt2(a) (((a)>>16)&0xFF)
-#define getGB4bt3(a) (((a)>>28)&0x0F|0x30)
+#define getGB4bt0(a) ((unsigned char)((a)>> 8))
+#define getGB4bt1(a) ((unsigned char)((a)>>24)&0x0F|0x30)
+#define getGB4bt2(a) ((unsigned char)((a)>>16))
+#define getGB4bt3(a) ((unsigned char)((a)>>28)&0x0F|0x30)
#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))