Skip to content

Commit

Permalink
fix calng-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eyck committed Jul 27, 2021
1 parent ea6a7c6 commit 64bb5dd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 29 deletions.
3 changes: 2 additions & 1 deletion src/sysc/scc/configurer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ void scc::configurer::check_config_hierarchical(Json::Value const& node, std::st

void scc::init_cci(std::string name) {
#ifdef WITH_CCI
cci::cci_register_broker(new cci_utils::broker("Global Broker"));
static cci_utils::broker broker(name);
cci::cci_register_broker(&broker);
#endif
}
5 changes: 2 additions & 3 deletions src/sysc/scc/report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include <fstream>
#include "report.h"
#ifdef WITH_CCI
#include <cci_configuration>
#include <cci_utils/broker.h>
#include "configurer.h"
#endif
#include "spdlog/async.h"
#include "spdlog/sinks/basic_file_sink.h"
Expand Down Expand Up @@ -346,7 +345,7 @@ static void configure_logging() {
static bool spdlog_initialized = false;
#ifdef WITH_CCI
if(!log_cfg.dont_create_broker)
cci::cci_register_broker(new cci_utils::broker("SCCBroker"));
scc::init_cci("SCCBroker");
#endif

sc_report_handler::set_actions(SC_ERROR, SC_DEFAULT_ERROR_ACTIONS | SC_DISPLAY);
Expand Down
4 changes: 2 additions & 2 deletions src/sysc/scc/scv/scv_tr_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ struct Database : Base {
}

inline void writeAttribute(uint64_t id, EventType event, const string& name, data_type type, double value) {
int exponent;
const double mantissa = frexp(value, &exponent);
// int exponent;
// const double mantissa = frexp(value, &exponent);
}

inline void writeRelation(const std::string& name, uint64_t sink_id, uint64_t src_id) {
Expand Down
16 changes: 4 additions & 12 deletions third_party/scv-tr/src/scv-tr/scv_introspection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,7 @@ void scv_extensions_if::set_debug(int i) {
// ----------------------------------------
// dynamic data
// ----------------------------------------
_scv_dynamic_data::~_scv_dynamic_data() {
/*
std::list<_scv_dynamic_data::callback_base*>::iterator i;
std::list<_scv_dynamic_data::callback_base*>::iterator e = _callbacks.end();
for (i = _callbacks.begin(); i != e; ++i) {
delete *i;
}
*/
}
_scv_dynamic_data::~_scv_dynamic_data() = default;

void _scv_dynamic_data::execute_callbacks(scv_extensions_if* obj, scv_extensions_if::callback_reason r) {
std::list<_scv_dynamic_data::callback_base*>::iterator i;
Expand Down Expand Up @@ -841,9 +833,9 @@ void _scv_extension_rw_sc_bit::get_value(sc_lv_base& v) const { _SCV_RW_ERROR(ge
_SCV_EXT_RW_FC_BASE_I(sc_logic, sc_logic);
_SCV_EXT_RW_FC_ASSIGNS_I(sc_logic, sc_logic);
std::string _scv_extension_rw_sc_logic::get_string() const {
char str_val[2];
sprintf(str_val, "%c", this->_get_instance()->to_char());
return std::string(str_val);
std::array<char, 2> str_val;
sprintf(str_val.data(), "%c", this->_get_instance()->to_char());
return str_val.data();
}
void _scv_extension_rw_sc_logic::assign(const sc_bv_base& v) { _SCV_RW_ERROR(assign, sc_bv_base, sc_logic); }
void _scv_extension_rw_sc_logic::get_value(sc_bv_base& v) const { _SCV_RW_ERROR(get_value, sc_lv_base, sc_logic); }
Expand Down
6 changes: 1 addition & 5 deletions third_party/scv-tr/src/scv-tr/scv_tr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,7 @@ _scv_tr_handle_core::_scv_tr_handle_core()
this->ref_count = 1;
}

_scv_tr_handle_core::~_scv_tr_handle_core() {
#ifdef scv_tr_TRACE
cout << "In _scv_tr_handle_core dtor\n";
#endif
}
_scv_tr_handle_core::~_scv_tr_handle_core() = default;

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions third_party/scv-tr/src/scv-tr/scv_tr_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ static void do_attributes(bool declare_attributes, // If false then print the va
} break;

default: {
char tmpString[100];
sprintf(tmpString, "Unsupported attribute type = %d", my_exts_p->get_type());
std::array<char, 100> tmpString;
sprintf(tmpString.data(), "Unsupported attribute type = %d", my_exts_p->get_type());

_scv_message::message(_scv_message::TRANSACTION_RECORDING_INTERNAL, tmpString);
_scv_message::message(_scv_message::TRANSACTION_RECORDING_INTERNAL, tmpString.data());
}
}
}
Expand Down Expand Up @@ -593,9 +593,9 @@ static void scv_tr_handle_record_attribute_cbf(const scv_tr_handle& t, const cha
tmp_str = attribute_name;
}

char tmp_str2[100];
sprintf(tmp_str2, "tx_record_attribute " scv_tr_TEXT_LLU, t.get_id());
std::string exts_kind = tmp_str2;
std::array<char, 100> tmp_str2;
sprintf(tmp_str2.data(), "tx_record_attribute " scv_tr_TEXT_LLU, t.get_id());
std::string exts_kind = tmp_str2.data();

do_attributes(false, false, true, tmp_str, exts_kind, my_exts_p, nullptr);
}
Expand Down

0 comments on commit 64bb5dd

Please sign in to comment.