Use nullptr rather than NULL

This commit is contained in:
Alex Harker
2018-06-14 20:42:26 +01:00
parent 7a545846c2
commit eab4f6859a
57 changed files with 209 additions and 212 deletions
+4 -4
View File
@@ -51,15 +51,15 @@ class FrameLib_Context
{
if (mGlobal)
(mGlobal->*releaseMethod)(mReference);
mPointer = NULL;
mGlobal = NULL;
mReference = NULL;
mPointer = nullptr;
mGlobal = nullptr;
mReference = nullptr;
}
// Pointer / Bool Conversion
T *operator->() { return mPointer; }
operator bool() const { return mPointer != NULL; }
operator bool() const { return mPointer != nullptr; }
private:
+7 -7
View File
@@ -4,7 +4,7 @@
// Constructor / Destructor
FrameLib_DSP::FrameLib_DSP(ObjectType type, FrameLib_Context context, FrameLib_Proxy *proxy, FrameLib_Parameters::Info *info, unsigned long nIns, unsigned long nOuts, unsigned long nAudioChans)
: FrameLib_Block(type, context, proxy), mSamplingRate(44100.0), mMaxBlockSize(4096), mParameters(context, proxy, info), mProcessingQueue(context), mNext(NULL), mNoLiveInputs(true), mInUpdate(false)
: FrameLib_Block(type, context, proxy), mSamplingRate(44100.0), mMaxBlockSize(4096), mParameters(context, proxy, info), mProcessingQueue(context), mNext(nullptr), mNoLiveInputs(true), mInUpdate(false)
{
// Set IO
@@ -106,7 +106,7 @@ void FrameLib_DSP::reset(LocalQueue *queue)
// Remove info about the processing queue
mNext = NULL;
mNext = nullptr;
// Reset output
@@ -258,7 +258,7 @@ bool FrameLib_DSP::allocateOutputs()
for (auto outs = mOutputs.begin(); outs != mOutputs.end(); outs++)
{
outs->mMemory = NULL;
outs->mMemory = nullptr;
outs->mCurrentSize = 0;
}
@@ -281,7 +281,7 @@ const FrameLib_Parameters::Serial *FrameLib_DSP::getInput(unsigned long idx) con
if (mInputs[idx].mObject)
return mInputs[idx].mObject->getOutput(mInputs[idx].mIndex);
return NULL;
return nullptr;
}
double *FrameLib_DSP::getOutput(unsigned long idx, size_t *size) const
@@ -293,7 +293,7 @@ double *FrameLib_DSP::getOutput(unsigned long idx, size_t *size) const
}
*size = 0;
return NULL;
return nullptr;
}
FrameLib_Parameters::Serial *FrameLib_DSP::getOutput(unsigned long idx) const
@@ -301,7 +301,7 @@ FrameLib_Parameters::Serial *FrameLib_DSP::getOutput(unsigned long idx) const
if (mOutputs[0].mMemory && mOutputs[idx].mCurrentType == kFrameTagged)
return (Serial *) mOutputs[idx].mMemory;
return NULL;
return nullptr;
}
// Convience methods for copying and zeroing
@@ -573,7 +573,7 @@ inline void FrameLib_DSP::freeOutputMemory()
if (outs->mCurrentType == kFrameTagged)
((Serial *)outs->mMemory)->Serial::~Serial();
// Then deallocate (will also set to NULL)
// Then deallocate (will also set to nullptr)
dealloc(mOutputs[0].mMemory);
}
+5 -4
View File
@@ -7,9 +7,10 @@
#include "FrameLib_Object.h"
#include "FrameLib_ProcessingQueue.h"
#include <limits>
#include <vector>
#include <algorithm>
#include <limits>
#include <memory>
#include <vector>
// FrameLib_DSP
@@ -44,7 +45,7 @@ private:
struct Input
{
Input() : mObject(NULL), mIndex(0), mSize(0), mFixedInput(NULL), mType(kFrameNormal), mUpdate(false), mParameters(false), mTrigger(true), mSwitchable(false) {}
Input() : mObject(nullptr), mIndex(0), mSize(0), mFixedInput(nullptr), mType(kFrameNormal), mUpdate(false), mParameters(false), mTrigger(true), mSwitchable(false) {}
FrameType getCurrentType() const { return mObject ? mObject->mOutputs[mIndex].mCurrentType : kFrameNormal; }
@@ -70,7 +71,7 @@ private:
struct Output
{
Output() : mMemory(NULL), mType(kFrameNormal), mCurrentType(kFrameNormal), mRequestedType(kFrameNormal), mCurrentSize(0), mRequestedSize(0), mPointerOffset(0) {}
Output() : mMemory(nullptr), mType(kFrameNormal), mCurrentType(kFrameNormal), mRequestedType(kFrameNormal), mCurrentSize(0), mRequestedSize(0), mPointerOffset(0) {}
void *mMemory;
+1 -1
View File
@@ -34,7 +34,7 @@ public:
public:
ErrorReport() : mSource(kErrorObject), mReporter(NULL), mError(NULL), mItems(NULL), mNumItems(0) {}
ErrorReport() : mSource(kErrorObject), mReporter(nullptr), mError(nullptr), mItems(nullptr), mNumItems(0) {}
ErrorReport(ErrorSource source, FrameLib_Proxy *reporter, const char *error, const char *items, unsigned long numItems)
: mSource(source), mReporter(reporter), mError(error), mItems(items), mNumItems(numItems) {}
+2 -2
View File
@@ -25,7 +25,7 @@ T *FrameLib_Global::PointerSet<T>::find(void *reference)
}
}
return NULL;
return nullptr;
}
// Release a pre-existing object by reference address
@@ -124,7 +124,7 @@ FrameLib_Global *FrameLib_Global::decrement()
lock.destroy();
delete this;
return NULL;
return nullptr;
}
return this;
+1 -1
View File
@@ -61,7 +61,7 @@ public:
// Retrieve and release the global object
static FrameLib_Global *get(FrameLib_Global **global, FrameLib_ErrorReporter::HostNotifier *notifier = NULL);
static FrameLib_Global *get(FrameLib_Global **global, FrameLib_ErrorReporter::HostNotifier *notifier = nullptr);
static void release(FrameLib_Global **global);
private:
+11 -11
View File
@@ -29,7 +29,7 @@ inline size_t blockSize(void* ptr)
// The Core Allocator (has no threadsafety)
FrameLib_GlobalAllocator::CoreAllocator::CoreAllocator(FrameLib_ErrorReporter& errorReporter) : mPools(NULL), mOSAllocated(0), mAllocated(0), mLastDisposedPoolSize(0), mAllocThread(this), mFreeThread(this), mErrorReporter(errorReporter)
FrameLib_GlobalAllocator::CoreAllocator::CoreAllocator(FrameLib_ErrorReporter& errorReporter) : mPools(nullptr), mOSAllocated(0), mAllocated(0), mLastDisposedPoolSize(0), mAllocThread(this), mFreeThread(this), mErrorReporter(errorReporter)
{
mTLSF = tlsf_create(malloc(tlsf_size()));
insertPool(createPool(initSize));
@@ -64,7 +64,7 @@ void *FrameLib_GlobalAllocator::CoreAllocator::alloc(size_t size)
{
// N.B. - for now allocate double the necessary size (which should always work)
Pool *pool = NULL;
Pool *pool = nullptr;
size_t poolSize = size <= (growSize >> 1) ? growSize : (size << 1);
// Attempt to get the pool from the scheduled slot
@@ -101,7 +101,7 @@ void *FrameLib_GlobalAllocator::CoreAllocator::alloc(size_t size)
if (ptr)
mAllocated += blockSize(ptr);
else
mErrorReporter.reportError(kErrorMemory, NULL, "FrameLib - couldn't allocate memory");
mErrorReporter.reportError(kErrorMemory, nullptr, "FrameLib - couldn't allocate memory");
// Check for near full
@@ -144,7 +144,7 @@ void FrameLib_GlobalAllocator::CoreAllocator::prune()
return;
}
if (difftime(now, pool->mTime) > pruneInterval && mScheduledDisposePool.compareAndSwap(NULL, pool))
if (difftime(now, pool->mTime) > pruneInterval && mScheduledDisposePool.compareAndSwap(nullptr, pool))
{
removePool(pool);
mLastDisposedPoolSize = pool->mSize;
@@ -202,7 +202,7 @@ void FrameLib_GlobalAllocator::CoreAllocator::unlinkPool(Pool *pool)
pool->mNext->mPrev = pool->mPrev;
if (pool == mPools)
mPools = pool->mNext == pool ? NULL : pool->mNext;
mPools = pool->mNext == pool ? nullptr : pool->mNext;
}
void FrameLib_GlobalAllocator::CoreAllocator::poolToTop(Pool *pool)
@@ -231,7 +231,7 @@ void FrameLib_GlobalAllocator::CoreAllocator::removePool(Pool *pool)
void FrameLib_GlobalAllocator::CoreAllocator::addScheduledPool()
{
Pool *pool = createPool(growSize);
while (!mScheduledNewPool.compareAndSwap(NULL, pool));
while (!mScheduledNewPool.compareAndSwap(nullptr, pool));
}
void FrameLib_GlobalAllocator::CoreAllocator::destroyScheduledPool()
@@ -274,7 +274,7 @@ size_t FrameLib_GlobalAllocator::alignSize(size_t x)
// Local Storage
FrameLib_LocalAllocator::Storage::Storage(const char *name, FrameLib_LocalAllocator *allocator)
: mName(name), mType(kFrameNormal), mData(NULL), mSize(0), mMaxSize(0), mCount(1), mAllocator(allocator)
: mName(name), mType(kFrameNormal), mData(nullptr), mSize(0), mMaxSize(0), mCount(1), mAllocator(allocator)
{}
FrameLib_LocalAllocator::Storage::~Storage()
@@ -362,7 +362,7 @@ FrameLib_LocalAllocator::~FrameLib_LocalAllocator()
void *FrameLib_LocalAllocator::alloc(size_t size)
{
if (!size)
return NULL;
return nullptr;
// N.B. - all memory should be aligned to alignment / memory returned will be between size and size << 1
@@ -370,7 +370,7 @@ void *FrameLib_LocalAllocator::alloc(size_t size)
// Find an appropriately sized block in the free lists
for (FreeBlock *block = mTail->mNext; block && block->mMemory; block = block == mTail ? NULL : block->mNext)
for (FreeBlock *block = mTail->mNext; block && block->mMemory; block = block == mTail ? nullptr : block->mNext)
if (block->mSize >= size && block->mSize <= maxSize)
return removeBlock(block);
@@ -412,7 +412,7 @@ void FrameLib_LocalAllocator::clear()
if (mFreeLists[i].mMemory)
{
pruner.dealloc(mFreeLists[i].mMemory);
mFreeLists[i].mMemory = NULL;
mFreeLists[i].mMemory = nullptr;
mFreeLists[i].mSize = 0;
}
}
@@ -464,7 +464,7 @@ void *FrameLib_LocalAllocator::removeBlock(FreeBlock *block)
// Set to default values
block->mMemory = NULL;
block->mMemory = nullptr;
block->mSize = 0;
// If at the tail there is no need to do anything
+4 -4
View File
@@ -29,7 +29,7 @@ private:
struct Pool
{
Pool(void *mem, size_t size) : mUsedRecently(true), mTime(0), mSize(size), mPrev(NULL), mNext(NULL), mMem(mem) {}
Pool(void *mem, size_t size) : mUsedRecently(true), mTime(0), mSize(size), mPrev(nullptr), mNext(nullptr), mMem(mem) {}
bool isFree() { return tlsf_pool_is_free(mMem); }
@@ -207,7 +207,7 @@ class FrameLib_LocalAllocator
struct FreeBlock
{
FreeBlock() : mMemory(NULL), mSize(0), mPrev(NULL), mNext(NULL) {}
FreeBlock() : mMemory(nullptr), mSize(0), mPrev(nullptr), mNext(nullptr) {}
void *mMemory;
size_t mSize;
@@ -272,10 +272,10 @@ public:
// Getters
FrameType getType() const { return mType; }
double *getVector() const { return mType == kFrameNormal ? static_cast<double *>(mData) : NULL; }
double *getVector() const { return mType == kFrameNormal ? static_cast<double *>(mData) : nullptr; }
unsigned long getVectorSize() const { return mType == kFrameNormal ? mSize : 0; }
unsigned long getTaggedSize() const { return mType == kFrameTagged ? mSize : 0; }
Serial *getTagged() const { return mType == kFrameTagged ? static_cast<Serial *>(mData) : NULL; }
Serial *getTagged() const { return mType == kFrameTagged ? static_cast<Serial *>(mData) : nullptr; }
// Resize the storage
+23 -23
View File
@@ -19,7 +19,7 @@ class FrameLib_Queueable
public:
FrameLib_Queueable() : mNext(NULL) {}
FrameLib_Queueable() : mNext(nullptr) {}
class Queue
{
@@ -27,9 +27,9 @@ public:
public:
Queue() : mFirst(NULL), mTop(NULL), mTail(NULL) {}
Queue() : mFirst(nullptr), mTop(nullptr), mTail(nullptr) {}
Queue(T *object, Method method) : mFirst(NULL), mTop(NULL), mTail(NULL)
Queue(T *object, Method method) : mFirst(nullptr), mTop(nullptr), mTail(nullptr)
{
add(object);
start(method);
@@ -37,9 +37,9 @@ public:
void add(T *object)
{
// Do not add if NULL or re-add if already in queue
// Do not add if nullptr or re-add if already in queue
if (!object || object->FrameLib_Queueable<T>::mNext != NULL)
if (!object || object->FrameLib_Queueable<T>::mNext != nullptr)
return;
// Add to the top /tail of the queue depending on whether the queue is open
@@ -64,10 +64,10 @@ public:
T *object = mTop;
(object->*method)(this);
mTop = object->FrameLib_Queueable<T>::mNext;
object->FrameLib_Queueable<T>::mNext = NULL;
object->FrameLib_Queueable<T>::mNext = nullptr;
}
mFirst = mTail = NULL;
mFirst = mTail = nullptr;
}
T *getFirst() const { return mFirst; }
@@ -105,7 +105,7 @@ public:
struct Connection
{
Connection() : mObject(NULL), mIndex(0) {}
Connection() : mObject(nullptr), mIndex(0) {}
Connection(T *object, unsigned long index) : mObject(object), mIndex(index) {}
friend bool operator == (const Connection& a, const Connection& b) { return a.mObject == b.mObject && a.mIndex == b.mIndex; }
@@ -210,7 +210,7 @@ public:
// N.B. Parameter objects can be queried directly for info
virtual const FrameLib_Parameters *getParameters() const { return NULL; }
virtual const FrameLib_Parameters *getParameters() const { return nullptr; }
// Connection
@@ -294,7 +294,7 @@ public:
// Input Connection Queries
bool isConnected(unsigned long inIdx) const { return getConnection(inIdx).mObject != NULL; }
bool isConnected(unsigned long inIdx) const { return getConnection(inIdx).mObject != nullptr; }
Connection getConnection(unsigned long inIdx) const { return getConnection(inIdx, false); }
bool supportsOrderingConnections() const { return mSupportsOrderingConnections; }
@@ -363,7 +363,7 @@ protected:
template <class U> void dealloc(U *& ptr)
{
mAllocator->dealloc(ptr);
ptr = NULL;
ptr = nullptr;
}
void clearAllocator() { mAllocator->clear(); }
@@ -373,7 +373,7 @@ protected:
void releaseStorage(FrameLib_LocalAllocator::Storage *&storage)
{
mAllocator->releaseStorage(storage->getName());
storage = NULL;
storage = nullptr;
}
// Info Helpers
@@ -458,7 +458,7 @@ protected:
const double *getEmptyFixedInput(unsigned long idx, unsigned long *size)
{
*size = 0;
return NULL;
return nullptr;
}
private:
@@ -546,7 +546,7 @@ private:
// Notifications
void notifySelf(bool notify, Queue *queue = NULL)
void notifySelf(bool notify, Queue *queue = nullptr)
{
if (notify)
{
@@ -557,7 +557,7 @@ private:
}
}
void notifyConnectionsChanged(Connection connection, Queue *queue = NULL)
void notifyConnectionsChanged(Connection connection, Queue *queue = nullptr)
{
if (connection.mObject)
{
@@ -590,7 +590,7 @@ private:
// Change Input Connection
ConnectionResult changeConnection(Connection connection, unsigned long inIdx, bool notify, Queue *queue = NULL)
ConnectionResult changeConnection(Connection connection, unsigned long inIdx, bool notify, Queue *queue = nullptr)
{
if (mInputConnections[inIdx].mIn == connection)
return kConnectSuccess;
@@ -641,19 +641,19 @@ private:
return kConnectSuccess;
}
ConnectionResult addOrderingConnection(Connection connection, bool notify, Queue *queue = NULL)
ConnectionResult addOrderingConnection(Connection connection, bool notify, Queue *queue = nullptr)
{
return changeOrderingConnection(connection, &addUniqueItem<Connection>, &FrameLib_Object::addToConnector, notify, queue);
}
void deleteOrderingConnection(Connection connection, bool notify, Queue *queue = NULL)
void deleteOrderingConnection(Connection connection, bool notify, Queue *queue = nullptr)
{
changeOrderingConnection(connection, &deleteUniqueItem<Connection>, &FrameLib_Object::deleteFromConnector, notify, queue);
}
// Clear Ordering Connections
void clearOrderingConnections(bool notify, Queue *queue = NULL)
void clearOrderingConnections(bool notify, Queue *queue = nullptr)
{
if (!supportsOrderingConnections() || mOrderingConnector.mInternal)
return;
@@ -678,7 +678,7 @@ private:
// Clear output
void clearOutput(unsigned long outIdx, Queue *queue = NULL)
void clearOutput(unsigned long outIdx, Queue *queue = nullptr)
{
while (!mOutputConnections[outIdx].mInternal && mOutputConnections[outIdx].mOut.size())
{
@@ -716,7 +716,7 @@ private:
// Clear ordering connections
clearOrderingConnections(false, &queue);
changeOrderingAlias(NULL, false, &queue);
changeOrderingAlias(nullptr, false, &queue);
clearAliases(&FrameLib_Object::getOrderingConnector, kOrdering, &queue);
// Clear outputs
@@ -787,7 +787,7 @@ private:
return thisConnection(idx);
}
void changeAlias(ConnectorMethod method, Connection alias, unsigned long idx, bool notify, Queue *queue = NULL)
void changeAlias(ConnectorMethod method, Connection alias, unsigned long idx, bool notify, Queue *queue = nullptr)
{
Connector& connector = (this->*method)(idx);
@@ -835,7 +835,7 @@ private:
FrameLib_Object *traverseOrderingAliases() const { return traverseAliases(&FrameLib_Object::getOrderingConnector, kOrdering).mObject; }
void changeOrderingAlias(T *alias, bool notify, Queue *queue = NULL)
void changeOrderingAlias(T *alias, bool notify, Queue *queue = nullptr)
{
changeAlias(&FrameLib_Object::getOrderingConnector, Connection(alias, kOrdering), kOrdering, notify, queue);
}
+5 -5
View File
@@ -37,7 +37,7 @@ const double *FrameLib_Parameters::Serial::Iterator::getVector(unsigned long *si
}
*size = 0;
return NULL;
return nullptr;
}
unsigned long FrameLib_Parameters::Serial::Iterator::getVectorSize() const
@@ -53,7 +53,7 @@ char *FrameLib_Parameters::Serial::Iterator::getString() const
{
Entry entry = getEntry();
return entry.mType == kSingleString ? entry.data<char>() : NULL;
return entry.mType == kSingleString ? entry.data<char>() : nullptr;
}
// Get Size
@@ -159,7 +159,7 @@ FrameLib_Parameters::Serial::Serial(BytePointer ptr, size_t size) : mPtr(ptr), m
alignmentChecks();
}
FrameLib_Parameters::Serial::Serial() : mPtr(NULL), mSize(0), mMaxSize(0), mNumTags(0)
FrameLib_Parameters::Serial::Serial() : mPtr(nullptr), mSize(0), mMaxSize(0), mNumTags(0)
{
alignmentChecks();
}
@@ -507,7 +507,7 @@ void FrameLib_Parameters::Parameter::getRange(double *min, double *max) const
const char *FrameLib_Parameters::Parameter::getItemString(unsigned long item) const
{
assert(0 && "cannot get enum string for non-enum parameter");
return NULL;
return nullptr;
}
const double *FrameLib_Parameters::Parameter::getArray(size_t *size) const
@@ -616,7 +616,7 @@ FrameLib_Parameters::SetError FrameLib_Parameters::String::set(const char *str)
{
size_t i = 0;
if (str != NULL)
if (str != nullptr)
{
for (i = 0; i < maxLen; i++)
if ((mCString[i] = str[i]) == 0)
+5 -5
View File
@@ -118,7 +118,7 @@ public:
// Size Calculations
static size_t calcSize(const Serial *serialised) { return serialised != NULL ? serialised->mSize : 0; }
static size_t calcSize(const Serial *serialised) { return serialised != nullptr ? serialised->mSize : 0; }
static size_t calcSize(const FrameLib_Parameters *params);
static size_t calcSize(const char *tag, const char *str) { return sizeType() + sizeString(tag) + sizeString(str); }
static size_t calcSize(const char *tag, size_t N) { return sizeType() + sizeString(tag) + sizeArray(N); }
@@ -311,10 +311,10 @@ private:
double getDefault() const { return mDefault; }
virtual double getValue() const { return 0; }
virtual const char *getString() const { return NULL; }
virtual const char *getString() const { return nullptr; }
virtual size_t getArraySize() const { return 0; }
virtual size_t getArrayMaxSize() const { return 0; }
virtual const double *getArray() const { return NULL; }
virtual const double *getArray() const { return nullptr; }
const double *getArray(size_t *size) const;
bool changed();
@@ -415,7 +415,7 @@ private:
virtual SetError set(const char *str);
virtual void clear() { String::set(NULL); };
virtual void clear() { String::set(nullptr); };
// Getters
@@ -444,7 +444,7 @@ private:
virtual SetError set(double *values, size_t N);
virtual void clear() { Array::set(NULL, 0); };
virtual void clear() { Array::set(nullptr, 0); };
// Getters
@@ -26,7 +26,7 @@ void FrameLib_ProcessingQueue::add(FrameLib_DSP *object)
object = mTop;
object->dependenciesReady();
mTop = object->mNext;
object->mNext = NULL;
object->mNext = nullptr;
// Every so often check whether we're taking too long
@@ -43,14 +43,14 @@ void FrameLib_ProcessingQueue::add(FrameLib_DSP *object)
mErrorReporter.reportError(kErrorDSP, mTop->getProxy(), "FrameLib - DSP time out - FrameLib is disabled in this context until this is resolved");
object = mTop;
mTop = object->mNext;
object->mNext = NULL;
object->mNext = nullptr;
}
}
count = 0;
}
}
mTail = NULL;
mTail = nullptr;
}
else
{
@@ -37,7 +37,7 @@ class FrameLib_ProcessingQueue
public:
FrameLib_ProcessingQueue(FrameLib_ErrorReporter& errorReporter) : mTop(NULL), mTail(NULL), mTimedOut(false), mErrorReporter(errorReporter) {}
FrameLib_ProcessingQueue(FrameLib_ErrorReporter& errorReporter) : mTop(nullptr), mTail(nullptr), mTimedOut(false), mErrorReporter(errorReporter) {}
void add(FrameLib_DSP *object);
void reset() { mTimedOut = false; }
+7 -7
View File
@@ -58,7 +58,7 @@ void Thread::join()
// Wait for thread to join before we allow the program to continue
pthread_join(mInternal, NULL);
pthread_join(mInternal, nullptr);
}
}
@@ -66,7 +66,7 @@ void *Thread::threadStart(void *arg)
{
static_cast<Thread *>(arg)->call();
return NULL;
return nullptr;
}
// Semaphore Linux OS implementation
@@ -170,7 +170,7 @@ void Thread::join()
// Wait for thread to join before we allow the program to continue
pthread_join(mInternal, NULL);
pthread_join(mInternal, nullptr);
}
}
@@ -178,7 +178,7 @@ void *Thread::threadStart(void *arg)
{
static_cast<Thread *>(arg)->call();
return NULL;
return nullptr;
}
// Semaphore Mac OS implementation
@@ -237,7 +237,7 @@ void start()
// Create thread
mInternal = CreateThread(NULL, 0, threadStart, this, 0, NULL);
mInternal = CreateThread(nullptr, 0, threadStart, this, 0, nullptr);
// Set priority
@@ -275,7 +275,7 @@ DWORD WINAPI Thread::threadStart(LPVOID arg)
Semaphore::Semaphore(long maxCount) : mValid(true)
{
mInternal = CreateSemaphore(NULL, 0, maxCount, NULL);
mInternal = CreateSemaphore(nullptr, 0, maxCount, nullptr);
}
Semaphore::~Semaphore()
@@ -303,7 +303,7 @@ void Semaphore::signal(long n)
// N.B. - signalling is unsafe after the semaphore has been closed
MemoryBarrier();
ReleaseSemaphore(mInternal, n, NULL);
ReleaseSemaphore(mInternal, n, nullptr);
}
bool Semaphore::wait()
+4 -4
View File
@@ -139,11 +139,11 @@ template <class T> class AtomicPtr
public:
AtomicPtr() { mValue = NULL; }
AtomicPtr() { mValue = nullptr; }
bool compareAndSwap(T *comparand, T *exchange) { return OS_Specific::compareAndSwapPtr(&mValue, comparand, exchange); }
T *swap(T *exchange) { return (T *) OS_Specific::swapPtr(&mValue, exchange); }
T *clear() { return swap(NULL); }
T *clear() { return swap(nullptr); }
private:
@@ -195,7 +195,7 @@ public:
{
if (mLock)
mLock->release();
mLock = NULL;
mLock = nullptr;
}
private:
@@ -221,7 +221,7 @@ public:
enum PriorityLevel {kLowPriority, kMediumPriority, kHighPriority, kAudioPriority};
Thread(PriorityLevel priority, ThreadFunctionType *threadFunction, void *arg)
: mInternal(NULL), mPriority(priority), mThreadFunction(threadFunction), mArg(arg), mValid(false)
: mInternal(nullptr), mPriority(priority), mThreadFunction(threadFunction), mArg(arg), mValid(false)
{}
~Thread();
-4
View File
@@ -33,8 +33,4 @@ struct FrameLib_Proxy
virtual ~FrameLib_Proxy() {}
};
#ifdef __linux__
#define NULL 0
#endif
#endif
+1 -1
View File
@@ -53,7 +53,7 @@ bool FrameLib_MaxClass_Read::ReadProxy::sInit = false;
// Proxy Constructor
FrameLib_MaxClass_Read::ReadProxy::ReadProxy() : mBuffer(NULL)
FrameLib_MaxClass_Read::ReadProxy::ReadProxy() : mBuffer(nullptr)
{
if (!sInit)
{
+30 -30
View File
@@ -35,7 +35,7 @@ public:
enum Mode { kDownOnly, kDown, kAcross };
enum Action { kSyncComplete, kSync, kAttachAndSync };
SyncCheck() : mGlobal(get()), mObject(NULL), mTime(-1), mMode(kDownOnly) {}
SyncCheck() : mGlobal(get()), mObject(nullptr), mTime(-1), mMode(kDownOnly) {}
~SyncCheck() { mGlobal->release(); }
Action operator()(void *object, bool handlesAudio, bool isOutput)
@@ -57,10 +57,10 @@ public:
return kSyncComplete;
}
void sync(void *object = NULL, long time = -1, Mode mode = kDownOnly)
void sync(void *object = nullptr, long time = -1, Mode mode = kDownOnly)
{
set(object, time, mode);
mGlobal->setSyncCheck(object ? this : NULL);
mGlobal->setSyncCheck(object ? this : nullptr);
}
bool upwardsMode() { return setMode(mGlobal->getSyncCheck(), kAcross); }
@@ -119,18 +119,18 @@ public:
// Constructor and Destructor (public for the max API, but use the ManagedPointer for use from outside this class)
FrameLib_MaxGlobals(t_symbol *sym, long ac, t_atom *av)
: mGlobal(NULL), mConnectionInfo(NULL), mSyncCheck(NULL), mCount(0) { FrameLib_Global::get(&mGlobal); }
: mGlobal(nullptr), mConnectionInfo(nullptr), mSyncCheck(nullptr), mCount(0) { FrameLib_Global::get(&mGlobal); }
~FrameLib_MaxGlobals() { FrameLib_Global::release(&mGlobal); }
// Getters and setters for max global items
FrameLib_Global *getGlobal() const { return mGlobal; }
FrameLib_Global *getGlobal() const { return mGlobal; }
const ConnectionInfo *getConnectionInfo() const { return mConnectionInfo; }
void setConnectionInfo(ConnectionInfo *info = NULL) { mConnectionInfo = info; }
const ConnectionInfo *getConnectionInfo() const { return mConnectionInfo; }
void setConnectionInfo(ConnectionInfo *info = nullptr) { mConnectionInfo = info; }
SyncCheck *getSyncCheck() const { return mSyncCheck; }
void setSyncCheck(SyncCheck *check = NULL) { mSyncCheck = check; }
SyncCheck *getSyncCheck() const { return mSyncCheck; }
void setSyncCheck(SyncCheck *check = nullptr) { mSyncCheck = check; }
private:
@@ -152,7 +152,7 @@ private:
FrameLib_MaxGlobals *x = (FrameLib_MaxGlobals *) object_findregistered(nameSpace, globalTag);
if (!x)
x = (FrameLib_MaxGlobals *) object_register(nameSpace, globalTag, object_new_typed(CLASS_NOBOX, gensym(maxGlobalClass), 0, NULL));
x = (FrameLib_MaxGlobals *) object_register(nameSpace, globalTag, object_new_typed(CLASS_NOBOX, gensym(maxGlobalClass), 0, nullptr));
x->mCount++;
@@ -187,7 +187,7 @@ public:
Mutator(t_symbol *sym, long ac, t_atom *av)
{
mObject = ac ? atom_getobj(av) : NULL;
mObject = ac ? atom_getobj(av) : nullptr;
mMode = object_method(mObject, gensym("__fl.is_output")) ? FrameLib_MaxGlobals::SyncCheck::kDownOnly : FrameLib_MaxGlobals::SyncCheck::kDown;
}
@@ -263,7 +263,7 @@ public:
t_dictionary *d = dictionary_new();
t_atom a;
t_atom *av = NULL;
t_atom *av = nullptr;
long ac = 0;
atom_setparse(&ac, &av, "@defrect 0 0 300 300");
@@ -273,8 +273,8 @@ public:
// Get box text (and strip object name from the top - relace with stored name in case the object name is an alias)
t_object *textfield = NULL;
const char *text = NULL;
t_object *textfield = nullptr;
const char *text = nullptr;
std::string newObjectText = accessClassName<Wrapper>()->c_str();
object_obex_lookup(this, gensym("#B"), &textfield);
@@ -328,14 +328,14 @@ public:
for (long i = numIns + numAudioIns - 2; i >= 0 ; i--)
{
mInOutlets[i] = (t_object *) outlet_new(NULL, NULL);
mProxyIns[i] = (t_object *) (i ? proxy_new(this, i, &mProxyNum) : NULL);
mInOutlets[i] = (t_object *) outlet_new(nullptr, nullptr);
mProxyIns[i] = (t_object *) (i ? proxy_new(this, i, &mProxyNum) : nullptr);
}
// Outlets for messages/signals
for (long i = numOuts - 1; i >= 0 ; i--)
mOuts[i] = (t_object *) outlet_new(this, NULL);
mOuts[i] = (t_object *) outlet_new(this, nullptr);
for (long i = numAudioOuts - 2; i >= 0 ; i--)
mAudioOuts[i] = (t_object *) outlet_new(this, "signal");
@@ -379,7 +379,7 @@ public:
void *subpatcher(long index, void *arg)
{
return (((t_ptr_uint) arg <= 1) || ((t_ptr_uint) arg > 1 && !NOGOOD(arg))) && index == 0 ? (void *) mPatch : NULL;
return (((t_ptr_uint) arg <= 1) || ((t_ptr_uint) arg > 1 && !NOGOOD(arg))) && index == 0 ? (void *) mPatch : nullptr;
}
void assist(void *b, long m, long a, char *s)
@@ -535,7 +535,7 @@ public:
{
bool traverse = true;
for (t_object *parent = NULL; traverse && (parent = jpatcher_get_parentpatcher(patch)); patch = parent)
for (t_object *parent = nullptr; traverse && (parent = jpatcher_get_parentpatcher(patch)); patch = parent)
{
t_object *assoc = 0;
object_method(patch, gensym("getassoc"), &assoc);
@@ -548,7 +548,7 @@ public:
{
// Get text of loading object in parent if there is no association (patch is currently loading)
char *text = NULL;
char *text = nullptr;
for (t_object *b = jpatcher_get_firstobject(parent); b && !text; b = jbox_get_nextobject(b))
if (jbox_get_maxclass(b) == gensym("newobj") && jbox_get_textfield(b))
@@ -558,7 +558,7 @@ public:
{
// Get the first item in the box as a symbol
t_atombuf *atomBuffer = (t_atombuf *) atombuf_new(0, NULL);
t_atombuf *atomBuffer = (t_atombuf *) atombuf_new(0, nullptr);
atombuf_text(&atomBuffer, &text, strlen(text));
t_symbol *objectName = atom_getsym(atomBuffer->a_argv);
atombuf_free(atomBuffer);
@@ -599,7 +599,7 @@ public:
// Constructor and Destructor
FrameLib_MaxClass(t_symbol *s, long argc, t_atom *argv, FrameLib_MaxProxy *proxy = new FrameLib_MaxProxy()) : mFrameLibProxy(proxy), mConfirmObject(NULL), mConfirmInIndex(-1), mConfirmOutIndex(-1), mConfirm(false), mPatch(gensym("#P")->s_thing), mContextPatch(contextPatcher(mPatch)), mSyncIn(NULL), mUserObject(detectUserObjectAtLoad()), mNeedsResolve(true)
FrameLib_MaxClass(t_symbol *s, long argc, t_atom *argv, FrameLib_MaxProxy *proxy = new FrameLib_MaxProxy()) : mFrameLibProxy(proxy), mConfirmObject(nullptr), mConfirmInIndex(-1), mConfirmOutIndex(-1), mConfirm(false), mPatch(gensym("#P")->s_thing), mContextPatch(contextPatcher(mPatch)), mSyncIn(nullptr), mUserObject(detectUserObjectAtLoad()), mNeedsResolve(true)
{
// Object creation with parameters and arguments (N.B. the object is not a member due to size restrictions)
@@ -628,10 +628,10 @@ public:
// N.B. - we create a proxy if the inlet is not the first inlet (not the first frame input or the object handles audio)
for (long i = numIns - 1; i >= 0; i--)
mInputs[i] = (t_object *) ((i || T::handlesAudio()) ? proxy_new(this, getNumAudioIns() + i, &mProxyNum) : NULL);
mInputs[i] = (t_object *) ((i || T::handlesAudio()) ? proxy_new(this, getNumAudioIns() + i, &mProxyNum) : nullptr);
for (unsigned long i = getNumOuts(); i > 0; i--)
mOutputs[i - 1] = outlet_new(this, NULL);
mOutputs[i - 1] = outlet_new(this, nullptr);
// Setup for audio, even if the object doesn't handle it, so that dsp recompile works correctly
@@ -644,7 +644,7 @@ public:
if (T::handlesAudio())
{
mSyncIn = (t_object *) outlet_new(NULL, NULL);
mSyncIn = (t_object *) outlet_new(nullptr, nullptr);
outlet_add(mSyncIn, inlet_nth(*this, 0));
}
}
@@ -885,12 +885,12 @@ public:
resolveGraph(false);
if (action == FrameLib_MaxGlobals::SyncCheck::kAttachAndSync)
outlet_anything(mSyncIn, gensym("signal"), 0, NULL);
outlet_anything(mSyncIn, gensym("signal"), 0, nullptr);
if (action != FrameLib_MaxGlobals::SyncCheck::kSyncComplete)
{
for (unsigned long i = getNumOuts(); i > 0; i--)
outlet_anything(mOutputs[i - 1], gensym("sync"), 0, NULL);
outlet_anything(mOutputs[i - 1], gensym("sync"), 0, nullptr);
if (mSyncChecker.upwardsMode())
{
@@ -1090,7 +1090,7 @@ private:
ConnectionInfo info(*this, index, mode);
mGlobal->setConnectionInfo(&info);
outlet_anything(mOutputs[index], gensym("frame"), 0, NULL);
outlet_anything(mOutputs[index], gensym("frame"), 0, nullptr);
mGlobal->setConnectionInfo();
}
@@ -1122,7 +1122,7 @@ private:
bool result = mConfirm;
mConfirm = false;
mConfirmObject = NULL;
mConfirmObject = nullptr;
mConfirmInIndex = mConfirmOutIndex = -1;
return result;
@@ -1362,7 +1362,7 @@ private:
void parseParameters(FrameLib_Parameters::AutoSerial& serialisedParameters, long argc, t_atom *argv)
{
t_symbol *sym = NULL;
t_symbol *sym = nullptr;
std::vector<double> values;
long i;
+1 -1
View File
@@ -62,7 +62,7 @@ public:
template <class T> struct Perform { typedef void (T::*MethodPerform)(t_object *dsp64, double **ins, long numins, double **outs, long numouts, long vec_size, long flags, void *userparam); };
template <class T, typename Perform<T>::MethodPerform F> static void call(T *x, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long vec_size, long flags, void *userparam) { ((x)->*F)(dsp64, ins, numins, outs, numouts, vec_size, flags, userparam); }
template <class T, typename Perform<T>::MethodPerform F> void addPerform(t_object *dsp64) { object_method(dsp64, gensym("dsp_add64"), this, ((method) call<T, F>), 0, NULL); }
template <class T, typename Perform<T>::MethodPerform F> void addPerform(t_object *dsp64) { object_method(dsp64, gensym("dsp_add64"), this, ((method) call<T, F>), 0, nullptr); }
// Static Methods for class initialisation, object creation and deletion
@@ -55,12 +55,12 @@ void FrameLib_MaxClass_ToMax::ToHostProxy::sendToHost(unsigned long index, unsig
for (unsigned long i = 0; i < N; i++)
atom_setfloat(output + i, values[i]);
schedule_delay(mObject, (method) &FrameLib_MaxClass_ToMax::toOutletExternal, 0.0, NULL, N, output);
schedule_delay(mObject, (method) &FrameLib_MaxClass_ToMax::toOutletExternal, 0.0, nullptr, N, output);
dealloc(output);
}
else
schedule_delay(mObject, (method) &FrameLib_MaxClass_ToMax::toOutletExternal, 0.0, NULL, 0, NULL);
schedule_delay(mObject, (method) &FrameLib_MaxClass_ToMax::toOutletExternal, 0.0, nullptr, 0, nullptr);
}
void FrameLib_MaxClass_ToMax::ToHostProxy::sendToHost(unsigned long index, unsigned long stream, const FrameLib_Parameters::Serial *serial)
@@ -131,7 +131,7 @@ void FrameLib_MaxClass_ToMax::toOutlet(t_symbol *s, short ac, t_atom *av)
else if (s)
outlet_anything(mOutlet, s, ac, av);
else
outlet_list(mOutlet, NULL, ac, av);
outlet_list(mOutlet, nullptr, ac, av);
}
// Main
+1 -1
View File
@@ -79,7 +79,7 @@ FrameLib_Read::ParameterInfo::ParameterInfo()
void FrameLib_Read::process()
{
double *positions = NULL;
double *positions = nullptr;
unsigned long size;
long chan = mChan;
@@ -134,7 +134,7 @@ void FrameLib_RandGen::randSeedCMWC()
for (uint32_t i = 0; i < CMWC_LAG_SIZE; i++)
seeds[i] = arc4random();
#elif defined (__linux__)
srandom(time(NULL));
srandom(time(nullptr));
for (uint32_t i = 0; i < CMWC_LAG_SIZE; i++)
seeds[i] = random();
#else
@@ -11,7 +11,7 @@ public:
// Constructor
FrameLib_VectorSet(FrameLib_Context context) : mFrames(NULL), mNumFrames(0), mFrameLength(0), mAllocator(context)
FrameLib_VectorSet(FrameLib_Context context) : mFrames(nullptr), mNumFrames(0), mFrameLength(0), mAllocator(context)
{}
~FrameLib_VectorSet()
@@ -51,7 +51,7 @@ private:
void deallocVector(double *& ptr)
{
mAllocator->dealloc(ptr);
ptr = NULL;
ptr = nullptr;
}
double *mFrames;
@@ -17,7 +17,7 @@ template <typename Op> class FrameLib_Complex_BinaryOp : public FrameLib_Process
public:
PaddedInput(FrameLib_Complex_BinaryOp *owner, const double *input, unsigned long size, unsigned long paddedSize)
: mOwner(owner), mAllocated(NULL)
: mOwner(owner), mAllocated(nullptr)
{
if (paddedSize > size)
{
@@ -16,7 +16,7 @@ public:
// Constructor
FrameLib_Complex_UnaryOp(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 2, 2) {}
FrameLib_Complex_UnaryOp(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 2, 2) {}
// Info
@@ -48,7 +48,7 @@ struct UnaryOperation : public OpBase<std::complex<double> >
FrameLib_DSP *create(FrameLib_Context context) const
{
return new FrameLib_Complex_UnaryOp<Op>(context, NULL, NULL);
return new FrameLib_Complex_UnaryOp<Op>(context, nullptr, nullptr);
}
};
@@ -66,7 +66,7 @@ struct BinaryOperation : public OpBase<std::complex<double> >
{
FrameLib_Parameters::AutoSerial serialiedParameters;
serialiedParameters.write("mismatch", "wrap");
return new FrameLib_Complex_BinaryOp<Op>(context, &serialiedParameters, NULL);
return new FrameLib_Complex_BinaryOp<Op>(context, &serialiedParameters, nullptr);
}
};
@@ -127,7 +127,7 @@ FrameLib_ComplexExpression::Parser::Parser() : FrameLib_ExprParser(3)
// Constructor
FrameLib_ComplexExpression::InputProcessor::InputProcessor(FrameLib_Context context, MismatchModes mode, const double *triggers, size_t triggersSize, unsigned long numIns)
: FrameLib_Processor(context, NULL, NULL, numIns * 2, numIns * 2), mMode(mode)
: FrameLib_Processor(context, nullptr, nullptr, numIns * 2, numIns * 2), mMode(mode)
{
for (size_t i = 0; i < numIns; i++)
{
@@ -238,7 +238,7 @@ void FrameLib_ComplexExpression::InputProcessor::process()
// Constructor
FrameLib_ComplexExpression::ConstantOut::ConstantOut(FrameLib_Context context, MismatchModes mode, const double *triggers, size_t triggersSize, unsigned long numIns, std::complex<double> value) : FrameLib_Processor(context, NULL, NULL, numIns * 2, 2), mMode(mode), mValue(value)
FrameLib_ComplexExpression::ConstantOut::ConstantOut(FrameLib_Context context, MismatchModes mode, const double *triggers, size_t triggersSize, unsigned long numIns, std::complex<double> value) : FrameLib_Processor(context, nullptr, nullptr, numIns * 2, 2), mMode(mode), mValue(value)
{
for (size_t i = 0; i < numIns; i++)
{
@@ -283,7 +283,7 @@ void FrameLib_ComplexExpression::ConstantOut::process()
// Constructor
FrameLib_ComplexExpression::FrameLib_ComplexExpression(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Block(kProcessor, context, proxy), mInputProcessor(NULL), mParameters(context, proxy, &sParamInfo)
FrameLib_ComplexExpression::FrameLib_ComplexExpression(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Block(kProcessor, context, proxy), mInputProcessor(nullptr), mParameters(context, proxy, &sParamInfo)
{
typedef Graph<std::complex<double> > Graph;
typedef FrameLib_Block::Connection Connection;
@@ -181,7 +181,7 @@ class FrameLib_ExprParser
for (auto it = mItems.begin(); it != mItems.end(); it++)
{
delete (*it);
*it = NULL;
*it = nullptr;
}
mItems.clear();
@@ -198,7 +198,7 @@ class FrameLib_ExprParser
if (!strcmp(name, (*it)->mName))
return (*it);
return NULL;
return nullptr;
}
private:
@@ -459,7 +459,7 @@ private:
const OpBase<T> *getOperator(const char *name) const
{
const OpBase<T> *op = NULL;
const OpBase<T> *op = nullptr;
for (int i = 0; i < mOperators.size(); i++)
if ((op = getOperator(name, i)))
@@ -541,7 +541,7 @@ private:
ExprParseError parseOperators(Graph<T>& graph, Node &result, NodeList& nodes)
{
const OpBase<T> *op = NULL;
const OpBase<T> *op = nullptr;
ExprParseError error = kNoError;
// Check for any remaining tokens that are not operators
@@ -588,7 +588,7 @@ private:
for (n2 = nodes.begin(); ; )
{
const OpBase<T> *function = NULL;
const OpBase<T> *function = nullptr;
// Find first RHS parenthesis and matching LHS parenthesis
@@ -20,7 +20,7 @@ struct UnaryOperation : public OpBase<double>
FrameLib_DSP *create(FrameLib_Context context) const
{
return new FrameLib_UnaryOp<Op>(context, NULL, NULL);
return new FrameLib_UnaryOp<Op>(context, nullptr, nullptr);
}
};
@@ -36,7 +36,7 @@ struct BinaryOperation : public OpBase<double>
{
FrameLib_Parameters::AutoSerial serialiedParameters;
serialiedParameters.write("mismatch", "wrap");
return new FrameLib_BinaryOp<Op>(context, &serialiedParameters, NULL);
return new FrameLib_BinaryOp<Op>(context, &serialiedParameters, nullptr);
}
};
@@ -52,7 +52,7 @@ struct TernaryOperation : public OpBase<double>
{
FrameLib_Parameters::AutoSerial serialiedParameters;
serialiedParameters.write("mismatch", "extend");
return new FrameLib_TernaryOp<Op>(context, &serialiedParameters, NULL);
return new FrameLib_TernaryOp<Op>(context, &serialiedParameters, nullptr);
}
};
@@ -142,7 +142,7 @@ FrameLib_Expression::Parser::Parser() : FrameLib_ExprParser(7)
// Constructor
FrameLib_Expression::InputProcessor::InputProcessor(FrameLib_Context context, MismatchModes mode, const double *triggers, size_t triggersSize, unsigned long numIns) : FrameLib_Processor(context, NULL, NULL, numIns, numIns), mMode(mode)
FrameLib_Expression::InputProcessor::InputProcessor(FrameLib_Context context, MismatchModes mode, const double *triggers, size_t triggersSize, unsigned long numIns) : FrameLib_Processor(context, nullptr, nullptr, numIns, numIns), mMode(mode)
{
for (size_t i = 0; i < numIns; i++)
setInputMode(i, false, (i < triggersSize) && triggers[i], false);
@@ -201,7 +201,7 @@ void FrameLib_Expression::InputProcessor::process()
// Constructor
FrameLib_Expression::ConstantOut::ConstantOut(FrameLib_Context context, MismatchModes mode, const double *triggers, size_t triggersSize, unsigned long numIns, double value) : FrameLib_Processor(context, NULL, NULL, numIns, 1), mMode(mode), mValue(value)
FrameLib_Expression::ConstantOut::ConstantOut(FrameLib_Context context, MismatchModes mode, const double *triggers, size_t triggersSize, unsigned long numIns, double value) : FrameLib_Processor(context, nullptr, nullptr, numIns, 1), mMode(mode), mValue(value)
{
for (size_t i = 0; i < numIns; i++)
setInputMode(i, false, (i < triggersSize) && triggers[i], false);
@@ -233,7 +233,7 @@ void FrameLib_Expression::ConstantOut::process()
// Constructor
FrameLib_Expression::FrameLib_Expression(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Block(kProcessor, context, proxy), mInputProcessor(NULL), mParameters(context, proxy, &sParamInfo)
FrameLib_Expression::FrameLib_Expression(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Block(kProcessor, context, proxy), mInputProcessor(nullptr), mParameters(context, proxy, &sParamInfo)
{
typedef Graph<double> Graph;
typedef FrameLib_Block::Connection Connection;
@@ -88,7 +88,7 @@ void FrameLib_FromHost::Proxy::sendFromHost(unsigned long index, unsigned long s
// Constructor
FrameLib_FromHost::FrameLib_FromHost(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, &sParamInfo, 1, 1), mVectorFrame(NULL), mProxy(dynamic_cast<Proxy *>(proxy)), mStreamOwner(this), mStream(0)
FrameLib_FromHost::FrameLib_FromHost(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, &sParamInfo, 1, 1), mVectorFrame(nullptr), mProxy(dynamic_cast<Proxy *>(proxy)), mStreamOwner(this), mStream(0)
{
mParameters.addEnum(kMode, "mode", 0);
mParameters.addEnumItem(kValues, "values");
@@ -169,7 +169,7 @@ void FrameLib_FromHost::process()
allocateOutputs();
double *output = getOutput(0, &size);
copyVector(output, mVectorFrame ? mVectorFrame->data() : NULL, size);
copyVector(output, mVectorFrame ? mVectorFrame->data() : nullptr, size);
}
else
{
@@ -11,13 +11,13 @@ class FrameLib_FromHost : public FrameLib_Processor
struct SerialList
{
SerialList() : mTop(NULL), mTail(NULL) {}
SerialList() : mTop(nullptr), mTail(nullptr) {}
~SerialList() { clear(); }
struct Item
{
Item() : mNext(NULL) {}
Item(const FrameLib_Parameters::Serial& serial) : mSerial(serial), mNext(NULL) {}
Item() : mNext(nullptr) {}
Item(const FrameLib_Parameters::Serial& serial) : mSerial(serial), mNext(nullptr) {}
FrameLib_Parameters::AutoSerial mSerial;
Item *mNext;
@@ -25,7 +25,7 @@ class FrameLib_FromHost : public FrameLib_Processor
void push(Item *item)
{
assert (item->mNext == NULL && "item already in a list");
assert (item->mNext == nullptr && "item already in a list");
if (mTail)
{
@@ -40,11 +40,11 @@ class FrameLib_FromHost : public FrameLib_Processor
{
Item *item = mTop;
mTop = mTop ? mTop->mNext : NULL;
mTail = (mTail == item) ? NULL : mTail;
mTop = mTop ? mTop->mNext : nullptr;
mTail = (mTail == item) ? nullptr : mTail;
if (item)
item->mNext = NULL;
item->mNext = nullptr;
return item;
}
@@ -74,8 +74,8 @@ class FrameLib_FromHost : public FrameLib_Processor
if (list.mTail)
mTail = list.mTail;
list.mTop = NULL;
list.mTail = NULL;
list.mTop = nullptr;
list.mTail = nullptr;
}
private:
@@ -29,7 +29,7 @@ class FrameLib_HostProxy : public virtual FrameLib_Proxy
if (it->mObjects.size() <= stream)
it->mObjects.resize(stream + 1);
else
assert ((it->mObjects[stream] == NULL) && "stream is already registered");
assert ((it->mObjects[stream] == nullptr) && "stream is already registered");
it->mObjects[stream] = object;
@@ -55,11 +55,11 @@ class FrameLib_HostProxy : public virtual FrameLib_Proxy
{
assert(it->mObjects[stream] == object && "object not registered to expected stream");
it->mObjects[stream] = NULL;
it->mObjects[stream] = nullptr;
if (it->mObjects.size() == stream + 1)
{
while (stream && it->mObjects[stream] == NULL)
while (stream && it->mObjects[stream] == nullptr)
stream--;
if (stream)
@@ -5,7 +5,7 @@
// Constructor
FrameLib_ToHost::FrameLib_ToHost(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 1, 0), mProxy(dynamic_cast<Proxy *>(proxy)), mStreamOwner(this), mStream(0), mID(0)
FrameLib_ToHost::FrameLib_ToHost(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 1, 0), mProxy(dynamic_cast<Proxy *>(proxy)), mStreamOwner(this), mStream(0), mID(0)
{
mParameters.set(serialisedParameters);
@@ -16,7 +16,7 @@ public:
{
friend FrameLib_ToHost;
Proxy() : mObject(NULL) {}
Proxy() : mObject(nullptr) {}
virtual void sendToHost(unsigned long index, unsigned long stream, const double *values, unsigned long N) = 0;
virtual void sendToHost(unsigned long index, unsigned long stream, const FrameLib_Parameters::Serial *serial)= 0;
+2 -2
View File
@@ -1,7 +1,7 @@
#include "FrameLib_Lookup.h"
FrameLib_Lookup::FrameLib_Lookup(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 2, 1)
FrameLib_Lookup::FrameLib_Lookup(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 2, 1)
{
// FIX - loads of different mode options here (mapping of positions + padding values
@@ -84,7 +84,7 @@ void FrameLib_Lookup::process()
double *output = getOutput(0, &sizeOut);
const double *positions = input1;
double *temp = NULL;
double *temp = nullptr;
double scaleFactor;
Scaling scaling = (Scaling) mParameters.getInt(kScaling);
@@ -4,7 +4,7 @@
// Constructor
FrameLib_GetParam::FrameLib_GetParam(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) :
FrameLib_Processor(context, proxy, NULL, 2, 1), mConnectedObject(NULL)
FrameLib_Processor(context, proxy, nullptr, 2, 1), mConnectedObject(nullptr)
{
// Setup IO
@@ -5,7 +5,7 @@
// Constructor
FrameLib_Dispatch::Select::Select(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy, long numIns, long num) : FrameLib_Processor(context, proxy, NULL, numIns, 1), mNumIns(numIns)
FrameLib_Dispatch::Select::Select(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy, long numIns, long num) : FrameLib_Processor(context, proxy, nullptr, numIns, 1), mNumIns(numIns)
{
char name[32];
sprintf(name, "input_%2ld", num + 1);
+1 -1
View File
@@ -5,7 +5,7 @@
// Constructor
FrameLib_Route::Valve::Valve(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy, long num) : FrameLib_Processor(context, proxy, NULL, 2, 1), mValveNumber(num)
FrameLib_Route::Valve::Valve(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy, long num) : FrameLib_Processor(context, proxy, nullptr, 2, 1), mValveNumber(num)
{
mParameters.addInt(kActiveValve, "output", 0);
@@ -4,7 +4,7 @@
// Constructor
FrameLib_AudioTrigger::FrameLib_AudioTrigger(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Scheduler(context, proxy, NULL, 0, 1, 1)
FrameLib_AudioTrigger::FrameLib_AudioTrigger(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Scheduler(context, proxy, nullptr, 0, 1, 1)
{
objectReset();
}
+1 -1
View File
@@ -12,7 +12,7 @@ public:
// Constructor
FrameLib_Once(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy)
: FrameLib_Scheduler(context, proxy, NULL, 1, 1) {}
: FrameLib_Scheduler(context, proxy, nullptr, 1, 1) {}
// Info
@@ -3,7 +3,7 @@
// Constructor
FrameLib_PerBlock::FrameLib_PerBlock(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Scheduler(context, proxy, NULL, 1, 1, 0) {}
FrameLib_PerBlock::FrameLib_PerBlock(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Scheduler(context, proxy, nullptr, 1, 1, 0) {}
// Info
+1 -1
View File
@@ -84,7 +84,7 @@ void FrameLib_FFT::process()
unsigned long sizeInR, sizeInI, sizeOut;
const double *inputR = getInput(0, &sizeInR);
const double *inputI = NULL;
const double *inputI = nullptr;
sizeInI = 0;
@@ -42,7 +42,7 @@ FrameLib_Window::FrameLib_Window(FrameLib_Context context, FrameLib_Parameters::
mParameters.set(serialisedParameters);
mWindow = NULL;
mWindow = nullptr;
mWindowType = kHann;
mSize = 0;
mSqrtWindow = false;
+1 -1
View File
@@ -113,7 +113,7 @@ void FrameLib_iFFT::process()
// Setup output and temporary memory
double *outputR = getOutput(0, &sizeOut);
double *outputI = NULL;
double *outputI = nullptr;
if (mMode == kComplex && sizeOut)
{
@@ -4,7 +4,7 @@
// Constructor
FrameLib_StreamID::FrameLib_StreamID(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy)
: FrameLib_Processor(context, proxy, NULL, 1, 1), mStream(1)
: FrameLib_Processor(context, proxy, nullptr, 1, 1), mStream(1)
{}
// Info
@@ -15,7 +15,7 @@ template <typename Op> class FrameLib_TernaryOp : public FrameLib_Processor
public:
EnlargedInput(FrameLib_TernaryOp *owner, const double *input, unsigned long size, unsigned long extendedSize, MismatchModes mode)
: mOwner(owner), mAllocated(NULL)
: mOwner(owner), mAllocated(nullptr)
{
if (extendedSize > size)
{
@@ -2,7 +2,7 @@
#include "FrameLib_EWMA.h"
#include "Interpolation.hpp"
FrameLib_EWMA::FrameLib_EWMA(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, &sParamInfo, 2, 1), mAverageFrame(NULL), mPrevFrame(NULL), mFrameSize(0)
FrameLib_EWMA::FrameLib_EWMA(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, &sParamInfo, 2, 1), mAverageFrame(nullptr), mPrevFrame(nullptr), mFrameSize(0)
{
mParameters.addInt(kAlphaUp, "alpha_up", 0.5, 0);
mParameters.setClip(0.0, 1.0);
@@ -2,7 +2,7 @@
#include "FrameLib_EWMSD.h"
#include "Interpolation.hpp"
FrameLib_EWMSD::FrameLib_EWMSD(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, &sParamInfo, 2, 1), mAverageFrame(NULL), mVarianceFrame(NULL), mPrevFrame(NULL), mFrameSize(0)
FrameLib_EWMSD::FrameLib_EWMSD(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, &sParamInfo, 2, 1), mAverageFrame(nullptr), mVarianceFrame(nullptr), mPrevFrame(nullptr), mFrameSize(0)
{
mParameters.addInt(kAlphaUp, "alpha_up", 0.5, 0);
mParameters.setClip(0.0, 1.0);
@@ -1,7 +1,7 @@
#include "FrameLib_FrameDelta.h"
FrameLib_FrameDelta::FrameLib_FrameDelta(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 1, 1), mLastFrame(NULL), mFrameSize(0)
FrameLib_FrameDelta::FrameLib_FrameDelta(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 1, 1), mLastFrame(nullptr), mFrameSize(0)
{}
// Info
@@ -1,7 +1,7 @@
#include "FrameLib_TimeMean.h"
FrameLib_TimeMean::FrameLib_TimeMean(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_TimeBuffer<FrameLib_TimeMean>(context, serialisedParameters, proxy), mSum(NULL), mCompensate(NULL)
FrameLib_TimeMean::FrameLib_TimeMean(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_TimeBuffer<FrameLib_TimeMean>(context, serialisedParameters, proxy), mSum(nullptr), mCompensate(nullptr)
{}
// Info
@@ -1,7 +1,7 @@
#include "FrameLib_TimeMedian.h"
FrameLib_TimeMedian::FrameLib_TimeMedian(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_TimeBuffer<FrameLib_TimeMedian>(context, serialisedParameters, proxy), mOrdered(NULL), mNumFrames(0)
FrameLib_TimeMedian::FrameLib_TimeMedian(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_TimeBuffer<FrameLib_TimeMedian>(context, serialisedParameters, proxy), mOrdered(nullptr), mNumFrames(0)
{}
// Info
@@ -1,7 +1,7 @@
#include "FrameLib_TimeStdDev.h"
FrameLib_TimeStdDev::FrameLib_TimeStdDev(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_TimeBuffer<FrameLib_TimeStdDev>(context, serialisedParameters, proxy), mSum(NULL), mCompensate(NULL), mSqSum(NULL), mSqCompensate(NULL)
FrameLib_TimeStdDev::FrameLib_TimeStdDev(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_TimeBuffer<FrameLib_TimeStdDev>(context, serialisedParameters, proxy), mSum(nullptr), mCompensate(nullptr), mSqSum(nullptr), mSqCompensate(nullptr)
{
}
@@ -15,7 +15,7 @@ public:
// Constructor
FrameLib_UnaryOp(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 1, 1) {}
FrameLib_UnaryOp(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 1, 1) {}
// Info
+1 -1
View File
@@ -1,7 +1,7 @@
#include "FrameLib_Peaks.h"
FrameLib_Peaks::FrameLib_Peaks(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 1, 3)
FrameLib_Peaks::FrameLib_Peaks(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 1, 3)
{
mParameters.set(serialisedParameters);
}
+1 -1
View File
@@ -4,7 +4,7 @@
// Constructor
FrameLib_Reverse::FrameLib_Reverse(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 1, 1)
FrameLib_Reverse::FrameLib_Reverse(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 1, 1)
{}
// Info
@@ -11,7 +11,7 @@ public:
// Constructor
FrameLib_Vector(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, NULL, 1, 1) {}
FrameLib_Vector(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy) : FrameLib_Processor(context, proxy, nullptr, 1, 1) {}
// Info
+28 -28
View File
@@ -38,7 +38,7 @@ public:
enum Mode { kDownOnly, kDown, kAcross };
enum Action { kSyncComplete, kSync, kAttachAndSync };
SyncCheck() : mGlobal(get()), mObject(NULL), mTime(-1), mMode(kDownOnly) {}
SyncCheck() : mGlobal(get()), mObject(nullptr), mTime(-1), mMode(kDownOnly) {}
~SyncCheck() { mGlobal->release(); }
Action operator()(void *object, bool handlesAudio, bool isOutput)
@@ -60,10 +60,10 @@ public:
return kSyncComplete;
}
void sync(void *object = NULL, long time = -1, Mode mode = kDownOnly)
void sync(void *object = nullptr, long time = -1, Mode mode = kDownOnly)
{
set(object, time, mode);
mGlobal->setSyncCheck(object ? this : NULL);
mGlobal->setSyncCheck(object ? this : nullptr);
}
bool upwardsMode() { return setMode(mGlobal->getSyncCheck(), kAcross); }
@@ -122,23 +122,23 @@ public:
// Constructor and Destructor (public for the PD API, but use the ManagedPointer for use from outside this class)
FrameLib_PDGlobals(t_symbol *sym, long ac, t_atom *av)
: mGlobal(NULL), mConnectionInfo(NULL), mSyncCheck(NULL) {}
: mGlobal(nullptr), mConnectionInfo(nullptr), mSyncCheck(nullptr) {}
~FrameLib_PDGlobals() { if (mGlobal) FrameLib_Global::release(&mGlobal); }
// Getters and setters for max global items
FrameLib_Global *getGlobal() const { return mGlobal; }
FrameLib_Global *getGlobal() const { return mGlobal; }
const ConnectionInfo *getConnectionInfo() const { return mConnectionInfo; }
void setConnectionInfo(ConnectionInfo *info = NULL) { mConnectionInfo = info; }
const ConnectionInfo *getConnectionInfo() const { return mConnectionInfo; }
void setConnectionInfo(ConnectionInfo *info = nullptr) { mConnectionInfo = info; }
SyncCheck *getSyncCheck() const { return mSyncCheck; }
void setSyncCheck(SyncCheck *check = NULL) { mSyncCheck = check; }
SyncCheck *getSyncCheck() const { return mSyncCheck; }
void setSyncCheck(SyncCheck *check = nullptr) { mSyncCheck = check; }
private:
void retain() { FrameLib_Global::get(&mGlobal); }
void release() { FrameLib_Global::release(&mGlobal); }
void retain() { FrameLib_Global::get(&mGlobal); }
void release() { FrameLib_Global::release(&mGlobal); }
static FrameLib_PDGlobals **getPDGlobalsPtr()
{
@@ -184,7 +184,7 @@ public:
Mutator(t_symbol *sym, long ac, t_atom *av)
{
mObject = ac ? atom_getobj(av) : NULL;
mObject = ac ? atom_getobj(av) : nullptr;
mMode = object_method(mObject, gensym("__fl.is_output")) ? FrameLib_PDGlobals::SyncCheck::kDownOnly : FrameLib_PDGlobals::SyncCheck::kDown;
}
@@ -259,7 +259,7 @@ public:
t_dictionary *d = dictionary_new();
t_atom a;
t_atom *av = NULL;
t_atom *av = nullptr;
long ac = 0;
atom_setparse(&ac, &av, "@defrect 0 0 300 300");
@@ -269,8 +269,8 @@ public:
// Get box text (and strip object name from the top - relace with stored name in case the object name is an alias)
t_object *textfield = NULL;
const char *text = NULL;
t_object *textfield = nullptr;
const char *text = nullptr;
std::string newObjectText = accessClassName<Wrapper>()->c_str();
object_obex_lookup(this, gensym("#B"), &textfield);
@@ -321,14 +321,14 @@ public:
for (long i = numIns + numAudioIns - 2; i >= 0 ; i--)
{
mInOutlets[i] = (t_object *) outlet_new(NULL, NULL);
mProxyIns[i] = (t_object *) (i ? proxy_new(this, i, &mProxyNum) : NULL);
mInOutlets[i] = (t_object *) outlet_new(nullptr, nullptr);
mProxyIns[i] = (t_object *) (i ? proxy_new(this, i, &mProxyNum) : nullptr);
}
// Outlets for messages/signals
for (long i = numOuts - 1; i >= 0 ; i--)
mOuts[i] = (t_object *) outlet_new(this, NULL);
mOuts[i] = (t_object *) outlet_new(this, nullptr);
for (long i = numAudioOuts - 2; i >= 0 ; i--)
mAudioOuts[i] = (t_object *) outlet_new(this, "signal");
@@ -367,7 +367,7 @@ public:
void *subpatcher(long index, void *arg)
{
return ((t_ptr_uint) arg > 1 && !NOGOOD(arg) && index == 0) ? (void *) mPatch : NULL;
return ((t_ptr_uint) arg > 1 && !NOGOOD(arg) && index == 0) ? (void *) mPatch : nullptr;
}
void assist(void *b, long m, long a, char *s)
@@ -488,7 +488,7 @@ template <class T, PDObjectArgsMode argsMode = kAsParams> class FrameLib_PDClass
addMethod<PDProxy, &PDProxy::frame>(c, "frame");
}
PDProxy(t_symbol *sym, long ac, t_atom *av) : mOwner(NULL), mIndex(-1) {}
PDProxy(t_symbol *sym, long ac, t_atom *av) : mOwner(nullptr), mIndex(-1) {}
void frame()
{
@@ -543,7 +543,7 @@ public:
// Constructor and Destructor
FrameLib_PDClass(t_symbol *s, long argc, t_atom *argv, FrameLib_PDProxy *proxy = new FrameLib_PDProxy()) : mFrameLibProxy(proxy), mConfirmObject(NULL), mConfirmInIndex(-1), mConfirmOutIndex(-1), mConfirm(false), mCanvas(canvas_getcurrent()), mSyncIn(NULL), mNeedsResolve(true), mUserObject(*this)
FrameLib_PDClass(t_symbol *s, long argc, t_atom *argv, FrameLib_PDProxy *proxy = new FrameLib_PDProxy()) : mFrameLibProxy(proxy), mConfirmObject(nullptr), mConfirmInIndex(-1), mConfirmOutIndex(-1), mConfirm(false), mCanvas(canvas_getcurrent()), mSyncIn(nullptr), mNeedsResolve(true), mUserObject(*this)
{
// Object creation with parameters and arguments (N.B. the object is not a member due to size restrictions)
@@ -579,7 +579,7 @@ public:
inlet_new(*this, mInputs[i], gensym("frame"), gensym("frame"));
}
else
mInputs[i] = NULL;
mInputs[i] = nullptr;
}
// Create frame outlets
@@ -591,7 +591,7 @@ public:
if (T::handlesAudio())
{
//mSyncIn = (t_object *) outlet_new(NULL, NULL);
//mSyncIn = (t_object *) outlet_new(nullptr, nullptr);
//outlet_add(mSyncIn, inlet_nth(*this, 0));
}
}
@@ -837,12 +837,12 @@ public:
// FIX
//if (action == FrameLib_PDGlobals::SyncCheck::kAttachAndSync)
// outlet_anything(mSyncIn, gensym("signal"), 0, NULL);
// outlet_anything(mSyncIn, gensym("signal"), 0, nullptr);
if (action != FrameLib_PDGlobals::SyncCheck::kSyncComplete)
{
for (unsigned long i = getNumOuts(); i > 0; i--)
outlet_anything(mOutputs[i - 1], gensym("sync"), 0, NULL);
outlet_anything(mOutputs[i - 1], gensym("sync"), 0, nullptr);
if (mSyncChecker.upwardsMode())
{
@@ -1067,7 +1067,7 @@ private:
ConnectionInfo info(*this, index, mode);
mGlobal->setConnectionInfo(&info);
outlet_anything(mOutputs[index], gensym("frame"), 0, NULL);
outlet_anything(mOutputs[index], gensym("frame"), 0, nullptr);
mGlobal->setConnectionInfo();
}
@@ -1099,7 +1099,7 @@ private:
bool result = mConfirm;
mConfirm = false;
mConfirmObject = NULL;
mConfirmObject = nullptr;
mConfirmInIndex = mConfirmOutIndex = -1;
return result;
@@ -1282,7 +1282,7 @@ private:
void parseParameters(FrameLib_Parameters::AutoSerial& serialisedParameters, long argc, t_atom *argv)
{
t_symbol *sym = NULL;
t_symbol *sym = nullptr;
std::vector<double> values;
long i;
+2 -2
View File
@@ -23,9 +23,9 @@ class pd_buffer
public:
pd_buffer() : mArray(NULL), mTable(NULL), mLength(0) {}
pd_buffer() : mArray(nullptr), mTable(nullptr), mLength(0) {}
pd_buffer(t_symbol *name) : mTable(NULL), mLength(0)
pd_buffer(t_symbol *name) : mTable(nullptr), mLength(0)
{
mArray = (t_garray *) pd_findbyclass(name, garray_class);