Skip to content

Address selected warnings raised by Visual Studio/AppVeyor #2304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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