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

@ -727,32 +727,7 @@ public:
@see addSorted, sort
*/
template <typename ElementComparator, typename TargetValueType>
int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const
{
ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
const ScopedLockType lock (getLock());
for (int s = 0, e = values.size();;)
{
if (s >= e)
return -1;
if (comparator.compareElements (elementToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
return -1;
if (comparator.compareElements (elementToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
}
int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const;
//==============================================================================
/** Removes an element from the array.
@ -1106,14 +1081,7 @@ public:
@see addSorted, indexOfSorted, sortArray
*/
template <class ElementComparator>
void sort (ElementComparator& comparator,
bool retainOrderOfEquivalentItems = false)
{
const ScopedLockType lock (getLock());
ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
void sort (ElementComparator& comparator, bool retainOrderOfEquivalentItems = false);
//==============================================================================
/** Returns the CriticalSection that locks this array.
@ -1150,4 +1118,43 @@ private:
}
};
//==============================================================================
template <typename ElementType, typename TypeOfCriticalSectionToUse, int minimumAllocatedSize>
template <typename ElementComparator, typename TargetValueType>
int Array<ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize>::indexOfSorted (
[[maybe_unused]] ElementComparator& comparator,
TargetValueType elementToLookFor) const
{
const ScopedLockType lock (getLock());
for (int s = 0, e = values.size();;)
{
if (s >= e)
return -1;
if (comparator.compareElements (elementToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
return -1;
if (comparator.compareElements (elementToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
}
template <typename ElementType, typename TypeOfCriticalSectionToUse, int minimumAllocatedSize>
template <class ElementComparator>
void Array<ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize>::sort (
[[maybe_unused]] ElementComparator& comparator,
bool retainOrderOfEquivalentItems)
{
const ScopedLockType lock (getLock());
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
} // namespace juce

View file

@ -542,7 +542,7 @@ private:
template <typename... Elements>
void addImpl (Elements&&... toAdd)
{
ignoreUnused (std::initializer_list<int> { (((void) checkSourceIsNotAMember (toAdd)), 0)... });
(checkSourceIsNotAMember (toAdd), ...);
ensureAllocatedSize (numUsed + (int) sizeof... (toAdd));
addAssumingCapacityIsReady (std::forward<Elements> (toAdd)...);
}
@ -550,7 +550,7 @@ private:
template <typename... Elements>
void addAssumingCapacityIsReady (Elements&&... toAdd)
{
ignoreUnused (std::initializer_list<int> { ((void) (new (elements + numUsed++) ElementType (std::forward<Elements> (toAdd))), 0)... });
(new (elements + numUsed++) ElementType (std::forward<Elements> (toAdd)), ...);
}
//==============================================================================

View file

@ -123,7 +123,7 @@ static void sortArray (ElementComparator& comparator,
@param lastElement the index of the last element in the range (this is non-inclusive)
*/
template <class ElementType, class ElementComparator>
static int findInsertIndexInSortedArray (ElementComparator& comparator,
static int findInsertIndexInSortedArray ([[maybe_unused]] ElementComparator& comparator,
ElementType* const array,
const ElementType newElement,
int firstElement,
@ -131,9 +131,6 @@ static int findInsertIndexInSortedArray (ElementComparator& comparator,
{
jassert (firstElement <= lastElement);
ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
while (firstElement < lastElement)
{
if (comparator.compareElements (newElement, array [firstElement]) == 0)

View file

@ -46,7 +46,6 @@ namespace juce
*/
template <class ObjectClass,
class TypeOfCriticalSectionToUse = DummyCriticalSection>
class OwnedArray
{
public:
@ -531,17 +530,7 @@ public:
@see add, sort, indexOfSorted
*/
template <class ElementComparator>
int addSorted (ElementComparator& comparator, ObjectClass* newObject) noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
auto index = findInsertIndexInSortedArray (comparator, values.begin(), newObject, 0, values.size());
insert (index, newObject);
return index;
}
int addSorted (ElementComparator& comparator, ObjectClass* newObject) noexcept;
/** Finds the index of an object in the array, assuming that the array is sorted.
@ -556,33 +545,7 @@ public:
@see addSorted, sort
*/
template <typename ElementComparator>
int indexOfSorted (ElementComparator& comparator, const ObjectClass* objectToLookFor) const noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
int indexOfSorted (ElementComparator& comparator, const ObjectClass* objectToLookFor) const noexcept;
//==============================================================================
/** Removes an object from the array.
@ -818,18 +781,7 @@ public:
@see sortArray, indexOfSorted
*/
template <class ElementComparator>
void sort (ElementComparator& comparator,
bool retainOrderOfEquivalentItems = false) noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
if (size() > 1)
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
void sort (ElementComparator& comparator, bool retainOrderOfEquivalentItems = false) noexcept;
//==============================================================================
/** Returns the CriticalSection that locks this array.
@ -870,4 +822,57 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OwnedArray)
};
//==============================================================================
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <class ElementComparator>
int OwnedArray<ObjectClass, TypeOfCriticalSectionToUse>::addSorted (
[[maybe_unused]] ElementComparator& comparator,
ObjectClass* newObject) noexcept
{
const ScopedLockType lock (getLock());
auto index = findInsertIndexInSortedArray (comparator, values.begin(), newObject, 0, values.size());
insert (index, newObject);
return index;
}
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <typename ElementComparator>
int OwnedArray<ObjectClass, TypeOfCriticalSectionToUse>::indexOfSorted (
[[maybe_unused]] ElementComparator& comparator,
const ObjectClass* objectToLookFor) const noexcept
{
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <typename ElementComparator>
void OwnedArray<ObjectClass, TypeOfCriticalSectionToUse>::sort (
[[maybe_unused]] ElementComparator& comparator,
bool retainOrderOfEquivalentItems) noexcept
{
const ScopedLockType lock (getLock());
if (size() > 1)
sortArray (comparator, values.begin(), 0, size() - 1, retainOrderOfEquivalentItems);
}
} // namespace juce

View file

@ -563,31 +563,7 @@ public:
@see addSorted, sort
*/
template <class ElementComparator>
int indexOfSorted (ElementComparator& comparator,
const ObjectClass* objectToLookFor) const noexcept
{
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
int indexOfSorted (ElementComparator& comparator, const ObjectClass* objectToLookFor) const noexcept;
//==============================================================================
/** Removes an object from the array.
@ -828,16 +804,7 @@ public:
@see sortArray
*/
template <class ElementComparator>
void sort (ElementComparator& comparator,
bool retainOrderOfEquivalentItems = false) noexcept
{
// If you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
sortArray (comparator, values.begin(), 0, values.size() - 1, retainOrderOfEquivalentItems);
}
void sort (ElementComparator& comparator, bool retainOrderOfEquivalentItems = false) noexcept;
//==============================================================================
/** Reduces the amount of storage being used by the array.
@ -904,4 +871,43 @@ private:
}
};
//==============================================================================
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <class ElementComparator>
int ReferenceCountedArray<ObjectClass, TypeOfCriticalSectionToUse>::indexOfSorted (
[[maybe_unused]] ElementComparator& comparator,
const ObjectClass* objectToLookFor) const noexcept
{
const ScopedLockType lock (getLock());
int s = 0, e = values.size();
while (s < e)
{
if (comparator.compareElements (objectToLookFor, values[s]) == 0)
return s;
auto halfway = (s + e) / 2;
if (halfway == s)
break;
if (comparator.compareElements (objectToLookFor, values[halfway]) >= 0)
s = halfway;
else
e = halfway;
}
return -1;
}
template <class ObjectClass, class TypeOfCriticalSectionToUse>
template <class ElementComparator>
void ReferenceCountedArray<ObjectClass, TypeOfCriticalSectionToUse>::sort (
[[maybe_unused]] ElementComparator& comparator,
bool retainOrderOfEquivalentItems) noexcept
{
const ScopedLockType lock (getLock());
sortArray (comparator, values.begin(), 0, values.size() - 1, retainOrderOfEquivalentItems);
}
} // namespace juce

View file

@ -953,7 +953,7 @@ File File::createTempFile (StringRef fileNameEnding)
}
bool File::createSymbolicLink (const File& linkFileToCreate,
const String& nativePathOfTarget,
[[maybe_unused]] const String& nativePathOfTarget,
bool overwriteExisting)
{
if (linkFileToCreate.exists())
@ -986,7 +986,6 @@ bool File::createSymbolicLink (const File& linkFileToCreate,
nativePathOfTarget.toWideCharPointer(),
targetFile.isDirectory() ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0) != FALSE;
#else
ignoreUnused (nativePathOfTarget);
jassertfalse; // symbolic links not supported on this platform!
return false;
#endif

View file

@ -1539,9 +1539,9 @@ struct JavascriptEngine::RootObject : public DynamicObject
setMethod ("clone", cloneFn);
}
static Identifier getClassName() { static const Identifier i ("Object"); return i; }
static var dump (Args a) { DBG (JSON::toString (a.thisObject)); ignoreUnused (a); return var::undefined(); }
static var cloneFn (Args a) { return a.thisObject.clone(); }
static Identifier getClassName() { static const Identifier i ("Object"); return i; }
static var dump ([[maybe_unused]] Args a) { DBG (JSON::toString (a.thisObject)); return var::undefined(); }
static var cloneFn (Args a) { return a.thisObject.clone(); }
};
//==============================================================================

View file

@ -424,9 +424,8 @@ struct Expression::Helpers
String getName() const { return "-"; }
TermPtr negated() { return input; }
TermPtr createTermToEvaluateInput (const Scope& scope, const Term* t, double overallTarget, Term* topLevelTerm) const
TermPtr createTermToEvaluateInput (const Scope& scope, [[maybe_unused]] const Term* t, double overallTarget, Term* topLevelTerm) const
{
ignoreUnused (t);
jassert (t == input);
const Term* const dest = findDestinationFor (topLevelTerm, this);

View file

@ -49,7 +49,7 @@ struct ContainerDeletePolicy
// implementation of all methods trying to use the OwnedArray (e.g. the destructor
// of the class owning it) into cpp files where they can see to the definition
// of ObjectType. This should fix the error.
ignoreUnused (sizeof (ObjectType));
[[maybe_unused]] constexpr auto size = sizeof (ObjectType);
delete object;
}

View file

@ -101,8 +101,7 @@ struct AndroidDocumentDetail
auto* env = getEnv();
LocalRef<jobjectArray> array { env->NewObjectArray (sizeof... (args), JavaString, nullptr) };
int unused[] { (env->SetObjectArrayElement (array.get(), Ix, args.get()), 0)... };
ignoreUnused (unused);
(env->SetObjectArrayElement (array.get(), Ix, args.get()), ...);
return array;
}
@ -745,21 +744,17 @@ struct AndroidDocument::Utils
};
//==============================================================================
void AndroidDocumentPermission::takePersistentReadWriteAccess (const URL& url)
void AndroidDocumentPermission::takePersistentReadWriteAccess ([[maybe_unused]] const URL& url)
{
#if JUCE_ANDROID
AndroidDocumentDetail::setPermissions (url, ContentResolver19.takePersistableUriPermission);
#else
ignoreUnused (url);
#endif
}
void AndroidDocumentPermission::releasePersistentReadWriteAccess (const URL& url)
void AndroidDocumentPermission::releasePersistentReadWriteAccess ([[maybe_unused]] const URL& url)
{
#if JUCE_ANDROID
AndroidDocumentDetail::setPermissions (url, ContentResolver19.releasePersistableUriPermission);
#else
ignoreUnused (url);
#endif
}
@ -817,7 +812,7 @@ AndroidDocument AndroidDocument::fromFile (const File& filePath)
: nullptr };
}
AndroidDocument AndroidDocument::fromDocument (const URL& documentUrl)
AndroidDocument AndroidDocument::fromDocument ([[maybe_unused]] const URL& documentUrl)
{
#if JUCE_ANDROID
if (getAndroidSDKVersion() < 19)
@ -839,12 +834,11 @@ AndroidDocument AndroidDocument::fromDocument (const URL& documentUrl)
return AndroidDocument { Utils::createPimplForSdk (javaUri) };
#else
ignoreUnused (documentUrl);
return AndroidDocument{};
#endif
}
AndroidDocument AndroidDocument::fromTree (const URL& treeUrl)
AndroidDocument AndroidDocument::fromTree ([[maybe_unused]] const URL& treeUrl)
{
#if JUCE_ANDROID
if (getAndroidSDKVersion() < 21)
@ -874,7 +868,6 @@ AndroidDocument AndroidDocument::fromTree (const URL& treeUrl)
return AndroidDocument { Utils::createPimplForSdk (documentUri) };
#else
ignoreUnused (treeUrl);
return AndroidDocument{};
#endif
}

View file

@ -397,7 +397,7 @@ bool DirectoryIterator::NativeIterator::next (String& filenameFound,
//==============================================================================
bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String& parameters)
bool JUCE_CALLTYPE Process::openDocument (const String& fileName, [[maybe_unused]] const String& parameters)
{
JUCE_AUTORELEASEPOOL
{
@ -406,8 +406,6 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String&
: [NSURL URLWithString: fileNameAsNS];
#if JUCE_IOS
ignoreUnused (parameters);
if (@available (iOS 10.0, *))
{
[[UIApplication sharedApplication] openURL: filenameAsURL

View file

@ -58,14 +58,12 @@ void MACAddress::findAllAddresses (Array<MACAddress>& result)
}
//==============================================================================
bool JUCE_CALLTYPE Process::openEmailWithAttachments (const String& targetEmailAddress,
const String& emailSubject,
const String& bodyText,
const StringArray& filesToAttach)
bool JUCE_CALLTYPE Process::openEmailWithAttachments ([[maybe_unused]] const String& targetEmailAddress,
[[maybe_unused]] const String& emailSubject,
[[maybe_unused]] const String& bodyText,
[[maybe_unused]] const StringArray& filesToAttach)
{
#if JUCE_IOS
ignoreUnused (targetEmailAddress, emailSubject, bodyText, filesToAttach);
//xxx probably need to use MFMailComposeViewController
jassertfalse;
return false;
@ -282,9 +280,9 @@ public:
return newRequest;
}
void didFailWithError (NSError* error)
void didFailWithError ([[maybe_unused]] NSError* error)
{
DBG (nsStringToJuce ([error description])); ignoreUnused (error);
DBG (nsStringToJuce ([error description]));
nsUrlErrorCode = [error code];
hasFailed = true;
initialised = true;
@ -951,10 +949,8 @@ public:
connection.reset();
}
bool connect (WebInputStream::Listener* webInputListener, int numRetries = 0)
bool connect (WebInputStream::Listener* webInputListener, [[maybe_unused]] int numRetries = 0)
{
ignoreUnused (numRetries);
{
const ScopedLock lock (createConnectionLock);

View file

@ -391,8 +391,8 @@ struct ObjCClass
template <typename Type>
void addIvar (const char* name)
{
BOOL b = class_addIvar (cls, name, sizeof (Type), (uint8_t) rint (log2 (sizeof (Type))), @encode (Type));
jassert (b); ignoreUnused (b);
[[maybe_unused]] BOOL b = class_addIvar (cls, name, sizeof (Type), (uint8_t) rint (log2 (sizeof (Type))), @encode (Type));
jassert (b);
}
template <typename Fn>
@ -408,8 +408,8 @@ struct ObjCClass
void addProtocol (Protocol* protocol)
{
BOOL b = class_addProtocol (cls, protocol);
jassert (b); ignoreUnused (b);
[[maybe_unused]] BOOL b = class_addProtocol (cls, protocol);
jassert (b);
}
template <typename ReturnType, typename... Params>

View file

@ -254,8 +254,7 @@ void NamedPipe::close()
pimpl->stopReadOperation = true;
const char buffer[] { 0 };
const auto done = ::write (pimpl->pipeIn.get(), buffer, numElementsInArray (buffer));
ignoreUnused (done);
[[maybe_unused]] const auto done = ::write (pimpl->pipeIn.get(), buffer, numElementsInArray (buffer));
}
}

View file

@ -140,10 +140,9 @@ bool File::setAsCurrentWorkingDirectory() const
//==============================================================================
// The unix siginterrupt function is deprecated - this does the same job.
int juce_siginterrupt (int sig, int flag)
int juce_siginterrupt ([[maybe_unused]] int sig, [[maybe_unused]] int flag)
{
#if JUCE_WASM
ignoreUnused (sig, flag);
return 0;
#else
#if JUCE_ANDROID
@ -693,8 +692,7 @@ int File::getVolumeSerialNumber() const
void juce_runSystemCommand (const String&);
void juce_runSystemCommand (const String& command)
{
int result = system (command.toUTF8());
ignoreUnused (result);
[[maybe_unused]] int result = system (command.toUTF8());
}
String juce_getOutputFromCommand (const String&);
@ -1015,7 +1013,7 @@ void JUCE_CALLTYPE Thread::yield()
#define SUPPORT_AFFINITIES 1
#endif
void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask (uint32 affinityMask)
void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask ([[maybe_unused]] uint32 affinityMask)
{
#if SUPPORT_AFFINITIES
cpu_set_t affinity;
@ -1042,7 +1040,6 @@ void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask (uint32 affinityMask)
// affinities aren't supported because either the appropriate header files weren't found,
// or the SUPPORT_AFFINITIES macro was turned off
jassertfalse;
ignoreUnused (affinityMask);
#endif
}

View file

@ -960,7 +960,7 @@ bool File::createShortcut (const String& description, const File& linkFileToCrea
ComSmartPtr<IShellLink> shellLink;
ComSmartPtr<IPersistFile> persistFile;
ignoreUnused (CoInitialize (nullptr));
[[maybe_unused]] const auto result = CoInitialize (nullptr);
return SUCCEEDED (shellLink.CoCreateInstance (CLSID_ShellLink))
&& SUCCEEDED (shellLink->SetPath (getFullPathName().toWideCharPointer()))

View file

@ -457,8 +457,7 @@ public:
#endif
#if JUCE_WIN32_TIMER_PERIOD > 0
auto res = timeBeginPeriod (JUCE_WIN32_TIMER_PERIOD);
ignoreUnused (res);
[[maybe_unused]] auto res = timeBeginPeriod (JUCE_WIN32_TIMER_PERIOD);
jassert (res == TIMERR_NOERROR);
#endif

View file

@ -134,7 +134,7 @@ void Thread::killThread()
}
}
void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name)
void JUCE_CALLTYPE Thread::setCurrentThreadName ([[maybe_unused]] const String& name)
{
#if JUCE_DEBUG && JUCE_MSVC
struct
@ -159,8 +159,6 @@ void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name)
{
OutputDebugStringA ("** Warning - Encountered noncontinuable exception **\n");
}
#else
ignoreUnused (name);
#endif
}

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.

View file

@ -43,8 +43,7 @@
#if ! DOXYGEN
#define JUCE_VERSION_ID \
volatile auto juceVersionId = "juce_version_" JUCE_STRINGIFY(JUCE_MAJOR_VERSION) "_" JUCE_STRINGIFY(JUCE_MINOR_VERSION) "_" JUCE_STRINGIFY(JUCE_BUILDNUMBER); \
ignoreUnused (juceVersionId);
[[maybe_unused]] volatile auto juceVersionId = "juce_version_" JUCE_STRINGIFY(JUCE_MAJOR_VERSION) "_" JUCE_STRINGIFY(JUCE_MINOR_VERSION) "_" JUCE_STRINGIFY(JUCE_BUILDNUMBER);
#endif
//==============================================================================