mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Convert ignoreUnused to [[maybe_unused]]
This commit is contained in:
parent
4351e87bdd
commit
28f2157912
141 changed files with 1057 additions and 1209 deletions
|
|
@ -70,10 +70,9 @@ namespace detail
|
|||
template <typename Fn>
|
||||
void clear (void* s)
|
||||
{
|
||||
auto& fn = *reinterpret_cast<Fn*> (s);
|
||||
fn.~Fn();
|
||||
// I know this looks insane, for some reason MSVC 14 sometimes thinks fn is unreferenced
|
||||
ignoreUnused (fn);
|
||||
[[maybe_unused]] auto& fn = *reinterpret_cast<Fn*> (s);
|
||||
fn.~Fn();
|
||||
}
|
||||
|
||||
template <typename Fn, typename Ret, typename... Args>
|
||||
|
|
|
|||
|
|
@ -334,8 +334,8 @@ public:
|
|||
bool smallCalled = false;
|
||||
bool largeCalled = false;
|
||||
|
||||
SmallFn small = [&smallCalled, a = std::array<char, 8>{}] { smallCalled = true; juce::ignoreUnused (a); };
|
||||
LargeFn large = [&largeCalled, a = std::array<char, 8>{}] { largeCalled = true; juce::ignoreUnused (a); };
|
||||
SmallFn small = [&smallCalled, a = std::array<char, 8>{}] { smallCalled = true; ignoreUnused (a); };
|
||||
LargeFn large = [&largeCalled, a = std::array<char, 8>{}] { largeCalled = true; ignoreUnused (a); };
|
||||
|
||||
large = std::move (small);
|
||||
|
||||
|
|
|
|||
|
|
@ -208,10 +208,10 @@ namespace juce
|
|||
inline void snapToZero (long double& x) noexcept { JUCE_SNAP_TO_ZERO (x); }
|
||||
#endif
|
||||
#else
|
||||
inline void snapToZero (float& x) noexcept { ignoreUnused (x); }
|
||||
inline void snapToZero ([[maybe_unused]] float& x) noexcept {}
|
||||
#ifndef DOXYGEN
|
||||
inline void snapToZero (double& x) noexcept { ignoreUnused (x); }
|
||||
inline void snapToZero (long double& x) noexcept { ignoreUnused (x); }
|
||||
inline void snapToZero ([[maybe_unused]] double& x) noexcept {}
|
||||
inline void snapToZero ([[maybe_unused]] long double& x) noexcept {}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue