summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-01-20 22:09:21 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-01-20 22:09:21 +0100
commit64105cd84307c091e3dd2bea2727edf6bdf58ed6 (patch)
tree4722e8e75b9fe859aa6e53697df612a1e05a5693 /src
parent3f094996520fbf006a567873bc9da4d1b430345f (diff)
downloaddabmod-64105cd84307c091e3dd2bea2727edf6bdf58ed6.tar.gz
dabmod-64105cd84307c091e3dd2bea2727edf6bdf58ed6.tar.bz2
dabmod-64105cd84307c091e3dd2bea2727edf6bdf58ed6.zip
fix some errors seen by cppcheck
Diffstat (limited to 'src')
-rw-r--r--src/EtiReader.cpp8
-rw-r--r--src/EtiReader.h4
-rw-r--r--src/FIRFilter.cpp2
-rw-r--r--src/InputZeroMQReader.cpp2
-rw-r--r--src/Log.cpp2
-rw-r--r--src/RemoteControl.cpp6
-rw-r--r--src/RemoteControl.h6
7 files changed, 15 insertions, 15 deletions
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<SubchannelSource*> 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<LogBackend*>::iterator it = backends.begin(); it != backends.end(); it++) {
+ for (std::list<LogBackend*>::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<RemoteControllable*>::iterator it = cohort_.begin(); it != cohort_.end(); it++) {
+ for (list<RemoteControllable*>::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<string> > params = get_parameter_descriptions_(cmd[1]);
- for (list< vector<string> >::iterator it = params.begin(); it != params.end(); it++) {
+ for (list< vector<string> >::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<string> > r = get_param_list_values_(cmd[1]);
- for (list< vector<string> >::iterator it = r.begin(); it != r.end(); it++) {
+ for (list< vector<string> >::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<string> get_supported_parameters() {
cerr << "get_sup_par" << parameters_.size() << endl;
list<string> parameterlist;
- for (list< vector<string> >::iterator it = parameters_.begin(); it != parameters_.end(); it++) {
+ for (list< vector<string> >::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<RemoteControllable*>::iterator it = cohort_.begin(); it != cohort_.end(); it++) {
+ for (list<RemoteControllable*>::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<string> > allparams;
list<string> params = controllable->get_supported_parameters();
cerr << "# of supported parameters " << params.size() << endl;
- for (list<string>::iterator it = params.begin(); it != params.end(); it++) {
+ for (list<string>::iterator it = params.begin(); it != params.end(); ++it) {
vector<string> item;
item.push_back(*it);
item.push_back(controllable->get_parameter(*it));