Skip to content

Commit 0612749

Browse files
authored
Merge pull request #2304 from tautschnig/appveyor-warnings
Address selected warnings raised by Visual Studio/AppVeyor
2 parents e54bba2 + 04565b4 commit 0612749

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/goto-programs/goto_function.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class goto_functiont
4646
type.set(ID_C_hide, true);
4747
}
4848

49-
goto_functiont()
49+
goto_functiont() : body(), type({}, empty_typet())
5050
{
5151
}
5252

src/goto-programs/goto_model.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ class goto_modelt : public abstract_goto_modelt
9292

9393
bool can_produce_function(const irep_idt &id) const override
9494
{
95-
return goto_functions.function_map.count(id);
95+
return goto_functions.function_map.find(id) !=
96+
goto_functions.function_map.end();
9697
}
9798
};
9899

@@ -127,7 +128,8 @@ class wrapper_goto_modelt : public abstract_goto_modelt
127128

128129
bool can_produce_function(const irep_idt &id) const override
129130
{
130-
return goto_functions.function_map.count(id);
131+
return goto_functions.function_map.find(id) !=
132+
goto_functions.function_map.end();
131133
}
132134

133135
private:

src/util/arith_tools.h

+3-6
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ Author: Daniel Kroening, [email protected]
1010
#ifndef CPROVER_UTIL_ARITH_TOOLS_H
1111
#define CPROVER_UTIL_ARITH_TOOLS_H
1212

13+
#include "invariant.h"
1314
#include "mp_arith.h"
1415
#include "optional.h"
15-
#include "invariant.h"
16+
#include "std_expr.h"
1617

1718
#include "deprecate.h"
1819

19-
class exprt;
20-
class constant_exprt;
2120
class typet;
2221

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

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

3431
// returns 'true' on error
@@ -49,7 +46,7 @@ struct numeric_castt<mp_integer> final
4946
optionalt<mp_integer> operator()(const exprt &expr) const
5047
{
5148
mp_integer out;
52-
if(to_integer(expr, out))
49+
if(expr.id() != ID_constant || to_integer(to_constant_expr(expr), out))
5350
return {};
5451
return out;
5552
}

0 commit comments

Comments
 (0)