Remove google-runtime-references check

This commit is contained in:
Carles Fernandez 2019-02-14 12:51:43 +01:00
parent 31383258b0
commit 719af13a33
11 changed files with 41 additions and 37 deletions

View File

@ -1,5 +1,5 @@
--- ---
Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare' Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare'
WarningsAsErrors: '' WarningsAsErrors: ''
HeaderFilterRegex: '' HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false AnalyzeTemporaryDtors: false
@ -21,8 +21,6 @@ CheckOptions:
value: '_t' value: '_t'
- key: google-runtime-int.UnsignedTypePrefix - key: google-runtime-int.UnsignedTypePrefix
value: uint value: uint
- key: google-runtime-references.WhiteListTypes
value: ''
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
value: '1' value: '1'
- key: modernize-loop-convert.MaxCopySize - key: modernize-loop-convert.MaxCopySize

View File

@ -618,7 +618,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -704,7 +704,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -734,7 +734,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -764,7 +764,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -794,7 +794,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -824,7 +824,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -854,7 +854,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -914,7 +914,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -944,7 +944,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -974,7 +974,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -1004,7 +1004,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -1064,7 +1064,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -1124,7 +1124,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
{ {
LOG(WARNING) << "Problem opening output XML file"; LOG(WARNING) << "Problem opening output XML file";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
} }
@ -1176,7 +1176,7 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name)
xml << boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map); xml << boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map);
LOG(INFO) << "Saved gnss_sychro map data"; LOG(INFO) << "Saved gnss_sychro map data";
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
LOG(WARNING) << e.what(); LOG(WARNING) << e.what();
return false; return false;
@ -1201,7 +1201,7 @@ bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string& file_name)
xml >> boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map); xml >> boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map);
//std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges" << std::endl; //std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges" << std::endl;
} }
catch (std::exception& e) catch (const std::exception& e)
{ {
std::cout << e.what() << "File: " << file_name; std::cout << e.what() << "File: " << file_name;
return false; return false;

View File

@ -93,11 +93,11 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag
{ {
try try
{ {
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit);
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str(); LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str();
} }
catch (const std::ifstream::failure &e) catch (const std::ofstream::failure &e)
{ {
LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what(); LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what();
} }

View File

@ -53,7 +53,7 @@ gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsig
} }
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> ControlMessageFactory::GetControlMessages(const gr::message::sptr& queue_message) std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> ControlMessageFactory::GetControlMessages(const gr::message::sptr queue_message) // NOLINT(performance-unnecessary-value-param)
{ {
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages = std::make_shared<std::vector<std::shared_ptr<ControlMessage>>>(); std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages = std::make_shared<std::vector<std::shared_ptr<ControlMessage>>>();
unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage); unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage);

View File

@ -58,7 +58,7 @@ public:
virtual ~ControlMessageFactory(); virtual ~ControlMessageFactory();
gr::message::sptr GetQueueMessage(unsigned int who, unsigned int what); gr::message::sptr GetQueueMessage(unsigned int who, unsigned int what);
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> GetControlMessages(const gr::message::sptr& queue_message); std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> GetControlMessages(const gr::message::sptr queue_message); // NOLINT(performance-unnecessary-value-param)
}; };
#endif /*GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_*/ #endif /*GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_*/

View File

@ -285,11 +285,16 @@ int ControlThread::run()
flowgraph_->disconnect(); flowgraph_->disconnect();
// Join keyboard thread // Join keyboard thread
keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); try
sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); {
cmd_interface_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
LOG(INFO) << "Flowgraph stopped"; cmd_interface_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
}
catch (const boost::thread_interrupted &interrupt)
{
DLOG(INFO) << "Thread interrupted";
}
if (restart_) if (restart_)
{ {
@ -300,7 +305,7 @@ int ControlThread::run()
} }
void ControlThread::set_control_queue(const gr::msg_queue::sptr &control_queue) void ControlThread::set_control_queue(const gr::msg_queue::sptr control_queue) // NOLINT(performance-unnecessary-value-param)
{ {
if (flowgraph_->running()) if (flowgraph_->running())
{ {

View File

@ -93,7 +93,7 @@ public:
* *
* \param[in] boost::shared_ptr<gr::msg_queue> control_queue * \param[in] boost::shared_ptr<gr::msg_queue> control_queue
*/ */
void set_control_queue(const gr::msg_queue::sptr& control_queue); void set_control_queue(const gr::msg_queue::sptr control_queue); // NOLINT(performance-unnecessary-value-param)
unsigned int processed_control_messages() unsigned int processed_control_messages()

View File

@ -182,7 +182,7 @@ GNSSBlockFactory::~GNSSBlockFactory() = default;
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalSource( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalSource(
const std::shared_ptr<ConfigurationInterface>& configuration, const gr::msg_queue::sptr& queue, int ID) const std::shared_ptr<ConfigurationInterface>& configuration, const gr::msg_queue::sptr queue, int ID) // NOLINT(performance-unnecessary-value-param)
{ {
std::string default_implementation = "File_Signal_Source"; std::string default_implementation = "File_Signal_Source";
std::string role = "SignalSource"; //backwards compatibility for old conf files std::string role = "SignalSource"; //backwards compatibility for old conf files
@ -851,7 +851,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B1(
} }
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFactory::GetChannels( std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFactory::GetChannels(
const std::shared_ptr<ConfigurationInterface>& configuration, const gr::msg_queue::sptr& queue) const std::shared_ptr<ConfigurationInterface>& configuration, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param)
{ {
std::string default_implementation = "Pass_Through"; std::string default_implementation = "Pass_Through";
std::string tracking_implementation; std::string tracking_implementation;
@ -1139,7 +1139,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& role, const std::string& role,
const std::string& implementation, unsigned int in_streams, const std::string& implementation, unsigned int in_streams,
unsigned int out_streams, const gr::msg_queue::sptr& queue) unsigned int out_streams, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param)
{ {
std::unique_ptr<GNSSBlockInterface> block; std::unique_ptr<GNSSBlockInterface> block;

View File

@ -58,7 +58,7 @@ public:
GNSSBlockFactory(); GNSSBlockFactory();
virtual ~GNSSBlockFactory(); virtual ~GNSSBlockFactory();
std::unique_ptr<GNSSBlockInterface> GetSignalSource(const std::shared_ptr<ConfigurationInterface>& configuration, std::unique_ptr<GNSSBlockInterface> GetSignalSource(const std::shared_ptr<ConfigurationInterface>& configuration,
const gr::msg_queue::sptr& queue, int ID = -1); const gr::msg_queue::sptr queue, int ID = -1); // NOLINT(performance-unnecessary-value-param)
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(const std::shared_ptr<ConfigurationInterface>& configuration, int ID = -1); std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(const std::shared_ptr<ConfigurationInterface>& configuration, int ID = -1);
@ -67,7 +67,7 @@ public:
std::unique_ptr<GNSSBlockInterface> GetObservables(const std::shared_ptr<ConfigurationInterface>& configuration); std::unique_ptr<GNSSBlockInterface> GetObservables(const std::shared_ptr<ConfigurationInterface>& configuration);
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(const std::shared_ptr<ConfigurationInterface>& configuration, std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(const std::shared_ptr<ConfigurationInterface>& configuration,
const gr::msg_queue::sptr& queue); const gr::msg_queue::sptr queue); // NOLINT(performance-unnecessary-value-param)
/* /*
* \brief Returns the block with the required configuration and implementation * \brief Returns the block with the required configuration and implementation
@ -75,7 +75,7 @@ public:
std::unique_ptr<GNSSBlockInterface> GetBlock(const std::shared_ptr<ConfigurationInterface>& configuration, std::unique_ptr<GNSSBlockInterface> GetBlock(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& role, const std::string& implementation, const std::string& role, const std::string& implementation,
unsigned int in_streams, unsigned int out_streams, unsigned int in_streams, unsigned int out_streams,
const gr::msg_queue::sptr& queue = nullptr); const gr::msg_queue::sptr queue = nullptr); // NOLINT(performance-unnecessary-value-param)
private: private:
std::unique_ptr<GNSSBlockInterface> GetChannel_1C(const std::shared_ptr<ConfigurationInterface>& configuration, std::unique_ptr<GNSSBlockInterface> GetChannel_1C(const std::shared_ptr<ConfigurationInterface>& configuration,

View File

@ -62,7 +62,7 @@
using google::LogMessage; using google::LogMessage;
GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr& queue) GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param)
{ {
connected_ = false; connected_ = false;
running_ = false; running_ = false;
@ -839,6 +839,7 @@ void GNSSFlowgraph::disconnect()
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)
{ {
top_block_->disconnect(observables_->get_right_block(), i, pvt_->get_left_block(), i); top_block_->disconnect(observables_->get_right_block(), i, pvt_->get_left_block(), i);
top_block_->disconnect(observables_->get_right_block(), i, GnssSynchroMonitor_, i);
top_block_->msg_disconnect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry")); top_block_->msg_disconnect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry"));
} }
} }

View File

@ -72,7 +72,7 @@ public:
/*! /*!
* \brief Constructor that initializes the receiver flow graph * \brief Constructor that initializes the receiver flow graph
*/ */
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr& queue); GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr queue); // NOLINT(performance-unnecessary-value-param)
/*! /*!
* \brief Destructor * \brief Destructor