如何在目标C中定义结束

时间:2010-11-15 15:14:53

标签: objective-c xcode definition undefined

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;
   } 

//这是确切的错误

  

标签'end'已使用但未定义        我有两次错误

2 个答案:

答案 0 :(得分:3)

如果您查看该代码段来自的SoundEngine.cpp源代码,您会看到它已在下一行中定义:

end:
    return result;

这是一个标签,当出现错误时执行会跳转到。

答案 1 :(得分:1)

嗯,我能找到AssertNoError的唯一地方就在Technical Note TN2113。它有一个完全不同的格式。 AssertNoError(theError, "couldn't unregister the ABL"); AssertNoError定义在哪里?

用户@Jeremy P提及this document as well.