Skip to content

Commit d52f015

Browse files
authored
Merge 5d475fd into sapling-pr-archive-ktf
2 parents 3384771 + 5d475fd commit d52f015

File tree

86 files changed

+618
-515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+618
-515
lines changed

Algorithm/include/Algorithm/BitstreamReader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#include <type_traits>
2121
#include <bitset>
22+
#include <utility>
23+
#include <string>
2224

2325
namespace o2
2426
{

Algorithm/include/Algorithm/FlattenRestore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/// @brief Utilities to copy complex objects to flat buffer and restore
1919

2020
#include <type_traits>
21+
#include <utility>
2122

2223
namespace o2::algorithm
2324
{

Algorithm/include/Algorithm/PageParser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <cassert>
2323
#include <type_traits>
2424
#include <stdexcept>
25+
#include <set>
26+
#include <algorithm>
2527

2628
namespace o2
2729
{

Algorithm/test/StaticSequenceAllocator.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
/// @since 2017-09-21
1515
/// @brief An allocator for static sequences of object types
1616

17+
#include <memory>
18+
1719
namespace o2
1820
{
1921
namespace algorithm
@@ -145,7 +147,7 @@ struct StaticSequenceAllocator {
145147
StaticSequenceAllocator() = delete;
146148

147149
template <typename... Targs>
148-
StaticSequenceAllocator(Targs... args)
150+
explicit StaticSequenceAllocator(Targs... args)
149151
{
150152
bufferSize = sequenceLength(args...);
151153
buffer = std::make_unique<value_type[]>(bufferSize);

Algorithm/test/o2formatparser.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <iostream>
2222
#include <iomanip>
2323
#include <cstring> // memcmp
24+
#include <vector>
2425
#include "Headers/DataHeader.h" // hexdump, DataHeader
2526
#include "../include/Algorithm/O2FormatParser.h"
2627

Algorithm/test/pageparser.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <iostream>
2222
#include <iomanip>
2323
#include <vector>
24+
#include <memory>
25+
#include <utility>
2426
#include "Headers/DataHeader.h" // hexdump
2527
#include "../include/Algorithm/PageParser.h"
2628
#include "StaticSequenceAllocator.h"
@@ -29,7 +31,7 @@ struct PageHeader {
2931
uint32_t magic = 0x45474150;
3032
uint32_t pageid;
3133

32-
PageHeader(uint32_t id) : pageid(id) {}
34+
explicit PageHeader(uint32_t id) : pageid(id) {}
3335
};
3436

3537
struct ClusterData {

Algorithm/test/parser.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ struct Header {
2929
unsigned identifier = 0xdeadbeef;
3030
size_t payloadSize = 0;
3131

32-
Header(size_t ps) : payloadSize(ps) {}
32+
explicit Header(size_t ps) : payloadSize(ps) {}
3333
};
3434

3535
// trailer test class
3636
struct Trailer {
3737
unsigned identifier = 0xaaffee00;
3838
unsigned char flags = 0xaa;
3939

40-
Trailer(unsigned char f) : flags(f) {}
40+
explicit Trailer(unsigned char f) : flags(f) {}
4141
};
4242

4343
// trailer test class including payload size

Algorithm/test/test_BitstreamReader.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <array>
2424
#include <vector>
2525
#include <bitset>
26+
#include <string>
2627
#include "../include/Algorithm/BitstreamReader.h"
2728

2829
namespace o2

Algorithm/test/test_FlattenRestore.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "../include/Algorithm/FlattenRestore.h"
2222
#include <vector>
2323
#include <algorithm>
24+
#include <cstdlib>
2425

2526
namespace flatten = o2::algorithm::flatten;
2627

@@ -35,13 +36,14 @@ struct DataAccess {
3536
} // namespace o2::test
3637
BOOST_AUTO_TEST_CASE(test_flattenrestore)
3738
{
38-
o2::test::DataAccess access{static_cast<size_t>(rand() % 32)};
39+
unsigned int seed = 1;
40+
o2::test::DataAccess access{static_cast<size_t>(rand_r(&seed) % 32)};
3941
std::vector<char> chars(access.count);
40-
std::generate(chars.begin(), chars.end(), []() { return rand() % 256; });
42+
std::generate(chars.begin(), chars.end(), [&seed]() { return rand_r(&seed) % 256; });
4143
std::vector<int> ints(access.count);
42-
std::generate(ints.begin(), ints.end(), []() { return rand() % 256; });
44+
std::generate(ints.begin(), ints.end(), [&seed]() { return rand_r(&seed) % 256; });
4345
std::vector<float> floats(access.count);
44-
std::generate(floats.begin(), floats.end(), []() { return rand() % 256; });
46+
std::generate(floats.begin(), floats.end(), [&seed]() { return rand_r(&seed) % 256; });
4547
access.chars = chars.data();
4648
access.ints = ints.data();
4749
access.floats = floats.data();

Algorithm/test/test_RangeTokenizer.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "../include/Algorithm/RangeTokenizer.h"
2222
#include <vector>
2323
#include <map>
24+
#include <string>
25+
#include <utility>
2426

2527
using RangeTokenizer = o2::RangeTokenizer;
2628

0 commit comments

Comments
 (0)