1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Used the ignoreUnused() function to tidy up some old code

This commit is contained in:
jules 2015-12-23 16:27:50 +00:00
parent 7988190e73
commit 4583fa3fbf
55 changed files with 98 additions and 111 deletions

View file

@ -249,8 +249,7 @@ private:
{
// this is the item they chose in the drop-down list..
const int optionIndexChosen = w.getComboBoxComponent ("option")->getSelectedItemIndex();
(void) optionIndexChosen; // (just avoids a compiler warning about unused variables)
ignoreUnused (optionIndexChosen);
// this is the text they entered..
String text = w.getTextEditorContents ("text");

View file

@ -1005,7 +1005,7 @@ void JUCE_CALLTYPE FloatVectorOperations::enableFlushToZeroMode (bool shouldEnab
if (FloatVectorHelpers::isSSE2Available())
_MM_SET_FLUSH_ZERO_MODE (shouldEnable ? _MM_FLUSH_ZERO_ON : _MM_FLUSH_ZERO_OFF);
#endif
(void) shouldEnable;
ignoreUnused (shouldEnable);
}
//==============================================================================

View file

@ -71,7 +71,7 @@ public:
virtual bool isLooping() const = 0;
/** Tells the source whether you'd like it to play in a loop. */
virtual void setLooping (bool shouldLoop) { (void) shouldLoop; }
virtual void setLooping (bool shouldLoop) { ignoreUnused (shouldLoop); }
};

View file

@ -512,13 +512,13 @@ void Synthesiser::handleSostenutoPedal (int midiChannel, bool isDown)
void Synthesiser::handleSoftPedal (int midiChannel, bool /*isDown*/)
{
(void) midiChannel;
ignoreUnused (midiChannel);
jassert (midiChannel > 0 && midiChannel <= 16);
}
void Synthesiser::handleProgramChange (int midiChannel, int programNumber)
{
(void) midiChannel; (void) programNumber;
ignoreUnused (midiChannel, programNumber);
jassert (midiChannel > 0 && midiChannel <= 16);
}

View file

@ -74,8 +74,7 @@ public:
int numBytesSoFar,
double timestamp)
{
// (this bit is just to avoid compiler warnings about unused variables)
(void) source; (void) messageData; (void) numBytesSoFar; (void) timestamp;
ignoreUnused (source, messageData, numBytesSoFar, timestamp);
}
};

View file

@ -552,7 +552,7 @@ private:
static void staticCallback (SLAndroidSimpleBufferQueueItf queue, void* context) noexcept
{
jassert (queue == static_cast<Player*> (context)->playerBufferQueue); (void) queue;
jassert (queue == static_cast<Player*> (context)->playerBufferQueue); ignoreUnused (queue);
static_cast<Player*> (context)->bufferList.bufferReturned();
}
@ -687,7 +687,7 @@ private:
static void staticCallback (SLAndroidSimpleBufferQueueItf queue, void* context) noexcept
{
jassert (queue == static_cast<Recorder*> (context)->recorderBufferQueue); (void) queue;
jassert (queue == static_cast<Recorder*> (context)->recorderBufferQueue); ignoreUnused (queue);
static_cast<Recorder*> (context)->bufferList.bufferReturned();
}

View file

@ -169,7 +169,7 @@ void AudioCDReader::refreshTrackLengths()
{
XmlDocument doc (toc);
const char* error = CDReaderHelpers::getTrackOffsets (doc, trackStartSamples);
(void) error; // could be logged..
ignoreUnused (error); // could be logged..
lengthInSamples = trackStartSamples.getLast() - trackStartSamples.getFirst();
}

View file

@ -37,7 +37,7 @@ namespace CoreMidiHelpers
Logger::writeToLog ("CoreMIDI error: " + String (lineNum) + " - " + String::toHexString ((int) err));
#endif
(void) lineNum;
ignoreUnused (lineNum);
return false;
}

View file

