Skip to content
Snippets Groups Projects
Commit 26d6b904 authored by Victor Poughon's avatar Victor Poughon
Browse files

Merge branch 'warning-missing-braces' into 'develop'

Fix missing braces warning on clang

See merge request orfeotoolbox/otb!433
parents 893910f1 2e7392e7
No related branches found
No related tags found
No related merge requests found
......@@ -59,12 +59,13 @@ typedef enum
ParameterType_RAM,
ParameterType_OutputProcessXML,
ParameterType_InputProcessXML,
ParameterType_Bool
ParameterType_Bool,
ParameterType_MAX__
} ParameterType;
namespace
{
constexpr std::array<const char*, 24> parameterTypesStrings = {
constexpr char const* parameterTypesStrings [] = {
"Int",
"Float",
"String",
......@@ -90,6 +91,8 @@ constexpr std::array<const char*, 24> parameterTypesStrings = {
"InputProcessXML",
"Bool"
};
static_assert(std::extent<decltype(parameterTypesStrings)>::value == ParameterType_MAX__,
"Wrong number of parameters in parameterTypesStrings");
}
// Free functions to convert from and to std::string
......
......@@ -396,6 +396,8 @@ ParameterGroup::AddParameter(ParameterType type, std::string paramKey, std::stri
newParam = BoolParameter::New();
}
break;
default:
break;
}
if (newParam.IsNull())
......
......@@ -32,7 +32,7 @@ std::string ParameterTypeToString(ParameterType type)
ParameterType ParameterStringToType(const std::string& str)
{
for (std::size_t i = 0; i < parameterTypesStrings.size(); i++)
for (std::size_t i = 0; i < ParameterType_MAX__; i++)
{
if (str == parameterTypesStrings[i])
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment