From 8b4abd3228b31c104964f174fac733bc5e7c4b33 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Mon, 17 Jan 2022 20:12:51 -0800 Subject: [PATCH] Remove some dead code This dead code was discovered by gcov testing. --- verireal.cc | 27 ++------------------------- verireal.h | 18 ++++++------------ 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/verireal.cc b/verireal.cc index 0cdc8ed32..6297bc31c 100644 --- a/verireal.cc +++ b/verireal.cc @@ -66,9 +66,9 @@ verireal::~verireal() { } -long verireal::as_long(int shift) const +long verireal::as_long() const { - double out = value_ * pow(10.0,shift); + double out = value_; double outf; if (out >= 0.0) { @@ -133,13 +133,6 @@ verireal operator/ (const verireal&l, const verireal&r) return res; } -verireal operator/ (const verireal&l, const verinum&r) -{ - verireal res; - res.value_ = l.value_ / (double)r.as_long(); - return res; -} - verireal operator% (const verireal&l, const verireal&r) { verireal res; @@ -151,22 +144,6 @@ verireal operator% (const verireal&l, const verireal&r) return res; } -verireal operator% (const verireal&l, const verinum&r) -{ - verireal res; - // See above. - assert(gn_icarus_misc_flag); - res.value_ = fmod(l.value_, (double)r.as_long()); - return res; -} - -verireal pow (const verireal&l, const verireal&r) -{ - verireal res; - res.value_ = pow(l.value_, r.value_); - return res; -} - verireal operator- (const verireal&l) { verireal res; diff --git a/verireal.h b/verireal.h index 084c0c6e6..8a76b4e9a 100644 --- a/verireal.h +++ b/verireal.h @@ -42,10 +42,7 @@ class verireal { friend verireal operator- (const verireal&, const verireal&); friend verireal operator* (const verireal&, const verireal&); friend verireal operator/ (const verireal&, const verireal&); - friend verireal operator/ (const verireal&, const verinum&); friend verireal operator% (const verireal&, const verireal&); - friend verireal operator% (const verireal&, const verinum&); - friend verireal pow(const verireal&, const verireal&); // Unary minus. friend verireal operator- (const verireal&); @@ -57,12 +54,12 @@ class verireal { explicit verireal(double val); ~verireal(); - /* Return the value of the floating point number as an - integer, rounded as needed. The shift is the power of 10 to - multiply the value before calculating the result. So for - example if the value is 2.5 and shift == 1, the result - is 25. */ - long as_long(int shift =0) const; + // Return the value of the floating point number as an + // integer, rounded as needed. The shift is the power of 10 to + // multiply the value before calculating the result. So for + // example if the value is 2.5 and shift == 1, the result + // is 25. + long as_long() const; int64_t as_long64(int shift =0) const; double as_double() const; @@ -74,10 +71,7 @@ class verireal { extern std::ostream& operator<< (std::ostream&, const verireal&); extern verireal operator* (const verireal&, const verireal&); extern verireal operator/ (const verireal&, const verireal&); -extern verireal operator/ (const verireal&, const verinum&); extern verireal operator% (const verireal&, const verireal&); -extern verireal operator% (const verireal&, const verinum&); -extern verireal pow(const verireal&, const verireal&); extern verireal operator- (const verireal&); #endif /* IVL_verireal_H */