changeset 1704: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 33a54060190d
children 7f9553bedfd5
files src/cpu/x86/vm/vm_version_x86.hpp src/share/vm/memory/referenceProcessor.hpp src/share/vm/utilities/globalDefinitions.hpp
diffstat 3 files changed, 29 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/vm_version_x86.hpp	Thu Sep 09 01:43:48 2010 -0700
+++ b/src/cpu/x86/vm/vm_version_x86.hpp	Thu Sep 09 05:24:11 2010 -0700
@@ -296,14 +296,14 @@
       result |= CPU_CX8;
     if (_cpuid_info.std_cpuid1_edx.bits.cmov != 0)
       result |= CPU_CMOV;
-    if (_cpuid_info.std_cpuid1_edx.bits.fxsr != 0 || is_amd() &&
-        _cpuid_info.ext_cpuid1_edx.bits.fxsr != 0)
+    if (_cpuid_info.std_cpuid1_edx.bits.fxsr != 0 || (is_amd() &&
+        _cpuid_info.ext_cpuid1_edx.bits.fxsr != 0))
       result |= CPU_FXSR;
     // HT flag is set for multi-core processors also.
     if (threads_per_core() > 1)
       result |= CPU_HT;
-    if (_cpuid_info.std_cpuid1_edx.bits.mmx != 0 || is_amd() &&
-        _cpuid_info.ext_cpuid1_edx.bits.mmx != 0)
+    if (_cpuid_info.std_cpuid1_edx.bits.mmx != 0 || (is_amd() &&
+        _cpuid_info.ext_cpuid1_edx.bits.mmx != 0))
       result |= CPU_MMX;
     if (_cpuid_info.std_cpuid1_edx.bits.sse != 0)
       result |= CPU_SSE;
--- a/src/share/vm/memory/referenceProcessor.hpp	Thu Sep 09 01:43:48 2010 -0700
+++ b/src/share/vm/memory/referenceProcessor.hpp	Thu Sep 09 05:24:11 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -346,7 +346,8 @@
   bool _was_discovering_refs;
  public:
   NoRefDiscovery(ReferenceProcessor* rp) : _rp(rp) {
-    if (_was_discovering_refs = _rp->discovery_enabled()) {
+    _was_discovering_refs = _rp->discovery_enabled();
+    if (_was_discovering_refs) {
       _rp->disable_discovery();
     }
   }
--- a/src/share/vm/utilities/globalDefinitions.hpp	Thu Sep 09 01:43:48 2010 -0700
+++ b/src/share/vm/utilities/globalDefinitions.hpp	Thu Sep 09 05:24:11 2010 -0700
@@ -1034,22 +1034,22 @@
 
 // This routine takes eight bytes:
 inline u8 build_u8_from( u1 c1, u1 c2, u1 c3, u1 c4, u1 c5, u1 c6, u1 c7, u1 c8 ) {
-  return  ( u8(c1) << 56 )  &  ( u8(0xff) << 56 )
-       |  ( u8(c2) << 48 )  &  ( u8(0xff) << 48 )
-       |  ( u8(c3) << 40 )  &  ( u8(0xff) << 40 )
-       |  ( u8(c4) << 32 )  &  ( u8(0xff) << 32 )
-       |  ( u8(c5) << 24 )  &  ( u8(0xff) << 24 )
-       |  ( u8(c6) << 16 )  &  ( u8(0xff) << 16 )
-       |  ( u8(c7) <<  8 )  &  ( u8(0xff) <<  8 )
-       |  ( u8(c8) <<  0 )  &  ( u8(0xff) <<  0 );
+  return  (( u8(c1) << 56 )  &  ( u8(0xff) << 56 ))
+       |  (( u8(c2) << 48 )  &  ( u8(0xff) << 48 ))
+       |  (( u8(c3) << 40 )  &  ( u8(0xff) << 40 ))
+       |  (( u8(c4) << 32 )  &  ( u8(0xff) << 32 ))
+       |  (( u8(c5) << 24 )  &  ( u8(0xff) << 24 ))
+       |  (( u8(c6) << 16 )  &  ( u8(0xff) << 16 ))
+       |  (( u8(c7) <<  8 )  &  ( u8(0xff) <<  8 ))
+       |  (( u8(c8) <<  0 )  &  ( u8(0xff) <<  0 ));
 }
 
 // This routine takes four bytes:
 inline u4 build_u4_from( u1 c1, u1 c2, u1 c3, u1 c4 ) {
-  return  ( u4(c1) << 24 )  &  0xff000000
-       |  ( u4(c2) << 16 )  &  0x00ff0000
-       |  ( u4(c3) <<  8 )  &  0x0000ff00
-       |  ( u4(c4) <<  0 )  &  0x000000ff;
+  return  (( u4(c1) << 24 )  &  0xff000000)
+       |  (( u4(c2) << 16 )  &  0x00ff0000)
+       |  (( u4(c3) <<  8 )  &  0x0000ff00)
+       |  (( u4(c4) <<  0 )  &  0x000000ff);
 }
 
 // And this one works if the four bytes are contiguous in memory:
@@ -1059,8 +1059,8 @@
 
 // Ditto for two-byte ints:
 inline u2 build_u2_from( u1 c1, u1 c2 ) {
-  return  u2(( u2(c1) <<  8 )  &  0xff00
-          |  ( u2(c2) <<  0 )  &  0x00ff);
+  return  u2((( u2(c1) <<  8 )  &  0xff00)
+          |  (( u2(c2) <<  0 )  &  0x00ff));
 }
 
 // And this one works if the two bytes are contiguous in memory:
@@ -1083,14 +1083,14 @@
 // now (64-bit) longs
 
 inline jlong build_long_from( u1 c1, u1 c2, u1 c3, u1 c4, u1 c5, u1 c6, u1 c7, u1 c8 ) {
-  return  ( jlong(c1) << 56 )  &  ( jlong(0xff) << 56 )
-       |  ( jlong(c2) << 48 )  &  ( jlong(0xff) << 48 )
-       |  ( jlong(c3) << 40 )  &  ( jlong(0xff) << 40 )
-       |  ( jlong(c4) << 32 )  &  ( jlong(0xff) << 32 )
-       |  ( jlong(c5) << 24 )  &  ( jlong(0xff) << 24 )
-       |  ( jlong(c6) << 16 )  &  ( jlong(0xff) << 16 )
-       |  ( jlong(c7) <<  8 )  &  ( jlong(0xff) <<  8 )
-       |  ( jlong(c8) <<  0 )  &  ( jlong(0xff) <<  0 );
+  return  (( jlong(c1) << 56 )  &  ( jlong(0xff) << 56 ))
+       |  (( jlong(c2) << 48 )  &  ( jlong(0xff) << 48 ))
+       |  (( jlong(c3) << 40 )  &  ( jlong(0xff) << 40 ))
+       |  (( jlong(c4) << 32 )  &  ( jlong(0xff) << 32 ))
+       |  (( jlong(c5) << 24 )  &  ( jlong(0xff) << 24 ))
+       |  (( jlong(c6) << 16 )  &  ( jlong(0xff) << 16 ))
+       |  (( jlong(c7) <<  8 )  &  ( jlong(0xff) <<  8 ))
+       |  (( jlong(c8) <<  0 )  &  ( jlong(0xff) <<  0 ));
 }
 
 inline jlong build_long_from( u1* p ) {