debugPrint0 for zero arg debugPrint

This commit is contained in:
James Cherry 2021-01-04 20:52:44 -08:00
parent 54dbbf625e
commit 777e36b870
2 changed files with 12 additions and 5 deletions

View File

@ -880,7 +880,7 @@ ArnoldiDelayCalc::pr_solve1(double s,
// ignoring a typical error at drive node, that comes
// from slight inaccuracies in rr
if (!(rr[order-1]>1.0 && p[order-1]>500.0 && va>v1-0.002))
debugPrint(debug_, "arnoldi", 1, "err, pr_solve1, va<v1");
debugPrint0(debug_, "arnoldi", 1, "err, pr_solve1, va<v1");
}
tmin = ta; vmin = va;
} else {
@ -893,7 +893,7 @@ ArnoldiDelayCalc::pr_solve1(double s,
pr_get_v(ta,s,order,p,rr,&va);
}
if (va>v1)
debugPrint(debug_, "arnoldi", 1, "err, pr_solve1, va>v1");
debugPrint0(debug_, "arnoldi", 1, "err, pr_solve1, va>v1");
tmax = ta; vmax = va;
}
} else {
@ -1459,9 +1459,9 @@ ArnoldiDelayCalc::ar1_ceff_delay(delay_work *D,
ceff_time = s;
ceff = pr_ceff(s,r,mod->order,p,rr,ceff_time);
if((ceff-1e-20) < 0.0) { // 1e-8pf
debugPrint(debug_, "arnoldi", 1,
"Invalid effective capacitance, using total capacitance");
if ((ceff-1e-20) < 0.0) { // 1e-8pf
debugPrint0(debug_, "arnoldi", 1,
"Invalid effective capacitance, using total capacitance");
ceff = ctot;
}

View File

@ -65,4 +65,11 @@ private:
debug->reportLine(what, msg, ##__VA_ARGS__); \
}
// Sadly c++11 __VA_ARGS__ macros must have at least one arg, so this form
// should be used when there are no args for the message.
#define debugPrint0(debug, what, level, msg) \
if (debug->check(what, level)) { \
debug->reportLine(what, msg); \
}
} // namespace