diff --git a/src/tactic/fpa/fpa2bv_model_converter.cpp b/src/tactic/fpa/fpa2bv_model_converter.cpp index e4d51ed45..91f7bd3d4 100644 --- a/src/tactic/fpa/fpa2bv_model_converter.cpp +++ b/src/tactic/fpa/fpa2bv_model_converter.cpp @@ -179,8 +179,6 @@ expr_ref fpa2bv_model_converter::convert_bv2rm(model * bv_mdl, func_decl * var, void fpa2bv_model_converter::convert(model * bv_mdl, model * float_mdl) { fpa_util fu(m); bv_util bu(m); - unsynch_mpz_manager & mpzm = fu.fm().mpz_manager(); - unsynch_mpq_manager & mpqm = fu.fm().mpq_manager(); TRACE("fpa2bv_mc", tout << "BV Model: " << std::endl; for (unsigned i = 0; i < bv_mdl->get_num_constants(); i++) diff --git a/src/test/ddnf.cpp b/src/test/ddnf.cpp index 8620bd441..d2ca92557 100644 --- a/src/test/ddnf.cpp +++ b/src/test/ddnf.cpp @@ -123,7 +123,7 @@ datalog::ddnf_core* populate_ddnf(char const* file, ptr_vector& tbvs) { static void read_args(char ** argv, int argc, int& i) { - if (argc = i + 2) { + if (argc == i + 2) { g_file = argv[i + 1]; ++i; return; diff --git a/src/test/doc.cpp b/src/test/doc.cpp index b2863a629..331901734 100644 --- a/src/test/doc.cpp +++ b/src/test/doc.cpp @@ -181,7 +181,6 @@ class test_doc_cls { expr_ref result(m); expr_ref_vector conjs(m); unsigned n = m2.num_tbits(); - tbv_manager& tm = m2.tbvm(); SASSERT(n <= m_vars.size()); for (unsigned i = 0; i < n; ++i) { switch (t[i]) { diff --git a/src/test/old_interval.cpp b/src/test/old_interval.cpp index 91096a629..92064c03e 100644 --- a/src/test/old_interval.cpp +++ b/src/test/old_interval.cpp @@ -172,7 +172,6 @@ public: static void tst2() { typedef basic_interval_manager mpzi_manager; - typedef mpzi_manager::interval mpzi; typedef mpzi_manager::scoped_interval scoped_mpzi; unsynch_mpz_manager nm; diff --git a/src/test/simplex.cpp b/src/test/simplex.cpp index 61ab7180b..3a5e58a4b 100644 --- a/src/test/simplex.cpp +++ b/src/test/simplex.cpp @@ -24,35 +24,35 @@ static vector vec(int i, int j) { return nv; } -static vector vec(int i, int j, int k) { - vector nv = vec(i, j); - nv.push_back(R(k)); - return nv; -} +// static vector vec(int i, int j, int k) { +// vector nv = vec(i, j); +// nv.push_back(R(k)); +// return nv; +// } -static vector vec(int i, int j, int k, int l) { - vector nv = vec(i, j, k); - nv.push_back(R(l)); - return nv; -} +// static vector vec(int i, int j, int k, int l) { +// vector nv = vec(i, j, k); +// nv.push_back(R(l)); +// return nv; +// } -static vector vec(int i, int j, int k, int l, int x) { - vector nv = vec(i, j, k, l); - nv.push_back(R(x)); - return nv; -} +/// static vector vec(int i, int j, int k, int l, int x) { +/// vector nv = vec(i, j, k, l); +/// nv.push_back(R(x)); +/// return nv; +/// } -static vector vec(int i, int j, int k, int l, int x, int y) { - vector nv = vec(i, j, k, l, x); - nv.push_back(R(y)); - return nv; -} +// static vector vec(int i, int j, int k, int l, int x, int y) { +// vector nv = vec(i, j, k, l, x); +// nv.push_back(R(y)); +// return nv; +// } -static vector vec(int i, int j, int k, int l, int x, int y, int z) { - vector nv = vec(i, j, k, l, x, y); - nv.push_back(R(z)); - return nv; -} +// static vector vec(int i, int j, int k, int l, int x, int y, int z) { +// vector nv = vec(i, j, k, l, x, y); +// nv.push_back(R(z)); +// return nv; +// } @@ -148,7 +148,7 @@ void tst_simplex() { coeffs.push_back(mpz(i+1)); } - Simplex::row r = S.add_row(1, coeffs.size(), vars.c_ptr(), coeffs.c_ptr()); + // Simplex::row r = S.add_row(1, coeffs.size(), vars.c_ptr(), coeffs.c_ptr()); is_sat = S.make_feasible(); std::cout << "feasible: " << is_sat << "\n"; S.display(std::cout); diff --git a/src/util/hwf.cpp b/src/util/hwf.cpp index 21f1c281f..3963836f2 100644 --- a/src/util/hwf.cpp +++ b/src/util/hwf.cpp @@ -85,8 +85,8 @@ hwf_manager::~hwf_manager() { } -#define RAW(X) (*reinterpret_cast(&(X))) -#define DBL(X) (*reinterpret_cast(&(X))) +uint64 RAW(double X) { uint64 tmp; memcpy(&tmp, &(X), sizeof(uint64)); return tmp; } +double DBL(uint64 X) { double tmp; memcpy(&tmp, &(X), sizeof(double)); return tmp; } void hwf_manager::set(hwf & o, int value) { o.value = (double) value; @@ -166,7 +166,7 @@ void hwf_manager::set(hwf & o, bool sign, uint64 significand, int exponent) { uint64 raw = (sign?0x8000000000000000ull:0); raw |= (((uint64)exponent) + 1023) << 52; raw |= significand; - o.value = *reinterpret_cast(&raw); + memcpy(&o.value, &raw, sizeof(double)); } void hwf_manager::set(hwf & o, hwf const & x) { diff --git a/src/util/mpfx.cpp b/src/util/mpfx.cpp index c75a43046..41ed93617 100644 --- a/src/util/mpfx.cpp +++ b/src/util/mpfx.cpp @@ -199,8 +199,10 @@ void mpfx_manager::set(mpfx & n, uint64 v) { else { allocate_if_needed(n); n.m_sign = 0; - unsigned * _v = reinterpret_cast(&v); unsigned * w = words(n); + uint64 * _vp = &v; + unsigned * _v = 0; + memcpy(&_v, &_vp, sizeof(unsigned*)); for (unsigned i = 0; i < m_total_sz; i++) w[i] = 0; w[m_frac_part_sz] = _v[0]; @@ -679,7 +681,8 @@ int64 mpfx_manager::get_int64(mpfx const & n) const { SASSERT(is_int64(n)); unsigned * w = words(n); w += m_frac_part_sz; - uint64 r = *reinterpret_cast(w); + uint64 r = 0; + memcpy(&r, w, sizeof(uint64)); if (r == 0x8000000000000000ull) { SASSERT(is_neg(n)); return INT64_MIN; @@ -693,7 +696,9 @@ uint64 mpfx_manager::get_uint64(mpfx const & n) const { SASSERT(is_uint64(n)); unsigned * w = words(n); w += m_frac_part_sz; - return *reinterpret_cast(w); + uint64 r = 0; + memcpy(&r, w, sizeof(uint64)); + return r; } template