Skip to content

Commit b17fefa

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#2540 from tautschnig/vs-explicit-cast
Explicit type cast to avoid signed/unsigned warning
2 parents 425db26 + 96a7014 commit b17fefa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

jbmc/src/java_bytecode/object_factory_parameters.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Author: Daniel Kroening, [email protected]
1515
#include <util/irep.h>
1616

1717
#define MAX_NONDET_ARRAY_LENGTH_DEFAULT 5
18-
#define MAX_NONDET_STRING_LENGTH std::numeric_limits<std::int32_t>::max()
18+
#define MAX_NONDET_STRING_LENGTH \
19+
static_cast<std::size_t>(std::numeric_limits<std::int32_t>::max())
1920
#define MAX_NONDET_TREE_DEPTH 5
2021
#define MAX_NONNULL_TREE_DEPTH 0
2122

src/solvers/sat/satcheck_minisat2.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414
#include <unistd.h>
1515
#endif
1616

17+
#include <limits>
1718
#include <stack>
1819

1920
#include <util/invariant.h>
@@ -28,7 +29,9 @@ Author: Daniel Kroening, [email protected]
2829

2930
void convert(const bvt &bv, Minisat::vec<Minisat::Lit> &dest)
3031
{
31-
dest.capacity(bv.size());
32+
PRECONDITION(
33+
bv.size() <= static_cast<std::size_t>(std::numeric_limits<int>::max()));
34+
dest.capacity(static_cast<int>(bv.size()));
3235

3336
forall_literals(it, bv)
3437
if(!it->is_false())

0 commit comments

Comments
 (0)