Skip to content

Commit afc0255

Browse files
authored
clang 20 warnings (#514)
1 parent ff9cc71 commit afc0255

4 files changed

Lines changed: 62 additions & 77 deletions

File tree

include/rfl/generic/Writer.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@
22
#define GENERIC_WRITER_HPP_
33

44
#include <cstddef>
5-
#include <exception>
6-
#include <functional>
7-
#include <map>
8-
#include <optional>
9-
#include <sstream>
10-
#include <stdexcept>
115
#include <string>
126
#include <string_view>
137
#include <type_traits>
148
#include <vector>
159

1610
#include "../Generic.hpp"
17-
#include "../Result.hpp"
18-
#include "../Variant.hpp"
1911
#include "../always_false.hpp"
2012

2113
namespace rfl::generic {

include/rfl/generic/write.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#ifndef GENERIC_WRITE_HPP_
22
#define GENERIC_WRITE_HPP_
33

4-
#include <cstddef>
5-
#include <ostream>
6-
#include <sstream>
7-
#include <vector>
8-
94
#include "../Generic.hpp"
105
#include "../parsing/Parent.hpp"
116
#include "Parser.hpp"

include/rfl/json/schema/JSONSchema.hpp

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

44
#include <map>
55
#include <string>
6-
#include <variant>
76

87
#include "../../Flatten.hpp"
98
#include "../../Literal.hpp"
@@ -15,9 +14,9 @@ namespace rfl::json::schema {
1514
template <class T>
1615
struct JSONSchema {
1716
Rename<"$schema", Literal<"https://json-schema.org/draft/2020-12/schema">>
18-
schema;
19-
Flatten<T> root;
20-
std::map<std::string, Type> definitions;
17+
schema{};
18+
Flatten<T> root{};
19+
std::map<std::string, Type> definitions{};
2120
};
2221

2322
} // namespace rfl::json::schema

include/rfl/json/schema/Type.hpp

Lines changed: 59 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef RFL_JSON_SCHEMA_TYPE_HPP_
22
#define RFL_JSON_SCHEMA_TYPE_HPP_
33

4-
#include <map>
54
#include <memory>
65
#include <optional>
76
#include <string>
@@ -16,125 +15,125 @@ namespace rfl::json::schema {
1615
/// The JSON representation of internal::schema::Type.
1716
struct Type {
1817
struct Boolean {
19-
std::optional<std::string> description;
20-
Literal<"boolean"> type;
18+
std::optional<std::string> description{};
19+
Literal<"boolean"> type{};
2120
};
2221

2322
struct Integer {
24-
Literal<"integer"> type;
25-
std::optional<std::string> description;
23+
Literal<"integer"> type{};
24+
std::optional<std::string> description{};
2625
};
2726

2827
struct Number {
29-
Literal<"number"> type;
30-
std::optional<std::string> description;
28+
Literal<"number"> type{};
29+
std::optional<std::string> description{};
3130
};
3231

3332
struct String {
34-
Literal<"string"> type;
35-
std::optional<std::string> description;
36-
rfl::Rename<"minLength", std::optional<size_t>> minSize;
37-
rfl::Rename<"maxLength", std::optional<size_t>> maxSize;
33+
Literal<"string"> type{};
34+
std::optional<std::string> description{};
35+
rfl::Rename<"minLength", std::optional<size_t>> minSize{};
36+
rfl::Rename<"maxLength", std::optional<size_t>> maxSize{};
3837
};
3938

4039
using NumericType = rfl::Variant<Integer, Number>;
4140

4241
struct AllOf {
43-
std::optional<std::string> description;
44-
std::vector<Type> allOf;
42+
std::optional<std::string> description{};
43+
std::vector<Type> allOf{};
4544
};
4645

4746
struct AnyOf {
48-
std::optional<std::string> description;
49-
std::vector<Type> anyOf;
47+
std::optional<std::string> description{};
48+
std::vector<Type> anyOf{};
5049
};
5150

5251
struct ExclusiveMaximum {
53-
std::optional<std::string> description;
54-
rfl::Variant<double, int> exclusiveMaximum;
55-
std::string type;
52+
std::optional<std::string> description{};
53+
rfl::Variant<double, int> exclusiveMaximum{};
54+
std::string type{};
5655
};
5756

5857
struct ExclusiveMinimum {
59-
std::optional<std::string> description;
60-
rfl::Variant<double, int> exclusiveMinimum;
61-
std::string type;
58+
std::optional<std::string> description{};
59+
rfl::Variant<double, int> exclusiveMinimum{};
60+
std::string type{};
6261
};
6362

6463
struct FixedSizeTypedArray {
65-
Literal<"array"> type;
66-
std::optional<std::string> description;
67-
rfl::Ref<Type> items;
68-
size_t minItems;
69-
size_t maxItems;
64+
Literal<"array"> type{};
65+
std::optional<std::string> description{};
66+
rfl::Ref<Type> items{};
67+
size_t minItems{};
68+
size_t maxItems{};
7069
};
7170

7271
struct Maximum {
73-
std::optional<std::string> description;
74-
rfl::Variant<double, int> maximum;
75-
std::string type;
72+
std::optional<std::string> description{};
73+
rfl::Variant<double, int> maximum{};
74+
std::string type{};
7675
};
7776

7877
struct Minimum {
79-
std::optional<std::string> description;
80-
rfl::Variant<double, int> minimum;
81-
std::string type;
78+
std::optional<std::string> description{};
79+
rfl::Variant<double, int> minimum{};
80+
std::string type{};
8281
};
8382

8483
struct Null {
85-
Literal<"null"> type;
86-
std::optional<std::string> description;
84+
Literal<"null"> type{};
85+
std::optional<std::string> description{};
8786
};
8887

8988
struct Object {
90-
Literal<"object"> type;
91-
std::optional<std::string> description;
92-
rfl::Object<Type> properties;
93-
std::vector<std::string> required;
94-
std::shared_ptr<Type> additionalProperties;
89+
Literal<"object"> type{};
90+
std::optional<std::string> description{};
91+
rfl::Object<Type> properties{};
92+
std::vector<std::string> required{};
93+
std::shared_ptr<Type> additionalProperties{};
9594
};
9695

9796
struct OneOf {
98-
std::optional<std::string> description;
99-
std::vector<Type> oneOf;
97+
std::optional<std::string> description{};
98+
std::vector<Type> oneOf{};
10099
};
101100

102101
struct Reference {
103-
Rename<"$ref", std::optional<std::string>> ref;
104-
std::optional<std::string> description;
102+
Rename<"$ref", std::optional<std::string>> ref{};
103+
std::optional<std::string> description{};
105104
};
106105

107106
struct Regex {
108-
Literal<"string"> type;
109-
std::optional<std::string> description;
110-
std::string pattern;
107+
Literal<"string"> type{};
108+
std::optional<std::string> description{};
109+
std::string pattern{};
111110
};
112111

113112
struct StringEnum {
114-
Literal<"string"> type;
115-
std::optional<std::string> description;
116-
rfl::Rename<"enum", std::vector<std::string>> values;
113+
Literal<"string"> type{};
114+
std::optional<std::string> description{};
115+
rfl::Rename<"enum", std::vector<std::string>> values{};
117116
};
118117

119118
struct StringMap {
120-
Literal<"object"> type;
121-
std::optional<std::string> description;
122-
rfl::Ref<Type> additionalProperties;
119+
Literal<"object"> type{};
120+
std::optional<std::string> description{};
121+
rfl::Ref<Type> additionalProperties{};
123122
};
124123

125124
struct Tuple {
126-
Literal<"array"> type;
127-
std::optional<std::string> description;
128-
std::vector<Type> prefixItems;
125+
Literal<"array"> type{};
126+
std::optional<std::string> description{};
127+
std::vector<Type> prefixItems{};
129128
bool items = false;
130129
};
131130

132131
struct TypedArray {
133-
Literal<"array"> type;
134-
std::optional<std::string> description;
135-
rfl::Ref<Type> items;
136-
rfl::Rename<"minItems", std::optional<size_t>> minSize;
137-
rfl::Rename<"maxItems", std::optional<size_t>> maxSize;
132+
Literal<"array"> type{};
133+
std::optional<std::string> description{};
134+
rfl::Ref<Type> items{};
135+
rfl::Rename<"minItems", std::optional<size_t>> minSize{};
136+
rfl::Rename<"maxItems", std::optional<size_t>> maxSize{};
138137
};
139138

140139
using ReflectionType =

0 commit comments

Comments
 (0)