1
0
Fork 0
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:
reuk 2022-09-16 19:08:31 +01:00
parent 4351e87bdd
commit 28f2157912
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
141 changed files with 1057 additions and 1209 deletions

View file

@ -91,15 +91,16 @@ namespace SocketHelpers
: setOption (handle, IPPROTO_TCP, TCP_NODELAY, (int) 1));
}
static void closeSocket (std::atomic<int>& handle, CriticalSection& readLock,
bool isListener, int portNumber, std::atomic<bool>& connected) noexcept
static void closeSocket (std::atomic<int>& handle,
[[maybe_unused]] CriticalSection& readLock,
[[maybe_unused]] bool isListener,
[[maybe_unused]] int portNumber,
std::atomic<bool>& connected) noexcept
{
const auto h = (SocketHandle) handle.load();
handle = -1;
#if JUCE_WINDOWS
ignoreUnused (portNumber, isListener, readLock);
if (h != invalidSocket || connected)
closesocket (h);
@ -771,11 +772,9 @@ bool DatagramSocket::setMulticastLoopbackEnabled (bool enable)
return SocketHelpers::setOption<bool> ((SocketHandle) handle.load(), IPPROTO_IP, IP_MULTICAST_LOOP, enable);
}
bool DatagramSocket::setEnablePortReuse (bool enabled)
bool DatagramSocket::setEnablePortReuse ([[maybe_unused]] bool enabled)
{
#if JUCE_ANDROID
ignoreUnused (enabled);
#else
#if ! JUCE_ANDROID
if (handle >= 0)
return SocketHelpers::setOption ((SocketHandle) handle.load(),
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD

View file

@ -630,8 +630,7 @@ public:
}
else
{
auto desc = [error localizedDescription];
ignoreUnused (desc);
[[maybe_unused]] auto desc = [error localizedDescription];
jassertfalse;
}
}
@ -664,8 +663,7 @@ private:
return urlToUse.getLocalFile();
}
auto desc = [error localizedDescription];
ignoreUnused (desc);
[[maybe_unused]] auto desc = [error localizedDescription];
jassertfalse;
}

View file

@ -96,4 +96,11 @@ void WebInputStream::createHeadersAndPostData (const URL& aURL,
aURL.createHeadersAndPostData (headers, data, addParametersToBody);
}
bool WebInputStream::Listener::postDataSendProgress ([[maybe_unused]] WebInputStream& request,
[[maybe_unused]] int bytesSent,
[[maybe_unused]] int totalBytes)
{
return true;
}
} // namespace juce

View file

@ -107,11 +107,7 @@ class JUCE_API WebInputStream : public InputStream
@returns true to continue or false to cancel the upload
*/
virtual bool postDataSendProgress (WebInputStream& request, int bytesSent, int totalBytes)
{
ignoreUnused (request, bytesSent, totalBytes);
return true;
}
virtual bool postDataSendProgress (WebInputStream& request, int bytesSent, int totalBytes);
};
/** Wait until the first byte is ready for reading.