@ -67,7 +67,7 @@ namespace ASIODebugging
#else
static void dummyLog() {}
#define JUCE_ASIO_LOG(msg) ASIODebugging::dummyLog()
#define JUCE_ASIO_LOG_ERROR(msg, errNum) (void) errNum; ASIODebugging::dummyLog()
#define JUCE_ASIO_LOG_ERROR(msg, errNum) ignoreUnused (errNum); ASIODebugging::dummyLog()
#endif
}

View file

@ -249,7 +249,7 @@ public:
{
JUCE_DS_LOG ("closing output: " + name);
HRESULT hr = pOutputBuffer->Stop();
JUCE_DS_LOG_ERROR (hr); (void) hr;
JUCE_DS_LOG_ERROR (hr); ignoreUnused (hr);
pOutputBuffer->Release();
pOutputBuffer = nullptr;
@ -532,7 +532,7 @@ public:
{
JUCE_DS_LOG ("closing input: " + name);
HRESULT hr = pInputBuffer->Stop();
JUCE_DS_LOG_ERROR (hr); (void) hr;
JUCE_DS_LOG_ERROR (hr); ignoreUnused (hr);
pInputBuffer->Release();
pInputBuffer = nullptr;

View file

@ -32,7 +32,7 @@ namespace WasapiClasses
void logFailure (HRESULT hr)
{
(void) hr;
ignoreUnused (hr);
jassert (hr != (HRESULT) 0x800401f0); // If you hit this, it means you're trying to call from
// a thread which hasn't been initialised with CoInitialize().

View file

@ -715,7 +715,7 @@ private:
using namespace AiffFileHelpers;
const bool couldSeekOk = output->setPosition (headerPosition);
(void) couldSeekOk;
ignoreUnused (couldSeekOk);
// if this fails, you've given it an output stream that can't seek! It needs
// to be able to seek back to write the header

View file

@ -433,7 +433,7 @@ public:
memcpy (buffer + 18, info.md5sum, 16);
const bool seekOk = output->setPosition (4);
(void) seekOk;
ignoreUnused (seekOk);
// if this fails, you've given it an output stream that can't seek! It needs
// to be able to seek back to write the header

View file

@ -110,7 +110,7 @@ private:
if (cp.start (processArgs))
{
const String childOutput (cp.readAllProcessOutput());
DBG (childOutput); (void) childOutput;
DBG (childOutput); ignoreUnused (childOutput);
cp.waitForProcessToFinish (10000);
return tempMP3.getFile().getSize() > 0;

View file

@ -111,7 +111,7 @@ struct AAXClasses
{
static void check (AAX_Result result)
{
jassert (result == AAX_SUCCESS); (void) result;
jassert (result == AAX_SUCCESS); ignoreUnused (result);
}
static int getParamIndexFromID (AAX_CParamID paramID) noexcept
@ -900,8 +900,7 @@ struct AAXClasses
midiBuffer.clear();
(void) midiNodeIn;
(void) midiNodesOut;
ignoreUnused (midiNodeIn, midiNodesOut);
#if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect
{
@ -969,8 +968,6 @@ struct AAXClasses
}
}
}
#else
(void) midiNodesOut;
#endif
}

View file

@ -454,7 +454,7 @@ public:
VstIntPtr vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg) override
{
(void) lArg; (void) lArg2; (void) ptrArg; (void) floatArg;
ignoreUnused (lArg, lArg2, ptrArg, floatArg);
#if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2
if ((lArg == 'stCA' || lArg == 'stCa') && lArg2 == 'FUID' && ptrArg != nullptr)
@ -488,7 +488,7 @@ public:
VSTMidiEventList::addEventsToMidiBuffer (events, midiEvents);
return 1;
#else
(void) events;
ignoreUnused (events);
return 0;
#endif
}

View file

@ -1014,7 +1014,7 @@ public:
{
const int headerLen = static_cast<int> (htonl (*(juce::int32*) (data + 4)));
const struct fxBank* bank = (const struct fxBank*) (data + (8 + headerLen));
const int version = static_cast<int> (htonl (bank->version)); (void) version;
const int version = static_cast<int> (htonl (bank->version)); ignoreUnused (version);
jassert ('VstW' == htonl (*(juce::int32*) data));
jassert (1 == htonl (*(juce::int32*) (data + 8))); // version should be 1 according to Steinberg's docs

View file

@ -54,7 +54,7 @@ extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserve
}
#endif
(void) reserved;
ignoreUnused (reserved);
return TRUE;
}

View file

@ -455,7 +455,7 @@ public:
tresult PLUGIN_API requestOpenEditor (FIDString name) override
{
(void) name;
ignoreUnused (name);
jassertfalse;
return kResultFalse;
}
@ -2015,8 +2015,7 @@ public:
/** @note Not applicable to VST3 */
void setCurrentProgramStateInformation (const void* data, int sizeInBytes) override
{
(void) data;
(void) sizeInBytes;
ignoreUnused (data, sizeInBytes);
}
//==============================================================================

View file

@ -2158,7 +2158,7 @@ public:
//==============================================================================
void mouseDown (const MouseEvent& e) override
{
(void) e;
ignoreUnused (e);
#if JUCE_LINUX
if (pluginWindow == 0)

View file

@ -762,8 +762,8 @@ public:
template <typename ElementComparator, typename TargetValueType>
int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
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());
@ -1116,8 +1116,8 @@ public:
const bool retainOrderOfEquivalentItems = false)
{
const ScopedLockType lock (getLock());
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
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, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems);
}

View file

@ -128,8 +128,8 @@ static int findInsertIndexInSortedArray (ElementComparator& comparator,
{
jassert (firstElement <= lastElement);
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
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)
{

View file

@ -523,8 +523,8 @@ public:
template <class ElementComparator>
int addSorted (ElementComparator& comparator, ObjectClass* const newObject) noexcept
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
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());
const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed);
insert (index, newObject);
@ -546,7 +546,7 @@ public:
template <typename ElementComparator>
int indexOfSorted (ElementComparator& comparator, const ObjectClass* const objectToLookFor) const noexcept
{
(void) comparator;
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
int s = 0, e = numUsed;
@ -854,8 +854,8 @@ public:
void sort (ElementComparator& comparator,
bool retainOrderOfEquivalentItems = false) const noexcept
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
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());
sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems);

View file

@ -518,7 +518,7 @@ public:
int indexOfSorted (ElementComparator& comparator,
const ObjectClass* const objectToLookFor) const noexcept
{
(void) comparator;
ignoreUnused (comparator);
const ScopedLockType lock (getLock());
int s = 0, e = numUsed;
@ -835,8 +835,8 @@ public:
void sort (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) const noexcept
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused
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());
sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems);

View file

@ -1466,7 +1466,7 @@ struct JavascriptEngine::RootObject : public DynamicObject
}
static Identifier getClassName() { static const Identifier i ("Object"); return i; }
static var dump (Args a) { DBG (JSON::toString (a.thisObject)); (void) a; return var::undefined(); }
static var dump (Args a) { DBG (JSON::toString (a.thisObject)); ignoreUnused (a); return var::undefined(); }
static var cloneFn (Args a) { return a.thisObject.clone(); }
};

View file

