Skip to content

Commit

Permalink
Merge pull request diffblue#2304 from tautschnig/appveyor-warnings
Browse files Browse the repository at this point in the history
Address selected warnings raised by Visual Studio/AppVeyor
  • Loading branch information
tautschnig authored Jun 7, 2018
2 parents e54bba2 + 04565b4 commit 0612749
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/goto-programs/goto_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class goto_functiont
type.set(ID_C_hide, true);
}

goto_functiont()
goto_functiont() : body(), type({}, empty_typet())
{
}

Expand Down
6 changes: 4 additions & 2 deletions src/goto-programs/goto_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class goto_modelt : public abstract_goto_modelt

bool can_produce_function(const irep_idt &id) const override
{
return goto_functions.function_map.count(id);
return goto_functions.function_map.find(id) !=
goto_functions.function_map.end();
}
};

Expand Down Expand Up @@ -127,7 +128,8 @@ class wrapper_goto_modelt : public abstract_goto_modelt

bool can_produce_function(const irep_idt &id) const override
{
return goto_functions.function_map.count(id);
return goto_functions.function_map.find(id) !=
goto_functions.function_map.end();
}

private:
Expand Down
9 changes: 3 additions & 6 deletions src/util/arith_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_UTIL_ARITH_TOOLS_H
#define CPROVER_UTIL_ARITH_TOOLS_H

#include "invariant.h"
#include "mp_arith.h"
#include "optional.h"
#include "invariant.h"
#include "std_expr.h"

#include "deprecate.h"

class exprt;
class constant_exprt;
class typet;

// this one will go away
Expand All @@ -27,8 +26,6 @@ DEPRECATED("Use the constant_exprt version instead")
bool to_integer(const exprt &expr, mp_integer &int_value);

// returns 'true' on error
/// \deprecated: use numeric_cast<mp_integer> instead
DEPRECATED("Use numeric_cast<mp_integer> instead")
bool to_integer(const constant_exprt &expr, mp_integer &int_value);

// returns 'true' on error
Expand All @@ -49,7 +46,7 @@ struct numeric_castt<mp_integer> final
optionalt<mp_integer> operator()(const exprt &expr) const
{
mp_integer out;
if(to_integer(expr, out))
if(expr.id() != ID_constant || to_integer(to_constant_expr(expr), out))
return {};
return out;
}
Expand Down

0 comments on commit 0612749

Please sign in to comment.