File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -2649,9 +2649,9 @@ class HexVolMesh : public Mesh
26492649
26502650 // / These are for our own use (making the hash function.
26512651 static const int sz_quarter_int = (int )(sz_int / 4 );
2652- static const int top4_mask = ((~(( int ) 0 )) << sz_quarter_int << sz_quarter_int << sz_quarter_int);
2653- static const int up4_mask = top4_mask ^ (~(( int ) 0 ) << sz_quarter_int << sz_quarter_int);
2654- static const int mid4_mask = top4_mask ^ (~(( int ) 0 ) << sz_quarter_int);
2652+ static const int top4_mask = -( 1 << sz_quarter_int << sz_quarter_int << sz_quarter_int);
2653+ static const int up4_mask = top4_mask ^ -( 1 << sz_quarter_int << sz_quarter_int);
2654+ static const int mid4_mask = top4_mask ^ -( 1 << sz_quarter_int);
26552655 static const int low4_mask = ~(top4_mask | mid4_mask);
26562656
26572657 // / This is the hash function
@@ -2714,7 +2714,7 @@ class HexVolMesh : public Mesh
27142714 // / These are for our own use (making the hash function.
27152715 static const int sz_int = sizeof (int ) * 8 ; // in bits
27162716 static const int sz_half_int = sizeof (int ) << 2 ; // in bits
2717- static const int up_mask = ((~(( int ) 0 )) << sz_half_int);
2717+ static const int up_mask = -( 1 << sz_half_int);
27182718 static const int low_mask = (~((int )0 ) ^ up_mask);
27192719
27202720 // / This is the hash function
Original file line number Diff line number Diff line change @@ -2408,9 +2408,9 @@ class PrismVolMesh : public Mesh
24082408
24092409 // / These are for our own use (making the hash function.
24102410 static const int sz_quarter_int = (int )(sz_int / 4 );
2411- static const int top4_mask = ((~(( int ) 0 )) << sz_quarter_int << sz_quarter_int << sz_quarter_int);
2412- static const int up4_mask = top4_mask ^ (~(( int ) 0 ) << sz_quarter_int << sz_quarter_int);
2413- static const int mid4_mask = top4_mask ^ (~(( int ) 0 ) << sz_quarter_int);
2411+ static const int top4_mask = -( 1 << sz_quarter_int << sz_quarter_int << sz_quarter_int);
2412+ static const int up4_mask = top4_mask ^ -( 1 << sz_quarter_int << sz_quarter_int);
2413+ static const int mid4_mask = top4_mask ^ -( 1 << sz_quarter_int);
24142414 static const int low4_mask = ~(top4_mask | mid4_mask);
24152415
24162416 // / This is the hash function
@@ -2451,7 +2451,7 @@ class PrismVolMesh : public Mesh
24512451 // / These are for our own use (making the hash function.
24522452 static const int sz_int = sizeof (int ) * 8 ; // in bits
24532453 static const int sz_half_int = sizeof (int ) << 2 ; // in bits
2454- static const int up_mask = ((~(( int ) 0 )) << sz_half_int);
2454+ static const int up_mask = -( 1 << sz_half_int);
24552455 static const int low_mask = (~((int )0 ) ^ up_mask);
24562456
24572457 // / This is the hash function
Original file line number Diff line number Diff line change @@ -1586,8 +1586,8 @@ TEST(FieldHashTests, TestShiftingZero)
15861586
15871587 // / These are for our own use (making the hash function).
15881588 static const int sz_third_int = (int )(sz_int / 3 );
1589- static const int up_mask = (~((int )0 ) << sz_third_int << sz_third_int);
1590- static const int mid_mask = up_mask ^ (~((int )0 ) << sz_third_int);
1589+ static const int up_mask = - 1048576 ; // (~((int)0) << sz_third_int << sz_third_int);
1590+ static const int mid_mask = 1047552 ; // up_mask ^ (~((int)0) << sz_third_int);
15911591 static const int low_mask = ~(up_mask | mid_mask);
15921592
15931593 std::cout << " sz_int: " << sz_int << std::endl;
You can’t perform that action at this time.
0 commit comments