Skip to content

Explicit type cast to avoid signed/unsigned warning #2540

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 1 commit into from
Jul 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
3 changes: 2 additions & 1 deletion jbmc/src/java_bytecode/object_factory_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Author: Daniel Kroening, [email protected]
#include <util/irep.h>

#define MAX_NONDET_ARRAY_LENGTH_DEFAULT 5
#define MAX_NONDET_STRING_LENGTH std::numeric_limits<std::int32_t>::max()
#define MAX_NONDET_STRING_LENGTH \
static_cast<std::size_t>(std::numeric_limits<std::int32_t>::max())
#define MAX_NONDET_TREE_DEPTH 5
#define MAX_NONNULL_TREE_DEPTH 0

Expand Down
5 changes: 4 additions & 1 deletion src/solvers/sat/satcheck_minisat2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
#include <unistd.h>
#endif

#include <limits>
#include <stack>

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

void convert(const bvt &bv, Minisat::vec<Minisat::Lit> &dest)
{
dest.capacity(bv.size());
PRECONDITION(
bv.size() <= static_cast<std::size_t>(std::numeric_limits<int>::max()));
dest.capacity(static_cast<int>(bv.size()));

forall_literals(it, bv)
if(!it->is_false())
Expand Down