Matt McCutchen's Web Site
/
bigint
/
bigint.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5ff40cf
)
Really rename DOTR_ALIASED -> DTRT_ALIASED.
author
Matt McCutchen
<matt@mattmccutchen.net>
Fri, 18 Jan 2008 03:32:04 +0000
(22:32 -0500)
committer
Matt McCutchen
<matt@mattmccutchen.net>
Fri, 18 Jan 2008 03:32:04 +0000
(22:32 -0500)
BigInteger.cc
patch
|
blob
|
blame
|
history
diff --git
a/BigInteger.cc
b/BigInteger.cc
index
3873e15
..
00074cf
100644
(file)
--- a/
BigInteger.cc
+++ b/
BigInteger.cc
@@
-311,7
+311,7
@@
BigInteger::CmpRes BigInteger::compareTo(const BigInteger &x) const {
// then call one of BigUnsigned's put-heres.
// See remarks about aliased calls in BigUnsigned.cc .
// then call one of BigUnsigned's put-heres.
// See remarks about aliased calls in BigUnsigned.cc .
-#define D
OTR
_ALIASED(cond, op) \
+#define D
TRT
_ALIASED(cond, op) \
if (cond) { \
BigInteger tmpThis; \
tmpThis.op; \
if (cond) { \
BigInteger tmpThis; \
tmpThis.op; \
@@
-321,7
+321,7
@@
BigInteger::CmpRes BigInteger::compareTo(const BigInteger &x) const {
// Addition
void BigInteger::add(const BigInteger &a, const BigInteger &b) {
// Addition
void BigInteger::add(const BigInteger &a, const BigInteger &b) {
- D
OTR
_ALIASED(this == &a || this == &b, add(a, b));
+ D
TRT
_ALIASED(this == &a || this == &b, add(a, b));
// If one argument is zero, copy the other.
if (a.sign == zero)
operator =(b);
// If one argument is zero, copy the other.
if (a.sign == zero)
operator =(b);
@@
-358,7
+358,7
@@
void BigInteger::add(const BigInteger &a, const BigInteger &b) {
void BigInteger::subtract(const BigInteger &a, const BigInteger &b) {
// Notice that this routine is identical to BigInteger::add,
// if one replaces b.sign by its opposite.
void BigInteger::subtract(const BigInteger &a, const BigInteger &b) {
// Notice that this routine is identical to BigInteger::add,
// if one replaces b.sign by its opposite.
- D
OTR
_ALIASED(this == &a || this == &b, subtract(a, b));
+ D
TRT
_ALIASED(this == &a || this == &b, subtract(a, b));
// If a is zero, copy b and flip its sign. If b is zero, copy a.
if (a.sign == zero) {
BigUnsigned::operator =(b);
// If a is zero, copy b and flip its sign. If b is zero, copy a.
if (a.sign == zero) {
BigUnsigned::operator =(b);
@@
-397,7
+397,7
@@
void BigInteger::subtract(const BigInteger &a, const BigInteger &b) {
// Multiplication
void BigInteger::multiply(const BigInteger &a, const BigInteger &b) {
// Multiplication
void BigInteger::multiply(const BigInteger &a, const BigInteger &b) {
- D
OTR
_ALIASED(this == &a || this == &b, multiply(a, b));
+ D
TRT
_ALIASED(this == &a || this == &b, multiply(a, b));
// If one object is zero, copy zero and return.
if (a.sign == zero || b.sign == zero) {
sign = zero;
// If one object is zero, copy zero and return.
if (a.sign == zero || b.sign == zero) {
sign = zero;
@@
-517,7
+517,7
@@
void BigInteger::divideWithRemainder(const BigInteger &b, BigInteger &q) {
// Negation
void BigInteger::negate(const BigInteger &a) {
// Negation
void BigInteger::negate(const BigInteger &a) {
- D
OTR
_ALIASED(this == &a, negate(a));
+ D
TRT
_ALIASED(this == &a, negate(a));
// Copy a's magnitude
BigUnsigned::operator =(a);
// Copy the opposite of a.sign
// Copy a's magnitude
BigUnsigned::operator =(a);
// Copy the opposite of a.sign