diff --git a/dcalc/ArnoldiDelayCalc.cc b/dcalc/ArnoldiDelayCalc.cc index 92ad09a9..d83e5d9c 100644 --- a/dcalc/ArnoldiDelayCalc.cc +++ b/dcalc/ArnoldiDelayCalc.cc @@ -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, vav1) - 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; } diff --git a/include/sta/Debug.hh b/include/sta/Debug.hh index fc042c7d..9c7d017a 100644 --- a/include/sta/Debug.hh +++ b/include/sta/Debug.hh @@ -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