Skip to content

Commit

Permalink
Do not explicitly depend on sc_uint128_t
Browse files Browse the repository at this point in the history
  • Loading branch information
cburstedde committed Sep 16, 2020
1 parent 0b7cd7e commit 1a25d6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
17 changes: 1 addition & 16 deletions src/p4est_bits.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,21 +281,6 @@ p4est_qcoord_set_bit (p4est_qcoord_t * input, int bit_number)
*input |= ((p4est_qcoord_t) 1) << bit_number;
}

/* unused */
#if 0
/* The assumption is that all bits after 32nd bit are zero. */
static p4est_qcoord_t
p4est_lid_to_qcoord (const p4est_lid_t * input)
{
#ifdef P4_TO_P8
P4EST_ASSERT (((sc_uint128_t *) input)->high_bits == 0);
return (p4est_qcoord_t) ((sc_uint128_t *) input)->low_bits;
#else
return (p4est_qcoord_t) * input;
#endif
}
#endif

void
p4est_quadrant_print (int log_priority, const p4est_quadrant_t * q)
{
Expand Down Expand Up @@ -2404,7 +2389,7 @@ p4est_quadrant_srand (const p4est_quadrant_t * q, sc_rand_state_t * rstate)
SC_ABORT_NOT_REACHED ();
#else
p4est_quadrant_linear_id_ext128 (q, P4EST_QMAXLEVEL, &id);
*rstate = ((sc_uint128_t) id).high_bits ^ ((sc_uint128_t) id).low_bits;
*rstate = id.high_bits ^ id.low_bits;
#endif
}
}
5 changes: 2 additions & 3 deletions test/test_quadrants3.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,8 @@ main (int argc, char **argv)
p4est_quadrant_srand (&R, &state);
SC_CHECK_ABORT ((uint64_t) state == 7, "quadrant_srand");
p4est_quadrant_srand (&S, &state);
SC_CHECK_ABORT ((uint64_t) state ==
(((sc_uint128_t) id).high_bits ^ ((sc_uint128_t) id).
low_bits), "quadrant_srand");
SC_CHECK_ABORT ((uint64_t) state == (id.high_bits ^ id.low_bits),
"quadrant_srand");

SC_CHECK_ABORT (p4est_quadrant_compare (&B, &F) < 0, "Comp 1");
SC_CHECK_ABORT (p4est_quadrant_compare (&A, &G) < 0, "Comp 2");
Expand Down

0 comments on commit 1a25d6e

Please sign in to comment.