Skip to content

Commit

Permalink
initialize potentially unused variables. Fixes issue #112
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
Nikolaj Bjorner committed May 28, 2015
1 parent 49a4df0 commit 23a6138
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/api/c++/z3++.h
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ namespace z3 {

friend expr operator+(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
Z3_ast args[2] = { a, b };
r = Z3_mk_add(a.ctx(), 2, args);
Expand All @@ -703,7 +703,7 @@ namespace z3 {

friend expr operator*(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
Z3_ast args[2] = { a, b };
r = Z3_mk_mul(a.ctx(), 2, args);
Expand All @@ -730,7 +730,7 @@ namespace z3 {

friend expr operator/(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
r = Z3_mk_div(a.ctx(), a, b);
}
Expand All @@ -748,7 +748,7 @@ namespace z3 {
friend expr operator/(int a, expr const & b) { return b.ctx().num_val(a, b.get_sort()) / b; }

friend expr operator-(expr const & a) {
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith()) {
r = Z3_mk_unary_minus(a.ctx(), a);
}
Expand All @@ -765,7 +765,7 @@ namespace z3 {

friend expr operator-(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
Z3_ast args[2] = { a, b };
r = Z3_mk_sub(a.ctx(), 2, args);
Expand All @@ -785,7 +785,7 @@ namespace z3 {

friend expr operator<=(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
r = Z3_mk_le(a.ctx(), a, b);
}
Expand All @@ -804,7 +804,7 @@ namespace z3 {

friend expr operator>=(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
r = Z3_mk_ge(a.ctx(), a, b);
}
Expand All @@ -823,7 +823,7 @@ namespace z3 {

friend expr operator<(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
r = Z3_mk_lt(a.ctx(), a, b);
}
Expand All @@ -842,7 +842,7 @@ namespace z3 {

friend expr operator>(expr const & a, expr const & b) {
check_context(a, b);
Z3_ast r;
Z3_ast r = 0;
if (a.is_arith() && b.is_arith()) {
r = Z3_mk_gt(a.ctx(), a, b);
}
Expand Down Expand Up @@ -1189,7 +1189,7 @@ namespace z3 {

expr eval(expr const & n, bool model_completion=false) const {
check_context(*this, n);
Z3_ast r;
Z3_ast r = 0;
Z3_bool status = Z3_model_eval(ctx(), m_model, n, model_completion, &r);
check_error();
if (status == Z3_FALSE)
Expand Down

0 comments on commit 23a6138

Please sign in to comment.