From 96718187e1348349891c0f27c0d8702f67e0b8af Mon Sep 17 00:00:00 2001 From: James Cherry Date: Sun, 12 Dec 2021 17:10:24 -0700 Subject: [PATCH] gcc warning Signed-off-by: James Cherry --- CMakeLists.txt | 2 +- include/sta/Error.hh | 2 +- tcl/StaTcl.i | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e0fa284..05e7fd9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,7 +369,7 @@ add_custom_command(OUTPUT ${STA_TCL_INIT} # CMAKE_FIND_FRAMEWORK LAST bypasses the version in the framework directory # but not the one in /usr/lib. # This calls cmake/FindTCL.cmake -# Do not use REQUIRED because it also requires TK. +# Do not use REQUIRED because it also requires TK, which is not used by OpenSTA. find_package(TCL) # Zlib diff --git a/include/sta/Error.hh b/include/sta/Error.hh index 760ff819..fa942f39 100644 --- a/include/sta/Error.hh +++ b/include/sta/Error.hh @@ -77,7 +77,7 @@ protected: // Report an error condition that should not be possible. // The default handler prints msg to stderr and exits. // The msg should NOT include a period or return. -// For only in those cases where a Report object is not available. +// Only for use in those cases where a Report object is not available. #define criticalError(id,msg) \ Report::defaultReport()->fileCritical(id, __FILE__, __LINE__, msg) diff --git a/tcl/StaTcl.i b/tcl/StaTcl.i index 07d35689..d4cf1b4d 100644 --- a/tcl/StaTcl.i +++ b/tcl/StaTcl.i @@ -4136,12 +4136,13 @@ crpr_mode() void set_crpr_mode(const char *mode) { + Sta *sta = Sta::sta(); if (stringEq(mode, "same_pin")) Sta::sta()->setCrprMode(CrprMode::same_pin); else if (stringEq(mode, "same_transition")) Sta::sta()->setCrprMode(CrprMode::same_transition); else - criticalError(272, "unknown common clk pessimism mode."); + sta->report()->critical(272, "unknown common clk pessimism mode."); } bool @@ -5063,16 +5064,15 @@ set_clock_sense_cmd(PinSet *pins, bool negative, bool stop_propagation) { - ClockSense sense; + Sta *sta = Sta::sta(); if (positive) - sense = ClockSense::positive; + sta->setClockSense(pins, clks, ClockSense::positive); else if (negative) - sense = ClockSense::negative; + sta->setClockSense(pins, clks, ClockSense::negative); else if (stop_propagation) - sense = ClockSense::stop; + sta->setClockSense(pins, clks, ClockSense::stop); else - criticalError(273, "unknown clock sense"); - Sta::sta()->setClockSense(pins, clks, sense); + sta->report()->critical(273, "unknown clock sense"); } bool