@ -427,7 +427,7 @@ struct Expression::Helpers
TermPtr createTermToEvaluateInput (const Scope& scope, const Term* t, double overallTarget, Term* topLevelTerm) const
{
(void) t;
ignoreUnused (t);
jassert (t == input);
const Term* const dest = findDestinationFor (topLevelTerm, this);

View file

@ -299,7 +299,7 @@ void ignoreUnused (const Type1&, const Type2&, const Type3&, const Type4&) noexc
template <typename Type, int N>
int numElementsInArray (Type (&array)[N])
{
(void) array; // (required to avoid a spurious warning in MS compilers)
ignoreUnused (array);
(void) sizeof (0[array]); // This line should cause an error if you pass an object with a user-defined subscript operator
return N;
}

View file

@ -404,7 +404,7 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String&
filenameAsURL = [NSURL fileURLWithPath: fileNameAsNS];
#if JUCE_IOS
(void) parameters;
ignoreUnused (parameters);
return [[UIApplication sharedApplication] openURL: filenameAsURL];
#else
NSWorkspace* workspace = [NSWorkspace sharedWorkspace];

View file

@ -64,10 +64,7 @@ bool JUCE_CALLTYPE Process::openEmailWithAttachments (const String& targetEmailA
const StringArray& filesToAttach)
{
#if JUCE_IOS
(void) targetEmailAddress;
(void) emailSubject;
(void) bodyText;
(void) filesToAttach;
ignoreUnused (targetEmailAddress, emailSubject, bodyText, filesToAttach);
//xxx probably need to use MFMailComposeViewController
jassertfalse;
@ -234,7 +231,7 @@ public:
void didFailWithError (NSError* error)
{
DBG (nsStringToJuce ([error description])); (void) error;
DBG (nsStringToJuce ([error description])); ignoreUnused (error);
hasFailed = true;
initialised = true;
signalThreadShouldExit();

View file

@ -115,14 +115,14 @@ struct ObjCClass
void addIvar (const char* name)
{
BOOL b = class_addIvar (cls, name, sizeof (Type), (uint8_t) rint (log2 (sizeof (Type))), @encode (Type));
jassert (b); (void) b;
jassert (b); ignoreUnused (b);
}
template <typename FunctionType>
void addMethod (SEL selector, FunctionType callbackFn, const char* signature)
{
BOOL b = class_addMethod (cls, selector, (IMP) callbackFn, signature);
jassert (b); (void) b;
jassert (b); ignoreUnused (b);
}
template <typename FunctionType>
@ -146,7 +146,7 @@ struct ObjCClass
void addProtocol (Protocol* protocol)
{
BOOL b = class_addProtocol (cls, protocol);
jassert (b); (void) b;
jassert (b); ignoreUnused (b);
}
#if JUCE_MAC

View file

@ -680,7 +680,7 @@ void juce_runSystemCommand (const String&);
void juce_runSystemCommand (const String& command)
{
int result = system (command.toUTF8());
(void) result;
ignoreUnused (result);
}
String juce_getOutputFromCommand (const String&);
@ -1286,7 +1286,7 @@ private:
THREAD_TIME_CONSTRAINT_POLICY_COUNT) == KERN_SUCCESS;
#else
(void) periodMs;
ignoreUnused (periodMs);
struct sched_param param;
param.sched_priority = sched_get_priority_max (SCHED_RR);
return pthread_setschedparam (thread, SCHED_RR, &param) == 0;

View file

@ -275,7 +275,7 @@ public:
#if JUCE_WIN32_TIMER_PERIOD > 0
const MMRESULT res = timeBeginPeriod (JUCE_WIN32_TIMER_PERIOD);
(void) res;
ignoreUnused (res);
jassert (res == TIMERR_NOERROR);
#endif

View file

@ -154,7 +154,7 @@ void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name)
__except (EXCEPTION_CONTINUE_EXECUTION)
{}
#else
(void) name;
ignoreUnused (name);
#endif
}

View file

@ -92,7 +92,7 @@ public:
If it's not possible to merge the two actions, the method should return zero.
*/
virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { (void) nextAction; return nullptr; }
virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { ignoreUnused (nextAction); return nullptr; }
};

View file

