mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Update code to use C++14 [[deprecated]] attribute
This commit removes the various compiler-specific JUCE_DEPRECATED macros and replaces them with C++14's deprecated attribute. It also removes the JUCE_CATCH_DEPRECATED_CODE_MISUSE flag as we can rely on the override specifier catching usage of these old virtual methods, and tidies up the DOXYGEN preprocessor checks as they were inconsistent across the codebase.
This commit is contained in:
parent
a435026b24
commit
b9542ccc4c
104 changed files with 579 additions and 587 deletions
|
|
@ -209,13 +209,14 @@ MidiBufferIterator MidiBuffer::findNextSamplePosition (int samplePosition) const
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
|
||||
|
||||
MidiBuffer::Iterator::Iterator (const MidiBuffer& b) noexcept
|
||||
: buffer (b), iterator (b.data.begin())
|
||||
{
|
||||
}
|
||||
|
||||
MidiBuffer::Iterator::~Iterator() noexcept {}
|
||||
|
||||
void MidiBuffer::Iterator::setNextSamplePosition (int samplePosition) noexcept
|
||||
{
|
||||
iterator = buffer.findNextSamplePosition (samplePosition);
|
||||
|
|
@ -244,6 +245,9 @@ bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePositio
|
|||
return true;
|
||||
}
|
||||
|
||||
JUCE_END_IGNORE_WARNINGS_MSVC
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
|
||||
//==============================================================================
|
||||
//==============================================================================
|
||||
#if JUCE_UNIT_TESTS
|
||||
|
|
|
|||
|
|
@ -273,7 +273,9 @@ public:
|
|||
MidiBufferIterator findNextSamplePosition (int samplePosition) const noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
#ifndef DOXYGEN
|
||||
/** This class is now deprecated in favour of MidiBufferIterator.
|
||||
|
||||
Used to iterate through the events in a MidiBuffer.
|
||||
|
||||
Note that altering the buffer while an iterator is using it will produce
|
||||
|
|
@ -281,20 +283,12 @@ public:
|
|||
|
||||
@see MidiBuffer
|
||||
*/
|
||||
class JUCE_API Iterator
|
||||
class [[deprecated]] JUCE_API Iterator
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
/** Creates an Iterator for this MidiBuffer.
|
||||
This class has been deprecated in favour of MidiBufferIterator.
|
||||
*/
|
||||
JUCE_DEPRECATED (Iterator (const MidiBuffer&) noexcept);
|
||||
|
||||
/** Creates a copy of an iterator. */
|
||||
Iterator (const Iterator&) = default;
|
||||
|
||||
/** Destructor. */
|
||||
~Iterator() noexcept;
|
||||
/** Creates an Iterator for this MidiBuffer. */
|
||||
Iterator (const MidiBuffer& b) noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/** Repositions the iterator so that the next event retrieved will be the first
|
||||
|
|
@ -336,6 +330,7 @@ public:
|
|||
const MidiBuffer& buffer;
|
||||
MidiBufferIterator iterator;
|
||||
};
|
||||
#endif
|
||||
|
||||
/** The raw data holding this buffer.
|
||||
Obviously access to this data is provided at your own risk. Its internal format could
|
||||
|
|
|
|||
|
|
@ -857,17 +857,16 @@ public:
|
|||
|
||||
|
||||
//==============================================================================
|
||||
#ifndef DOXYGEN
|
||||
/** Reads a midi variable-length integer.
|
||||
|
||||
This signature has been deprecated in favour of the safer
|
||||
readVariableLengthValue.
|
||||
|
||||
The `data` argument indicates the data to read the number from,
|
||||
and `numBytesUsed` is used as an out-parameter to indicate the number
|
||||
of bytes that were read.
|
||||
*/
|
||||
JUCE_DEPRECATED (static int readVariableLengthVal (const uint8* data,
|
||||
int& numBytesUsed) noexcept);
|
||||
[[deprecated ("This signature has been deprecated in favour of the safer readVariableLengthValue.")]]
|
||||
static int readVariableLengthVal (const uint8* data, int& numBytesUsed) noexcept;
|
||||
#endif
|
||||
|
||||
/** Holds information about a variable-length value which was parsed
|
||||
from a stream of bytes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue