Skip to content

Commit def6081

Browse files
authored
Merge pull request #187 from wravery/next
Fix some code analysis issues detected by VS 2022
2 parents 777ef34 + 734580e commit def6081

File tree

5 files changed

+180
-205
lines changed

5 files changed

+180
-205
lines changed

samples/learn/schema/StarWarsSchema.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ enum class Episode
3030

3131
struct ReviewInput
3232
{
33-
int stars;
34-
std::optional<std::string> commentary;
33+
int stars {};
34+
std::optional<std::string> commentary {};
3535
};
3636

3737
namespace object {

samples/today/nointrospection/TodaySchema.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,33 @@ enum class TaskState
3131

3232
struct CompleteTaskInput
3333
{
34-
response::IdType id;
35-
std::optional<TaskState> testTaskState;
36-
std::optional<bool> isComplete;
37-
std::optional<std::string> clientMutationId;
34+
response::IdType id {};
35+
std::optional<TaskState> testTaskState {};
36+
std::optional<bool> isComplete {};
37+
std::optional<std::string> clientMutationId {};
3838
};
3939

4040
struct ThirdNestedInput
4141
{
42-
response::IdType id;
42+
response::IdType id {};
4343
};
4444

4545
struct FourthNestedInput
4646
{
47-
response::IdType id;
47+
response::IdType id {};
4848
};
4949

5050
struct SecondNestedInput
5151
{
52-
response::IdType id;
53-
ThirdNestedInput third;
52+
response::IdType id {};
53+
ThirdNestedInput third {};
5454
};
5555

5656
struct FirstNestedInput
5757
{
58-
response::IdType id;
59-
SecondNestedInput second;
60-
ThirdNestedInput third;
58+
response::IdType id {};
59+
SecondNestedInput second {};
60+
ThirdNestedInput third {};
6161
};
6262

6363
namespace object {

samples/today/schema/TodaySchema.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,33 @@ enum class TaskState
3131

3232
struct CompleteTaskInput
3333
{
34-
response::IdType id;
35-
std::optional<TaskState> testTaskState;
36-
std::optional<bool> isComplete;
37-
std::optional<std::string> clientMutationId;
34+
response::IdType id {};
35+
std::optional<TaskState> testTaskState {};
36+
std::optional<bool> isComplete {};
37+
std::optional<std::string> clientMutationId {};
3838
};
3939

4040
struct ThirdNestedInput
4141
{
42-
response::IdType id;
42+
response::IdType id {};
4343
};
4444

4545
struct FourthNestedInput
4646
{
47-
response::IdType id;
47+
response::IdType id {};
4848
};
4949

5050
struct SecondNestedInput
5151
{
52-
response::IdType id;
53-
ThirdNestedInput third;
52+
response::IdType id {};
53+
ThirdNestedInput third {};
5454
};
5555

5656
struct FirstNestedInput
5757
{
58-
response::IdType id;
59-
SecondNestedInput second;
60-
ThirdNestedInput third;
58+
response::IdType id {};
59+
SecondNestedInput second {};
60+
ThirdNestedInput third {};
6161
};
6262

6363
namespace object {

samples/validation/schema/ValidationSchema.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ enum class CatCommand
3535

3636
struct ComplexInput
3737
{
38-
std::optional<std::string> name;
39-
std::optional<std::string> owner;
38+
std::optional<std::string> name {};
39+
std::optional<std::string> owner {};
4040
};
4141

4242
namespace object {

0 commit comments

Comments
 (0)