Commit ad867e14 authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Fix: Coding Rules Fat Roughing Modernize empty

parent 5340af58
......@@ -538,7 +538,7 @@ void CBoxAlgorithmSkeletonGenerator::buttonOkCB()
//Codecs algorithms
//--------------------------------------------------------------------------------------
CString l_sPattern = "@@Algorithms@@";
CString l_sSubstitute = m_vInputs.size() == 0 ? "\\/\\/ No Input decoder.\\n" : "\\/\\/ Input decoder:\\n";
CString l_sSubstitute = m_vInputs.empty() ? "\\/\\/ No Input decoder.\\n" : "\\/\\/ Input decoder:\\n";
for (size_t idx = 0; idx < m_vInputs.size(); idx++)
{
string l_sTypeName(camelCase((const char *)m_vInputs[idx]._type));
......@@ -550,7 +550,7 @@ void CBoxAlgorithmSkeletonGenerator::buttonOkCB()
l_sSubstitute += CString("\\t\\t\\tOpenViBEToolkit::T") + l_sTypeName.c_str() + "Decoder < CBoxAlgorithm" + m_sClassName + " > m_oInput" + std::to_string(idx).c_str() + "Decoder;\\n";
}
l_sSubstitute += m_vOutputs.size() == 0 ? "\\t\\t\\t\\/\\/ No Output decoder.\\n" : "\\t\\t\\t\\/\\/ Output decoder:\\n";
l_sSubstitute += m_vOutputs.empty() ? "\\t\\t\\t\\/\\/ No Output decoder.\\n" : "\\t\\t\\t\\/\\/ Output decoder:\\n";
for (size_t idx = 0; idx < m_vOutputs.size(); idx++)
{
string l_sTypeName(camelCase((const char *)m_vOutputs[idx]._type));
......
......@@ -255,7 +255,7 @@ bool CSkeletonGenerator::generate(CString sTemplateFile, CString sDestinationFil
}
// we check the map
if (mSubstitutions.size() == 0)
if (mSubstitutions.empty())
{
rLog += "[WARNING] No substitution provided.\n";
OV_WARNING_K("No substitution provided.");
......
......@@ -160,7 +160,7 @@ bool CConfigurationLabStreamingLayer::postConfigure()
return false;
}
if (m_vSignalIndex.size() == 0)
if (m_vSignalIndex.empty())
{
m_rDriverContext.getLogManager() << LogLevel_Error << "LSL: Cannot proceed without a signal stream.\n";
m_bApplyConfiguration = false;
......
......@@ -161,7 +161,7 @@ bool CDriverLabStreamingLayer::initialize(
// Find the signal stream
const std::vector<lsl::stream_info> l_vStreams = lsl::resolve_stream("name", m_sSignalStream.toASCIIString(), 1, g_LSL_resolveTimeOut);
if (!l_vStreams.size())
if (l_vStreams.empty())
{
m_rDriverContext.getLogManager() << LogLevel_Error << "Error resolving signal stream with name [" << m_sSignalStream.toASCIIString() << "]\n";
return false;
......@@ -181,7 +181,7 @@ bool CDriverLabStreamingLayer::initialize(
if (m_sMarkerStream != CString("None"))
{
const std::vector<lsl::stream_info> l_vMarkerStreams = lsl::resolve_stream("name", m_sMarkerStream.toASCIIString(), 1, g_LSL_resolveTimeOut);
if (!l_vMarkerStreams.size())
if (l_vMarkerStreams.empty())
{
m_rDriverContext.getLogManager() << LogLevel_Error << "Error resolving marker stream with name [" << m_sMarkerStream.toASCIIString() << "]\n";
return false;
......
......@@ -392,7 +392,7 @@ short CDriverMicromedSystemPlusEvolution::MyReceive(char* buf, long dataLen)
long nDati = 0;
long recByte;
//get data contains in the temp buffer
while (m_lTempBuff.size() > 0 && nDati < dataLen)
while (!m_lTempBuff.empty() && nDati < dataLen)
{
buf[nDati] = m_lTempBuff.front();
m_lTempBuff.pop_front();
......@@ -432,7 +432,7 @@ bool CDriverMicromedSystemPlusEvolution::receiveAllHeader()
else
{
//if no header was found, its impossible to find the next data block
if (m_lHeader.size() == 0)
if (m_lHeader.empty())
{
m_rDriverContext.getLogManager() << LogLevel_Error << "Header received not in correct form\n";
return false;
......@@ -706,7 +706,7 @@ bool CDriverMicromedSystemPlusEvolution::loop()
}
m_rDriverContext.getLogManager() << LogLevel_Trace << ">Number header received: " << m_lHeader.size() << "\n";
while (m_lHeader.size() > 0)
while (!m_lHeader.empty())
{
if (!loadNextHeader())
{
......
......@@ -179,7 +179,7 @@ namespace OpenViBEAcquisitionServer
m_oPendingBufferCondition.wait(oLock,
[this]()
{
return (m_bPleaseQuit || !m_rConnection.isConnected() || m_vClientPendingBuffer.size() > 0);
return (m_bPleaseQuit || !m_rConnection.isConnected() || !m_vClientPendingBuffer.empty());
}
);
......@@ -191,7 +191,7 @@ namespace OpenViBEAcquisitionServer
}
// At this point, we should have a buffer
if (!m_vClientPendingBuffer.size())
if (m_vClientPendingBuffer.empty())
{
// n.b. Shouldn't happen, but we don't have an error reporting mechanism in the thread...
oLock.unlock();
......@@ -727,7 +727,7 @@ bool CAcquisitionServer::connect(IDriver& rDriver, IHeader& rHeaderCopy, uint32
for (uint32_t i = 0, l = 0; i < m_ui32ChannelCount; ++i)
{
const std::string name = rHeaderCopy.getChannelName(i);
if (name != "")
if (!name.empty())
{
m_vSelectedChannels.push_back(i);
rHeaderCopy.setChannelName(l, name.c_str());
......@@ -832,7 +832,7 @@ bool CAcquisitionServer::connect(IDriver& rDriver, IHeader& rHeaderCopy, uint32
for (uint32_t i = 0; i < m_ui32ChannelCount; i++)
{
const std::string l_sChannelName = rHeaderCopy.getChannelName(i);
if (l_sChannelName != "")
if (!l_sChannelName.empty())
{
ip_pSignalMatrix->setDimensionLabel(0, i, l_sChannelName.c_str());
}
......
......@@ -290,7 +290,7 @@ bool CHeaderImpl::isChannelGainSet() const
bool CHeaderImpl::isChannelUnitSet() const
{
return m_vChannelUnits.size() > 0;
return !m_vChannelUnits.empty();
}
......
......@@ -94,7 +94,7 @@ namespace OpenViBEAcquisitionServer
while (std::getline(in, token, ' '))
{
if (token == "")
if (token.empty())
{
continue;
}
......
......@@ -41,10 +41,10 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
for (auto it = l_vArgValue.begin(); it != l_vArgValue.end(); ++it)
{
if (*it == "") { }
if (*it.empty()) { }
else if (*it == "-c" || *it == "--config")
{
if (*++it == "")
if (*++it.empty())
{
std::cout << "Error: Switch --config needs an argument\n";
return false;
......@@ -53,7 +53,7 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
}
else if (*it == "-d" || *it == "--define")
{
if (*++it == "")
if (*++it.empty())
{
std::cout << "Error: Need two arguments after -d / --define.\n";
return false;
......@@ -62,7 +62,7 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
// Were not using = as a separator for token/value, as on Windows its a problem passing = to the cmd interpreter
// which is used to launch the actual designer exe.
const std::string& l_rToken = *it;
if (*++it == "")
if (*++it.empty())
{
std::cout << "Error: Need two arguments after -d / --define.\n";
return false;
......@@ -74,7 +74,7 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
}
else if (*it == "-k" || *it == "--kernel")
{
if (*++it == "")
if (*++it.empty())
{
std::cout << "Error: Switch --kernel needs an argument\n";
return false;
......
......@@ -64,7 +64,7 @@ bool Demuxer::step()
OpenViBE::Kernel::ErrorType::BadParsing
);
*/
if (bytes.size() > 0)
if (!bytes.empty())
{
m_oReader.processData(&bytes[0], bytes.size());
}
......
......@@ -554,7 +554,7 @@ bool GUI::resetWidgetProperties()
gtk_range_set_value(GTK_RANGE(m_hScrollbar), 0);
if (m_Tracks.size() > 0 && !m_rTracker.getWorkspace().getMemorySaveMode())
if (!m_Tracks.empty() && !m_rTracker.getWorkspace().getMemorySaveMode())
{
const ovtime_t maxDuration = m_rTracker.getWorkspace().getMaxDuration();
const double maxSecs = ITimeArithmetics::timeToSeconds(maxDuration);
......
......@@ -76,7 +76,7 @@ bool ParallelExecutor::pushJobList(const std::deque<jobCall>& vJobList)
{ // lock scope
std::lock_guard<std::mutex> lock(m_JobMutex);
if (m_JobList.size() > 0)
if (!m_JobList.empty())
{
std::cout << "Error, trying to push list with old jobs pending\n";
return false;
......@@ -94,7 +94,7 @@ bool ParallelExecutor::pushJobList(const std::deque<jobCall>& vJobList)
bool ParallelExecutor::waitForAll()
{
std::unique_lock<std::mutex> lock(m_JobMutex);
while (m_JobList.size() > 0)
while (!m_JobList.empty())
{
m_JobDone.wait(lock);
}
......@@ -107,7 +107,7 @@ bool ParallelExecutor::getJob(jobCall& job)
// Wait until we get a job or are told to quit
std::unique_lock<std::mutex> lock(m_JobMutex);
m_HaveWork.wait(lock, [this]() { return (this->m_Quit || this->m_JobList.size() > 0); });
m_HaveWork.wait(lock, [this]() { return (this->m_Quit || !this->m_JobList.empty()); });
if (m_Quit)
{
......@@ -149,7 +149,7 @@ size_t ParallelExecutor::getJobCount() const
bool ParallelExecutor::isIdle() const
{
std::unique_lock<std::mutex> lock(m_JobMutex);
return (m_JobList.size() == 0 && m_nJobsRunning == 0);
return (m_JobList.empty() && m_nJobsRunning == 0);
}
......
......@@ -356,7 +356,7 @@ bool ProcExternalProcessing::pop()
// @note Decoder doesn't need to add offsets as these times are coming from the
// external processor, so they are already offset by the past length.
if (chunk.bufferData.size() > 0)
if (!chunk.bufferData.empty())
{
m_vDecoders[chunk.streamIndex]->decode(chunk);
......
......@@ -151,10 +151,10 @@ bool PushClient::step()
m_oBufferCondition.wait(oLock,
[this]()
{
return (m_bPleaseFlush || m_vBuffer.size() > 0 || m_bPleaseQuit || !isConnected() || isEndReceived());
return (m_bPleaseFlush || !m_vBuffer.empty() || m_bPleaseQuit || !isConnected() || isEndReceived());
});
while (m_vBuffer.size() > 0)
while (!m_vBuffer.empty())
{
EncodedChunk* chunk = m_vBuffer[0];
m_vBuffer.pop_front();
......@@ -201,7 +201,7 @@ bool PullClient::pullBuffer(EncodedChunk& rEncodedChunk)
{
std::lock_guard<std::mutex> oLock(m_oThreadMutex);
if (m_vBuffer.size() == 0)
if (m_vBuffer.empty())
{
return false;
}
......
......@@ -91,11 +91,11 @@ bool Selection::isSelectionConsistent() const
selectedTypes.push_back(str->getTypeIdentifier());
}
}
if (selectedTypesPrevious.size() > 0 && selectedTypes.size() > 0 && selectedTypesPrevious != selectedTypes)
if (!selectedTypesPrevious.empty() && !selectedTypes.empty() && selectedTypesPrevious != selectedTypes)
{
return false;
}
if (selectedTypes.size() > 0)
if (!selectedTypes.empty())
{
selectedTypesPrevious = selectedTypes;
}
......
......@@ -160,7 +160,7 @@ bool StreamBundle::deleteStream(size_t idx)
bool StreamBundle::getNextStreamIndex(size_t& earliestIndex) const
{
if (m_Streams.size() == 0)
if (m_Streams.empty())
{
return false;
}
......
......@@ -256,7 +256,7 @@ bool Tracker::applyBoxPlugin(size_t index)
{
// Free resources if this thread is the last
if (wptr->streamsToProcess.size() == 0)
if (wptr->streamsToProcess.empty())
{
if (wptr->source->getDirtyBit())
{
......@@ -274,7 +274,7 @@ bool Tracker::applyBoxPlugin(size_t index)
delete wptr->source;
}
}
if (wptr->streamsToProcess.size() == 0)
if (wptr->streamsToProcess.empty())
{
delete wptr;
}
......
......@@ -19,7 +19,7 @@ TrackerPlugins::TrackerPlugins(const OpenViBE::Kernel::IKernelContext& ctx) : Co
m_TrackerPlugins.push_back(ptr);
}
if (m_TrackerPlugins.size() == 0)
if (m_TrackerPlugins.empty())
{
return;
}
......
......@@ -816,7 +816,7 @@ std::vector<std::pair<std::string, std::string>> Workspace::getConfigurationToke
// @fixme for multiple workspaces this solution needs to be reworked
bool Workspace::save(const CString& filename)
{
if (m_Tracks.size() > 0 && !saveAll())
if (!m_Tracks.empty() && !saveAll())
{
return false;
}
......
......@@ -86,7 +86,7 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
for (auto it = l_vArgValue.cbegin(); it != l_vArgValue.cend(); ++it)
{
if (*it == "") { }
if (*it.empty()) { }
else if (*it == "-h" || *it == "--help")
{
l_oConfiguration.m_help = true;
......@@ -95,7 +95,7 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
}
else if (*it == "-c" || *it == "--config")
{
if (*++it == "")
if (*++it.empty())
{
std::cout << "Error: Switch --config needs an argument\n";
return false;
......@@ -104,7 +104,7 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
}
else if (*it == "-d" || *it == "--define")
{
if (*++it == "")
if (*++it.empty())
{
std::cout << "Error: Need two arguments after -d / --define.\n";
return false;
......@@ -113,7 +113,7 @@ bool parse_arguments(int argc, char** argv, SConfiguration& rConfiguration)
// Were not using = as a separator for token/value, as on Windows its a problem passing = to the cmd interpreter
// which is used to launch the actual designer exe.
const std::string& l_rToken = *it;
if (*++it == "")
if (*++it.empty())
{
std::cout << "Error: Need two arguments after -d / --define.\n";
return false;
......
......@@ -64,7 +64,7 @@ bool CBoxAlgorithmBrainampFileWriterGipsa::initialize()
}
//Perform checks:
if (std::string(l_sFilename) == "")
if (std::string(l_sFilename).empty())
{
this->getLogManager() << LogLevel_Error << "Header file path is empty!\n";
return false;
......
......@@ -119,7 +119,7 @@ bool CBoxAlgorithmEDFFileWriter::uninitialize()
}
// Do we have a partial buffer? If so, write it out padded by zeroes
if (m_vBuffer.size() > 0)
if (!m_vBuffer.empty())
{
this->getLogManager() << LogLevel_Trace << "if(buffer.size() > 0))\n";
for (int element = 0; element < m_iSampleFrequency * m_iNumberOfChannels; element++)
......
......@@ -183,9 +183,9 @@ namespace oscpkt
return &(data[pos]);
}
char* begin() { return data.size() ? &data.front() : nullptr; }
char* begin() { return !data.empty() ? &data.front() : nullptr; }
char* end() { return begin() + size(); }
const char* begin() const { return data.size() ? &data.front() : nullptr; }
const char* begin() const { return !data.empty() ? &data.front() : nullptr; }
const char* end() const { return begin() + size(); }
size_t size() const { return data.size(); }
void assign(const char* beg, const char* end) { data.assign(beg, end); }
......@@ -733,7 +733,7 @@ namespace oscpkt
PacketWriter& startBundle(TimeTag ts = TimeTag::immediate())
{
char* p;
if (bundles.size()) p = storage.getBytes(4); // hold the bundle size
if (!bundles.empty()) p = storage.getBytes(4); // hold the bundle size
p = storage.getBytes(8);
strcpy(p, "#bundle");
bundles.push_back(p - storage.begin());
......@@ -744,7 +744,7 @@ namespace oscpkt
/** close the current bundle. */
PacketWriter& endBundle()
{
if (bundles.size())
if (!bundles.empty())
{
if (storage.size() - bundles.back() == 16)
{
......@@ -767,7 +767,7 @@ namespace oscpkt
{
if (storage.size() != 0 && bundles.empty())
OSCPKT_SET_ERR(BUNDLE_REQUIRED_FOR_MULTI_MESSAGES);
else msg.packMessage(storage, bundles.size() > 0);
else msg.packMessage(storage, !bundles.empty());
if (!msg.isOk())
OSCPKT_SET_ERR(msg.getErr());
return *this;
......
......@@ -101,7 +101,7 @@ bool CBoxAlgorithmLSLExportGipsa::process()
uint64_t identifier = set->getStimulationIdentifier(j);
if (m_stims.size() == 0)
if (m_stims.empty())
{
m_stims.push_back(std::pair<float32, uint64_t>((float)identifier, time));
//std::cout<< "added: " << m_stims[m_stims.size()-1].first << " " << m_stims[m_stims.size()-1].second<< "\n";
......
......@@ -161,7 +161,7 @@ bool CDriverMBTSmarting::loop()
for (int i = 0; i < readed; i++)
{
if (m_byteArray.size() > 0)
if (!m_byteArray.empty())
{
m_byteArray.push_back(receiveBuffer[i]);
if (m_byteArray.size() == 83)
......@@ -193,7 +193,7 @@ bool CDriverMBTSmarting::loop()
}
}
if (m_byteArray.size() == 0 && receiveBuffer[i] == '>')
if (m_byteArray.empty() && receiveBuffer[i] == '>')
{
m_byteArray.push_back(receiveBuffer[i]);
}
......
......@@ -63,7 +63,7 @@ void SmartingAmp::on_receive(const system::error_code& ec, size_t bytes_transfer
for (unsigned int i = 0; i < bytes_transferred; i++)
{
if (m_byteArray.size() > 0)
if (!m_byteArray.empty())
{
m_byteArray.push_back(m_receiveBuffer[i]);
if (m_byteArray.size() == 83)
......@@ -86,7 +86,7 @@ void SmartingAmp::on_receive(const system::error_code& ec, size_t bytes_transfer
}
}
if (m_byteArray.size() == 0 && m_receiveBuffer[i] == '>')
if (m_byteArray.empty() && m_receiveBuffer[i] == '>')
{
m_byteArray.push_back(m_receiveBuffer[i]);
}
......@@ -332,7 +332,7 @@ bool SmartingAmp::start()
float* SmartingAmp::get_sample()
{
if (m_samplesBuffer.size() > 0)
if (!m_samplesBuffer.empty())
{
m_samples_lock.lock();
float* sample = m_samplesBuffer.front();
......
......@@ -261,7 +261,7 @@ bool CDriverOpenBCI::loop()
}
// now deal with acquired samples
if (m_vChannelBuffer.size() != 0)
if (!m_vChannelBuffer.empty())
{
if (m_rDriverContext.isStarted())
{
......@@ -632,7 +632,7 @@ bool CDriverOpenBCI::sendCommand(FD_TYPE i32FileDescriptor, const char* sCommand
if (bLogResponse)
{
// l_oReadStream stream to std::string and then to const to please log manager
if (l_oReadStream.str().size() > 0)
if (!l_oReadStream.str().empty())
{
m_rDriverContext.getLogManager() << LogLevel_Trace << this->m_sDriverName << ": " << (l_bFinished ? "Board response" : "Partial board response") << " was (size=" << uint32_t(l_oReadStream.str().size()) << ") :\n";
m_rDriverContext.getLogManager() << l_oReadStream.str().c_str() << "\n";
......@@ -791,7 +791,7 @@ bool CDriverOpenBCI::handleCurrentSample(int32_t i32PacketNumber)
if ((m_i32LastPacketNumber != UNINITIALIZED_PACKET_NUMBER) && ((m_i32LastPacketNumber + 1) % 256 != i32PacketNumber))
{
uint32_t l_ui32DroppedSampleTime = System::Time::getTime() - m_ui32StartTime;
while (m_vDroppedSampleTime.size() != 0 && l_ui32DroppedSampleTime - m_vDroppedSampleTime.front() > 1000)
while (!m_vDroppedSampleTime.empty() && l_ui32DroppedSampleTime - m_vDroppedSampleTime.front() > 1000)
{
m_vDroppedSampleTime.pop_front();
}
......
......@@ -123,7 +123,7 @@ bool CDriverOpenEEGModularEEG::loop()
return false;
}
if (m_vChannelBuffer.size() != 0)
if (!m_vChannelBuffer.empty())
{
if (m_rDriverContext.isStarted())
{
......
......@@ -20,7 +20,7 @@ void CTagQueue::push(const Tag& tag)
bool CTagQueue::pop(Tag& tag)
{
std::lock_guard<std::mutex> guard(m_mutex);
if (m_queue.size() == 0) return false;
if (m_queue.empty()) return false;
else
{
tag = m_queue.front();
......
......@@ -327,7 +327,7 @@ bool CBoxAlgorithmSignalConcatenation::process()
{
for (uint32_t i = 0; i < m_vStimulationChunkBuffers.size(); i++)
{
if (m_vSignalChunkBuffers[i].size() != 0)
if (!m_vSignalChunkBuffers[i].empty())
{
this->getLogManager() << LogLevel_Trace << "File " << i
<< " has 1st signal chunk at " << time64(m_vSignalChunkBuffers[i][0].m_ui64StartTime)
......@@ -545,7 +545,7 @@ bool CBoxAlgorithmSignalConcatenation::concate()
{
for (uint32_t s = 0; s < l_pBufferedStimSet->getStimulationCount(); s++)
{
if (l_rChunkVector.size() != 0)
if (!l_rChunkVector.empty())
{
this->getLogManager() << LogLevel_Warning
<< "Stimulation " << l_pBufferedStimSet->getStimulationIdentifier(s)
......
......@@ -228,7 +228,7 @@ bool CGDFFileWriter::uninitialize()
if (m_oFile.is_open())
{
//update the fixed header
if (m_vSampleCount.size() != 0)
if (!m_vSampleCount.empty())
{
m_oFixedHeader.m_i64NumberOfDataRecords = m_vSampleCount[0];
this->getLogManager() << LogLevel_Trace << "Saving " << m_vSampleCount[0] << " data records\n";
......
......@@ -135,7 +135,7 @@ bool CMatrixVariance::process()
Vec<float64>* l_vMatrix = new Vec<double>(l_pInputMatrix->getBuffer(), l_pInputMatrix->getBufferElementCount());
m_vHistory.push_back(l_vMatrix);
l_bShouldPerformAverage = (m_vHistory.size() > 0);
l_bShouldPerformAverage = (!m_vHistory.empty());
}
else if (ip_ui64AveragingMethod == OVP_TypeId_EpochAverageMethod_BlockAverage.toUInteger())
{
......@@ -175,7 +175,7 @@ bool CMatrixVariance::process()
Vec<float64>* l_vMatrix = new Vec<double>(l_pInputMatrix->getBuffer(), l_pInputMatrix->getBufferElementCount());
m_vHistory.push_back(l_vMatrix);
l_bShouldPerformAverage = (m_vHistory.size() != 0);
l_bShouldPerformAverage = (!m_vHistory.empty());
}
else
{
......@@ -185,7 +185,7 @@ bool CMatrixVariance::process()
if (l_bShouldPerformAverage)
{
if (m_vHistory.size() != 0)
if (!m_vHistory.empty())
{
std::deque<Vec<double>*>::iterator it;
students_t_distribution<double> l_oStudentDistribution(2);
......
......@@ -252,7 +252,7 @@ bool CBoxAlgorithmXDAWNSpatialFilterTrainer::process()
l_rDynamicBoxContext.markInputAsDeprecated(2, i);
}
if (l_vEvokedPotential.size() == 0)
if (l_vEvokedPotential.empty())
{
// @fixme mem leak
this->getLogManager() << LogLevel_Error << "No evoked potentials received... Can't continue\n";
......
......@@ -638,7 +638,7 @@ bool CBoxAlgorithmP300SpellerVisualization::process()
{
std::string l_sString;
l_sString = gtk_label_get_text(GTK_LABEL(l_vWidgets[0]));
if (m_vTargetHistory.size())
if (!m_vTargetHistory.empty())
{
std::list<std::pair<int, int>>::const_iterator it = m_vTargetHistory.begin();
bool l_bCorrect = (it->first == m_iSelectedRow && it->second == m_iSelectedColumn);
......
......@@ -226,7 +226,7 @@ namespace OpenViBEPlugins
m_vStimulationsId.clear();
m_vImageNames.clear();
if (m_vOriginalPicture.size() > 0)
if (!m_vOriginalPicture.empty())
{
for (uint32_t i = 0; i < m_ui32NumberOfCues; i++)
{
......@@ -235,7 +235,7 @@ namespace OpenViBEPlugins
m_vOriginalPicture.clear();
}
if (m_vScaledPicture.size() > 0)
if (!m_vScaledPicture.empty())
{
for (uint32_t i = 0; i < m_ui32NumberOfCues; i++)
{
......
......@@ -165,7 +165,7 @@ namespace OpenViBEPlugins
}
// Subcomponents may generate errors while running e.g. in gtk callbacks, where its not safe/possible to call logmanager
if (((CSignalDisplayView*)m_pSignalDisplayView)->m_vErrorState.size() > 0)
if (!((CSignalDisplayView*)m_pSignalDisplayView)->m_vErrorState.empty())
{
for (uint32_t i = 0; i < ((CSignalDisplayView*)m_pSignalDisplayView)->m_vErrorState.size(); i++)
{
......
......@@ -392,7 +392,7 @@ bool CSignalChannelDisplay::mustRedrawAll() const
void CSignalChannelDisplay::draw(const GdkRectangle& rExposedArea)
{
//ensure there is data to display
if (!m_pDatabase || m_pDatabase->m_oSampleBuffers.size() == 0)
if (!m_pDatabase || m_pDatabase->m_oSampleBuffers.empty())
{
return;
}
......@@ -881,7 +881,7 @@ bool CSignalChannelDisplay::drawSignals(uint32 ui32FirstBufferToDisplay, uint32
}
}
if (m_pDatabase->m_oStimulations.size() != 0)
if (!m_pDatabase->m_oStimulations.empty())
{
//switch to dashed line
gdk_gc_set_line_attributes(m_pDrawingArea->style->fg_gc[GTK_WIDGET_STATE (m_pDrawingArea)], 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_BEVEL);
......
......@@ -386,7 +386,7 @@ namespace OpenViBEPlugins
//add channel label
//-----------------
// Convention: Channels are numbered as 1,2,... when shown to user
if (l_oChannelName[i] == "")
if (l_oChannelName[i].empty())
{