Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 79efc89

Browse files
committed
Assume default struct initialization for OptionDef arrays.
The use of -Wmissing-field-initializers causes a warning for aggregate-initialization in the form of { NULL } where the struct has more than a single field with the first field a pointer. This replaces { NULL } with a value of { } to signify the end of the list.
1 parent 6fb884d commit 79efc89

Some content is hidden

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

49 files changed

+58
-58
lines changed

src/lib/support/nlargparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ HelpOptions::HelpOptions(const char *appName, const char *appUsage, const char *
10821082
{
10831083
{ "help", kNoArgument, 'h' },
10841084
{ "version", kNoArgument, 'v' },
1085-
{ NULL }
1085+
{ }
10861086
};
10871087
OptionDefs = optionDefs;
10881088

src/test-apps/CASEOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ CASEOptions::CASEOptions()
152152
{ "case-use-known-key", kNoArgument, kToolCommonOpt_CASEUseKnownECDHKey },
153153
#endif // WEAVE_CONFIG_SECURITY_TEST_MODE
154154
#endif // WEAVE_CONFIG_ENABLE_CASE_INITIATOR || WEAVE_CONFIG_ENABLE_CASE_RESPONDER
155-
{ NULL }
155+
{ }
156156
};
157157
OptionDefs = optionDefs;
158158

src/test-apps/DeviceDescOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ DeviceDescOptions::DeviceDescOptions()
4444
{ "product-id", kArgumentRequired, kToolCommonOpt_DeviceProductId },
4545
{ "product-rev", kArgumentRequired, kToolCommonOpt_DeviceProductRevision },
4646
{ "software-version", kArgumentRequired, kToolCommonOpt_DeviceSoftwareVersion },
47-
{ NULL }
47+
{ }
4848
};
4949
OptionDefs = optionDefs;
5050

src/test-apps/GenerateEventLog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static OptionDef gToolOptionDefs[] = { { "loglevel", kArgumentRequired, 'l' },
350350
{ "test", kArgumentRequired, 't' },
351351
{ "verbose", kNoArgument, 'V' },
352352
{ "wdm", kNoArgument, 'w' },
353-
{ NULL } };
353+
{ } };
354354

355355
static const char * gToolOptionHelp = " -l, --loglevel <logLevel>\n"
356356
" Configured default log level, 1 - PRODUCTION, 2 - INFO, 3 - DEBUG\n"

src/test-apps/KeyExportOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ KeyExportOptions::KeyExportOptions()
140140
{ "allowed-key-export-configs", kArgumentRequired, kToolCommonOpt_AllowedKeyExportConfigs },
141141
{ "access-token", kArgumentRequired, kToolCommonOpt_AccessToken },
142142
#endif
143-
{ NULL }
143+
{ }
144144
};
145145
OptionDefs = optionDefs;
146146

src/test-apps/MockWdmNodeOptions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ MockWdmNodeOptions::MockWdmNodeOptions() :
9393
{ "wdm-update-timing", kArgumentRequired, kToolOpt_WdmUpdateTiming },
9494
{ "wdm-update-discard-on-error", kNoArgument, kToolOpt_WdmUpdateDiscardOnError },
9595
#endif // WEAVE_CONFIG_ENABLE_RELIABLE_MESSAGING
96-
{ NULL }
96+
{ }
9797
};
9898

9999
OptionDefs = optionDefs;
@@ -593,7 +593,7 @@ TestWdmNextOptions::TestWdmNextOptions(void) :
593593
{ "test-delay", kArgumentRequired, kToolOpt_TestDelayBetweenIterationMsec },
594594
{ "save-perf", kNoArgument, kToolOpt_SavePerfData },
595595
{ "clear-state-between-iterations", kNoArgument, kToolOpt_ClearDataSinkStateBetweenTests },
596-
{ NULL }
596+
{ }
597597
};
598598

599599
OptionDefs = optionDefs;

src/test-apps/TAKEOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ TAKEOptions::TAKEOptions()
3939
#if WEAVE_CONFIG_ENABLE_TAKE_INITIATOR || WEAVE_CONFIG_ENABLE_TAKE_RESPONDER
4040
{ "take-reauth", kNoArgument, kToolCommonOpt_TAKEReauth },
4141
#endif
42-
{ NULL }
42+
{ }
4343
};
4444
OptionDefs = optionDefs;
4545

src/test-apps/TestArgParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static OptionDef sOptionSetA_Defs[] =
121121
{ "foo", kNoArgument, '1' },
122122
{ "bar", kNoArgument, 1001 },
123123
{ "baz", kArgumentRequired, 'Z' },
124-
{ NULL }
124+
{ }
125125
};
126126

127127
static OptionSet sOptionSetA =
@@ -140,7 +140,7 @@ static OptionDef sOptionSetB_Defs[] =
140140
{ "stop", kNoArgument, 's' },
141141
{ "run", kArgumentRequired, 1000 },
142142
{ "walk", kNoArgument, 1001 },
143-
{ NULL }
143+
{ }
144144
};
145145

146146
static OptionSet sOptionSetB =

src/test-apps/TestBinding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static OptionDef gToolOptionDefs[] =
147147
#if WEAVE_CONFIG_ENABLE_DNS_RESOLVER
148148
{ "dns-options", kArgumentRequired, kToolOpt_DNSOptions },
149149
#endif // WEAVE_CONFIG_ENABLE_DNS_RESOLVER
150-
{ NULL }
150+
{ }
151151
};
152152

153153
static const char *const gToolOptionHelp =

src/test-apps/TestCASE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ void CASEEngineTests_FuzzTests()
10311031
static OptionDef gToolOptionDefs[] =
10321032
{
10331033
{ "fuzz-duration", kArgumentRequired, 'f' },
1034-
{ NULL }
1034+
{ }
10351035
};
10361036

10371037
static const char *const gToolOptionHelp =

0 commit comments

Comments
 (0)