@ -49,7 +49,7 @@ public:
totalEventCount (0)
{
int ret = ::socketpair (AF_LOCAL, SOCK_STREAM, 0, fd);
(void) ret; jassert (ret == 0);
ignoreUnused (ret); jassert (ret == 0);
}
~InternalMessageQueue()
@ -75,7 +75,7 @@ public:
ScopedUnlock ul (lock);
const unsigned char x = 0xff;
ssize_t bytesWritten = write (fd[0], &x, 1);
(void) bytesWritten;
ignoreUnused (bytesWritten);
}
}
@ -187,7 +187,7 @@ private:
const ScopedUnlock ul (lock);
unsigned char x;
ssize_t numBytes = read (fd[1], &x, 1);
(void) numBytes;
ignoreUnused (numBytes);
}
return queue.removeAndReturn (0);
@ -235,7 +235,7 @@ namespace LinuxErrorHandling
int errorHandler (Display* display, XErrorEvent* event)
{
(void) display; (void) event;
ignoreUnused (display, event);
#if JUCE_DEBUG_XERRORS
char errorStr[64] = { 0 };

View file

@ -656,7 +656,7 @@ bool CoreGraphicsContext::drawTextLayout (const AttributedString& text, const Re
CoreTextTypeLayout::drawToCGContext (text, area, context, (float) flipHeight);
return true;
#else
(void) text; (void) area;
ignoreUnused (text, area);
return false;
#endif
}

View file

@ -1206,6 +1206,6 @@ bool TextLayout::createNativeLayout (const AttributedString& text)
}
#endif
(void) text;
ignoreUnused (text);
return false;
}

View file

@ -40,7 +40,7 @@ public:
if (factories->d2dFactory != nullptr)
{
HRESULT hr = factories->d2dFactory->CreateHwndRenderTarget (props, propsHwnd, renderingTarget.resetAndGetPointerAddress());
jassert (SUCCEEDED (hr)); (void) hr;
jassert (SUCCEEDED (hr)); ignoreUnused (hr);
hr = renderingTarget->CreateSolidColorBrush (D2D1::ColorF::ColorF (0.0f, 0.0f, 0.0f, 1.0f), colourBrush.resetAndGetPointerAddress());
}
}

View file

@ -153,7 +153,7 @@ void FileSearchPathListComponent::returnKeyPressed (int row)
changed();
}
#else
(void) row;
ignoreUnused (row);
#endif
}

View file

@ -457,7 +457,7 @@ void LookAndFeel_V3::drawLinearSliderBackground (Graphics& g, int x, int y, int
void LookAndFeel_V3::drawPopupMenuBackground (Graphics& g, int width, int height)
{
g.fillAll (findColour (PopupMenu::backgroundColourId));
(void) width; (void) height;
ignoreUnused (width, height);
#if ! JUCE_MAC
g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.6f));

View file

@ -1544,7 +1544,7 @@ int PopupMenu::showWithOptionalCallback (const Options& options, ModalComponentM
if (userCallback == nullptr && canBeModal)
return window->runModalLoop();
#else
(void) canBeModal;
ignoreUnused (canBeModal);
jassert (! (userCallback == nullptr && canBeModal));
#endif
}

View file

@ -317,15 +317,14 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c)
- (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation
duration: (NSTimeInterval) duration
{
(void) toInterfaceOrientation;
(void) duration;
ignoreUnused (toInterfaceOrientation, duration);
[UIView setAnimationsEnabled: NO]; // disable this because it goes the wrong way and looks like crap.
}
- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation
{
(void) fromInterfaceOrientation;
ignoreUnused (fromInterfaceOrientation);
sendScreenBoundsUpdate (self);
[UIView setAnimationsEnabled: YES];
}
@ -347,13 +346,13 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c)
- (void) viewWillAppear: (BOOL) animated
{
(void) animated;
ignoreUnused (animated);
[self viewDidLoad];
}
- (void) viewDidAppear: (BOOL) animated
{
(void) animated;
ignoreUnused (animated);
[self viewDidLoad];
}
@ -405,7 +404,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c)
//==============================================================================
- (void) touchesBegan: (NSSet*) touches withEvent: (UIEvent*) event
{
(void) touches;
ignoreUnused (touches);
if (owner != nullptr)
owner->handleTouches (event, true, false, false);
@ -413,7 +412,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c)
- (void) touchesMoved: (NSSet*) touches withEvent: (UIEvent*) event
{
(void) touches;
ignoreUnused (touches);
if (owner != nullptr)
owner->handleTouches (event, false, false, false);
@ -421,7 +420,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c)
- (void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*) event
{
(void) touches;
ignoreUnused (touches);
if (owner != nullptr)
owner->handleTouches (event, false, true, false);
@ -459,7 +458,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c)
- (BOOL) textView: (UITextView*) textView shouldChangeTextInRange: (NSRange) range replacementText: (NSString*) text
{
(void) textView;
ignoreUnused (textView);
return owner->textViewReplaceCharacters (Range<int> ((int) range.location, (int) (range.location + range.length)),
nsStringToJuce (text));
}

View file

@ -658,7 +658,7 @@ public:
if (invScale > 0.0f)
handleMagnifyGesture (0, getMousePos (ev, view), getMouseTime (ev), 1.0f / invScale);
#endif
(void) ev;
ignoreUnused (ev);
}
void redirectCopy (NSObject*) { handleKeyPress (KeyPress ('c', ModifierKeys (ModifierKeys::commandModifier), 'c')); }
@ -1998,7 +1998,7 @@ void Desktop::setKioskComponent (Component* kioskComp, bool shouldBeEnabled, boo
SetSystemUIMode (kUIModeNormal, 0);
}
#else
(void) kioskComp; (void) shouldBeEnabled; (void) allowMenusAndBars;
ignoreUnused (kioskComp, shouldBeEnabled, allowMenusAndBars);
// If you're targeting OSes earlier than 10.6 and want to use this feature,
// you'll need to enable JUCE_SUPPORT_CARBON.

View file

@ -270,7 +270,7 @@ public:
kIOPMAssertionLevelOn,
CFSTR ("JUCE Playback"),
&assertionID);
jassert (res == kIOReturnSuccess); (void) res;
jassert (res == kIOReturnSuccess); ignoreUnused (res);
}
~PMAssertion()
@ -443,7 +443,7 @@ void Process::setDockIconVisible (bool isVisible)
[NSApp setActivationPolicy: isVisible ? NSApplicationActivationPolicyRegular
: NSApplicationActivationPolicyProhibited];
#else
(void) isVisible;
ignoreUnused (isVisible);
jassertfalse; // sorry, not available in 10.5!
#endif
}

View file

@ -1691,7 +1691,7 @@ private:
void setCurrentRenderingEngine (int index) override
{
(void) index;
ignoreUnused (index);
#if JUCE_DIRECT2D
if (getAvailableRenderingEngines().size() > 1)

View file

@ -460,7 +460,7 @@ void Label::textEditorEscapeKeyPressed (TextEditor& ed)
if (editor != nullptr)
{
jassert (&ed == editor);
(void) ed;
ignoreUnused (ed);
editor->setText (textValue.toString(), false);
hideEditor (true);

View file

@ -951,7 +951,7 @@ void ListBox::startDragAndDrop (const MouseEvent& e, const SparseSet<int>& rowsT
//==============================================================================
Component* ListBoxModel::refreshComponentForRow (int, bool, Component* existingComponentToUpdate)
{
(void) existingComponentToUpdate;
ignoreUnused (existingComponentToUpdate);
jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code that recycles the components
return nullptr;
}

View file

@ -470,7 +470,7 @@ var TableListBoxModel::getDragSourceDescription (const SparseSet<int>&)
Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component* existingComponentToUpdate)
{
(void) existingComponentToUpdate;
ignoreUnused (existingComponentToUpdate);
jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code that recycles the components
return nullptr;
}

View file

@ -601,7 +601,7 @@ private:
else
#endif
{
(void) modal; // (to avoid an unused variable warning)
ignoreUnused (modal);
alertBox->enterModalState (true, callback, true);
alertBox.release();

View file

@ -593,4 +593,4 @@ void ComponentPeer::setRepresentedFile (const File&)
//==============================================================================
int ComponentPeer::getCurrentRenderingEngine() const { return 0; }
void ComponentPeer::setCurrentRenderingEngine (int index) { jassert (index == 0); (void) index; }
void ComponentPeer::setCurrentRenderingEngine (int index) { jassert (index == 0); ignoreUnused (index); }

View file

@ -141,6 +141,6 @@ void RecentlyOpenedFilesList::registerRecentFileNatively (const File& file)
noteNewRecentDocumentURL: [NSURL fileURLWithPath: juceStringToNS (file.getFullPathName())]];
}
#else
(void) file;
ignoreUnused (file);
#endif
}

View file

@ -23,8 +23,8 @@
*/
AppleRemoteDevice::AppleRemoteDevice()
: device (0),
queue (0),
: device (nullptr),
queue (nullptr),
remoteId (0)
{
}
@ -73,13 +73,13 @@ namespace
CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID),
device);
(void) hr;
ignoreUnused (hr);
(*cfPlugInInterface)->Release (cfPlugInInterface);
}
}
return *device != 0;
return *device != nullptr;
}
void appleRemoteQueueCallback (void* const target, const IOReturn result, void*, void*)
@ -91,7 +91,7 @@ namespace
bool AppleRemoteDevice::start (const bool inExclusiveMode)
{
if (queue != 0)
if (queue != nullptr)
return true;
stop();
@ -114,25 +114,25 @@ bool AppleRemoteDevice::start (const bool inExclusiveMode)
void AppleRemoteDevice::stop()
{
if (queue != 0)
if (queue != nullptr)
{
(*(IOHIDQueueInterface**) queue)->stop ((IOHIDQueueInterface**) queue);
(*(IOHIDQueueInterface**) queue)->dispose ((IOHIDQueueInterface**) queue);
(*(IOHIDQueueInterface**) queue)->Release ((IOHIDQueueInterface**) queue);
queue = 0;
queue = nullptr;
}
if (device != 0)
if (device != nullptr)
{
(*(IOHIDDeviceInterface**) device)->close ((IOHIDDeviceInterface**) device);
(*(IOHIDDeviceInterface**) device)->Release ((IOHIDDeviceInterface**) device);
device = 0;
device = nullptr;
}
}
bool AppleRemoteDevice::isActive() const
{
return queue != 0;
return queue != nullptr;
}
bool AppleRemoteDevice::open (const bool openInExclusiveMode)
@ -229,7 +229,6 @@ void AppleRemoteDevice::handleCallbackInternal()
}
cookies [numCookies++] = 0;
//DBG (String::toHexString ((uint8*) cookies, numCookies, 1) + " " + String (totalValues));
static const char buttonPatterns[] =
{

View file

@ -98,7 +98,7 @@ private:
[resultListener chooseFilename: juceStringToNS (files.getReference(i).getFullPathName())];
}
#else
(void) resultListener; (void) allowMultipleFiles;
ignoreUnused (resultListener, allowMultipleFiles);
jassertfalse; // Can't use this without modal loops being enabled!
#endif
}
@ -122,8 +122,7 @@ private:
- (BOOL) gestureRecognizer: (UIGestureRecognizer*) gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer*) otherGestureRecognizer
{
(void) gestureRecognizer;
(void) otherGestureRecognizer;
ignoreUnused (gestureRecognizer, otherGestureRecognizer);
return YES;
}
@ -153,8 +152,7 @@ private:
- (BOOL) webView: (UIWebView*) webView shouldStartLoadWithRequest: (NSURLRequest*) request
navigationType: (UIWebViewNavigationType) navigationType
{
(void) webView;
(void) navigationType;
ignoreUnused (webView, navigationType);
return ownerComponent->pageAboutToLoad (nsStringToJuce (request.URL.absoluteString));
}

View file

@ -240,7 +240,7 @@ private:
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorBufferHandle);
bool ok = [context renderbufferStorage: GL_RENDERBUFFER fromDrawable: glLayer];
jassert (ok); (void) ok;
jassert (ok); ignoreUnused (ok);
GLint width, height;
glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width);

View file

@ -72,7 +72,7 @@ public:
static void createAttribs (NSOpenGLPixelFormatAttribute* attribs, OpenGLVersion version,
const OpenGLPixelFormat& pixFormat, bool shouldUseMultisampling)
{
(void) version;
ignoreUnused (version);
int numAttribs = 0;
#if JUCE_OPENGL3