From 15c9b72f136e182ae1ea798c6ae3b9624066d3cd Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 20 Dec 2012 16:42:33 +0100 Subject: [PATCH] [buddy] * src/bdd.h: Make all inplace operators return a reference. --- buddy/src/bdd.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/buddy/src/bdd.h b/buddy/src/bdd.h index 0792d6c60..e02b59901 100644 --- a/buddy/src/bdd.h +++ b/buddy/src/bdd.h @@ -461,23 +461,23 @@ class bdd int id(void) const; - bdd operator=(const bdd &r); + bdd& operator=(const bdd &r); bdd operator&(const bdd &r) const; - bdd operator&=(const bdd &r); + bdd& operator&=(const bdd &r); bdd operator^(const bdd &r) const; - bdd operator^=(const bdd &r); + bdd& operator^=(const bdd &r); bdd operator|(const bdd &r) const; - bdd operator|=(const bdd &r); + bdd& operator|=(const bdd &r); bdd operator!(void) const; bdd operator>>(const bdd &r) const; - bdd operator>>=(const bdd &r); + bdd& operator>>=(const bdd &r); bdd operator-(const bdd &r) const; - bdd operator-=(const bdd &r); + bdd& operator-=(const bdd &r); bdd operator>(const bdd &r) const; bdd operator<(const bdd &r) const; bdd operator<<(const bdd &r) const; - bdd operator<<=(const bdd &r); + bdd& operator<<=(const bdd &r); int operator==(const bdd &r) const; int operator!=(const bdd &r) const; @@ -485,7 +485,7 @@ private: BDD root; bdd(BDD r) { root=r; if (root > 1) bdd_addref_nc(root); } - bdd operator=(BDD r); + bdd& operator=(BDD r); friend int bdd_init(int, int); friend int bdd_setvarnum(int); @@ -808,19 +808,19 @@ inline int bdd::id(void) const inline bdd bdd::operator&(const bdd &r) const { return bdd_apply(*this,r,bddop_and); } -inline bdd bdd::operator&=(const bdd &r) +inline bdd& bdd::operator&=(const bdd &r) { return (*this=bdd_apply(*this,r,bddop_and)); } inline bdd bdd::operator^(const bdd &r) const { return bdd_apply(*this,r,bddop_xor); } -inline bdd bdd::operator^=(const bdd &r) +inline bdd& bdd::operator^=(const bdd &r) { return (*this=bdd_apply(*this,r,bddop_xor)); } inline bdd bdd::operator|(const bdd &r) const { return bdd_apply(*this,r,bddop_or); } -inline bdd bdd::operator|=(const bdd &r) +inline bdd& bdd::operator|=(const bdd &r) { return (*this=bdd_apply(*this,r,bddop_or)); } inline bdd bdd::operator!(void) const @@ -829,13 +829,13 @@ inline bdd bdd::operator!(void) const inline bdd bdd::operator>>(const bdd &r) const { return bdd_apply(*this,r,bddop_imp); } -inline bdd bdd::operator>>=(const bdd &r) +inline bdd& bdd::operator>>=(const bdd &r) { return (*this=bdd_apply(*this,r,bddop_imp)); } inline bdd bdd::operator-(const bdd &r) const { return bdd_apply(*this,r,bddop_diff); } -inline bdd bdd::operator-=(const bdd &r) +inline bdd& bdd::operator-=(const bdd &r) { return (*this=bdd_apply(*this,r,bddop_diff)); } inline bdd bdd::operator>(const bdd &r) const @@ -847,7 +847,7 @@ inline bdd bdd::operator<(const bdd &r) const inline bdd bdd::operator<<(const bdd &r) const { return bdd_apply(*this,r,bddop_invimp); } -inline bdd bdd::operator<<=(const bdd &r) +inline bdd& bdd::operator<<=(const bdd &r) { return (*this=bdd_apply(*this,r,bddop_invimp)); } inline int bdd::operator==(const bdd &r) const @@ -856,7 +856,7 @@ inline int bdd::operator==(const bdd &r) const inline int bdd::operator!=(const bdd &r) const { return r.root!=root; } -inline bdd bdd::operator=(const bdd &r) +inline bdd& bdd::operator=(const bdd &r) { if (__likely(root != r.root)) { @@ -869,7 +869,7 @@ inline bdd bdd::operator=(const bdd &r) return *this; } -inline bdd bdd::operator=(int r) +inline bdd& bdd::operator=(int r) { if (__likely(root != r)) {