| 1624 | // ---------------------------------------------------------------------------------------- |
| 1625 | |
| 1626 | void bigint_kernel_2:: |
| 1627 | shift_right ( |
| 1628 | const data_record* data, |
| 1629 | data_record* result |
| 1630 | ) const |
| 1631 | { |
| 1632 | |
| 1633 | uint16* r = result->number; // result |
| 1634 | uint16* s = data->number; // source |
| 1635 | uint16* end = s + data->digits_used - 1; |
| 1636 | |
| 1637 | while (s != end) |
| 1638 | { |
| 1639 | *r = (*s >> 1) | (*(s+1) << 15); |
| 1640 | ++r; |
| 1641 | ++s; |
| 1642 | } |
| 1643 | *r = *s >> 1; |
| 1644 | |
| 1645 | |
| 1646 | // calculate the new number for digits_used |
| 1647 | if (*r == 0) |
| 1648 | { |
| 1649 | if (data->digits_used != 1) |
| 1650 | result->digits_used = data->digits_used - 1; |
| 1651 | else |
| 1652 | result->digits_used = 1; |
| 1653 | } |
| 1654 | else |
| 1655 | { |
| 1656 | result->digits_used = data->digits_used; |
| 1657 | } |
| 1658 | |
| 1659 | |
| 1660 | } |
| 1661 | |
| 1662 | // ---------------------------------------------------------------------------------------- |
| 1663 |
nothing calls this directly
no outgoing calls
no test coverage detected