Skip to content
Draft
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
11 changes: 5 additions & 6 deletions src/bin/opensmt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,13 @@ SMTConfig parseCMDLineArgs( int argc, char * argv[ ] )
printHelp();
exit(0);
case 'v':
res.setOption(SMTConfig::o_verbosity, SMTOption(true), msg);
res.setOption(SMTConfig::o_verbosity, SMTOption{true}, msg);
break;
case 'd':
res.setOption(SMTConfig::o_dryrun, SMTOption(true), msg);
res.setOption(SMTConfig::o_dryrun, SMTOption{true}, msg);
break;
case 'r':
if (!res.setOption(SMTConfig::o_random_seed, SMTOption(atoi(optarg)), msg))
if (!res.setOption(SMTConfig::o_random_seed, SMTOption{atoi(optarg)}, msg))
fprintf(stderr, "Error setting random seed: %s\n", msg);
else
fprintf(stderr, "; Using random seed %d\n", atoi(optarg));
Expand All @@ -339,7 +339,7 @@ SMTConfig parseCMDLineArgs( int argc, char * argv[ ] )
res.setOption(SMTConfig::o_produce_models, SMTOption(true), msg);
break;
case 'i':
res.setOption(SMTConfig::o_produce_inter, SMTOption(true), msg);
res.setOption(SMTConfig::o_produce_inter, SMTOption{true}, msg);
break;
case 't': {
int64_t timeLimit;
Expand All @@ -349,8 +349,7 @@ SMTConfig parseCMDLineArgs( int argc, char * argv[ ] )
throw std::invalid_argument{"Invalid argument of time-limit: "s + e.what()};
}

//+ SMTOption is not defined for long long
ok &= res.setOption(SMTConfig::o_time_limit, SMTOption(long(timeLimit)), msg);
ok &= res.setOption(SMTConfig::o_time_limit, SMTOption{timeLimit}, msg);
break;
}
case 'p':
Expand Down
3 changes: 2 additions & 1 deletion src/options/SMTConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ namespace opensmt {
SMTOption(int i) : value(i) {}
//+ Should also support long representation
SMTOption(long i) : SMTOption(static_cast<int>(i)) {}
SMTOption(long long i) : SMTOption(static_cast<long>(i)) {}
SMTOption(double i): value(i) {}
SMTOption(const char* s) : value(s) {}
inline bool isEmpty() const { return value.type == O_EMPTY; }
Expand Down Expand Up @@ -964,7 +965,7 @@ namespace opensmt {

void setSimplifyInterpolant(int val) {
const char* msg;
setOption(o_simplify_inter, SMTOption(val), msg);
setOption(o_simplify_inter, SMTOption{val}, msg);
}

int getSimplifyInterpolant() const {
Expand Down
6 changes: 3 additions & 3 deletions src/parallel/opensmtSplitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ int main( int argc, char * argv[] )
break;
case 'd':
const char* msg;
c.setOption(SMTConfig::o_dryrun, SMTOption(true), msg);
c.setOption(SMTConfig::o_dryrun, SMTOption{true}, msg);
break;
case 'r':
if (!c.setOption(SMTConfig::o_random_seed, SMTOption(atoi(optarg)), msg))
if (!c.setOption(SMTConfig::o_random_seed, SMTOption{atoi(optarg)}, msg))
fprintf(stderr, "Error setting random seed: %s\n", msg);
else
fprintf(stderr, "; Using random seed %d\n", atoi(optarg));
break;
case 'i':
c.setOption(SMTConfig::o_produce_inter, SMTOption(true), msg);
c.setOption(SMTConfig::o_produce_inter, SMTOption{true}, msg);
break;
case 'p':
pipe = true;
Expand Down
3 changes: 1 addition & 2 deletions test/unit/test_Timeout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ class TimeoutTest : public ::testing::Test {
solver.setTimeLimit(limit_ms);
} else {
auto & config = configs[solverIdx];
//+ SMTOption is not defined for long long
[[maybe_unused]]
bool rval = config.setOption(SMTConfig::o_time_limit, SMTOption(long(limit_ms.count())), auxMsg);
bool rval = config.setOption(SMTConfig::o_time_limit, SMTOption{limit_ms.count()}, auxMsg);
assert(rval);
}
}
Expand Down