Skip to content

Commit bce3177

Browse files
franzpoeschelax3l
authored andcommitted
Manual changes to the codebase to prepare for formatting
1) Change OPENPMD_private macros so clang-format understands them 2) Put HDF5 lint back to the right place 3) Fix includes: sorting the includes via clang-format uncovered an include error.
1 parent b1ee2e7 commit bce3177

12 files changed

Lines changed: 46 additions & 21 deletions

include/openPMD/IO/ADIOS/ADIOS1FilePosition.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "openPMD/IO/AbstractFilePosition.hpp"
2424

25+
#include <string>
2526

2627
namespace openPMD
2728
{

include/openPMD/RecordComponent.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
// expose private and protected members for invasive testing
3939
#ifndef OPENPMD_protected
40-
# define OPENPMD_protected protected
40+
# define OPENPMD_protected protected:
4141
#endif
4242

4343

@@ -327,7 +327,10 @@ class RecordComponent : public BaseRecordComponent
327327

328328
RecordComponent();
329329

330-
OPENPMD_protected:
330+
// clang-format off
331+
OPENPMD_protected
332+
// clang-format on
333+
331334
RecordComponent( std::shared_ptr< internal::RecordComponentData > );
332335

333336
inline internal::RecordComponentData const & get() const

include/openPMD/Series.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
// expose private and protected members for invasive testing
4848
#ifndef OPENPMD_private
49-
# define OPENPMD_private private
49+
# define OPENPMD_private private:
5050
#endif
5151

5252

@@ -421,7 +421,10 @@ class Series : public Attributable
421421
*/
422422
WriteIterations writeIterations();
423423

424-
OPENPMD_private:
424+
// clang-format off
425+
OPENPMD_private
426+
// clang-format on
427+
425428
static constexpr char const * const BASEPATH = "/data/%T/";
426429

427430
struct ParsedInput;

include/openPMD/backend/Attributable.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// expose private and protected members for invasive testing
3737
#ifndef OPENPMD_protected
38-
# define OPENPMD_protected protected
38+
# define OPENPMD_protected protected:
3939
#endif
4040

4141

@@ -259,7 +259,9 @@ class Attributable
259259
*/
260260
MyPath myPath() const;
261261

262-
OPENPMD_protected:
262+
// clang-format off
263+
OPENPMD_protected
264+
// clang-format on
263265

264266
Series retrieveSeries() const;
265267

include/openPMD/backend/BaseRecordComponent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
// expose private and protected members for invasive testing
2828
#ifndef OPENPMD_protected
29-
# define OPENPMD_protected protected
29+
# define OPENPMD_protected protected:
3030
#endif
3131

3232

include/openPMD/backend/Container.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
// expose private and protected members for invasive testing
3535
#ifndef OPENPMD_protected
36-
# define OPENPMD_protected protected
36+
# define OPENPMD_protected protected:
3737
#endif
3838

3939

@@ -341,7 +341,10 @@ class Container : public Attributable
341341
return container().emplace(std::forward<Args>(args)...);
342342
}
343343

344-
OPENPMD_protected:
344+
// clang-format off
345+
OPENPMD_protected
346+
// clang-format on
347+
345348
Container( std::shared_ptr< ContainerData > containerData )
346349
: Attributable{ containerData }
347350
, m_containerData{ std::move( containerData ) }
@@ -368,7 +371,10 @@ class Container : public Attributable
368371
flushAttributes();
369372
}
370373

371-
OPENPMD_private:
374+
// clang-format off
375+
OPENPMD_private
376+
// clang-format on
377+
372378
Container() : Attributable{ nullptr }
373379
{
374380
Attributable::setData( m_containerData );

include/openPMD/backend/PatchRecordComponent.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
// expose private and protected members for invasive testing
3131
#ifndef OPENPMD_private
32-
# define OPENPMD_private private
32+
# define OPENPMD_private private:
3333
#endif
3434

3535

@@ -88,7 +88,9 @@ class PatchRecordComponent : public BaseRecordComponent
8888
template< typename T >
8989
void store(uint64_t idx, T);
9090

91-
OPENPMD_private:
91+
// clang-format off
92+
OPENPMD_private
93+
// clang-format on
9294

9395
void flush(std::string const&);
9496
void read();
@@ -110,7 +112,10 @@ class PatchRecordComponent : public BaseRecordComponent
110112

111113
PatchRecordComponent();
112114

113-
OPENPMD_protected:
115+
// clang-format off
116+
OPENPMD_protected
117+
// clang-format on
118+
114119
PatchRecordComponent(
115120
std::shared_ptr< internal::PatchRecordComponentData > );
116121

include/openPMD/backend/Writable.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
// expose private and protected members for invasive testing
3030
#ifndef OPENPMD_private
31-
# define OPENPMD_private private
31+
# define OPENPMD_private private:
3232
#endif
3333

3434

@@ -114,7 +114,10 @@ class Writable final
114114
*/
115115
void seriesFlush();
116116

117-
OPENPMD_private:
117+
// clang-format off
118+
OPENPMD_private
119+
// clang-format on
120+
118121
void seriesFlush( FlushLevel );
119122
/*
120123
* These members need to be shared pointers since distinct instances of

src/IO/HDF5/HDF5IOHandler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,9 @@ HDF5IOHandlerImpl::readAttribute(Writable* writable,
16381638
char* m1 = H5Tget_member_name(attr_type, 1);
16391639
char* m2 = H5Tget_member_name(attr_type, 2);
16401640
if( m0 == nullptr || m1 == nullptr || m2 == nullptr )
1641+
// clang-format off
16411642
isLegacyLibSplashAttr = false; // NOLINT(bugprone-branch-clone)
1643+
// clang-format on
16421644
else if(strcmp("x", m0) != 0 || strcmp("y", m1) != 0 || strcmp("z", m2) != 0)
16431645
isLegacyLibSplashAttr = false;
16441646
H5free_memory(m2);

test/AuxiliaryTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// expose private and protected members for invasive testing
22
#if openPMD_USE_INVASIVE_TESTS
3-
# define OPENPMD_private public
4-
# define OPENPMD_protected public
3+
# define OPENPMD_private public:
4+
# define OPENPMD_protected public:
55
#endif
66
#include "openPMD/config.hpp"
77
#include "openPMD/backend/Writable.hpp"

0 commit comments

Comments
 (0)