Signed-off-by: falkTX <falktx@gmail.com>tags/v2.1-alpha1-winvst
@@ -62,15 +62,16 @@ endif | |||
ifeq ($(USING_JUCE),true) | |||
ALL_LIBS += $(MODULEDIR)/juce_audio_basics.a | |||
ALL_LIBS += $(MODULEDIR)/juce_audio_devices.a | |||
ALL_LIBS += $(MODULEDIR)/juce_audio_formats.a | |||
ALL_LIBS += $(MODULEDIR)/juce_audio_processors.a | |||
ALL_LIBS += $(MODULEDIR)/juce_core.a | |||
ALL_LIBS += $(MODULEDIR)/juce_data_structures.a | |||
ALL_LIBS += $(MODULEDIR)/juce_events.a | |||
ifeq ($(MACOS_OR_WIN32),true) | |||
ALL_LIBS += $(MODULEDIR)/juce_audio_processors.a | |||
ALL_LIBS += $(MODULEDIR)/juce_graphics.a | |||
ALL_LIBS += $(MODULEDIR)/juce_gui_basics.a | |||
# ALL_LIBS += $(MODULEDIR)/juce_gui_extra.a | |||
endif | |||
endif | |||
libs: $(ALL_LIBS) | |||
@@ -343,6 +343,7 @@ endif | |||
ifeq ($(USING_JUCE),true) | |||
BASE_FLAGS += -DUSING_JUCE | |||
BUILD_CXX_FLAGS += -DJUCE_APP_CONFIG_HEADER='<AppConfig.h>' | |||
endif | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
@@ -29,8 +29,8 @@ OBJSa = $(OBJS) \ | |||
$(OBJDIR)/CarlaEngineNative.cpp.o | |||
ifeq ($(USING_JUCE),true) | |||
# OBJSa += \ | |||
# - $(OBJDIR)/CarlaEngineJuce.cpp.o | |||
OBJSa += \ | |||
$(OBJDIR)/CarlaEngineJuce.cpp.o | |||
else | |||
OBJSa += \ | |||
$(OBJDIR)/CarlaEngineRtAudio.cpp.o | |||
@@ -476,6 +476,7 @@ private: | |||
static void errorCallback (const char* msg) | |||
{ | |||
JUCE_JACK_LOG ("JackAudioIODevice::errorCallback " + String (msg)); | |||
ignoreUnused(msg); | |||
} | |||
static void sendDeviceChangedCallback(); | |||
@@ -229,7 +229,7 @@ public: | |||
{ | |||
if (isPositiveAndBelow (index, numUsed)) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
return data.elements [index]; | |||
} | |||
@@ -247,7 +247,7 @@ public: | |||
*/ | |||
inline ElementType getUnchecked (const int index) const | |||
{ | |||
jassert (isPositiveAndBelow (index, numUsed) && data.elements != nullptr); | |||
wassert (isPositiveAndBelow (index, numUsed) && data.elements != nullptr); | |||
return data.elements [index]; | |||
} | |||
@@ -262,7 +262,7 @@ public: | |||
*/ | |||
inline ElementType& getReference (const int index) const noexcept | |||
{ | |||
jassert (isPositiveAndBelow (index, numUsed) && data.elements != nullptr); | |||
wassert (isPositiveAndBelow (index, numUsed) && data.elements != nullptr); | |||
return data.elements [index]; | |||
} | |||
@@ -274,7 +274,7 @@ public: | |||
{ | |||
if (numUsed > 0) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
return data.elements[0]; | |||
} | |||
@@ -289,7 +289,7 @@ public: | |||
{ | |||
if (numUsed > 0) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
return data.elements[numUsed - 1]; | |||
} | |||
@@ -551,11 +551,11 @@ public: | |||
*/ | |||
void set (const int indexToChange, ParameterType newValue) | |||
{ | |||
jassert (indexToChange >= 0); | |||
wassert (indexToChange >= 0); | |||
if (isPositiveAndBelow (indexToChange, numUsed)) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
data.elements [indexToChange] = newValue; | |||
} | |||
else if (indexToChange >= 0) | |||
@@ -576,7 +576,7 @@ public: | |||
*/ | |||
void setUnchecked (const int indexToChange, ParameterType newValue) | |||
{ | |||
jassert (isPositiveAndBelow (indexToChange, numUsed)); | |||
wassert (isPositiveAndBelow (indexToChange, numUsed)); | |||
data.elements [indexToChange] = newValue; | |||
} | |||
@@ -646,7 +646,7 @@ public: | |||
{ | |||
if (startIndex < 0) | |||
{ | |||
jassertfalse; | |||
wassertfalse; | |||
startIndex = 0; | |||
} | |||
@@ -666,7 +666,7 @@ public: | |||
*/ | |||
void resize (const int targetNumItems) | |||
{ | |||
jassert (targetNumItems >= 0); | |||
wassert (targetNumItems >= 0); | |||
const int numToAdd = targetNumItems - numUsed; | |||
if (numToAdd > 0) | |||
@@ -761,7 +761,7 @@ public: | |||
{ | |||
if (isPositiveAndBelow (indexToRemove, numUsed)) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
removeInternal (indexToRemove); | |||
} | |||
} | |||
@@ -780,7 +780,7 @@ public: | |||
{ | |||
if (isPositiveAndBelow (indexToRemove, numUsed)) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
ElementType removed (data.elements[indexToRemove]); | |||
removeInternal (indexToRemove); | |||
return removed; | |||
@@ -801,13 +801,13 @@ public: | |||
*/ | |||
void remove (const ElementType* elementToRemove) | |||
{ | |||
jassert (elementToRemove != nullptr); | |||
jassert (data.elements != nullptr); | |||
wassert (elementToRemove != nullptr); | |||
wassert (data.elements != nullptr); | |||
const int indexToRemove = int (elementToRemove - data.elements); | |||
if (! isPositiveAndBelow (indexToRemove, numUsed)) | |||
{ | |||
jassertfalse; | |||
wassertfalse; | |||
return; | |||
} | |||
@@ -122,7 +122,7 @@ static int findInsertIndexInSortedArray (ElementComparator& comparator, | |||
int firstElement, | |||
int lastElement) | |||
{ | |||
jassert (firstElement <= lastElement); | |||
wassert (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 | |||
@@ -443,7 +443,7 @@ private: | |||
int generateHashFor (KeyTypeParameter key) const | |||
{ | |||
const int hash = hashFunctionToUse.generateHash (key, getNumSlots()); | |||
jassert (isPositiveAndBelow (hash, getNumSlots())); // your hash function is generating out-of-range numbers! | |||
wassert (isPositiveAndBelow (hash, getNumSlots())); // your hash function is generating out-of-range numbers! | |||
return hash; | |||
} | |||
@@ -90,7 +90,7 @@ public: | |||
LinkedListPointer& operator= (LinkedListPointer&& other) noexcept | |||
{ | |||
jassert (this != &other); // hopefully the compiler should make this situation impossible! | |||
wassert (this != &other); // hopefully the compiler should make this situation impossible! | |||
item = other.item; | |||
other.item = nullptr; | |||
@@ -186,8 +186,8 @@ public: | |||
*/ | |||
void insertNext (ObjectType* const newItem) | |||
{ | |||
jassert (newItem != nullptr); | |||
jassert (newItem->nextListItem == nullptr); | |||
wassert (newItem != nullptr); | |||
wassert (newItem->nextListItem == nullptr); | |||
newItem->nextListItem = item; | |||
item = newItem; | |||
} | |||
@@ -198,7 +198,7 @@ public: | |||
*/ | |||
void insertAtIndex (int index, ObjectType* newItem) | |||
{ | |||
jassert (newItem != nullptr); | |||
wassert (newItem != nullptr); | |||
LinkedListPointer* l = this; | |||
while (index != 0 && l->item != nullptr) | |||
@@ -215,8 +215,8 @@ public: | |||
*/ | |||
ObjectType* replaceNext (ObjectType* const newItem) noexcept | |||
{ | |||
jassert (newItem != nullptr); | |||
jassert (newItem->nextListItem == nullptr); | |||
wassert (newItem != nullptr); | |||
wassert (newItem->nextListItem == nullptr); | |||
ObjectType* const oldItem = item; | |||
item = newItem; | |||
@@ -315,7 +315,7 @@ public: | |||
*/ | |||
void copyToArray (ObjectType** destArray) const noexcept | |||
{ | |||
jassert (destArray != nullptr); | |||
wassert (destArray != nullptr); | |||
for (ObjectType* i = item; i != nullptr; i = i->nextListItem) | |||
*destArray++ = i; | |||
@@ -344,7 +344,7 @@ public: | |||
: endOfList (&endOfListPointer) | |||
{ | |||
// This can only be used to add to the end of a list. | |||
jassert (endOfListPointer.item == nullptr); | |||
wassert (endOfListPointer.item == nullptr); | |||
} | |||
/** Appends an item to the list. */ | |||
@@ -186,7 +186,7 @@ Identifier NamedValueSet::getName (const int index) const noexcept | |||
if (isPositiveAndBelow (index, values.size())) | |||
return values.getReference (index).name; | |||
jassertfalse; | |||
wassertfalse; | |||
return Identifier(); | |||
} | |||
@@ -195,7 +195,7 @@ const var& NamedValueSet::getValueAt (const int index) const noexcept | |||
if (isPositiveAndBelow (index, values.size())) | |||
return values.getReference (index).value; | |||
jassertfalse; | |||
wassertfalse; | |||
return getNullVarRef(); | |||
} | |||
@@ -415,7 +415,7 @@ public: | |||
} | |||
else | |||
{ | |||
jassertfalse; // you're trying to set an object at a negative index, which doesn't have | |||
wassertfalse; // you're trying to set an object at a negative index, which doesn't have | |||
// any effect - but since the object is not being added, it may be leaking.. | |||
} | |||
@@ -438,7 +438,7 @@ public: | |||
{ | |||
if (startIndex < 0) | |||
{ | |||
jassertfalse; | |||
wassertfalse; | |||
startIndex = 0; | |||
} | |||
@@ -446,7 +446,7 @@ public: | |||
numElementsToAdd = arrayToAddFrom.size() - startIndex; | |||
data.ensureAllocatedSize (numUsed + numElementsToAdd); | |||
jassert (numElementsToAdd <= 0 || data.elements != nullptr); | |||
wassert (numElementsToAdd <= 0 || data.elements != nullptr); | |||
while (--numElementsToAdd >= 0) | |||
{ | |||
@@ -478,7 +478,7 @@ public: | |||
numElementsToAdd = arrayToAddFrom.size() - startIndex; | |||
data.ensureAllocatedSize (numUsed + numElementsToAdd); | |||
jassert (numElementsToAdd <= 0 || data.elements != nullptr); | |||
wassert (numElementsToAdd <= 0 || data.elements != nullptr); | |||
while (--numElementsToAdd >= 0) | |||
data.elements [numUsed++] = createCopyIfNotNull (arrayToAddFrom.getUnchecked (startIndex++)); | |||
@@ -187,7 +187,7 @@ public: | |||
{ | |||
if (isPositiveAndBelow (index, numUsed)) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
return data.elements [index]; | |||
} | |||
@@ -199,7 +199,7 @@ public: | |||
*/ | |||
inline ObjectClass* getObjectPointerUnchecked (const int index) const noexcept | |||
{ | |||
jassert (isPositiveAndBelow (index, numUsed) && data.elements != nullptr); | |||
wassert (isPositiveAndBelow (index, numUsed) && data.elements != nullptr); | |||
return data.elements [index]; | |||
} | |||
@@ -212,7 +212,7 @@ public: | |||
{ | |||
if (numUsed > 0) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
return data.elements [0]; | |||
} | |||
@@ -228,7 +228,7 @@ public: | |||
{ | |||
if (numUsed > 0) | |||
{ | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
return data.elements [numUsed - 1]; | |||
} | |||
@@ -314,7 +314,7 @@ public: | |||
ObjectClass* add (ObjectClass* const newObject) noexcept | |||
{ | |||
data.ensureAllocatedSize (numUsed + 1); | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
data.elements [numUsed++] = newObject; | |||
if (newObject != nullptr) | |||
@@ -346,7 +346,7 @@ public: | |||
indexToInsertAt = numUsed; | |||
data.ensureAllocatedSize (numUsed + 1); | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
ObjectClass** const e = data.elements + indexToInsertAt; | |||
const int numToMove = numUsed - indexToInsertAt; | |||
@@ -411,7 +411,7 @@ public: | |||
else | |||
{ | |||
data.ensureAllocatedSize (numUsed + 1); | |||
jassert (data.elements != nullptr); | |||
wassert (data.elements != nullptr); | |||
data.elements [numUsed++] = newObject; | |||
} | |||
} | |||
@@ -432,7 +432,7 @@ public: | |||
{ | |||
if (startIndex < 0) | |||
{ | |||
jassertfalse; | |||
wassertfalse; | |||
startIndex = 0; | |||
} | |||
@@ -840,7 +840,7 @@ private: | |||
if (ObjectClass* o = data.elements [--numUsed]) | |||
releaseObject (o); | |||
jassert (numUsed == 0); | |||
wassert (numUsed == 0); | |||
} | |||
static void releaseObject (ObjectClass* o) | |||
@@ -331,13 +331,13 @@ public: | |||
int startIndex = 0, | |||
int numElementsToAdd = -1) noexcept | |||
{ | |||
jassert (this != &setToAddFrom); | |||
wassert (this != &setToAddFrom); | |||
if (this != &setToAddFrom) | |||
{ | |||
if (startIndex < 0) | |||
{ | |||
jassertfalse; | |||
wassertfalse; | |||
startIndex = 0; | |||
} | |||
@@ -41,8 +41,8 @@ DirectoryIterator::DirectoryIterator (const File& directory, bool recursive, | |||
hasBeenAdvanced (false) | |||
{ | |||
// you have to specify the type of files you're looking for! | |||
jassert ((type & (File::findFiles | File::findDirectories)) != 0); | |||
jassert (type > 0 && type <= 7); | |||
wassert ((type & (File::findFiles | File::findDirectories)) != 0); | |||
wassert (type > 0 && type <= 7); | |||
} | |||
DirectoryIterator::~DirectoryIterator() | |||
@@ -143,7 +143,7 @@ const File& DirectoryIterator::getFile() const | |||
return subIterator->getFile(); | |||
// You need to call DirectoryIterator::next() before asking it for the file that it found! | |||
jassert (hasBeenAdvanced); | |||
wassert (hasBeenAdvanced); | |||
return currentFile; | |||
} | |||
@@ -194,7 +194,7 @@ String File::parseAbsolutePath (const String& p) | |||
// Yes, I know it's legal for a unix pathname to contain a backslash, but this assertion is here | |||
// to catch anyone who's trying to run code that was written on Windows with hard-coded path names. | |||
// If that's why you've ended up here, use File::getChildFile() to build your paths instead. | |||
jassert ((! p.containsChar ('\\')) || (p.indexOfChar ('/') >= 0 && p.indexOfChar ('/') < p.indexOfChar ('\\'))); | |||
wassert ((! p.containsChar ('\\')) || (p.indexOfChar ('/') >= 0 && p.indexOfChar ('/') < p.indexOfChar ('\\'))); | |||
String path (removeEllipsis (p)); | |||
@@ -722,7 +722,7 @@ FileOutputStream* File::createOutputStream (const size_t bufferSize) const | |||
bool File::appendData (const void* const dataToAppend, | |||
const size_t numberOfBytes) const | |||
{ | |||
jassert (((ssize_t) numberOfBytes) >= 0); | |||
wassert (((ssize_t) numberOfBytes) >= 0); | |||
if (numberOfBytes == 0) | |||
return true; | |||
@@ -969,7 +969,9 @@ namespace WindowsFileHelpers | |||
int64 fileTimeToTime (const FILETIME* const ft) | |||
{ | |||
static_jassert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME)); // tell me if this fails! | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
static_wassert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME)); // tell me if this fails! | |||
#endif | |||
return (int64) ((reinterpret_cast<const ULARGE_INTEGER*> (ft)->QuadPart - 116444736000000000LL) / 10000); | |||
} | |||
@@ -1116,7 +1118,7 @@ File File::getSpecialLocation (const SpecialLocationType type) | |||
return WindowsFileHelpers::getModuleFileName (nullptr); | |||
default: | |||
jassertfalse; // unknown type? | |||
wassertfalse; // unknown type? | |||
return File(); | |||
} | |||
@@ -1354,7 +1356,7 @@ File water_getExecutableFile() | |||
} | |||
// if we reach this, we failed to find ourselves... | |||
jassertfalse; | |||
wassertfalse; | |||
return filename; | |||
} | |||
}; | |||
@@ -1433,7 +1435,7 @@ File File::getSpecialLocation (const SpecialLocationType type) | |||
} | |||
default: | |||
jassertfalse; // unknown type? | |||
wassertfalse; // unknown type? | |||
break; | |||
} | |||
@@ -1584,7 +1586,7 @@ File File::getSpecialLocation (const SpecialLocationType type) | |||
} | |||
default: | |||
jassertfalse; // unknown type? | |||
wassertfalse; // unknown type? | |||
break; | |||
} | |||
@@ -42,7 +42,7 @@ FileInputStream::FileInputStream (const File& f) | |||
int64 FileInputStream::getTotalLength() | |||
{ | |||
// You should always check that a stream opened successfully before using it! | |||
jassert (openedOk()); | |||
wassert (openedOk()); | |||
return file.getSize(); | |||
} | |||
@@ -50,11 +50,11 @@ int64 FileInputStream::getTotalLength() | |||
int FileInputStream::read (void* buffer, int bytesToRead) | |||
{ | |||
// You should always check that a stream opened successfully before using it! | |||
jassert (openedOk()); | |||
wassert (openedOk()); | |||
// The buffer should never be null, and a negative size is probably a | |||
// sign that something is broken! | |||
jassert (buffer != nullptr && bytesToRead >= 0); | |||
wassert (buffer != nullptr && bytesToRead >= 0); | |||
const size_t num = readInternal (buffer, (size_t) bytesToRead); | |||
currentPosition += (int64) num; | |||
@@ -75,7 +75,7 @@ int64 FileInputStream::getPosition() | |||
bool FileInputStream::setPosition (int64 pos) | |||
{ | |||
// You should always check that a stream opened successfully before using it! | |||
jassert (openedOk()); | |||
wassert (openedOk()); | |||
if (pos != currentPosition) | |||
currentPosition = water_fileSetPosition (fileHandle, pos); | |||
@@ -87,7 +87,7 @@ void FileOutputStream::flush() | |||
bool FileOutputStream::write (const void* const src, const size_t numBytes) | |||
{ | |||
jassert (src != nullptr && ((ssize_t) numBytes) >= 0); | |||
wassert (src != nullptr && ((ssize_t) numBytes) >= 0); | |||
if (bytesInBuffer + numBytes < bufferSize) | |||
{ | |||
@@ -123,7 +123,7 @@ bool FileOutputStream::write (const void* const src, const size_t numBytes) | |||
bool FileOutputStream::writeRepeatedByte (uint8 byte, size_t numBytes) | |||
{ | |||
jassert (((ssize_t) numBytes) >= 0); | |||
wassert (((ssize_t) numBytes) >= 0); | |||
if (bytesInBuffer + numBytes < bufferSize) | |||
{ | |||
@@ -52,7 +52,7 @@ TemporaryFile::TemporaryFile (const File& target, const int optionFlags) | |||
targetFile (target) | |||
{ | |||
// If you use this constructor, you need to give it a valid target file! | |||
jassert (targetFile != File()); | |||
wassert (targetFile != File()); | |||
} | |||
TemporaryFile::TemporaryFile (const File& target, const File& temporary) | |||
@@ -72,7 +72,7 @@ TemporaryFile::~TemporaryFile() | |||
call TemporaryFile::deleteTemporaryFile() to detect those error cases and | |||
handle them appropriately. | |||
*/ | |||
jassertfalse; | |||
wassertfalse; | |||
} | |||
} | |||
@@ -81,7 +81,7 @@ bool TemporaryFile::overwriteTargetFileWithTemporary() const | |||
{ | |||
// This method only works if you created this object with the constructor | |||
// that takes a target file! | |||
jassert (targetFile != File()); | |||
wassert (targetFile != File()); | |||
if (temporaryFile.exists()) | |||
{ | |||
@@ -98,7 +98,7 @@ bool TemporaryFile::overwriteTargetFileWithTemporary() const | |||
{ | |||
// There's no temporary file to use. If your write failed, you should | |||
// probably check, and not bother calling this method. | |||
jassertfalse; | |||
wassertfalse; | |||
} | |||
return false; | |||
@@ -80,7 +80,7 @@ Type jmap (Type value0To1, Type targetRangeMin, Type targetRangeMax) | |||
template <typename Type> | |||
Type jmap (Type sourceValue, Type sourceRangeMin, Type sourceRangeMax, Type targetRangeMin, Type targetRangeMax) | |||
{ | |||
jassert (sourceRangeMax != sourceRangeMin); // mapping from a range of zero will produce NaN! | |||
wassert (sourceRangeMax != sourceRangeMin); // mapping from a range of zero will produce NaN! | |||
return targetRangeMin + ((targetRangeMax - targetRangeMin) * (sourceValue - sourceRangeMin)) / (sourceRangeMax - sourceRangeMin); | |||
} | |||
@@ -450,7 +450,7 @@ inline int countNumberOfBits (uint64 n) noexcept | |||
template <typename IntegerType> | |||
IntegerType negativeAwareModulo (IntegerType dividend, const IntegerType divisor) noexcept | |||
{ | |||
jassert (divisor > 0); | |||
wassert (divisor > 0); | |||
dividend %= divisor; | |||
return (dividend < 0) ? (dividend + divisor) : dividend; | |||
} | |||
@@ -77,7 +77,7 @@ int Random::nextInt() noexcept | |||
int Random::nextInt (const int maxValue) noexcept | |||
{ | |||
jassert (maxValue > 0); | |||
wassert (maxValue > 0); | |||
return (int) ((((unsigned int) nextInt()) * (uint64) maxValue) >> 32); | |||
} | |||
@@ -74,7 +74,7 @@ public: | |||
{ | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
// This class can only be used for types which are 32 or 64 bits in size. | |||
static_jassert (sizeof (Type) == 4 || sizeof (Type) == 8); | |||
static_wassert (sizeof (Type) == 4 || sizeof (Type) == 8); | |||
#endif | |||
} | |||
@@ -200,7 +200,7 @@ template<> | |||
inline int32 Atomic<int32>::get() const noexcept | |||
{ | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
static_jassert (sizeof (int32) == 4); | |||
static_wassert (sizeof (int32) == 4); | |||
#endif | |||
return castFrom32Bit ((int32) __sync_add_and_fetch (const_cast<volatile int32*>(&value), 0)); | |||
} | |||
@@ -209,7 +209,7 @@ template<> | |||
inline int64 Atomic<int64>::get() const noexcept | |||
{ | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
static_jassert (sizeof (int64) == 8); | |||
static_wassert (sizeof (int64) == 8); | |||
#endif | |||
return castFrom64Bit ((int64) __sync_add_and_fetch (const_cast<volatile int64*>(&value), 0)); | |||
} | |||
@@ -218,7 +218,7 @@ template<> | |||
inline uint32 Atomic<uint32>::get() const noexcept | |||
{ | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
static_jassert (sizeof (uint32) == 4); | |||
static_wassert (sizeof (uint32) == 4); | |||
#endif | |||
return castFrom32Bit ((uint32) __sync_add_and_fetch (const_cast<volatile uint32*>(&value), 0)); | |||
} | |||
@@ -227,7 +227,7 @@ template<> | |||
inline uint64 Atomic<uint64>::get() const noexcept | |||
{ | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
static_jassert (sizeof (uint64) == 8); | |||
static_wassert (sizeof (uint64) == 8); | |||
#endif | |||
return castFrom64Bit ((uint64) __sync_add_and_fetch (const_cast<volatile uint64*>(&value), 0)); | |||
} | |||
@@ -50,7 +50,7 @@ MemoryBlock::MemoryBlock (const MemoryBlock& other) | |||
{ | |||
if (size > 0) | |||
{ | |||
jassert (other.data != nullptr); | |||
wassert (other.data != nullptr); | |||
data.malloc (size); | |||
memcpy (data, other.data, size); | |||
} | |||
@@ -59,11 +59,11 @@ MemoryBlock::MemoryBlock (const MemoryBlock& other) | |||
MemoryBlock::MemoryBlock (const void* const dataToInitialiseFrom, const size_t sizeInBytes) | |||
: size (sizeInBytes) | |||
{ | |||
jassert (((ssize_t) sizeInBytes) >= 0); | |||
wassert (((ssize_t) sizeInBytes) >= 0); | |||
if (size > 0) | |||
{ | |||
jassert (dataToInitialiseFrom != nullptr); // non-zero size, but a zero pointer passed-in? | |||
wassert (dataToInitialiseFrom != nullptr); // non-zero size, but a zero pointer passed-in? | |||
data.malloc (size); | |||
@@ -177,7 +177,7 @@ void MemoryBlock::append (const void* const srcData, const size_t numBytes) | |||
{ | |||
if (numBytes > 0) | |||
{ | |||
jassert (srcData != nullptr); // this must not be null! | |||
wassert (srcData != nullptr); // this must not be null! | |||
const size_t oldSize = size; | |||
setSize (size + numBytes); | |||
memcpy (data + oldSize, srcData, numBytes); | |||
@@ -188,7 +188,7 @@ void MemoryBlock::replaceWith (const void* const srcData, const size_t numBytes) | |||
{ | |||
if (numBytes > 0) | |||
{ | |||
jassert (srcData != nullptr); // this must not be null! | |||
wassert (srcData != nullptr); // this must not be null! | |||
setSize (numBytes); | |||
memcpy (data, srcData, numBytes); | |||
} | |||
@@ -198,7 +198,7 @@ void MemoryBlock::insert (const void* const srcData, const size_t numBytes, size | |||
{ | |||
if (numBytes > 0) | |||
{ | |||
jassert (srcData != nullptr); // this must not be null! | |||
wassert (srcData != nullptr); // this must not be null! | |||
insertPosition = jmin (size, insertPosition); | |||
const size_t trailingDataSize = size - insertPosition; | |||
setSize (size + numBytes, false); | |||
@@ -81,7 +81,7 @@ public: | |||
*/ | |||
void decReferenceCount() noexcept | |||
{ | |||
jassert (getReferenceCount() > 0); | |||
wassert (getReferenceCount() > 0); | |||
if (--refCount == 0) | |||
delete this; | |||
@@ -93,7 +93,7 @@ public: | |||
*/ | |||
bool decReferenceCountWithoutDeleting() noexcept | |||
{ | |||
jassert (getReferenceCount() > 0); | |||
wassert (getReferenceCount() > 0); | |||
return --refCount == 0; | |||
} | |||
@@ -111,7 +111,7 @@ protected: | |||
virtual ~ReferenceCountedObject() | |||
{ | |||
// it's dangerous to delete an object that's still referenced by something else! | |||
jassert (getReferenceCount() == 0); | |||
wassert (getReferenceCount() == 0); | |||
} | |||
/** Resets the reference count to zero without deleting the object. | |||
@@ -160,7 +160,7 @@ public: | |||
*/ | |||
void decReferenceCount() noexcept | |||
{ | |||
jassert (getReferenceCount() > 0); | |||
wassert (getReferenceCount() > 0); | |||
if (--refCount == 0) | |||
delete this; | |||
@@ -172,7 +172,7 @@ public: | |||
*/ | |||
bool decReferenceCountWithoutDeleting() noexcept | |||
{ | |||
jassert (getReferenceCount() > 0); | |||
wassert (getReferenceCount() > 0); | |||
return --refCount == 0; | |||
} | |||
@@ -189,7 +189,7 @@ protected: | |||
virtual ~SingleThreadedReferenceCountedObject() | |||
{ | |||
// it's dangerous to delete an object that's still referenced by something else! | |||
jassert (getReferenceCount() == 0); | |||
wassert (getReferenceCount() == 0); | |||
} | |||
private: | |||
@@ -347,7 +347,7 @@ public: | |||
// the -> operator is called on the referenced object | |||
ReferencedType* operator->() const noexcept | |||
{ | |||
jassert (referencedObject != nullptr); // null pointer method call! | |||
wassert (referencedObject != nullptr); // null pointer method call! | |||
return referencedObject; | |||
} | |||
@@ -375,7 +375,7 @@ void MidiFile::convertTimestampTicksToSeconds() | |||
//============================================================================== | |||
bool MidiFile::writeTo (OutputStream& out, int midiFileType) | |||
{ | |||
jassert (midiFileType >= 0 && midiFileType <= 2); | |||
wassert (midiFileType >= 0 && midiFileType <= 2); | |||
if (! out.writeIntBigEndian ((int) ByteOrder::bigEndianInt ("MThd"))) return false; | |||
if (! out.writeIntBigEndian (6)) return false; | |||
@@ -52,7 +52,7 @@ uint16 MidiMessage::pitchbendToPitchwheelPos (const float pitchbend, | |||
const float pitchbendRange) noexcept | |||
{ | |||
// can't translate a pitchbend value that is outside of the given range! | |||
jassert (std::abs (pitchbend) <= pitchbendRange); | |||
wassert (std::abs (pitchbend) <= pitchbendRange); | |||
return static_cast<uint16> (pitchbend > 0.0f | |||
? jmap (pitchbend, 0.0f, pitchbendRange, 8192.0f, 16383.0f) | |||
@@ -82,7 +82,7 @@ int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) no | |||
int MidiMessage::getMessageLengthFromFirstByte (const uint8 firstByte) noexcept | |||
{ | |||
// this method only works for valid starting bytes of a short midi message | |||
jassert (firstByte >= 0x80 && firstByte != 0xf0 && firstByte != 0xf7); | |||
wassert (firstByte >= 0x80 && firstByte != 0xf0 && firstByte != 0xf7); | |||
static const char messageLengths[] = | |||
{ | |||
@@ -110,9 +110,9 @@ MidiMessage::MidiMessage() noexcept | |||
MidiMessage::MidiMessage (const void* const d, const int dataSize, const double t) | |||
: timeStamp (t), size (dataSize) | |||
{ | |||
jassert (dataSize > 0); | |||
wassert (dataSize > 0); | |||
// this checks that the length matches the data.. | |||
jassert (dataSize > 3 || *(uint8*)d >= 0xf0 || getMessageLengthFromFirstByte (*(uint8*)d) == size); | |||
wassert (dataSize > 3 || *(uint8*)d >= 0xf0 || getMessageLengthFromFirstByte (*(uint8*)d) == size); | |||
memcpy (allocateSpace (dataSize), d, (size_t) dataSize); | |||
} | |||
@@ -123,7 +123,7 @@ MidiMessage::MidiMessage (const int byte1, const double t) noexcept | |||
packedData.asBytes[0] = (uint8) byte1; | |||
// check that the length matches the data.. | |||
jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 1); | |||
wassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 1); | |||
} | |||
MidiMessage::MidiMessage (const int byte1, const int byte2, const double t) noexcept | |||
@@ -133,7 +133,7 @@ MidiMessage::MidiMessage (const int byte1, const int byte2, const double t) noex | |||
packedData.asBytes[1] = (uint8) byte2; | |||
// check that the length matches the data.. | |||
jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 2); | |||
wassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 2); | |||
} | |||
MidiMessage::MidiMessage (const int byte1, const int byte2, const int byte3, const double t) noexcept | |||
@@ -144,7 +144,7 @@ MidiMessage::MidiMessage (const int byte1, const int byte2, const int byte3, con | |||
packedData.asBytes[2] = (uint8) byte3; | |||
// check that the length matches the data.. | |||
jassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 3); | |||
wassert (byte1 >= 0xf0 || getMessageLengthFromFirstByte ((uint8) byte1) == 3); | |||
} | |||
MidiMessage::MidiMessage (const MidiMessage& other) | |||
@@ -334,7 +334,7 @@ int MidiMessage::getChannel() const noexcept | |||
bool MidiMessage::isForChannel (const int channel) const noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
wassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
const uint8* const data = getData(); | |||
@@ -344,7 +344,7 @@ bool MidiMessage::isForChannel (const int channel) const noexcept | |||
void MidiMessage::setChannel (const int channel) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
wassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
uint8* const data = getData(); | |||
@@ -423,7 +423,7 @@ bool MidiMessage::isAftertouch() const noexcept | |||
int MidiMessage::getAfterTouchValue() const noexcept | |||
{ | |||
jassert (isAftertouch()); | |||
wassert (isAftertouch()); | |||
return getData()[2]; | |||
} | |||
@@ -431,9 +431,9 @@ MidiMessage MidiMessage::aftertouchChange (const int channel, | |||
const int noteNum, | |||
const int aftertouchValue) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
jassert (isPositiveAndBelow (noteNum, (int) 128)); | |||
jassert (isPositiveAndBelow (aftertouchValue, (int) 128)); | |||
wassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
wassert (isPositiveAndBelow (noteNum, (int) 128)); | |||
wassert (isPositiveAndBelow (aftertouchValue, (int) 128)); | |||
return MidiMessage (MidiHelpers::initialByte (0xa0, channel), | |||
noteNum & 0x7f, | |||
@@ -447,14 +447,14 @@ bool MidiMessage::isChannelPressure() const noexcept | |||
int MidiMessage::getChannelPressureValue() const noexcept | |||
{ | |||
jassert (isChannelPressure()); | |||
wassert (isChannelPressure()); | |||
return getData()[1]; | |||
} | |||
MidiMessage MidiMessage::channelPressureChange (const int channel, const int pressure) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
jassert (isPositiveAndBelow (pressure, (int) 128)); | |||
wassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
wassert (isPositiveAndBelow (pressure, (int) 128)); | |||
return MidiMessage (MidiHelpers::initialByte (0xd0, channel), pressure & 0x7f); | |||
} | |||
@@ -476,13 +476,13 @@ bool MidiMessage::isProgramChange() const noexcept | |||
int MidiMessage::getProgramChangeNumber() const noexcept | |||
{ | |||
jassert (isProgramChange()); | |||
wassert (isProgramChange()); | |||
return getData()[1]; | |||
} | |||
MidiMessage MidiMessage::programChange (const int channel, const int programNumber) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
wassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
return MidiMessage (MidiHelpers::initialByte (0xc0, channel), programNumber & 0x7f); | |||
} | |||
@@ -494,15 +494,15 @@ bool MidiMessage::isPitchWheel() const noexcept | |||
int MidiMessage::getPitchWheelValue() const noexcept | |||
{ | |||
jassert (isPitchWheel()); | |||
wassert (isPitchWheel()); | |||
const uint8* const data = getData(); | |||
return data[1] | (data[2] << 7); | |||
} | |||
MidiMessage MidiMessage::pitchWheel (const int channel, const int position) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
jassert (isPositiveAndBelow (position, (int) 0x4000)); | |||
wassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16 | |||
wassert (isPositiveAndBelow (position, (int) 0x4000)); | |||
return MidiMessage (MidiHelpers::initialByte (0xe0, channel), | |||
position & 127, (position >> 7) & 127); | |||
@@ -521,20 +521,20 @@ bool MidiMessage::isControllerOfType (const int controllerType) const noexcept | |||
int MidiMessage::getControllerNumber() const noexcept | |||
{ | |||
jassert (isController()); | |||
wassert (isController()); | |||
return getData()[1]; | |||
} | |||
int MidiMessage::getControllerValue() const noexcept | |||
{ | |||
jassert (isController()); | |||
wassert (isController()); | |||
return getData()[2]; | |||
} | |||
MidiMessage MidiMessage::controllerEvent (const int channel, const int controllerType, const int value) noexcept | |||
{ | |||
// the channel must be between 1 and 16 inclusive | |||
jassert (channel > 0 && channel <= 16); | |||
wassert (channel > 0 && channel <= 16); | |||
return MidiMessage (MidiHelpers::initialByte (0xb0, channel), | |||
controllerType & 127, value & 127); | |||
@@ -542,8 +542,8 @@ MidiMessage MidiMessage::controllerEvent (const int channel, const int controlle | |||
MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const uint8 velocity) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); | |||
jassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
wassert (channel > 0 && channel <= 16); | |||
wassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
return MidiMessage (MidiHelpers::initialByte (0x90, channel), | |||
noteNumber & 127, MidiHelpers::validVelocity (velocity)); | |||
@@ -556,8 +556,8 @@ MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const | |||
MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 velocity) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); | |||
jassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
wassert (channel > 0 && channel <= 16); | |||
wassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
return MidiMessage (MidiHelpers::initialByte (0x80, channel), | |||
noteNumber & 127, MidiHelpers::validVelocity (velocity)); | |||
@@ -570,8 +570,8 @@ MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, float | |||
MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber) noexcept | |||
{ | |||
jassert (channel > 0 && channel <= 16); | |||
jassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
wassert (channel > 0 && channel <= 16); | |||
wassert (isPositiveAndBelow (noteNumber, (int) 128)); | |||
return MidiMessage (MidiHelpers::initialByte (0x80, channel), noteNumber & 127, 0); | |||
} | |||
@@ -667,7 +667,7 @@ int MidiMessage::getMetaEventLength() const noexcept | |||
const uint8* MidiMessage::getMetaEventData() const noexcept | |||
{ | |||
jassert (isMetaEvent()); | |||
wassert (isMetaEvent()); | |||
int n; | |||
const uint8* d = getData() + 2; | |||
@@ -693,7 +693,7 @@ String MidiMessage::getTextFromTextMetaEvent() const | |||
MidiMessage MidiMessage::textMetaEvent (int type, StringRef text) | |||
{ | |||
jassert (type > 0 && type < 16); | |||
wassert (type > 0 && type < 16); | |||
MidiMessage result; | |||
@@ -728,7 +728,7 @@ bool MidiMessage::isMidiChannelMetaEvent() const noexcept { const uint8* data | |||
int MidiMessage::getMidiChannelMetaEventChannel() const noexcept | |||
{ | |||
jassert (isMidiChannelMetaEvent()); | |||
wassert (isMidiChannelMetaEvent()); | |||
return getData()[3] + 1; | |||
} | |||
@@ -841,7 +841,7 @@ bool MidiMessage::isKeySignatureMajorKey() const noexcept | |||
MidiMessage MidiMessage::keySignatureMetaEvent (int numberOfSharpsOrFlats, bool isMinorKey) | |||
{ | |||
jassert (numberOfSharpsOrFlats >= -7 && numberOfSharpsOrFlats <= 7); | |||
wassert (numberOfSharpsOrFlats >= -7 && numberOfSharpsOrFlats <= 7); | |||
const uint8 d[] = { 0xff, 0x59, 0x02, (uint8) numberOfSharpsOrFlats, isMinorKey ? (uint8) 1 : (uint8) 0 }; | |||
return MidiMessage (d, 5, 0.0); | |||
@@ -898,7 +898,7 @@ bool MidiMessage::isFullFrame() const noexcept | |||
void MidiMessage::getFullFrameParameters (int& hours, int& minutes, int& seconds, int& frames, | |||
MidiMessage::SmpteTimecodeType& timecodeType) const noexcept | |||
{ | |||
jassert (isFullFrame()); | |||
wassert (isFullFrame()); | |||
const uint8* const data = getData(); | |||
timecodeType = (SmpteTimecodeType) (data[5] >> 5); | |||
@@ -933,7 +933,7 @@ bool MidiMessage::isMidiMachineControlMessage() const noexcept | |||
MidiMessage::MidiMachineControlCommand MidiMessage::getMidiMachineControlCommand() const noexcept | |||
{ | |||
jassert (isMidiMachineControlMessage()); | |||
wassert (isMidiMachineControlMessage()); | |||
return (MidiMachineControlCommand) getData()[4]; | |||
} | |||
@@ -317,7 +317,7 @@ void MidiMessageSequence::createControllerUpdatesForTime (const int channelNumbe | |||
else if (mm.isController()) | |||
{ | |||
const int controllerNumber = mm.getControllerNumber(); | |||
jassert (isPositiveAndBelow (controllerNumber, 128)); | |||
wassert (isPositiveAndBelow (controllerNumber, 128)); | |||
if (! doneControllers[controllerNumber]) | |||
{ | |||
@@ -360,7 +360,7 @@ private: | |||
if (inputChan >= numOuts) | |||
{ | |||
bufIndex = getReadOnlyEmptyBuffer(); | |||
jassert (bufIndex >= 0); | |||
wassert (bufIndex >= 0); | |||
} | |||
else | |||
{ | |||
@@ -380,7 +380,7 @@ private: | |||
{ | |||
// if not found, this is probably a feedback loop | |||
bufIndex = getReadOnlyEmptyBuffer(); | |||
jassert (bufIndex >= 0); | |||
wassert (bufIndex >= 0); | |||
} | |||
if (inputChan < numOuts | |||
@@ -436,7 +436,7 @@ private: | |||
{ | |||
// can't re-use any of our input chans, so get a new one and copy everything into it.. | |||
bufIndex = getFreeBuffer (false); | |||
jassert (bufIndex != 0); | |||
wassert (bufIndex != 0); | |||
const int srcIndex = getBufferContaining (sourceNodes.getUnchecked (0), | |||
sourceOutputChans.getUnchecked (0)); | |||
@@ -490,7 +490,7 @@ private: | |||
} | |||
} | |||
jassert (bufIndex >= 0); | |||
wassert (bufIndex >= 0); | |||
audioChannelsToUse.add (bufIndex); | |||
if (inputChan < numOuts) | |||
@@ -500,7 +500,7 @@ private: | |||
for (int outputChan = numIns; outputChan < numOuts; ++outputChan) | |||
{ | |||
const int bufIndex = getFreeBuffer (false); | |||
jassert (bufIndex != 0); | |||
wassert (bufIndex != 0); | |||
audioChannelsToUse.add (bufIndex); | |||
markBufferAsContaining (bufIndex, node.nodeId, outputChan); | |||
@@ -578,7 +578,7 @@ private: | |||
{ | |||
// can't re-use any of our input buffers, so get a new one and copy everything into it.. | |||
midiBufferToUse = getFreeBuffer (true); | |||
jassert (midiBufferToUse >= 0); | |||
wassert (midiBufferToUse >= 0); | |||
const int srcIndex = getBufferContaining (midiSourceNodes.getUnchecked(0), | |||
AudioProcessorGraph::midiChannelIndex); | |||
@@ -724,13 +724,13 @@ private: | |||
{ | |||
if (outputIndex == AudioProcessorGraph::midiChannelIndex) | |||
{ | |||
jassert (bufferNum > 0 && bufferNum < midiNodeIds.size()); | |||
wassert (bufferNum > 0 && bufferNum < midiNodeIds.size()); | |||
midiNodeIds.set (bufferNum, nodeId); | |||
} | |||
else | |||
{ | |||
jassert (bufferNum >= 0 && bufferNum < nodeIds.size()); | |||
wassert (bufferNum >= 0 && bufferNum < nodeIds.size()); | |||
nodeIds.set (bufferNum, nodeId); | |||
channels.set (bufferNum, outputIndex); | |||
@@ -884,7 +884,7 @@ AudioProcessorGraph::Connection::Connection (const uint32 sourceID, const int so | |||
AudioProcessorGraph::Node::Node (const uint32 nodeID, AudioProcessor* const p) noexcept | |||
: nodeId (nodeID), processor (p), isPrepared (false) | |||
{ | |||
jassert (processor != nullptr); | |||
wassert (processor != nullptr); | |||
} | |||
void AudioProcessorGraph::Node::prepare (const double newSampleRate, const int newBlockSize, | |||
@@ -997,7 +997,7 @@ AudioProcessorGraph::Node* AudioProcessorGraph::addNode (AudioProcessor* const n | |||
else | |||
{ | |||
// you can't add a node with an id that already exists in the graph.. | |||
jassert (getNodeForId (nodeId) == nullptr); | |||
wassert (getNodeForId (nodeId) == nullptr); | |||
removeNode (nodeId); | |||
if (nodeId > lastNodeId) | |||
@@ -1166,7 +1166,7 @@ bool AudioProcessorGraph::disconnectNode (const uint32 nodeId) | |||
bool AudioProcessorGraph::isConnectionLegal (const Connection* const c) const | |||
{ | |||
jassert (c != nullptr); | |||
wassert (c != nullptr); | |||
const Node* const source = getNodeForId (c->sourceNodeId); | |||
const Node* const dest = getNodeForId (c->destNodeId); | |||
@@ -100,7 +100,7 @@ int InputStream::readCompressedInt() | |||
const int numBytes = (sizeByte & 0x7f); | |||
if (numBytes > 4) | |||
{ | |||
jassertfalse; // trying to read corrupt data - this method must only be used | |||
wassertfalse; // trying to read corrupt data - this method must only be used | |||
// to read data that was written by OutputStream::writeCompressedInt() | |||
return 0; | |||
} | |||
@@ -137,7 +137,7 @@ float InputStream::readFloat() | |||
{ | |||
// the union below relies on these types being the same size... | |||
#ifdef CARLA_PROPER_CPP11_SUPPORT | |||
static_jassert (sizeof (int32) == sizeof (float)); | |||
static_wassert (sizeof (int32) == sizeof (float)); | |||
#endif | |||
union { int32 asInt; float asFloat; } n; | |||
n.asInt = (int32) readInt(); | |||
@@ -48,7 +48,7 @@ MemoryOutputStream::MemoryOutputStream (void* destBuffer, size_t destBufferSize) | |||
: blockToUse (nullptr), externalData (destBuffer), | |||
position (0), size (0), availableSize (destBufferSize) | |||
{ | |||
jassert (externalData != nullptr); // This must be a valid pointer. | |||
wassert (externalData != nullptr); // This must be a valid pointer. | |||
} | |||
MemoryOutputStream::~MemoryOutputStream() | |||
@@ -81,7 +81,7 @@ void MemoryOutputStream::reset() noexcept | |||
char* MemoryOutputStream::prepareToWrite (size_t numBytes) | |||
{ | |||
jassert ((ssize_t) numBytes >= 0); | |||
wassert ((ssize_t) numBytes >= 0); | |||
size_t storageNeeded = position + numBytes; | |||
char* data; | |||
@@ -109,7 +109,7 @@ char* MemoryOutputStream::prepareToWrite (size_t numBytes) | |||
bool MemoryOutputStream::write (const void* const buffer, size_t howMany) | |||
{ | |||
jassert (buffer != nullptr); | |||
wassert (buffer != nullptr); | |||
if (howMany == 0) | |||
return true; | |||
@@ -144,7 +144,7 @@ void Synthesiser::setNoteStealingEnabled (const bool shouldSteal) | |||
void Synthesiser::setMinimumRenderingSubdivisionSize (int numSamples, bool shouldBeStrict) noexcept | |||
{ | |||
jassert (numSamples > 0); // it wouldn't make much sense for this to be less than 1 | |||
wassert (numSamples > 0); // it wouldn't make much sense for this to be less than 1 | |||
minimumSubBlockSize = numSamples; | |||
subBlockSubdivisionIsStrict = shouldBeStrict; | |||
} | |||
@@ -169,7 +169,7 @@ void Synthesiser::processNextBlock (AudioSampleBuffer& outputAudio, | |||
int numSamples) | |||
{ | |||
// must set the sample rate before using this! | |||
jassert (sampleRate != 0); | |||
wassert (sampleRate != 0); | |||
const int targetChannels = outputAudio.getNumChannels(); | |||
MidiBuffer::Iterator midiIterator (midiData); | |||
@@ -325,12 +325,12 @@ void Synthesiser::startVoice (SynthesiserVoice* const voice, | |||
void Synthesiser::stopVoice (SynthesiserVoice* voice, float velocity, const bool allowTailOff) | |||
{ | |||
jassert (voice != nullptr); | |||
wassert (voice != nullptr); | |||
voice->stopNote (velocity, allowTailOff); | |||
// the subclass MUST call clearCurrentNote() if it's not tailing off! RTFM for stopNote()! | |||
jassert (allowTailOff || (voice->getCurrentlyPlayingNote() < 0 && voice->getCurrentlyPlayingSound() == 0)); | |||
wassert (allowTailOff || (voice->getCurrentlyPlayingNote() < 0 && voice->getCurrentlyPlayingSound() == 0)); | |||
} | |||
void Synthesiser::noteOff (const int midiChannel, | |||
@@ -472,7 +472,7 @@ void Synthesiser::handleSustainPedal (int midiChannel, bool isDown) | |||
void Synthesiser::handleSostenutoPedal (int midiChannel, bool isDown) | |||
{ | |||
jassert (midiChannel > 0 && midiChannel <= 16); | |||
wassert (midiChannel > 0 && midiChannel <= 16); | |||
for (int i = voices.size(); --i >= 0;) | |||
{ | |||
@@ -491,13 +491,13 @@ void Synthesiser::handleSostenutoPedal (int midiChannel, bool isDown) | |||
void Synthesiser::handleSoftPedal (int midiChannel, bool /*isDown*/) | |||
{ | |||
ignoreUnused (midiChannel); | |||
jassert (midiChannel > 0 && midiChannel <= 16); | |||
wassert (midiChannel > 0 && midiChannel <= 16); | |||
} | |||
void Synthesiser::handleProgramChange (int midiChannel, int programNumber) | |||
{ | |||
ignoreUnused (midiChannel, programNumber); | |||
jassert (midiChannel > 0 && midiChannel <= 16); | |||
wassert (midiChannel > 0 && midiChannel <= 16); | |||
} | |||
//============================================================================== | |||
@@ -536,7 +536,7 @@ SynthesiserVoice* Synthesiser::findVoiceToSteal (SynthesiserSound* soundToPlay, | |||
// - Protect the lowest & topmost notes, even if sustained, but not if they've been released. | |||
// apparently you are trying to render audio without having any voices... | |||
jassert (voices.size() > 0); | |||
wassert (voices.size() > 0); | |||
// These are the voices we want to protect (ie: only steal if unavoidable) | |||
SynthesiserVoice* low = nullptr; // Lowest sounding note, might be sustained, but NOT in release phase | |||
@@ -552,7 +552,7 @@ SynthesiserVoice* Synthesiser::findVoiceToSteal (SynthesiserSound* soundToPlay, | |||
if (voice->canPlaySound (soundToPlay)) | |||
{ | |||
jassert (voice->isVoiceActive()); // We wouldn't be here otherwise | |||
wassert (voice->isVoiceActive()); // We wouldn't be here otherwise | |||
VoiceAgeSorter sorter; | |||
usableVoices.addSorted (sorter, voice); | |||
@@ -613,7 +613,7 @@ SynthesiserVoice* Synthesiser::findVoiceToSteal (SynthesiserSound* soundToPlay, | |||
} | |||
// We've only got "protected" voices now: lowest note takes priority | |||
jassert (low != nullptr); | |||
wassert (low != nullptr); | |||
// Duophonic synth: give priority to the bass note: | |||
if (top != nullptr) | |||
@@ -122,7 +122,7 @@ public: | |||
/** Moves this pointer along to the next character in the string. */ | |||
CharPointer_UTF8& operator++() noexcept | |||
{ | |||
jassert (*data != 0); // trying to advance past the end of the string? | |||
wassert (*data != 0); // trying to advance past the end of the string? | |||
const signed char n = (signed char) *data++; | |||
if (n < 0) | |||
@@ -282,7 +282,7 @@ public: | |||
*/ | |||
size_t sizeInBytes() const noexcept | |||
{ | |||
jassert (data != nullptr); | |||
wassert (data != nullptr); | |||
return strlen (data) + 1; | |||
} | |||
@@ -556,7 +556,7 @@ public: | |||
*/ | |||
static bool isByteOrderMark (const void* possibleByteOrder) noexcept | |||
{ | |||
jassert (possibleByteOrder != nullptr); | |||
wassert (possibleByteOrder != nullptr); | |||
const uint8* const c = static_cast<const uint8*> (possibleByteOrder); | |||
return c[0] == (uint8) byteOrderMark1 | |||
@@ -53,21 +53,21 @@ Identifier::Identifier (const String& nm) | |||
: name (StringPool::getGlobalPool().getPooledString (nm)) | |||
{ | |||
// An Identifier cannot be created from an empty string! | |||
jassert (nm.isNotEmpty()); | |||
wassert (nm.isNotEmpty()); | |||
} | |||
Identifier::Identifier (const char* nm) | |||
: name (StringPool::getGlobalPool().getPooledString (nm)) | |||
{ | |||
// An Identifier cannot be created from an empty string! | |||
jassert (nm != nullptr && nm[0] != 0); | |||
wassert (nm != nullptr && nm[0] != 0); | |||
} | |||
Identifier::Identifier (String::CharPointerType start, String::CharPointerType end) | |||
: name (StringPool::getGlobalPool().getPooledString (start, end)) | |||
{ | |||
// An Identifier cannot be created from an empty string! | |||
jassert (start < end); | |||
wassert (start < end); | |||
} | |||
Identifier Identifier::null; | |||
@@ -427,7 +427,7 @@ namespace NumberToStringConverters | |||
StackArrayStream strm (buffer); | |||
len = strm.writeDouble (n, numDecPlaces); | |||
jassert (len <= charsNeededForDouble); | |||
wassert (len <= charsNeededForDouble); | |||
return buffer; | |||
} | |||
@@ -482,7 +482,7 @@ size_t String::getByteOffsetOfEnd() const noexcept | |||
water_uchar String::operator[] (int index) const noexcept | |||
{ | |||
jassert (index == 0 || (index > 0 && index <= (int) text.lengthUpTo ((size_t) index + 1))); | |||
wassert (index == 0 || (index > 0 && index <= (int) text.lengthUpTo ((size_t) index + 1))); | |||
return text [index]; | |||
} | |||
@@ -559,7 +559,7 @@ static int stringCompareRight (String::CharPointerType s1, String::CharPointerTy | |||
if (c1 != c2 && bias == 0) | |||
bias = c1 < c2 ? -1 : 1; | |||
jassert (c1 != 0 && c2 != 0); | |||
wassert (c1 != 0 && c2 != 0); | |||
} | |||
} | |||
@@ -632,7 +632,7 @@ static int naturalStringCompare (String::CharPointerType s1, String::CharPointer | |||
return c1 < c2 ? -1 : 1; | |||
} | |||
jassert (c1 != 0 && c2 != 0); | |||
wassert (c1 != 0 && c2 != 0); | |||
} | |||
} | |||
@@ -656,11 +656,11 @@ void String::appendCharPointer (const CharPointerType textToAppend) | |||
void String::appendCharPointer (const CharPointerType startOfTextToAppend, | |||
const CharPointerType endOfTextToAppend) | |||
{ | |||
jassert (startOfTextToAppend.getAddress() != nullptr && endOfTextToAppend.getAddress() != nullptr); | |||
wassert (startOfTextToAppend.getAddress() != nullptr && endOfTextToAppend.getAddress() != nullptr); | |||
const int extraBytesNeeded = getAddressDifference (endOfTextToAppend.getAddress(), | |||
startOfTextToAppend.getAddress()); | |||
jassert (extraBytesNeeded >= 0); | |||
wassert (extraBytesNeeded >= 0); | |||
if (extraBytesNeeded > 0) | |||
{ | |||
@@ -1058,7 +1058,7 @@ String String::repeatedString (StringRef stringToRepeat, int numberOfTimesToRepe | |||
String String::paddedLeft (const water_uchar padCharacter, int minimumLength) const | |||
{ | |||
jassert (padCharacter != 0); | |||
wassert (padCharacter != 0); | |||
int extraChars = minimumLength; | |||
CharPointerType end (text); | |||
@@ -1118,7 +1118,7 @@ String String::replaceSection (int index, int numCharsToReplace, StringRef strin | |||
if (index < 0) | |||
{ | |||
// a negative index to replace from? | |||
jassertfalse; | |||
wassertfalse; | |||
index = 0; | |||
} | |||
@@ -1126,7 +1126,7 @@ String String::replaceSection (int index, int numCharsToReplace, StringRef strin | |||
{ | |||
// replacing a negative number of characters? | |||
numCharsToReplace = 0; | |||
jassertfalse; | |||
wassertfalse; | |||
} | |||
CharPointerType insertPoint (text); | |||
@@ -1136,7 +1136,7 @@ String String::replaceSection (int index, int numCharsToReplace, StringRef strin | |||
if (insertPoint.isEmpty()) | |||
{ | |||
// replacing beyond the end of the string? | |||
jassertfalse; | |||
wassertfalse; | |||
return *this + stringToInsert; | |||
} | |||
@@ -1258,7 +1258,7 @@ String String::replaceCharacters (StringRef charactersToReplace, StringRef chara | |||
{ | |||
// Each character in the first string must have a matching one in the | |||
// second, so the two strings must be the same length. | |||
jassert (charactersToReplace.length() == charactersToInsertInstead.length()); | |||
wassert (charactersToReplace.length() == charactersToInsertInstead.length()); | |||
StringCreationHelper builder (text); | |||
@@ -1937,7 +1937,7 @@ struct StringCopier | |||
{ | |||
static size_t copyToBuffer (const CharPointerType_Src source, typename CharPointerType_Dest::CharType* const buffer, const size_t maxBufferSizeBytes) | |||
{ | |||
jassert (((ssize_t) maxBufferSizeBytes) >= 0); // keep this value positive! | |||
wassert (((ssize_t) maxBufferSizeBytes) >= 0); // keep this value positive! | |||
if (buffer == nullptr) | |||
return CharPointerType_Dest::getBytesRequiredFor (source) + sizeof (typename CharPointerType_Dest::CharType); | |||
@@ -1966,7 +1966,7 @@ String String::fromUTF8 (const char* const buffer, int bufferSizeBytes) | |||
if (bufferSizeBytes > 0) | |||
{ | |||
jassert (CharPointer_UTF8::isValidString (buffer, bufferSizeBytes)); | |||
wassert (CharPointer_UTF8::isValidString (buffer, bufferSizeBytes)); | |||
return String (CharPointer_UTF8 (buffer), CharPointer_UTF8 (buffer + bufferSizeBytes)); | |||
} | |||
} | |||
@@ -2032,7 +2032,7 @@ StringRef::StringRef() noexcept : text ((const String::CharPointerType::CharTyp | |||
StringRef::StringRef (const char* stringLiteral) noexcept | |||
: text (stringLiteral) | |||
{ | |||
jassert (stringLiteral != nullptr); // This must be a valid string literal, not a null pointer!! | |||
wassert (stringLiteral != nullptr); // This must be a valid string literal, not a null pointer!! | |||
/* If you get an assertion here, then you're trying to create a string from 8-bit data | |||
that contains values greater than 127. These can NOT be correctly converted to unicode | |||
@@ -2047,12 +2047,12 @@ StringRef::StringRef (const char* stringLiteral) noexcept | |||
because there's no other way to represent these strings in a way that isn't dependent on | |||
the compiler, source code editor and platform. | |||
*/ | |||
jassert (CharPointer_UTF8::isValidString (stringLiteral, std::numeric_limits<int>::max())); | |||
wassert (CharPointer_UTF8::isValidString (stringLiteral, std::numeric_limits<int>::max())); | |||
} | |||
StringRef::StringRef (String::CharPointerType stringLiteral) noexcept : text (stringLiteral) | |||
{ | |||
jassert (stringLiteral.getAddress() != nullptr); // This must be a valid string literal, not a null pointer!! | |||
wassert (stringLiteral.getAddress() != nullptr); // This must be a valid string literal, not a null pointer!! | |||
} | |||
StringRef::StringRef (const String& string) noexcept : text (string.getCharPointer()) {} | |||
@@ -185,7 +185,7 @@ public: | |||
void appendCharPointer (const CharPointer startOfTextToAppend, | |||
const CharPointer endOfTextToAppend) | |||
{ | |||
jassert (startOfTextToAppend.getAddress() != nullptr && endOfTextToAppend.getAddress() != nullptr); | |||
wassert (startOfTextToAppend.getAddress() != nullptr && endOfTextToAppend.getAddress() != nullptr); | |||
size_t extraBytesNeeded = 0, numChars = 1; | |||
@@ -149,7 +149,7 @@ void StringArray::addArray (const StringArray& otherArray, int startIndex, int n | |||
{ | |||
if (startIndex < 0) | |||
{ | |||
jassertfalse; | |||
wassertfalse; | |||
startIndex = 0; | |||
} | |||
@@ -156,7 +156,7 @@ public: | |||
// Looks like you're trying to launch a non-existent exe or a folder (perhaps on OSX | |||
// you're trying to launch the .app folder rather than the actual binary inside it?) | |||
jassert (File::getCurrentWorkingDirectory().getChildFile (exe).existsAsFile() | |||
wassert (File::getCurrentWorkingDirectory().getChildFile (exe).existsAsFile() | |||
|| ! exe.containsChar (File::separator)); | |||
int pipeHandles[2] = { 0 }; | |||
@@ -218,7 +218,7 @@ public: | |||
int read (void* const dest, const int numBytes) noexcept | |||
{ | |||
jassert (dest != nullptr); | |||
wassert (dest != nullptr); | |||
#ifdef fdopen | |||
#error // the zlib headers define this function as NULL! | |||
@@ -23,10 +23,10 @@ | |||
//============================================================================== | |||
#define jassertfalse carla_safe_assert("jassertfalse triggered", __FILE__, __LINE__); | |||
#define jassert(expression) CARLA_SAFE_ASSERT(expression) | |||
#define wassertfalse carla_safe_assert("wassertfalse triggered", __FILE__, __LINE__); | |||
#define wassert(expression) CARLA_SAFE_ASSERT(expression) | |||
#define static_jassert(expression) static_assert(expression, #expression); | |||
#define static_wassert(expression) static_assert(expression, #expression); | |||
//============================================================================== | |||
// Compiler support | |||
@@ -71,44 +71,44 @@ XmlElement::XmlAttributeNode::XmlAttributeNode (const XmlAttributeNode& other) n | |||
XmlElement::XmlAttributeNode::XmlAttributeNode (const Identifier& n, const String& v) noexcept | |||
: name (n), value (v) | |||
{ | |||
jassert (isValidXmlName (name)); | |||
wassert (isValidXmlName (name)); | |||
} | |||
XmlElement::XmlAttributeNode::XmlAttributeNode (String::CharPointerType nameStart, String::CharPointerType nameEnd) | |||
: name (nameStart, nameEnd) | |||
{ | |||
jassert (isValidXmlName (name)); | |||
wassert (isValidXmlName (name)); | |||
} | |||
//============================================================================== | |||
XmlElement::XmlElement (const String& tag) | |||
: tagName (StringPool::getGlobalPool().getPooledString (tag)) | |||
{ | |||
jassert (isValidXmlName (tagName)); | |||
wassert (isValidXmlName (tagName)); | |||
} | |||
XmlElement::XmlElement (const char* tag) | |||
: tagName (StringPool::getGlobalPool().getPooledString (tag)) | |||
{ | |||
jassert (isValidXmlName (tagName)); | |||
wassert (isValidXmlName (tagName)); | |||
} | |||
XmlElement::XmlElement (StringRef tag) | |||
: tagName (StringPool::getGlobalPool().getPooledString (tag)) | |||
{ | |||
jassert (isValidXmlName (tagName)); | |||
wassert (isValidXmlName (tagName)); | |||
} | |||
XmlElement::XmlElement (const Identifier& tag) | |||
: tagName (tag.toString()) | |||
{ | |||
jassert (isValidXmlName (tagName)); | |||
wassert (isValidXmlName (tagName)); | |||
} | |||
XmlElement::XmlElement (String::CharPointerType tagNameStart, String::CharPointerType tagNameEnd) | |||
: tagName (StringPool::getGlobalPool().getPooledString (tagNameStart, tagNameEnd)) | |||
{ | |||
jassert (isValidXmlName (tagName)); | |||
wassert (isValidXmlName (tagName)); | |||
} | |||
XmlElement::XmlElement (int /*dummy*/) noexcept | |||
@@ -145,7 +145,7 @@ XmlElement::XmlElement (XmlElement&& other) noexcept | |||
XmlElement& XmlElement::operator= (XmlElement&& other) noexcept | |||
{ | |||
jassert (this != &other); // hopefully the compiler should make this situation impossible! | |||
wassert (this != &other); // hopefully the compiler should make this situation impossible! | |||
removeAllAttributes(); | |||
deleteAllChildElements(); | |||
@@ -161,10 +161,10 @@ XmlElement& XmlElement::operator= (XmlElement&& other) noexcept | |||
void XmlElement::copyChildrenAndAttributesFrom (const XmlElement& other) | |||
{ | |||
jassert (firstChildElement.get() == nullptr); | |||
wassert (firstChildElement.get() == nullptr); | |||
firstChildElement.addCopyOfList (other.firstChildElement); | |||
jassert (attributes.get() == nullptr); | |||
wassert (attributes.get() == nullptr); | |||
attributes.addCopyOfList (other.attributes); | |||
} | |||
@@ -428,7 +428,7 @@ bool XmlElement::hasTagName (StringRef possibleTagName) const noexcept | |||
// XML tags should be case-sensitive, so although this method allows a | |||
// case-insensitive match to pass, you should try to avoid this. | |||
jassert ((! matches) || tagName == possibleTagName); | |||
wassert ((! matches) || tagName == possibleTagName); | |||
return matches; | |||
} | |||
@@ -628,7 +628,7 @@ XmlElement* XmlElement::getChildElement (const int index) const noexcept | |||
XmlElement* XmlElement::getChildByName (StringRef childName) const noexcept | |||
{ | |||
jassert (! childName.isEmpty()); | |||
wassert (! childName.isEmpty()); | |||
for (XmlElement* child = firstChildElement; child != nullptr; child = child->nextListItem) | |||
if (child->hasTagName (childName)) | |||
@@ -639,7 +639,7 @@ XmlElement* XmlElement::getChildByName (StringRef childName) const noexcept | |||
XmlElement* XmlElement::getChildByAttribute (StringRef attributeName, StringRef attributeValue) const noexcept | |||
{ | |||
jassert (! attributeName.isEmpty()); | |||
wassert (! attributeName.isEmpty()); | |||
for (XmlElement* child = firstChildElement; child != nullptr; child = child->nextListItem) | |||
if (child->compareAttribute (attributeName, attributeValue)) | |||
@@ -653,7 +653,7 @@ void XmlElement::addChildElement (XmlElement* const newNode) noexcept | |||
if (newNode != nullptr) | |||
{ | |||
// The element being added must not be a child of another node! | |||
jassert (newNode->nextListItem == nullptr); | |||
wassert (newNode->nextListItem == nullptr); | |||
firstChildElement.append (newNode); | |||
} | |||
@@ -664,7 +664,7 @@ void XmlElement::insertChildElement (XmlElement* const newNode, int indexToInser | |||
if (newNode != nullptr) | |||
{ | |||
// The element being added must not be a child of another node! | |||
jassert (newNode->nextListItem == nullptr); | |||
wassert (newNode->nextListItem == nullptr); | |||
firstChildElement.insertAtIndex (indexToInsertAt, newNode); | |||
} | |||
@@ -675,7 +675,7 @@ void XmlElement::prependChildElement (XmlElement* newNode) noexcept | |||
if (newNode != nullptr) | |||
{ | |||
// The element being added must not be a child of another node! | |||
jassert (newNode->nextListItem == nullptr); | |||
wassert (newNode->nextListItem == nullptr); | |||
firstChildElement.insertNext (newNode); | |||
} | |||
@@ -858,7 +858,7 @@ static const String water_xmltextContentAttributeName ("text"); | |||
const String& XmlElement::getText() const noexcept | |||
{ | |||
jassert (isTextElement()); // you're trying to get the text from an element that | |||
wassert (isTextElement()); // you're trying to get the text from an element that | |||
// isn't actually a text element.. If this contains text sub-nodes, you | |||
// probably want to use getAllSubText instead. | |||