comparison src/share/vm/utilities/globalDefinitions.hpp @ 1789:a83b0246bb77

6934483: GCC 4.5 errors "suggest parentheses around something..." when compiling with -Werror and -Wall Summary: These are minor changes fixing compile failure when -Wall -Werror flags are used under gcc 4.5. Reviewed-by: twisti, kvn, rasbold Contributed-by: Pavel Tisnovsky <ptisnovs@redhat.com>
author twisti
date Thu, 09 Sep 2010 05:24:11 -0700
parents d5d065957597
children 2d26b0046e0d f95d63e2154a
comparison
equal deleted inserted replaced
1788:33a54060190d 1789:a83b0246bb77
1032 // On the 386, this could be realized with a simple address cast. 1032 // On the 386, this could be realized with a simple address cast.
1033 // 1033 //
1034 1034
1035 // This routine takes eight bytes: 1035 // This routine takes eight bytes:
1036 inline u8 build_u8_from( u1 c1, u1 c2, u1 c3, u1 c4, u1 c5, u1 c6, u1 c7, u1 c8 ) { 1036 inline u8 build_u8_from( u1 c1, u1 c2, u1 c3, u1 c4, u1 c5, u1 c6, u1 c7, u1 c8 ) {
1037 return ( u8(c1) << 56 ) & ( u8(0xff) << 56 ) 1037 return (( u8(c1) << 56 ) & ( u8(0xff) << 56 ))
1038 | ( u8(c2) << 48 ) & ( u8(0xff) << 48 ) 1038 | (( u8(c2) << 48 ) & ( u8(0xff) << 48 ))
1039 | ( u8(c3) << 40 ) & ( u8(0xff) << 40 ) 1039 | (( u8(c3) << 40 ) & ( u8(0xff) << 40 ))
1040 | ( u8(c4) << 32 ) & ( u8(0xff) << 32 ) 1040 | (( u8(c4) << 32 ) & ( u8(0xff) << 32 ))
1041 | ( u8(c5) << 24 ) & ( u8(0xff) << 24 ) 1041 | (( u8(c5) << 24 ) & ( u8(0xff) << 24 ))
1042 | ( u8(c6) << 16 ) & ( u8(0xff) << 16 ) 1042 | (( u8(c6) << 16 ) & ( u8(0xff) << 16 ))
1043 | ( u8(c7) << 8 ) & ( u8(0xff) << 8 ) 1043 | (( u8(c7) << 8 ) & ( u8(0xff) << 8 ))
1044 | ( u8(c8) << 0 ) & ( u8(0xff) << 0 ); 1044 | (( u8(c8) << 0 ) & ( u8(0xff) << 0 ));
1045 } 1045 }
1046 1046
1047 // This routine takes four bytes: 1047 // This routine takes four bytes:
1048 inline u4 build_u4_from( u1 c1, u1 c2, u1 c3, u1 c4 ) { 1048 inline u4 build_u4_from( u1 c1, u1 c2, u1 c3, u1 c4 ) {
1049 return ( u4(c1) << 24 ) & 0xff000000 1049 return (( u4(c1) << 24 ) & 0xff000000)
1050 | ( u4(c2) << 16 ) & 0x00ff0000 1050 | (( u4(c2) << 16 ) & 0x00ff0000)
1051 | ( u4(c3) << 8 ) & 0x0000ff00 1051 | (( u4(c3) << 8 ) & 0x0000ff00)
1052 | ( u4(c4) << 0 ) & 0x000000ff; 1052 | (( u4(c4) << 0 ) & 0x000000ff);
1053 } 1053 }
1054 1054
1055 // And this one works if the four bytes are contiguous in memory: 1055 // And this one works if the four bytes are contiguous in memory:
1056 inline u4 build_u4_from( u1* p ) { 1056 inline u4 build_u4_from( u1* p ) {
1057 return build_u4_from( p[0], p[1], p[2], p[3] ); 1057 return build_u4_from( p[0], p[1], p[2], p[3] );
1058 } 1058 }
1059 1059
1060 // Ditto for two-byte ints: 1060 // Ditto for two-byte ints:
1061 inline u2 build_u2_from( u1 c1, u1 c2 ) { 1061 inline u2 build_u2_from( u1 c1, u1 c2 ) {
1062 return u2(( u2(c1) << 8 ) & 0xff00 1062 return u2((( u2(c1) << 8 ) & 0xff00)
1063 | ( u2(c2) << 0 ) & 0x00ff); 1063 | (( u2(c2) << 0 ) & 0x00ff));
1064 } 1064 }
1065 1065
1066 // And this one works if the two bytes are contiguous in memory: 1066 // And this one works if the two bytes are contiguous in memory:
1067 inline u2 build_u2_from( u1* p ) { 1067 inline u2 build_u2_from( u1* p ) {
1068 return build_u2_from( p[0], p[1] ); 1068 return build_u2_from( p[0], p[1] );
1081 1081
1082 1082
1083 // now (64-bit) longs 1083 // now (64-bit) longs
1084 1084
1085 inline jlong build_long_from( u1 c1, u1 c2, u1 c3, u1 c4, u1 c5, u1 c6, u1 c7, u1 c8 ) { 1085 inline jlong build_long_from( u1 c1, u1 c2, u1 c3, u1 c4, u1 c5, u1 c6, u1 c7, u1 c8 ) {
1086 return ( jlong(c1) << 56 ) & ( jlong(0xff) << 56 ) 1086 return (( jlong(c1) << 56 ) & ( jlong(0xff) << 56 ))
1087 | ( jlong(c2) << 48 ) & ( jlong(0xff) << 48 ) 1087 | (( jlong(c2) << 48 ) & ( jlong(0xff) << 48 ))
1088 | ( jlong(c3) << 40 ) & ( jlong(0xff) << 40 ) 1088 | (( jlong(c3) << 40 ) & ( jlong(0xff) << 40 ))
1089 | ( jlong(c4) << 32 ) & ( jlong(0xff) << 32 ) 1089 | (( jlong(c4) << 32 ) & ( jlong(0xff) << 32 ))
1090 | ( jlong(c5) << 24 ) & ( jlong(0xff) << 24 ) 1090 | (( jlong(c5) << 24 ) & ( jlong(0xff) << 24 ))
1091 | ( jlong(c6) << 16 ) & ( jlong(0xff) << 16 ) 1091 | (( jlong(c6) << 16 ) & ( jlong(0xff) << 16 ))
1092 | ( jlong(c7) << 8 ) & ( jlong(0xff) << 8 ) 1092 | (( jlong(c7) << 8 ) & ( jlong(0xff) << 8 ))
1093 | ( jlong(c8) << 0 ) & ( jlong(0xff) << 0 ); 1093 | (( jlong(c8) << 0 ) & ( jlong(0xff) << 0 ));
1094 } 1094 }
1095 1095
1096 inline jlong build_long_from( u1* p ) { 1096 inline jlong build_long_from( u1* p ) {
1097 return build_long_from( p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7] ); 1097 return build_long_from( p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7] );
1098 } 1098 }