Skip to content

Commit

Permalink
Fix cpp check supression
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardWaiteSTFC committed Jan 14, 2025
1 parent b1612c5 commit 77aae45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Framework/DataHandling/src/LoadNGEM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,20 @@ void LoadNGEM::loadSingleFile(const std::vector<std::string> &filePath, int &eve
// so we seek to the start of a valid event.
// Chopping only seems to occur on a 4 byte word, hence seekg() of 4
EventUnion event, eventBigEndian;
bool is_event_invalid = true;
bool is_not_eof_after_skip = true;
do {
file.read(reinterpret_cast<char *>(&eventBigEndian), sizeof(eventBigEndian));
// Correct for the big endian format of nGEM datafile.
correctForBigEndian(eventBigEndian, event);
} while (!event.generic.check() && !file.seekg(SKIP_WORD_SIZE, std::ios_base::cur).eof() && ++numWordsSkipped);
is_event_invalid = !event.generic.check();
if (is_event_invalid) {
is_not_eof_after_skip = !file.seekg(SKIP_WORD_SIZE, std::ios_base::cur).eof();
if (is_not_eof_after_skip) {
++numWordsSkipped;
}
}
} while (is_event_invalid && is_not_eof_after_skip);
if (file.eof()) {
break; // we have either not read an event, or only read part of one
}
Expand Down
1 change: 0 additions & 1 deletion buildconfig/CMake/CppCheck_Suppressions.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ constVariableReference:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadIsawDe
constVariableReference:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadIsawDetCal.cpp:286
constVariableReference:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadMask.cpp:431
constParameterReference:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadILLSANS.cpp:720
knownConditionTrueFalse:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadNGEM.cpp:288
integerOverflowCond:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadRaw/byte_rel_comp.cpp:59
constParameterReference:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadLLB.cpp:114
constParameterReference:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadLLB.cpp:156
Expand Down

0 comments on commit 77aae45

Please sign in to comment.