Skip to content

Commit 51c92af

Browse files
authored
Tidy some internal headers too (#7464)
1 parent 6ed89e7 commit 51c92af

Some content is hidden

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

54 files changed

+641
-459
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Checks: >
99
-bugprone-casting-through-void,
1010
-bugprone-reserved-identifier,
1111
-bugprone-macro-parentheses,
12+
-bugprone-branch-clone,
1213
cert-*,
1314
-cert-con36-c,
1415
-cert-dcl37-c,
@@ -58,5 +59,5 @@ Checks: >
5859
-readability-magic-numbers,
5960
6061
WarningsAsErrors: '*'
61-
HeaderFilterRegex: 'include\/ccf\/.*'
62+
HeaderFilterRegex: '(include\/ccf\/|src\/(udp|tcp|tls|tasks|snapshots|service|quic|pal|apps|clients|common|consensus|ds)\/).*'
6263
FormatStyle: 'file'

js/ccf-app/src/endpoints.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,12 @@ interface UserMemberCOSEAuthIdentityCommon {
158158
}
159159

160160
export interface MemberCOSESign1AuthnIdentity
161-
extends UserMemberAuthnIdentityCommon,
162-
UserMemberCOSEAuthIdentityCommon {
161+
extends UserMemberAuthnIdentityCommon, UserMemberCOSEAuthIdentityCommon {
163162
policy: "member_cose_sign1";
164163
}
165164

166165
export interface UserCOSESign1AuthnIdentity
167-
extends UserMemberAuthnIdentityCommon,
168-
UserMemberCOSEAuthIdentityCommon {
166+
extends UserMemberAuthnIdentityCommon, UserMemberCOSEAuthIdentityCommon {
169167
policy: "user_cose_sign1";
170168
}
171169

src/common/configuration.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ DECLARE_JSON_ENUM(
3030

3131
struct EnclaveConfig
3232
{
33-
uint8_t* to_enclave_buffer_start;
34-
size_t to_enclave_buffer_size;
35-
ringbuffer::Offsets* to_enclave_buffer_offsets;
33+
uint8_t* to_enclave_buffer_start = nullptr;
34+
size_t to_enclave_buffer_size = 0;
35+
ringbuffer::Offsets* to_enclave_buffer_offsets = nullptr;
3636

37-
uint8_t* from_enclave_buffer_start;
38-
size_t from_enclave_buffer_size;
39-
ringbuffer::Offsets* from_enclave_buffer_offsets;
37+
uint8_t* from_enclave_buffer_start = nullptr;
38+
size_t from_enclave_buffer_size = 0;
39+
ringbuffer::Offsets* from_enclave_buffer_offsets = nullptr;
4040

4141
oversized::WriterConfig writer_config = {};
4242
};

src/common/enclave_interface_types.h

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

55
#include "ccf/ds/logger_level.h"
66

7-
enum CreateNodeStatus
7+
enum CreateNodeStatus : std::uint8_t
88
{
99
/** Call was successful and the node was successfully created */
1010
OK = 0,
@@ -88,7 +88,7 @@ constexpr char const* create_node_result_to_str(CreateNodeStatus result)
8888
}
8989
}
9090

91-
enum StartType
91+
enum StartType : std::uint8_t
9292
{
9393
Start = 1,
9494
Join = 2,

src/consensus/aft/impl/state.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ namespace aft
132132
class Replica
133133
{
134134
public:
135-
Replica(const ccf::NodeId& id_, const std::vector<uint8_t>& cert_) :
136-
id(id_),
135+
Replica(ccf::NodeId id_, const std::vector<uint8_t>& cert_) :
136+
id(std::move(id_)),
137137
verifier(ccf::crypto::make_unique_verifier(cert_))
138138
{}
139139

140-
ccf::NodeId get_id() const
140+
[[nodiscard]] ccf::NodeId get_id() const
141141
{
142142
return id;
143143
}
@@ -149,8 +149,8 @@ namespace aft
149149

150150
struct State
151151
{
152-
State(const ccf::NodeId& node_id_, bool pre_vote_enabled_ = false) :
153-
node_id(node_id_),
152+
State(ccf::NodeId node_id_, bool pre_vote_enabled_ = false) :
153+
node_id(std::move(node_id_)),
154154
pre_vote_enabled(pre_vote_enabled_)
155155
{}
156156
State() = default;

0 commit comments

Comments
 (0)