diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2020-12-01 23:44:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 23:44:21 -0800 |
commit | 6b92c671980054cd30f72715d6081bff59c1e03a (patch) | |
tree | 901954e7cef1b4ee86026af25bd7efb63abd5494 /src/util/floatingpoint.cpp | |
parent | 4b311b17906994186a6c58ee1cb3aaeb590231f5 (diff) | |
parent | 901cea314c4dc3be411c345e42c858063fe5aa1b (diff) |
Merge branch 'master' into fixClangWarningsfixClangWarnings
Diffstat (limited to 'src/util/floatingpoint.cpp')
-rw-r--r-- | src/util/floatingpoint.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/util/floatingpoint.cpp b/src/util/floatingpoint.cpp index c5ec4d0c6..5b291f3c5 100644 --- a/src/util/floatingpoint.cpp +++ b/src/util/floatingpoint.cpp @@ -129,35 +129,35 @@ FloatingPoint::FloatingPoint(const FloatingPointSize& size, #ifdef CVC4_USE_SYMFPU if (signedBV) { - d_fpl = new FloatingPointLiteral( + d_fpl.reset(new FloatingPointLiteral( symfpu::convertSBVToFloat<symfpuLiteral::traits>( symfpuLiteral::CVC4FPSize(size), symfpuLiteral::CVC4RM(rm), - symfpuLiteral::CVC4SignedBitVector(bv))); + symfpuLiteral::CVC4SignedBitVector(bv)))); } else { - d_fpl = new FloatingPointLiteral( + d_fpl.reset(new FloatingPointLiteral( symfpu::convertUBVToFloat<symfpuLiteral::traits>( symfpuLiteral::CVC4FPSize(size), symfpuLiteral::CVC4RM(rm), - symfpuLiteral::CVC4UnsignedBitVector(bv))); + symfpuLiteral::CVC4UnsignedBitVector(bv)))); } #else - d_fpl = new FloatingPointLiteral(2, 2, 0.0); + d_fpl.reset(new FloatingPointLiteral(2, 2, 0.0)); #endif } FloatingPoint::FloatingPoint(const FloatingPointSize& fp_size, - const FloatingPointLiteral* fpl) + FloatingPointLiteral* fpl) : d_fp_size(fp_size) { - d_fpl = new FloatingPointLiteral(*fpl); + d_fpl.reset(fpl); } FloatingPoint::FloatingPoint(const FloatingPoint& fp) : d_fp_size(fp.d_fp_size) { - d_fpl = new FloatingPointLiteral(*fp.d_fpl); + d_fpl.reset(new FloatingPointLiteral(*fp.d_fpl)); } FloatingPoint::FloatingPoint(const FloatingPointSize& size, @@ -171,10 +171,10 @@ FloatingPoint::FloatingPoint(const FloatingPointSize& size, { #ifdef CVC4_USE_SYMFPU // In keeping with the SMT-LIB standard - d_fpl = new FloatingPointLiteral( - SymFPUUnpackedFloatLiteral::makeZero(size, false)); + d_fpl.reset(new FloatingPointLiteral( + SymFPUUnpackedFloatLiteral::makeZero(size, false))); #else - d_fpl = new FloatingPointLiteral(2, 2, 0.0); + d_fpl.reset(new FloatingPointLiteral(2, 2, 0.0)); #endif } else @@ -285,8 +285,8 @@ FloatingPoint::FloatingPoint(const FloatingPointSize& size, negative, exactExp.signExtend(extension), sig); // Then cast... - d_fpl = new FloatingPointLiteral( - symfpu::convertFloatToFloat(exactFormat, size, rm, exactFloat.d_symuf)); + d_fpl.reset(new FloatingPointLiteral(symfpu::convertFloatToFloat( + exactFormat, size, rm, exactFloat.d_symuf))); #else Unreachable() << "no concrete implementation of FloatingPointLiteral"; #endif @@ -295,8 +295,6 @@ FloatingPoint::FloatingPoint(const FloatingPointSize& size, FloatingPoint::~FloatingPoint() { - delete d_fpl; - d_fpl = nullptr; } FloatingPoint FloatingPoint::makeNaN(const FloatingPointSize& size) |