Skip to content
Snippets Groups Projects
Commit 05b4976d authored by psychocrypt's avatar psychocrypt
Browse files

fix default interleave value

The default value for interleave was wrongly set to 50.

Remove the value and take the devault from the default constructor instead of side channeling it from the json parser.
parent 35fb646c
No related branches found
No related tags found
No related merge requests found
...@@ -122,21 +122,22 @@ bool jconf::GetThreadConfig(size_t id, thd_cfg &cfg) ...@@ -122,21 +122,22 @@ bool jconf::GetThreadConfig(size_t id, thd_cfg &cfg)
return false; return false;
// interleave is optional // interleave is optional
if(interleave == nullptr) if(interleave != nullptr)
cfg.interleave = 50;
else if(!interleave->IsUint64())
{ {
printer::inst()->print_msg(L0, "ERROR: interleave must be a number"); if(!interleave->IsInt())
return false; {
} printer::inst()->print_msg(L0, "ERROR: interleave must be a number");
else if((int)interleave->GetInt64() < 0 || (int)interleave->GetInt64() > 100) return false;
{ }
printer::inst()->print_msg(L0, "ERROR: interleave must be in range [0;100]"); else if(interleave->GetInt() < 0 || interleave->GetInt() > 100)
return false; {
} printer::inst()->print_msg(L0, "ERROR: interleave must be in range [0;100]");
else return false;
{ }
cfg.interleave = (int)interleave->GetInt64(); else
{
cfg.interleave = interleave->GetInt();
}
} }
if(!idx->IsUint64() || !intensity->IsUint64() || !w_size->IsUint64()) if(!idx->IsUint64() || !intensity->IsUint64() || !w_size->IsUint64())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment