开发者

How to define end in objective C

OSStatus SetupBuffers(BG_FileInfo *inFileInfo)
{
int numBuffersToQueue = kNumberBuffers;
UInt32 maxPacketSize;
UInt32 size = sizeof(maxPacketSize);
// we need to calculate how many packets we read at a time, and how big a buffer we need
// we base this on the size of the packets in the file and an approximate duration for      each buffer

// first check to see what the max size of a packet is - if it is bigger
// than our allocation default size, that needs to become larger
OSStatus result = AudioFileGetProperty(inFileInfo->mAFID,   kAudioFilePropertyPacketSizeUpperBound, &size, &maxPacketSize);
AssertNoError("Error getting packet upper bound size", end);
bool isFormatVBR = (inFileInfo->mFileFormat.mBytesPerPacket == 0 || inFileInfo-   >mFileFormat.mFramesPerPacket == 0);

CalculateBytesForTime(inFileInfo->mFileFormat, maxPacketSize, 0.5/*seconds*/,  &mBufferByteSize, &mNumPacketsToRead);

// if the file is smaller than the capacity of all the buffer queues, always load it at  once
if ((mBufferByteSize * numBuffersToQueue) > inFileInfo->mFileDataSize)
inFileInfo->mLoadAtOnce = true;

if (inFileInfo->mLoadAtOnce)
{
UInt64 theFileNumPackets;
size = sizeof(UInt64);
result = AudioFileGetProperty(inFileInfo->mAFID, kAudioFilePropertyAudioDataPacketCount,   &size, &theFileNumPackets);
       AssertNoError("Error getting packet count for file", end);***>>>>this is where xcode says undefined<<<<***

      mNumPacketsToRead = (UInt32)theFileNumPackets;
      mBufferByteSize = inFileInfo->mFileDataSize;
      numBuffersToQueue = 1;
   } 

//Here is the exact error

label 'end' used but not开发者_如何学Python defined I have that error twice


If you look at the SoundEngine.cpp source that the snippet comes from, you'll see it's defined on the very next line:

end:
    return result;

It's a label that execution jumps to when there's an error.


Uhm, the only place I can find AssertNoError is here in Technical Note TN2113. And it has a completely different format. AssertNoError(theError, "couldn't unregister the ABL"); Where is AssertNoError defined?

User @Jeremy P mentions this document as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