diff --git a/Algorithm/include/Algorithm/BitstreamReader.h b/Algorithm/include/Algorithm/BitstreamReader.h index 0a112183ab5ef..66ea3d2ce06ad 100644 --- a/Algorithm/include/Algorithm/BitstreamReader.h +++ b/Algorithm/include/Algorithm/BitstreamReader.h @@ -19,6 +19,8 @@ #include #include +#include +#include namespace o2 { diff --git a/Algorithm/include/Algorithm/FlattenRestore.h b/Algorithm/include/Algorithm/FlattenRestore.h index a039a897a191c..a179e66eed1e3 100644 --- a/Algorithm/include/Algorithm/FlattenRestore.h +++ b/Algorithm/include/Algorithm/FlattenRestore.h @@ -18,6 +18,7 @@ /// @brief Utilities to copy complex objects to flat buffer and restore #include +#include namespace o2::algorithm { diff --git a/Algorithm/include/Algorithm/PageParser.h b/Algorithm/include/Algorithm/PageParser.h index 3ca01d87bcba3..739ff0c29ffef 100644 --- a/Algorithm/include/Algorithm/PageParser.h +++ b/Algorithm/include/Algorithm/PageParser.h @@ -22,6 +22,8 @@ #include #include #include +#include +#include namespace o2 { diff --git a/Algorithm/test/StaticSequenceAllocator.h b/Algorithm/test/StaticSequenceAllocator.h index 8a684159afdb9..530293e7bb8cd 100644 --- a/Algorithm/test/StaticSequenceAllocator.h +++ b/Algorithm/test/StaticSequenceAllocator.h @@ -14,6 +14,8 @@ /// @since 2017-09-21 /// @brief An allocator for static sequences of object types +#include + namespace o2 { namespace algorithm @@ -145,7 +147,7 @@ struct StaticSequenceAllocator { StaticSequenceAllocator() = delete; template - StaticSequenceAllocator(Targs... args) + explicit StaticSequenceAllocator(Targs... args) { bufferSize = sequenceLength(args...); buffer = std::make_unique(bufferSize); diff --git a/Algorithm/test/o2formatparser.cxx b/Algorithm/test/o2formatparser.cxx index 2896631ebc5b8..7af518622dd56 100644 --- a/Algorithm/test/o2formatparser.cxx +++ b/Algorithm/test/o2formatparser.cxx @@ -21,6 +21,7 @@ #include #include #include // memcmp +#include #include "Headers/DataHeader.h" // hexdump, DataHeader #include "../include/Algorithm/O2FormatParser.h" diff --git a/Algorithm/test/pageparser.cxx b/Algorithm/test/pageparser.cxx index 7551c32d9d864..c7ef5af13aa11 100644 --- a/Algorithm/test/pageparser.cxx +++ b/Algorithm/test/pageparser.cxx @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include "Headers/DataHeader.h" // hexdump #include "../include/Algorithm/PageParser.h" #include "StaticSequenceAllocator.h" @@ -29,7 +31,7 @@ struct PageHeader { uint32_t magic = 0x45474150; uint32_t pageid; - PageHeader(uint32_t id) : pageid(id) {} + explicit PageHeader(uint32_t id) : pageid(id) {} }; struct ClusterData { diff --git a/Algorithm/test/parser.cxx b/Algorithm/test/parser.cxx index 0f31df99ca825..babb53cc4b6ad 100644 --- a/Algorithm/test/parser.cxx +++ b/Algorithm/test/parser.cxx @@ -29,7 +29,7 @@ struct Header { unsigned identifier = 0xdeadbeef; size_t payloadSize = 0; - Header(size_t ps) : payloadSize(ps) {} + explicit Header(size_t ps) : payloadSize(ps) {} }; // trailer test class @@ -37,7 +37,7 @@ struct Trailer { unsigned identifier = 0xaaffee00; unsigned char flags = 0xaa; - Trailer(unsigned char f) : flags(f) {} + explicit Trailer(unsigned char f) : flags(f) {} }; // trailer test class including payload size diff --git a/Algorithm/test/test_BitstreamReader.cxx b/Algorithm/test/test_BitstreamReader.cxx index 41e3b47f5f276..0fcec20fa6797 100644 --- a/Algorithm/test/test_BitstreamReader.cxx +++ b/Algorithm/test/test_BitstreamReader.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include "../include/Algorithm/BitstreamReader.h" namespace o2 diff --git a/Algorithm/test/test_FlattenRestore.cxx b/Algorithm/test/test_FlattenRestore.cxx index 98f5f30393e41..efaad60823cb1 100644 --- a/Algorithm/test/test_FlattenRestore.cxx +++ b/Algorithm/test/test_FlattenRestore.cxx @@ -21,6 +21,7 @@ #include "../include/Algorithm/FlattenRestore.h" #include #include +#include namespace flatten = o2::algorithm::flatten; @@ -35,13 +36,14 @@ struct DataAccess { } // namespace o2::test BOOST_AUTO_TEST_CASE(test_flattenrestore) { - o2::test::DataAccess access{static_cast(rand() % 32)}; + unsigned int seed = 1; + o2::test::DataAccess access{static_cast(rand_r(&seed) % 32)}; std::vector chars(access.count); - std::generate(chars.begin(), chars.end(), []() { return rand() % 256; }); + std::generate(chars.begin(), chars.end(), [&seed]() { return rand_r(&seed) % 256; }); std::vector ints(access.count); - std::generate(ints.begin(), ints.end(), []() { return rand() % 256; }); + std::generate(ints.begin(), ints.end(), [&seed]() { return rand_r(&seed) % 256; }); std::vector floats(access.count); - std::generate(floats.begin(), floats.end(), []() { return rand() % 256; }); + std::generate(floats.begin(), floats.end(), [&seed]() { return rand_r(&seed) % 256; }); access.chars = chars.data(); access.ints = ints.data(); access.floats = floats.data(); diff --git a/Algorithm/test/test_RangeTokenizer.cxx b/Algorithm/test/test_RangeTokenizer.cxx index 2583b52159b5f..d3515fdf25262 100644 --- a/Algorithm/test/test_RangeTokenizer.cxx +++ b/Algorithm/test/test_RangeTokenizer.cxx @@ -21,6 +21,8 @@ #include "../include/Algorithm/RangeTokenizer.h" #include #include +#include +#include using RangeTokenizer = o2::RangeTokenizer; diff --git a/Algorithm/test/test_mpl_tools.cxx b/Algorithm/test/test_mpl_tools.cxx index e3f1b640b7ca1..c9a7556b3e10b 100644 --- a/Algorithm/test/test_mpl_tools.cxx +++ b/Algorithm/test/test_mpl_tools.cxx @@ -33,6 +33,7 @@ #include #include #include +#include // FIXME: mpl/string.hpp required to be included to avoid compilation error // error: no matching function for call to ‘assertion_failed ...' in the mpl::for_each @@ -42,7 +43,7 @@ namespace bmpl = boost::mpl; // defining a list of known data types -using knowntypes = bmpl::vector; +using knowntypes = bmpl::vector; // get the index of an element in a type sequence template @@ -132,7 +133,7 @@ struct checktype { BOOST_AUTO_TEST_CASE(test_mpl_fold) { - using types = bmpl::vector; + using types = bmpl::vector; std::cout << std::endl << "checking types:" << std::endl; bmpl::for_each(checktype());