Commit e663544f authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Fix: Coding Rules Second pass begin

parent 1582b8a9
......@@ -198,10 +198,7 @@ void CConfigurationBrainProductsActiCHamp::comboBoxDeviceChangedCB()
{
System::Time::sleep(500);
}
else
{
break;
}
else { break; }
}
// Opens device
if (l_pHandle != nullptr)
......
......@@ -195,10 +195,7 @@ bool CDriverBrainProductsActiCHamp::initialize(
m_rDriverContext.getLogManager() << LogLevel_Trace << "Failed to open the device, retrying (" << l_iRetriesCount << ")" << "\n";
System::Time::sleep(500);
}
else
{
break;
}
else { break; }
}
if (m_pHandle == nullptr)
......
......@@ -209,10 +209,7 @@ bool CConfigurationBrainProductsVAmp::preConfigure()
{
Sleep(500);
}
else
{
break;
}
else { break; }
}
m_rDriverContext.getLogManager() << LogLevel_Trace << "VAmp Configuration: " << l_uint32_tDeviceCount << " device(s) connected.\n";
......
......@@ -462,10 +462,7 @@ bool CAcquisitionServerGUI::initialize()
for (int i = 0; ; i++)
{
gtk_combo_box_set_active(l_pComboBoxSampleCountPerBuffer, i);
if (gtk_combo_box_get_active(l_pComboBoxSampleCountPerBuffer) == -1)
{
break;
}
if (gtk_combo_box_get_active(l_pComboBoxSampleCountPerBuffer) == -1) { break; }
if (l_sDefaultSampleCountPerBuffer == gtk_combo_box_get_active_text(l_pComboBoxSampleCountPerBuffer))
{
l_bFound = true;
......
......@@ -211,10 +211,7 @@ namespace OpenViBETracker
{
chunkCount++;
}
else
{
break;
}
else { break; }
}
}
return chunkCount;
......
......@@ -229,10 +229,7 @@ namespace OpenViBETracker
for (size_t i = 0; i < stream->getChunkCount(); i++)
{
const typename T::Buffer* ptr = stream->getChunk(i);
if (!ptr)
{
break;
}
if (!ptr) { break; }
std::stringstream ss;
ss << ptr->m_buffer.getDimensionCount() << " : ";
......
......@@ -102,10 +102,7 @@ bool BoxAdapterBundle::spool(bool /* verbose */)
{
size_t index;
StreamPtr stream = m_Source->getNextStream(index);
if (!stream)
{
break;
}
if (!stream) { break; }
EncodedChunk chk;
ChunkType outputType;
m_vEncoders[index]->encode(chk, outputType);
......
......@@ -187,10 +187,7 @@ bool ProcExternalProcessing::push()
size_t streamIndex;
StreamPtr stream = m_Source->getNextStream(streamIndex);
if (!stream)
{
break;
}
if (!stream) { break; }
if (m_vEncoders.size() <= streamIndex)
{
......
......@@ -33,19 +33,13 @@ void BufferedClient::start()
while (true)
{
// Push or pull, uses lock internally
if (!step())
{
break;
}
if (!step()) { break; }
{
std::lock_guard<std::mutex> oLock(m_oThreadMutex);
// Exit the loop if we're told to quit or if we've lost the connection
if (m_bPleaseQuit || !isConnected() || isEndReceived())
{
break;
}
if (m_bPleaseQuit || !isConnected() || isEndReceived()) { break; }
}
}
......
......@@ -172,10 +172,7 @@ bool StreamRendererStimulation::showChunkList()
for (size_t i = 0; i < m_Stream->getChunkCount(); i++)
{
const TypeStimulation::Buffer* ptr = m_Stream->getChunk(i);
if (!ptr)
{
break;
}
if (!ptr) { break; }
for (uint32_t s = 0; s < ptr->m_buffer.getStimulationCount(); s++)
{
......
......@@ -533,10 +533,7 @@ int edfclose_file(int handle)
while (annot2 != NULL)
{
if (fseeko(hdr->file_hdl, offset, SEEK_SET))
{
break;
}
if (fseeko(hdr->file_hdl, offset, SEEK_SET)) { break; }
p = edflib_sprint_ll_number_nonlocalized(str, (datarecords * hdr->long_data_record_duration) / EDFLIB_TIME_DIMENSION, 0, 1);
......@@ -573,10 +570,7 @@ int edfclose_file(int handle)
str[p++] = 20;
for (i = 0; i < EDFLIB_WRITE_MAX_ANNOTATION_LEN; i++)
{
if (annot2->annotation[i] == 0)
{
break;
}
if (annot2->annotation[i] == 0) { break; }
str[p++] = annot2->annotation[i];
}
......@@ -593,10 +587,7 @@ int edfclose_file(int handle)
datarecords++;
if (datarecords >= hdr->datarecords)
{
break;
}
if (datarecords >= hdr->datarecords) { break; }
annot2 = annot2->next_annotation;
}
......@@ -2332,10 +2323,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
{
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->patient[i + p] == ' ')
{
break;
}
if (edfhdr->patient[i + p] == ' ') { break; }
edfhdr->plus_patientcode[i] = edfhdr->patient[i + p];
if (edfhdr->plus_patientcode[i] == '_') edfhdr->plus_patientcode[i] = ' ';
}
......@@ -2357,10 +2345,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
}
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->patient[i + p] == ' ')
{
break;
}
if (edfhdr->patient[i + p] == ' ') { break; }
}
p += i + 1;
......@@ -2373,10 +2358,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
{
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->patient[i + p] == ' ')
{
break;
}
if (edfhdr->patient[i + p] == ' ') { break; }
edfhdr->plus_birthdate[i] = edfhdr->patient[i + p];
}
edfhdr->plus_birthdate[2] = ' ';
......@@ -2390,10 +2372,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->patient[i + p] == ' ')
{
break;
}
if (edfhdr->patient[i + p] == ' ') { break; }
edfhdr->plus_patient_name[i] = edfhdr->patient[i + p];
if (edfhdr->plus_patient_name[i] == '_') edfhdr->plus_patient_name[i] = ' ';
}
......@@ -2520,10 +2499,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
p = 10;
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->recording[i + p] == ' ')
{
break;
}
if (edfhdr->recording[i + p] == ' ') { break; }
edfhdr->plus_startdate[i] = edfhdr->recording[i + p];
}
edfhdr->plus_startdate[2] = ' ';
......@@ -2543,10 +2519,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
{
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->recording[i + p] == ' ')
{
break;
}
if (edfhdr->recording[i + p] == ' ') { break; }
edfhdr->plus_admincode[i] = edfhdr->recording[i + p];
if (edfhdr->plus_admincode[i] == '_') edfhdr->plus_admincode[i] = ' ';
}
......@@ -2563,10 +2536,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
{
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->recording[i + p] == ' ')
{
break;
}
if (edfhdr->recording[i + p] == ' ') { break; }
edfhdr->plus_technician[i] = edfhdr->recording[i + p];
if (edfhdr->plus_technician[i] == '_') edfhdr->plus_technician[i] = ' ';
}
......@@ -2583,10 +2553,7 @@ struct edfhdrblock* edflib_check_edf_file(FILE* inputfile, int* edf_error)
{
for (i = 0; i < (80 - p); i++)
{
if (edfhdr->recording[i + p] == ' ')
{
break;
}
if (edfhdr->recording[i + p] == ' ') { break; }
edfhdr->plus_equipment[i] = edfhdr->recording[i + p];
if (edfhdr->plus_equipment[i] == '_') edfhdr->plus_equipment[i] = ' ';
}
......@@ -5757,10 +5724,7 @@ int edfwrite_annotation_utf8(int handle, long long onset, long long duration, co
for (i = 0; ; i++)
{
if (list_annot->annotation[i] == 0)
{
break;
}
if (list_annot->annotation[i] == 0) { break; }
if (list_annot->annotation[i] < 32)
{
......@@ -5865,10 +5829,7 @@ void edflib_remove_padding_trailing_spaces(char* str)
{
for (i = 0; ; i++)
{
if (str[i] == 0)
{
break;
}
if (str[i] == 0) { break; }
str[i] = str[i + 1];
}
......@@ -5880,10 +5841,7 @@ void edflib_remove_padding_trailing_spaces(char* str)
{
str[i - 1] = 0;
}
else
{
break;
}
else { break; }
}
}
......@@ -6374,15 +6332,9 @@ double edflib_atof_nonlocalized(const char* str)
for (; ; i++)
{
if (str[i] == 0)
{
break;
}
if (str[i] == 0) { break; }
if (((str[i] < '0') || (str[i] > '9')) && (str[i] != '.'))
{
break;
}
if (((str[i] < '0') || (str[i] > '9')) && (str[i] != '.')) { break; }
if (dot_pos >= 0)
{
......@@ -6390,10 +6342,7 @@ double edflib_atof_nonlocalized(const char* str)
{
decimals++;
}
else
{
break;
}
else { break; }
}
if (str[i] == '.')
......@@ -6444,15 +6393,9 @@ int edflib_atoi_nonlocalized(const char* str)
for (; ; i++)
{
if (str[i] == 0)
{
break;
}
if (str[i] == 0) { break; }
if ((str[i] < '0') || (str[i] > '9'))
{
break;
}
if ((str[i] < '0') || (str[i] > '9')) { break; }
value *= 10;
......
......@@ -533,10 +533,7 @@ bool CGDFFileReader::readFileHeader()
{
char l_sBuffer[4];
m_oFile.read((char*)&l_sBuffer, 4);
if (m_oFile.bad() || m_oFile.eof())
{
break;
}
if (m_oFile.bad() || m_oFile.eof()) { break; }
m_ui64Header3Length += 4;
uint32_t l_ui32Tag = l_sBuffer[0];
......@@ -546,10 +543,7 @@ bool CGDFFileReader::readFileHeader()
this->getLogManager() << LogLevel_Info << "Found tag " << l_ui32Tag << " at pos " << (int64_t)(m_oFile.tellg() - std::streamoff(4)) << " [length " << l_ui32Length << "], skipping content.\n";
if (l_ui32Tag == 0)
{
break;
}
if (l_ui32Tag == 0) { break; }
m_oFile.seekg(static_cast<std::streamoff>(l_ui32Length), ios_base::cur);
m_ui64Header3Length += l_ui32Length;
}
......
......@@ -1316,10 +1316,7 @@ void ChannelSelectDialogApplyButtonCallback(GtkButton* /*button*/, gpointer data
gtk_widget_hide(view->m_LeftRulers[i]);
}
if (!gtk_tree_model_iter_next(channelSelectTreeModel, &iter))
{
break;
}
if (!gtk_tree_model_iter_next(channelSelectTreeModel, &iter)) { break; }
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment