3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00

minor code simplifications

This commit is contained in:
Nuno Lopes 2022-08-20 12:56:45 +01:00
parent 08bf7a6293
commit d5d77dfe64
4 changed files with 6 additions and 18 deletions

View file

@ -886,8 +886,7 @@ def mk_hpp_from_pyg(pyg_file, output_dir):
hpp = os.path.join(dirname, '%s.hpp' % class_name) hpp = os.path.join(dirname, '%s.hpp' % class_name)
out = open(hpp, 'w') out = open(hpp, 'w')
out.write('// Automatically generated file\n') out.write('// Automatically generated file\n')
out.write('#ifndef __%s_HPP_\n' % class_name.upper()) out.write('#pragma once\n')
out.write('#define __%s_HPP_\n' % class_name.upper())
out.write('#include "util/params.h"\n') out.write('#include "util/params.h"\n')
if export: if export:
out.write('#include "util/gparams.h"\n') out.write('#include "util/gparams.h"\n')
@ -919,7 +918,6 @@ def mk_hpp_from_pyg(pyg_file, output_dir):
out.write(' %s %s() const { return p.%s("%s", %s); }\n' % out.write(' %s %s() const { return p.%s("%s", %s); }\n' %
(TYPE2CTYPE[param[1]], to_c_method(param[0]), TYPE2GETTER[param[1]], param[0], pyg_default_as_c_literal(param))) (TYPE2CTYPE[param[1]], to_c_method(param[0]), TYPE2GETTER[param[1]], param[0], pyg_default_as_c_literal(param)))
out.write('};\n') out.write('};\n')
out.write('#endif\n')
out.close() out.close()
OUTPUT_HPP_FILE.append(hpp) OUTPUT_HPP_FILE.append(hpp)

View file

@ -20,10 +20,6 @@ Revision History:
#include "util/warning.h" #include "util/warning.h"
#include "util/z3_exception.h" #include "util/z3_exception.h"
template<bool SYNCH>
mpq_manager<SYNCH>::mpq_manager() {
}
template<bool SYNCH> template<bool SYNCH>
mpq_manager<SYNCH>::~mpq_manager() { mpq_manager<SYNCH>::~mpq_manager() {
del(m_tmp1); del(m_tmp1);

View file

@ -115,7 +115,7 @@ public:
static bool precise() { return true; } static bool precise() { return true; }
static bool field() { return true; } static bool field() { return true; }
mpq_manager(); mpq_manager() = default;
~mpq_manager(); ~mpq_manager();

View file

@ -138,21 +138,15 @@ public:
m().set(m_val, r.m_val); m().set(m_val, r.m_val);
return *this; return *this;
} }
private:
rational & operator=(bool) {
UNREACHABLE(); return *this;
}
inline rational operator*(bool r1) const {
UNREACHABLE();
return *this;
}
public: rational & operator=(bool) = delete;
rational operator*(bool r1) const = delete;
rational & operator=(int v) { rational & operator=(int v) {
m().set(m_val, v); m().set(m_val, v);
return *this; return *this;
} }
rational & operator=(double v) { UNREACHABLE(); return *this; } rational & operator=(double v) = delete;
friend inline rational numerator(rational const & r) { rational result; m().get_numerator(r.m_val, result.m_val); return result; } friend inline rational numerator(rational const & r) { rational result; m().get_numerator(r.m_val, result.m_val); return result; }