Skip to content

Commit 7e79103

Browse files
committed
Resolve 'cppcoreguidelines-pro-type-member-init' clang-tidy warnings
1 parent d904f1d commit 7e79103

File tree

14 files changed

+46
-43
lines changed

14 files changed

+46
-43
lines changed

.github/workflows/documentation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
run: |
4444
git clone https://github.com/Microsoft/vcpkg.git
4545
./vcpkg/bootstrap-vcpkg.sh
46+
vcpkg install nlohmann-json
4647
4748
- name: Configure CMake
4849
run: |
@@ -51,6 +52,8 @@ jobs:
5152
-G Ninja \
5253
-DCMAKE_BUILD_TYPE=Release \
5354
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
55+
-Dskyr_BUILD_TESTS=OFF \
56+
-Dskyr_BUILD_DOCS=ON \
5457
.
5558
5659
- name: Build documentation

include/skyr/containers/static_vector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace skyr {
2020
template <class T, std::size_t Capacity>
2121
class static_vector {
2222
private:
23-
alignas(T) std::array<std::byte, sizeof(T) * Capacity> storage_;
23+
alignas(T) std::array<std::byte, sizeof(T) * Capacity> storage_{};
2424
std::size_t size_ = 0;
2525

2626
auto data_ptr() noexcept -> T* {

include/skyr/core/host.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class host {
139139
}
140140

141141
private:
142-
host_types host_;
142+
host_types host_{};
143143
};
144144

145145
namespace details {

include/skyr/core/parse_query.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
namespace skyr {
1616
///
1717
struct query_parameter {
18-
std::string name;
19-
std::optional<std::string> value;
18+
std::string name{};
19+
std::optional<std::string> value{};
2020

2121
/// Constructor
2222
query_parameter() = default;

include/skyr/core/url_parser_context.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ class url_parser_context {
101101
private:
102102
url_record url;
103103
url_parse_state state;
104-
std::string_view input;
105-
std::string_view::const_iterator input_it;
104+
std::string_view input{};
105+
std::string_view::const_iterator input_it{};
106106
bool* validation_error;
107107
const url_record* base;
108-
std::optional<url_parse_state> state_override;
109-
std::string buffer;
108+
std::optional<url_parse_state> state_override{};
109+
std::string buffer{};
110110

111111
bool at_flag;
112112
bool square_braces_flag;

include/skyr/core/url_record.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ class url_record {
2323
using string_type = std::string;
2424

2525
/// An ASCII string that identifies the type of URL
26-
string_type scheme;
26+
string_type scheme{};
2727
/// An ASCII string identifying a username
28-
string_type username;
28+
string_type username{};
2929
/// An ASCII string identifying a password
30-
string_type password;
30+
string_type password{};
3131
/// An optional URL host, either a domain, IPv4 or IPv6 address,
3232
/// an opaque host, or empty
33-
std::optional<::skyr::host> host;
33+
std::optional<::skyr::host> host{};
3434
/// An optional network port
35-
std::optional<std::uint16_t> port;
35+
std::optional<std::uint16_t> port{};
3636
/// A list of zero or more ASCII strings, used to identify a
3737
/// location in a hierarchical form
38-
std::vector<string_type> path;
38+
std::vector<string_type> path{};
3939
/// An optional ASCII string
40-
std::optional<string_type> query;
40+
std::optional<string_type> query{};
4141
/// An optional ASCII string
42-
std::optional<string_type> fragment;
42+
std::optional<string_type> fragment{};
4343

4444
/// A Boolean value indicating whether this URL can be used as a
4545
/// base URL

include/skyr/domain/domain.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ constexpr auto validate_label(std::u32string_view label, [[maybe_unused]] bool u
6565
///
6666
struct domain_to_ascii_context {
6767
/// Stores the domain as UTF-32
68-
std::u32string domain_name;
68+
std::u32string domain_name{};
6969

7070
/// Parameters
71-
std::string* ascii_domain;
72-
bool check_hyphens;
73-
bool check_bidi;
74-
bool check_joiners;
75-
bool use_std3_ascii_rules;
76-
bool transitional_processing;
77-
bool verify_dns_length;
71+
std::string* ascii_domain{};
72+
bool check_hyphens{};
73+
bool check_bidi{};
74+
bool check_joiners{};
75+
bool use_std3_ascii_rules{};
76+
bool transitional_processing{};
77+
bool verify_dns_length{};
7878

7979
// These are intermediate buffers
80-
std::vector<std::u32string> labels;
81-
std::string punycode_encoded;
82-
std::u32string punycode_decoded;
80+
std::vector<std::u32string> labels{};
81+
std::string punycode_encoded{};
82+
std::u32string punycode_decoded{};
8383
};
8484

8585
///
@@ -296,15 +296,15 @@ inline auto domain_to_ascii(std::string_view domain_name, std::string* ascii_dom
296296
}
297297

298298
struct domain_to_u8_context {
299-
std::string_view domain_name;
299+
std::string_view domain_name{};
300300

301301
/// Parameters
302-
std::string* u8_domain;
302+
std::string* u8_domain{};
303303

304-
std::vector<std::string> labels;
304+
std::vector<std::string> labels{};
305305

306306
/// This is used as an intermediate buffer
307-
std::u32string punycode_decoded;
307+
std::u32string punycode_decoded{};
308308
};
309309

310310
///

include/skyr/percent_encoding/percent_decode_range.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class percent_decode_iterator {
118118
remainder_.remove_prefix(step);
119119
}
120120

121-
std::string_view remainder_;
121+
std::string_view remainder_{};
122122
};
123123

124124
///

include/skyr/percent_encoding/percent_encoded_char.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ struct percent_encoded_char {
187187
}
188188

189189
private:
190-
impl_type impl_;
190+
impl_type impl_{};
191191
};
192192

193193
///

include/skyr/unicode/ranges/transforms/u8_transform.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class transform_u8_range {
205205
}
206206

207207
private:
208-
iterator_type first_;
208+
iterator_type first_{};
209209
};
210210

211211
///

0 commit comments

Comments
 (0)