archive/ArchiveList, input/Registry: avoid zero-sized array
Some more `-Wpedantic` fixups.
This commit is contained in:
parent
8fdc6dec44
commit
caec384ed0
|
@ -43,8 +43,12 @@ const ArchivePlugin *const archive_plugins[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static constexpr std::size_t n_archive_plugins = std::size(archive_plugins) - 1;
|
||||||
|
|
||||||
/** which plugins have been initialized successfully? */
|
/** which plugins have been initialized successfully? */
|
||||||
static bool archive_plugins_enabled[std::size(archive_plugins) - 1];
|
/* the std::max() is just here to avoid a zero-sized array, which is
|
||||||
|
forbidden in C++ */
|
||||||
|
static bool archive_plugins_enabled[std::max(n_archive_plugins, std::size_t(1))];
|
||||||
|
|
||||||
#define archive_plugins_for_each_enabled(plugin) \
|
#define archive_plugins_for_each_enabled(plugin) \
|
||||||
archive_plugins_for_each(plugin) \
|
archive_plugins_for_each(plugin) \
|
||||||
|
|
|
@ -83,7 +83,11 @@ const InputPlugin *const input_plugins[] = {
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
bool input_plugins_enabled[std::size(input_plugins) - 1];
|
static constexpr std::size_t n_input_plugins = std::size(input_plugins) - 1;
|
||||||
|
|
||||||
|
/* the std::max() is just here to avoid a zero-sized array, which is
|
||||||
|
forbidden in C++ */
|
||||||
|
bool input_plugins_enabled[std::max(n_input_plugins, std::size_t(1))];
|
||||||
|
|
||||||
bool
|
bool
|
||||||
HasRemoteTagScanner(const char *uri) noexcept
|
HasRemoteTagScanner(const char *uri) noexcept
|
||||||
|
|
Loading…
Reference in New Issue