From 64105cd84307c091e3dd2bea2727edf6bdf58ed6 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 20 Jan 2014 22:09:21 +0100 Subject: fix some errors seen by cppcheck --- src/EtiReader.cpp | 8 ++++---- src/EtiReader.h | 4 ++-- src/FIRFilter.cpp | 2 +- src/InputZeroMQReader.cpp | 2 +- src/Log.cpp | 2 +- src/RemoteControl.cpp | 6 +++--- src/RemoteControl.h | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/EtiReader.cpp b/src/EtiReader.cpp index fcc0125..b1fa482 100644 --- a/src/EtiReader.cpp +++ b/src/EtiReader.cpp @@ -52,12 +52,12 @@ EtiReader::EtiReader(struct modulator_offset_config& modconf, Logger& logger) : myLogger(logger), state(EtiReaderStateSync), - myFicSource(NULL) + myFicSource(NULL), + myTimestampDecoder(modconf, myLogger) { PDEBUG("EtiReader::EtiReader()\n"); myCurrentFrame = 0; - myTimestampDecoder = new TimestampDecoder(modconf, myLogger); } EtiReader::~EtiReader() @@ -276,13 +276,13 @@ int EtiReader::process(Buffer* dataIn) } // Update timestamps - myTimestampDecoder->updateTimestampEti(eti_fc.FP & 0x3, + myTimestampDecoder.updateTimestampEti(eti_fc.FP & 0x3, eti_eoh.MNSC, getPPSOffset()); if (getFCT() % 125 == 0) //every 3 seconds is fine enough { - myTimestampDecoder->updateModulatorOffset(); + myTimestampDecoder.updateModulatorOffset(); } return dataIn->getLength() - input_size; diff --git a/src/EtiReader.h b/src/EtiReader.h index 5833a25..b3c1f94 100644 --- a/src/EtiReader.h +++ b/src/EtiReader.h @@ -57,7 +57,7 @@ public: void calculateTimestamp(struct frame_timestamp& ts) { - myTimestampDecoder->calculateTimestamp(ts); + myTimestampDecoder.calculateTimestamp(ts); } /* Return the frame counter */ @@ -85,7 +85,7 @@ protected: eti_TIST eti_tist; FicSource* myFicSource; std::vector mySources; - TimestampDecoder* myTimestampDecoder; + TimestampDecoder myTimestampDecoder; private: size_t myCurrentFrame; diff --git a/src/FIRFilter.cpp b/src/FIRFilter.cpp index d110060..ebf22a3 100644 --- a/src/FIRFilter.cpp +++ b/src/FIRFilter.cpp @@ -64,7 +64,7 @@ void FIRFilterWorker::process(struct FIRFilterWorkerData *fwd) dataOut = new Buffer(); dataOut->setLength(dataIn->getLength()); - PDEBUG("FIRFilterWorker: dataIn->getLength() %lu\n", dataIn->getLength()); + PDEBUG("FIRFilterWorker: dataIn->getLength() %zu\n", dataIn->getLength()); #if __AVX__ #define _mm256_load1_ps(x) _mm256_set_ps(x, x, x, x, x, x, x, x) diff --git a/src/InputZeroMQReader.cpp b/src/InputZeroMQReader.cpp index e689e4c..8bea761 100644 --- a/src/InputZeroMQReader.cpp +++ b/src/InputZeroMQReader.cpp @@ -114,7 +114,7 @@ void InputZeroMQWorker::RecvProcess(struct InputZeroMQThreadData* workerdata) } } } - catch ( zmq::error_t err ) { + catch (zmq::error_t& err) { printf("ZeroMQ error in RecvProcess: '%s'\n", err.what()); } } diff --git a/src/Log.cpp b/src/Log.cpp index 2c4de21..91fd278 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -41,7 +41,7 @@ Logger::register_backend(LogBackend* backend) { void Logger::log(log_level_t level, std::string message) { - for (std::list::iterator it = backends.begin(); it != backends.end(); it++) { + for (std::list::iterator it = backends.begin(); it != backends.end(); ++it) { (*it)->log(level, message); } } diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp index bd401f4..67c1d13 100644 --- a/src/RemoteControl.cpp +++ b/src/RemoteControl.cpp @@ -124,7 +124,7 @@ RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string command) stringstream ss; if (cmd.size() == 1) { - for (list::iterator it = cohort_.begin(); it != cohort_.end(); it++) { + for (list::iterator it = cohort_.begin(); it != cohort_.end(); ++it) { ss << (*it)->get_rc_name() << " "; } } @@ -133,7 +133,7 @@ RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string command) stringstream ss; list< vector > params = get_parameter_descriptions_(cmd[1]); - for (list< vector >::iterator it = params.begin(); it != params.end(); it++) { + for (list< vector >::iterator it = params.begin(); it != params.end(); ++it) { ss << (*it)[0] << " : " << (*it)[1] << endl; } reply(socket, ss.str()); @@ -153,7 +153,7 @@ RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string command) try { stringstream ss; list< vector > r = get_param_list_values_(cmd[1]); - for (list< vector >::iterator it = r.begin(); it != r.end(); it++) { + for (list< vector >::iterator it = r.begin(); it != r.end(); ++it) { ss << (*it)[0] << ": " << (*it)[1] << endl; } reply(socket, ss.str()); diff --git a/src/RemoteControl.h b/src/RemoteControl.h index 79b330f..6ac07a5 100644 --- a/src/RemoteControl.h +++ b/src/RemoteControl.h @@ -95,7 +95,7 @@ class RemoteControllable { virtual list get_supported_parameters() { cerr << "get_sup_par" << parameters_.size() << endl; list parameterlist; - for (list< vector >::iterator it = parameters_.begin(); it != parameters_.end(); it++) { + for (list< vector >::iterator it = parameters_.begin(); it != parameters_.end(); ++it) { parameterlist.push_back((*it)[0]); } return parameterlist; @@ -162,7 +162,7 @@ class RemoteControllerTelnet : public BaseRemoteController { } RemoteControllable* get_controllable_(string name) { - for (list::iterator it = cohort_.begin(); it != cohort_.end(); it++) { + for (list::iterator it = cohort_.begin(); it != cohort_.end(); ++it) { if ((*it)->get_rc_name() == name) { return *it; @@ -187,7 +187,7 @@ class RemoteControllerTelnet : public BaseRemoteController { list< vector > allparams; list params = controllable->get_supported_parameters(); cerr << "# of supported parameters " << params.size() << endl; - for (list::iterator it = params.begin(); it != params.end(); it++) { + for (list::iterator it = params.begin(); it != params.end(); ++it) { vector item; item.push_back(*it); item.push_back(controllable->get_parameter(*it)); -- cgit v1.2.3