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
|
|
@ -60,8 +60,8 @@ void InAppPurchases::getProductsInformation (const StringArray& productIdentifie
|
|||
}
|
||||
|
||||
void InAppPurchases::purchaseProduct (const String& productIdentifier,
|
||||
const String& upgradeProductIdentifier,
|
||||
bool creditForUnusedSubscription)
|
||||
[[maybe_unused]] const String& upgradeProductIdentifier,
|
||||
[[maybe_unused]] bool creditForUnusedSubscription)
|
||||
{
|
||||
#if JUCE_ANDROID || JUCE_IOS || JUCE_MAC
|
||||
pimpl->purchaseProduct (productIdentifier, upgradeProductIdentifier, creditForUnusedSubscription);
|
||||
|
|
@ -69,66 +69,55 @@ void InAppPurchases::purchaseProduct (const String& productIdentifier,
|
|||
Listener::PurchaseInfo purchaseInfo { Purchase { "", productIdentifier, {}, {}, {} }, {} };
|
||||
|
||||
listeners.call ([&] (Listener& l) { l.productPurchaseFinished (purchaseInfo, false, "In-app purchases unavailable"); });
|
||||
ignoreUnused (upgradeProductIdentifier, creditForUnusedSubscription);
|
||||
#endif
|
||||
}
|
||||
|
||||
void InAppPurchases::restoreProductsBoughtList (bool includeDownloadInfo, const String& subscriptionsSharedSecret)
|
||||
void InAppPurchases::restoreProductsBoughtList ([[maybe_unused]] bool includeDownloadInfo, [[maybe_unused]] const String& subscriptionsSharedSecret)
|
||||
{
|
||||
#if JUCE_ANDROID || JUCE_IOS || JUCE_MAC
|
||||
pimpl->restoreProductsBoughtList (includeDownloadInfo, subscriptionsSharedSecret);
|
||||
#else
|
||||
listeners.call ([] (Listener& l) { l.purchasesListRestored ({}, false, "In-app purchases unavailable"); });
|
||||
ignoreUnused (includeDownloadInfo, subscriptionsSharedSecret);
|
||||
#endif
|
||||
}
|
||||
|
||||
void InAppPurchases::consumePurchase (const String& productIdentifier, const String& purchaseToken)
|
||||
void InAppPurchases::consumePurchase (const String& productIdentifier, [[maybe_unused]] const String& purchaseToken)
|
||||
{
|
||||
#if JUCE_ANDROID || JUCE_IOS || JUCE_MAC
|
||||
pimpl->consumePurchase (productIdentifier, purchaseToken);
|
||||
#else
|
||||
listeners.call ([&] (Listener& l) { l.productConsumed (productIdentifier, false, "In-app purchases unavailable"); });
|
||||
ignoreUnused (purchaseToken);
|
||||
#endif
|
||||
}
|
||||
|
||||
void InAppPurchases::addListener (Listener* l) { listeners.add (l); }
|
||||
void InAppPurchases::removeListener (Listener* l) { listeners.remove (l); }
|
||||
|
||||
void InAppPurchases::startDownloads (const Array<Download*>& downloads)
|
||||
void InAppPurchases::startDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
#if JUCE_ANDROID || JUCE_IOS || JUCE_MAC
|
||||
pimpl->startDownloads (downloads);
|
||||
#else
|
||||
ignoreUnused (downloads);
|
||||
#endif
|
||||
}
|
||||
|
||||
void InAppPurchases::pauseDownloads (const Array<Download*>& downloads)
|
||||
void InAppPurchases::pauseDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
#if JUCE_ANDROID || JUCE_IOS || JUCE_MAC
|
||||
pimpl->pauseDownloads (downloads);
|
||||
#else
|
||||
ignoreUnused (downloads);
|
||||
#endif
|
||||
}
|
||||
|
||||
void InAppPurchases::resumeDownloads (const Array<Download*>& downloads)
|
||||
void InAppPurchases::resumeDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
#if JUCE_ANDROID || JUCE_IOS || JUCE_MAC
|
||||
pimpl->resumeDownloads (downloads);
|
||||
#else
|
||||
ignoreUnused (downloads);
|
||||
#endif
|
||||
}
|
||||
|
||||
void InAppPurchases::cancelDownloads (const Array<Download*>& downloads)
|
||||
void InAppPurchases::cancelDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
#if JUCE_ANDROID || JUCE_IOS || JUCE_MAC
|
||||
pimpl->cancelDownloads (downloads);
|
||||
#else
|
||||
ignoreUnused (downloads);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -261,12 +261,10 @@ public:
|
|||
"and only a single subscription can be upgraded/downgraded. Use the updated purchaseProduct method "
|
||||
"which takes a single String argument.")]]
|
||||
void purchaseProduct (const String& productIdentifier,
|
||||
bool isSubscription,
|
||||
[[maybe_unused]] bool isSubscription,
|
||||
const StringArray& upgradeOrDowngradeFromSubscriptionsWithProductIdentifiers = {},
|
||||
bool creditForUnusedSubscription = true)
|
||||
{
|
||||
|
||||
ignoreUnused (isSubscription);
|
||||
purchaseProduct (productIdentifier,
|
||||
upgradeOrDowngradeFromSubscriptionsWithProductIdentifiers[0],
|
||||
creditForUnusedSubscription);
|
||||
|
|
|
|||
|
|
@ -685,31 +685,27 @@ struct InAppPurchases::Pimpl
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
void startDownloads (const Array<Download*>& downloads)
|
||||
void startDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
// Not available on this platform.
|
||||
ignoreUnused (downloads);
|
||||
jassertfalse;
|
||||
}
|
||||
|
||||
void pauseDownloads (const Array<Download*>& downloads)
|
||||
void pauseDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
// Not available on this platform.
|
||||
ignoreUnused (downloads);
|
||||
jassertfalse;
|
||||
}
|
||||
|
||||
void resumeDownloads (const Array<Download*>& downloads)
|
||||
void resumeDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
// Not available on this platform.
|
||||
ignoreUnused (downloads);
|
||||
jassertfalse;
|
||||
}
|
||||
|
||||
void cancelDownloads (const Array<Download*>& downloads)
|
||||
void cancelDownloads ([[maybe_unused]] const Array<Download*>& downloads)
|
||||
{
|
||||
// Not available on this platform.
|
||||
ignoreUnused (downloads);
|
||||
jassertfalse;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue