From bf161cc759bee7dc75e9bde5a95528475fabece4 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Tue, 7 Jul 2020 17:07:50 -0700 Subject: [PATCH 1/2] compiler warning --- liberty/LibertyExpr.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/liberty/LibertyExpr.cc b/liberty/LibertyExpr.cc index 60ce4f55..4933cad9 100644 --- a/liberty/LibertyExpr.cc +++ b/liberty/LibertyExpr.cc @@ -16,6 +16,7 @@ #include "FuncExpr.hh" +#include // min #include "Report.hh" #include "StringUtil.hh" #include "Liberty.hh" @@ -129,14 +130,9 @@ LibExprParser::copyInput(char *buf, { size_t length = strlen(func_); if (length == 0) - return 0; + return 0; else { - size_t count; - - if (length < max_size) - count = length; - else - count = max_size; + size_t count = std::min(length, max_size); strncpy(buf, func_, count); func_ += count; return count; From 64a196da75f08da7370d7c535d82bcbdb8e997b5 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Tue, 7 Jul 2020 17:08:17 -0700 Subject: [PATCH 2/2] report json syntax --- search/ReportPath.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/search/ReportPath.cc b/search/ReportPath.cc index 293554ac..b16fda52 100644 --- a/search/ReportPath.cc +++ b/search/ReportPath.cc @@ -2551,11 +2551,11 @@ ReportPath::reportPathJson(const Path *path, network_->location(pin, x, y, exists); if (exists) { result += " \"x\": "; - stringPrint(tmp, "%.6f", x); + stringPrint(tmp, "%.9f", x); result += tmp + ",\n"; result += " \"y\": "; - stringPrint(tmp, "%.6f", y); - result += tmp + "\n"; + stringPrint(tmp, "%.9f", y); + result += tmp + ",\n"; } result += " \"arrival\": "; @@ -2564,9 +2564,12 @@ ReportPath::reportPathJson(const Path *path, result += " \"slew\": "; stringPrint(tmp, "%.3e", path->slew(this)); - result += tmp + ",\n"; + result += tmp + "\n"; - result += " }\n"; + result += " }"; + if (i < expanded.size() - 1) + result += ","; + result += "\n"; } result += " ]\n"; result += "}\n";