本文整理汇总了C++中plonk_assert函数的典型用法代码示例。如果您正苦于以下问题:C++ plonk_assert函数的具体用法?C++ plonk_assert怎么用?C++ plonk_assert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plonk_assert函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: throw
bool TimeStamp::operator!= (TimeStamp const& other) const throw()
{
plonk_assert (fractionIsValid (this->fraction));
plonk_assert (fractionIsValid (other.fraction));
return (time != other.time) || (fraction != other.fraction);
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:7,代码来源:plonk_TimeStamp.cpp
示例2: plonk_assert
PlankResult BinaryFileInternal::dynamicMemoryReadCallback (PlankFileRef p, PlankP ptr, int maximumBytes, int* bytesReadOut)
{
plonk_assert (p != 0);
plonk_assert (ptr != 0);
plonk_assert (maximumBytes > 0);
PlankResult result;
UnsignedChar* src;
ByteArray* array = static_cast<ByteArray*> (p->stream);
LongLong size = array->length();
int bytesRead;
result = PlankResult_OK;
bytesRead = int (plonk::min (LongLong (maximumBytes), size - p->position));
if (bytesRead <= 0)
{
result = PlankResult_FileEOF;
goto exit;
}
src = (UnsignedChar*)array->getArray() + p->position;
Memory::copy (ptr, src, bytesRead);
p->position += bytesRead;
if (bytesReadOut)
*bytesReadOut = bytesRead;
exit:
return result;
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:31,代码来源:plonk_BinaryFile.cpp
示例3: plonk_assert
/*PLONK_INLINE_LOW*/ bool TimeStamp::operator>= (TimeStamp const& other) const throw()
{
plonk_assert (fractionIsValid (this->fraction));
plonk_assert (fractionIsValid (other.fraction));
if (this->isInfinite())
{
if (other.isInfinite())
return false;
else
return true;
}
else return ((time > other.time) || ((time == other.time) && (fraction >= other.fraction)));
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:14,代码来源:plonk_TimeStamp.cpp
示例4: staticDoFree
static PLONK_INLINE_LOW void staticDoFree (void* userData, void* ptr) throw()
{
#if PLONK_OBJECTMEMORYDEFERFREE_DEBUG
plonk_assert (!Threading::currentThreadIsAudioThread());
#endif
pl_MemoryDefaultFree (userData, ptr);
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:7,代码来源:plonk_ObjectMemoryDeferFree.cpp
示例5: throw
AudioFile::Format AudioFileReaderInternal::getFormat() const throw()
{
int value;
ResultCode result = pl_AudioFileReader_GetFormat (getPeerRef(), &value);
plonk_assert (result == PlankResult_OK);
#ifndef PLONK_DEBUG
(void)result;
#endif
const int format = value;
switch (format)
{
case AudioFile::FormatInvalid: return AudioFile::FormatInvalid;
case AudioFile::FormatUnknown: return AudioFile::FormatUnknown;
case AudioFile::FormatWAV: return AudioFile::FormatWAV;
case AudioFile::FormatAIFF: return AudioFile::FormatAIFF;
case AudioFile::FormatAIFC: return AudioFile::FormatAIFC;
case AudioFile::FormatOggVorbis: return AudioFile::FormatOggVorbis;
case AudioFile::FormatOpus: return AudioFile::FormatOpus;
case AudioFile::FormatRegion: return AudioFile::FormatRegion;
case AudioFile::FormatMulti: return AudioFile::FormatMulti;
case AudioFile::FormatArray: return AudioFile::FormatArray;
case AudioFile::FormatQueue: return AudioFile::FormatQueue;
case AudioFile::FormatCustom: return AudioFile::FormatCustom;
default: return AudioFile::FormatInvalid;
}
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:29,代码来源:plonk_AudioFileReader.cpp
示例6: throw
int RNG::uniform (const int min, const int max) throw()
{
// plonk_assert (min >= 0);
// plonk_assert (max > 0);
plonk_assert (max > min);
return pl_RNG_NextInt (this->getInternal()->getRNGRef(), max - min) + min;
}
开发者ID:benavrhm,项目名称:pl-nk,代码行数:7,代码来源:plonk_RNG.cpp
示例7: throw
ResultCode ObjectMemoryDeferFree::run() throw()
{
const double minDuration = 0.000001;
const double maxDuration = 0.1;
double duration = minDuration;
while (! getShouldExit())
{
plonk_assert (getMemory().getUserData() == this);
Element d = queue->pop();
if (d.ptr != 0)
{
duration = minDuration; // reset back to high speed
staticDoFree (this, d.ptr);
}
else
{
// gradually increase the amount of sleep if the queue is empty
duration = plonk::min (duration * 2.0, maxDuration);
}
Threading::sleep (duration);
}
getMemory().resetFunctions();
queue->clearAll();
return 0;
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:31,代码来源:plonk_ObjectMemoryDeferFree.cpp
示例8: throw
bool BinaryFileInternal::setupMulti (PlankFileRef p, FilePathQueue const& fileQueue, const bool bigEndian) throw()
{
pl_File_Init (p);
const bool shouldTakeOwnership = true;
ResultCode result;
PlankMulitFileReaderRef multi = pl_MultiFileReader_Create();
int mode = PLANKFILE_READ | PLANKFILE_BINARY;
if (bigEndian)
mode |= PLANKFILE_BIGENDIAN;
result = pl_MultiFileReader_InitCustom (multi,
mode,
new FilePathQueue (fileQueue),
shouldTakeOwnership,
plonk_BinaryFileInternal_FilePathQueue_NextFuntion,
plonk_BinaryFileInternal_FilePathQueue_DestroyCustomFuntion);
result = pl_File_OpenMulti (p, multi, mode);
plonk_assert (result == PlankResult_OK);
return result == PlankResult_OK;
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:25,代码来源:plonk_BinaryFile.cpp
示例9: LongLong
/*PLONK_INLINE_LOW*/ TimeStamp& TimeStamp::operator+= (const double offset) throw()
{
if (pl_IsInfD (offset))
{
this->time = 0;
this->fraction = offset;
}
else
{
const double correctedOffset = offset + this->fraction;
const LongLong timeOffset = LongLong (correctedOffset);
this->time += timeOffset;
this->fraction = correctedOffset - timeOffset; // carry the fraction
if (this->fraction < 0.0)
{
this->time--;
this->fraction += 1.0;
}
plonk_assert (fractionIsValid (this->fraction));
}
return *this;
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:25,代码来源:plonk_TimeStamp.cpp
示例10: throw
void TextFileInternal::writeLine (const char* text) throw()
{
const ResultCode result = pl_File_WriteLine (getPeerRef(), text);
plonk_assert (result == PlankResult_OK);
#ifndef PLONK_DEBUG
(void)result;
#endif
}
开发者ID:jamiebullock,项目名称:pl-nk,代码行数:9,代码来源:plonk_TextFile.cpp
示例11: throw
ResultCode Threading::Thread::setShouldExitAndWait (const double interval) throw()
{
ResultCode result = PlankResult_OK;
result = setShouldExit();
plonk_assert (result == PlankResult_OK);
while (isRunning())
Threading::sleep (interval);
return result;
}
开发者ID:benavrhm,项目名称:pl-nk,代码行数:12,代码来源:plonk_Thread.cpp
注:本文中的plonk_assert函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论