From 134cf2cab701309c1a01c14cb7272c3d24d6101f Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 15 Apr 2026 18:21:47 -0700 Subject: [PATCH] tidy Signed-off-by: James Cherry --- include/sta/Liberty.hh | 18 +++++++------- liberty/Liberty.cc | 9 ++++--- power/VcdReader.cc | 5 ---- tcl/TclTypeHelpers.cc | 48 +++++-------------------------------- util/Machine.cc | 33 ------------------------- util/RiseFallMinMax.cc | 11 ++++----- util/RiseFallMinMaxDelay.cc | 14 +++++------ util/Util.i | 17 ------------- 8 files changed, 30 insertions(+), 125 deletions(-) delete mode 100644 util/Machine.cc diff --git a/include/sta/Liberty.hh b/include/sta/Liberty.hh index 5e5fef75..20443127 100644 --- a/include/sta/Liberty.hh +++ b/include/sta/Liberty.hh @@ -24,27 +24,27 @@ #pragma once -#include -#include -#include #include #include +#include +#include #include +#include #include #include #include -#include "ConcreteLibrary.hh" #include "ContainerHelpers.hh" +#include "MinMax.hh" +#include "RiseFallMinMax.hh" +#include "ConcreteLibrary.hh" +#include "RiseFallValues.hh" +#include "MinMaxValues.hh" +#include "Transition.hh" #include "Delay.hh" #include "InternalPower.hh" #include "LeakagePower.hh" #include "LibertyClass.hh" -#include "MinMax.hh" -#include "MinMaxValues.hh" -#include "RiseFallMinMax.hh" -#include "RiseFallValues.hh" -#include "Transition.hh" namespace sta { diff --git a/liberty/Liberty.cc b/liberty/Liberty.cc index bdccfcbd..8deb4a1d 100644 --- a/liberty/Liberty.cc +++ b/liberty/Liberty.cc @@ -2978,11 +2978,10 @@ scaleFactorPvtName(ScaleFactorPvt pvt) ScaleFactors::ScaleFactors(std::string_view name) : name_(name) { - for (auto &scale : scales_) { - for (size_t pvt = 0; pvt < scale_factor_pvt_count; pvt++) { - for (size_t rf_index : RiseFall::rangeIndex()) { - scale[pvt][rf_index] = 0.0; - } + for (auto &type_factors : scales_) { + for (auto pvt_factors : type_factors) { + for (size_t rf_index : RiseFall::rangeIndex()) + pvt_factors[rf_index] = 0.0; } } } diff --git a/power/VcdReader.cc b/power/VcdReader.cc index 66373022..a300c90f 100644 --- a/power/VcdReader.cc +++ b/power/VcdReader.cc @@ -48,7 +48,6 @@ namespace sta { class VcdCount { public: - VcdCount(); double transitionCount() const { return transition_count_; } VcdTime highTime(VcdTime time_max) const; void incrCounts(VcdTime time, @@ -66,10 +65,6 @@ private: double transition_count_ = 0; }; -VcdCount::VcdCount() -{ -} - void VcdCount::addPin(const Pin *pin) { diff --git a/tcl/TclTypeHelpers.cc b/tcl/TclTypeHelpers.cc index 913a437f..d9a50a41 100644 --- a/tcl/TclTypeHelpers.cc +++ b/tcl/TclTypeHelpers.cc @@ -41,8 +41,8 @@ tclListStringSeq(Tcl_Obj *const source, if (Tcl_ListObjGetElements(interp, source, &argc, &argv) == TCL_OK) { for (int i = 0; i < argc; i++) { Tcl_Size length; - const char *str = Tcl_GetStringFromObj(argv[i], &length); - seq.push_back(str); + const char *arg = Tcl_GetStringFromObj(argv[i], &length); + seq.emplace_back(arg); } } return seq; @@ -59,8 +59,8 @@ tclListStringSeqPtr(Tcl_Obj *const source, StringSeq *seq = new StringSeq; for (int i = 0; i < argc; i++) { Tcl_Size length; - const char *str = Tcl_GetStringFromObj(argv[i], &length); - seq->push_back(str); + const char *arg = Tcl_GetStringFromObj(argv[i], &length); + seq->emplace_back(arg); } return seq; } @@ -79,8 +79,8 @@ tclListStringSet(Tcl_Obj *const source, StringSet *set = new StringSet; for (int i = 0; i < argc; i++) { Tcl_Size length; - const char *str = Tcl_GetStringFromObj(argv[i], &length); - set->insert(str); + const char *arg = Tcl_GetStringFromObj(argv[i], &length); + set->insert(arg); } return set; } @@ -102,42 +102,6 @@ tclArgError(Tcl_Interp *interp, } } -void -objectListNext(const char *list, - const char *type, - // Return values. - bool &type_match, - const char *&next) -{ - // Default return values (failure). - type_match = false; - next = nullptr; - // _hexaddress_p_type - const char *s = list; - char ch = *s++; - if (ch == '_') { - while (*s && isxdigit(*s)) - s++; - if ((s - list - 1) == sizeof(void*) * 2 - && *s && *s++ == '_' - && *s && *s++ == 'p' - && *s && *s++ == '_') { - const char *t = type; - while (*s && *s != ' ') { - if (*s != *t) - return; - s++; - t++; - } - type_match = true; - if (*s) - next = s + 1; - else - next = nullptr; - } - } -} - Tcl_Obj * tclArcDcalcArg(ArcDcalcArg &gate, Tcl_Interp *interp) diff --git a/util/Machine.cc b/util/Machine.cc deleted file mode 100644 index 07e14182..00000000 --- a/util/Machine.cc +++ /dev/null @@ -1,33 +0,0 @@ -// OpenSTA, Static Timing Analyzer -// Copyright (c) 2026, Parallax Software, Inc. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. -// -// Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// -// This notice may not be removed or altered from any source distribution. - -#if defined(_WIN32) - #include "MachineWin32.cc" -#elif defined(__APPLE__) - #include "MachineApple.cc" -#elif defined(__linux__) - #include "MachineLinux.cc" -#else - #include "MachineUnknown.cc" -#endif diff --git a/util/RiseFallMinMax.cc b/util/RiseFallMinMax.cc index 6c2566f4..774fd560 100644 --- a/util/RiseFallMinMax.cc +++ b/util/RiseFallMinMax.cc @@ -34,10 +34,9 @@ RiseFallMinMax::RiseFallMinMax() void RiseFallMinMax::clear() { - for (size_t rf_index = 0; rf_index