本文整理汇总了C++中CheckResult函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckResult函数的具体用法?C++ CheckResult怎么用?C++ CheckResult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckResult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CSSM_ModuleLoad
void DotMacRelation::InitializeCertLibrary ()
{
if (mCertificateLibrary != 0)
{
return;
}
// figure out which GUID to attach to
const CSSM_GUID* attachGuid = &gGuidAppleX509CL;
// Initialize CDSA
CSSM_VERSION version = {2, 0};
// load the CL
CSSM_RETURN result = CSSM_ModuleLoad (attachGuid, CSSM_KEY_HIERARCHY_NONE, NULL, NULL);
CheckResult (result);
result = CSSM_ModuleAttach (attachGuid,
&version,
&memFuncs,
0, // no subservice ID
CSSM_SERVICE_CL,
0,
CSSM_KEY_HIERARCHY_NONE,
NULL,
0,
NULL,
&mCertificateLibrary);
CheckResult (result);
}
示例2: AddMediaFormatChecker
void
AddMediaFormatChecker(const TrackInfo& aTrackConfig)
{
if (aTrackConfig.IsVideo()) {
auto mimeType = aTrackConfig.GetAsVideoInfo()->mMimeType;
RefPtr<MediaByteBuffer> extraData =
aTrackConfig.GetAsVideoInfo()->mExtraData;
AddToCheckList([mimeType, extraData]() {
if (MP4Decoder::IsH264(mimeType)) {
mp4_demuxer::SPSData spsdata;
// WMF H.264 Video Decoder and Apple ATDecoder
// do not support YUV444 format.
// For consistency, all decoders should be checked.
if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata)
&& (spsdata.profile_idc == 244 /* Hi444PP */
|| spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
return CheckResult(
SupportChecker::Reason::kVideoFormatNotSupported,
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Decoder may not have the capability "
"to handle the requested video format "
"with YUV444 chroma subsampling.")));
}
}
return CheckResult(SupportChecker::Reason::kSupported);
});
}
}
示例3: __offload_myo_once_init
static void __offload_myo_once_init(void)
{
CheckResult("myoiRemoteFuncRegister",
myoiRemoteFuncRegister(
(MyoiRemoteFuncType) __intel_cilk_for_32_offload_wrapper,
"__intel_cilk_for_32_offload"));
CheckResult("myoiRemoteFuncRegister",
myoiRemoteFuncRegister(
(MyoiRemoteFuncType) __intel_cilk_for_64_offload_wrapper,
"__intel_cilk_for_64_offload"));
}
示例4: main
int main(int argc, const char *argv[])
{
MyAudioConverterSettings audioConverterSettings = {0};
// open the input audio file
CFURLRef inputFileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, kInputFileLocation, kCFURLPOSIXPathStyle, false);
CheckResult (AudioFileOpenURL(inputFileURL, kAudioFileReadPermission , 0, &audioConverterSettings.inputFile),
"AudioFileOpenURL failed");
CFRelease(inputFileURL);
// get the audio data format from the file
UInt32 propSize = sizeof(audioConverterSettings.inputFormat);
CheckResult (AudioFileGetProperty(audioConverterSettings.inputFile, kAudioFilePropertyDataFormat, &propSize, &audioConverterSettings.inputFormat),
"couldn't get file's data format");
// get the total number of packets in the file
propSize = sizeof(audioConverterSettings.inputFilePacketCount);
CheckResult (AudioFileGetProperty(audioConverterSettings.inputFile, kAudioFilePropertyAudioDataPacketCount, &propSize, &audioConverterSettings.inputFilePacketCount),
"couldn't get file's packet count");
// get size of the largest possible packet
propSize = sizeof(audioConverterSettings.inputFilePacketMaxSize);
CheckResult(AudioFileGetProperty(audioConverterSettings.inputFile, kAudioFilePropertyMaximumPacketSize, &propSize, &audioConverterSettings.inputFilePacketMaxSize),
"couldn't get file's max packet size");
// define the ouput format. AudioConverter requires that one of the data formats be LPCM
audioConverterSettings.outputFormat.mSampleRate = 44100.0;
audioConverterSettings.outputFormat.mFormatID = kAudioFormatLinearPCM;
audioConverterSettings.outputFormat.mFormatFlags = kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
audioConverterSettings.outputFormat.mBytesPerPacket = 4;
audioConverterSettings.outputFormat.mFramesPerPacket = 1;
audioConverterSettings.outputFormat.mBytesPerFrame = 4;
audioConverterSettings.outputFormat.mChannelsPerFrame = 2;
audioConverterSettings.outputFormat.mBitsPerChannel = 16;
// create output file
// KEVIN: TODO: this fails if file exists. isn't there an overwrite flag we can use?
CFURLRef outputFileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("output.aif"), kCFURLPOSIXPathStyle, false);
CheckResult (AudioFileCreateWithURL(outputFileURL, kAudioFileAIFFType, &audioConverterSettings.outputFormat, kAudioFileFlags_EraseFile, &audioConverterSettings.outputFile),
"AudioFileCreateWithURL failed");
CFRelease(outputFileURL);
fprintf(stdout, "Converting...\n");
Convert(&audioConverterSettings);
cleanup:
AudioFileClose(audioConverterSettings.inputFile);
AudioFileClose(audioConverterSettings.outputFile);
printf("Done\r");
return 0;
}
示例5: Convert
void Convert(MyAudioConverterSettings *mySettings)
{
UInt32 outputBufferSize = 32 * 1024; // 32 KB is a good starting point
UInt32 sizePerPacket = mySettings->outputFormat.mBytesPerPacket;
UInt32 packetsPerBuffer = outputBufferSize / sizePerPacket;
// allocate destination buffer
UInt8 *outputBuffer = (UInt8 *)malloc(sizeof(UInt8) * outputBufferSize);
UInt32 outputFilePacketPosition = 0; //in bytes
while(1)
{
// wrap the destination buffer in an AudioBufferList
AudioBufferList convertedData;
convertedData.mNumberBuffers = 1;
convertedData.mBuffers[0].mNumberChannels = mySettings->outputFormat.mChannelsPerFrame;
convertedData.mBuffers[0].mDataByteSize = outputBufferSize;
convertedData.mBuffers[0].mData = outputBuffer;
UInt32 frameCount = packetsPerBuffer;
// read from the extaudiofile
CheckResult(ExtAudioFileRead(mySettings->inputFile,
&frameCount,
&convertedData),
"Couldn't read from input file");
if (frameCount == 0) {
printf ("done reading from file");
return;
}
// write the converted data to the output file
CheckResult (AudioFileWritePackets(mySettings->outputFile,
FALSE,
frameCount,
NULL,
outputFilePacketPosition / mySettings->outputFormat.mBytesPerPacket,
&frameCount,
convertedData.mBuffers[0].mData),
"Couldn't write packets to file");
// advance the output file write location
outputFilePacketPosition += (frameCount * mySettings->outputFormat.mBytesPerPacket);
}
// AudioConverterDispose(audioConverter);
}
示例6: GameSession
int GameSession( int players_number )
{
GAME *game;
LogInit();
if ((game = AcceptPlayers(players_number)) == NULL)
{
/* MessageBox(NULL, strerror(GetLastError()), "Vse ochen ploho((", 0);*/
return 0x239;
}
SendPropInfo(*game);
while (1)
{
COMMAND command;
RESULT result;
command = ReadCommand(*game);
result = CheckResult(game, command);
SendResult(*game, result);
game->Current_player = (game->Current_player + 1) % game->Players_number;
if (result.Result == RESULT_WINNER)
{
EndGame(*game);
free(game->Players);
free(game);
return 0x30;
}
}
}
示例7: TestTransform
bool TestTransform()
{
HashMultiSet d;
d.Insert(0);
d.Insert(1);
d.Insert(2);
d.Insert(3);
d.Insert(4);
d.Insert(5);
d.Insert(6);
d.Insert(7);
d.Insert(8);
d.Insert(9);
int result[10] = {0};
int index[10] = {0};
int* i = d.Transform(Square, result);
if(i != result + 10)
return false;
std::sort(result, i);
if(!CheckResult(result))
return false;
return true;
}
示例8: fsal_posixdb_lockHandleForUpdate
/**
* @brief Lock the line of the Handle table with inode & devid defined in p_info
*
* @param p_conn
* Database connection
* @param p_info
* Information about the file
*
* @return ERR_FSAL_POSIXDB_NOERR if no error,
* another error code else.
*/
fsal_posixdb_status_t fsal_posixdb_lockHandleForUpdate(fsal_posixdb_conn * p_conn, /* IN */
fsal_posixdb_fileinfo_t *
p_info /* IN */ )
{
PGresult *p_res;
char devid_str[MAX_DEVICEIDSTR_SIZE];
char inode_str[MAX_INODESTR_SIZE];
const char *paramValues[2];
CheckConn(p_conn);
BeginTransaction(p_conn, p_res);
snprintf(devid_str, MAX_DEVICEIDSTR_SIZE, "%lli", (long long int)p_info->devid);
snprintf(inode_str, MAX_INODESTR_SIZE, "%lli", (long long int)p_info->inode);
paramValues[0] = devid_str;
paramValues[1] = inode_str;
p_res = PQexecPrepared(p_conn, "lookupHandleByInodeFU", 2, paramValues, NULL, NULL, 0);
CheckResult(p_res);
PQclear(p_res);
/* Do not end the transaction, because it will be closed by the next call to a posixdb function */
ReturnCodeDB(ERR_FSAL_POSIXDB_NOERR, 0);
}
示例9: CheckResults
void CheckResults(const TestDatum &test,
ib_status_t rc,
ib_flags_t result)
{
const TextBuf &exout = ExpectedOut(test);
bool exmod = (exout != test.InBuf());
ib_flags_t exresult = ExpectedResult( Op(), exmod );
CheckResult(test.LineNo(), test, rc, exresult, result);
const char *out = m_outbuf.GetBuf();
if (out != NULL) {
size_t outlen = m_outbuf.GetLen();
size_t exlen = exout.GetLen();
EXPECT_EQ(exlen, outlen)
<< "Line " << test.LineNo() << ": " << Stringize(test)
<< " expected len=" << exlen
<< ", actual len=" << outlen;
EXPECT_TRUE(exout == m_outbuf)
<< "Line " << test.LineNo() << ": " << Stringize(test)
<< " expected=\"" << exout.GetFmt() << "\""
<< " actual=\"" << m_outbuf.GetFmt() << "\"";
}
}
示例10: __offload_myo_fptr_table_register
static void __offload_myo_fptr_table_register(
FptrTableEntry *entry
)
{
int entries = 0;
FptrTableEntry *t_start;
OFFLOAD_DEBUG_TRACE(3, "%s(%p)\n", __func__, entry);
t_start = entry;
while (t_start->funcName != 0) {
OFFLOAD_DEBUG_TRACE_1(4, 0, c_offload_mic_myo_fptr,
"myo fptr entry name = \"%s\" addr = %p\n",
t_start->funcName, t_start->funcAddr);
t_start++;
entries++;
}
if (entries > 0) {
OFFLOAD_DEBUG_TRACE(3, "myoiTargetFptrTableRegister(%p, %d, 0)\n",
entry, entries);
CheckResult("myoiTargetFptrTableRegister",
myoiTargetFptrTableRegister(entry, entries, 0));
}
}
示例11: TestList2
bool TestList2()
{
List l;
l.PushBack(-1);
l.PushBack(0);
l.PushBack(1);
l.PushBack(2);
l.PushBack(3);
l.PushBack(4);
l.PushBack(5);
l.PushBack(6);
l.PushBack(7);
l.PushBack(8);
l.PushBack(9);
l.PopFront();
int result[10] = {0};
int* i = Transform(l.Begin(), l.End(), Square, result);
if(i != result + 10)
return false;
if(!CheckResult(result))
return false;
return true;
}
示例12: runAsyncFindL
LOCAL_C void runAsyncFindL(CAsyncFinder *aFinder, CContactIdArray* aResultIds)
{
CActiveScheduler::Start();
CContactIdArray* ids=aFinder->TakeContactIds();
CheckResult(ids,aResultIds);
delete ids;
}
示例13: Java_jACBrFramework_ACBrECF_vendeItem
JNIEXPORT void JNICALL Java_jACBrFramework_ACBrECF_vendeItem(JNIEnv *env, jobject obj, jstring codigo, jstring descricao, jstring aliquotaICMS, jdouble qtd, jdouble valorUnitario, jdouble descontoPorc, jstring unidade, jstring tipoDescontoAcrescimo, jstring descontoAcrescimo)
{
INTPTR handle = GetACBrHandle(env, obj);
jboolean isCopy = (jboolean)false;
const char* nCodigo = env->GetStringUTFChars(codigo, &isCopy);
const char* nDescricao = env->GetStringUTFChars(descricao, &isCopy);
const char* nAliquotaICMS = env->GetStringUTFChars(aliquotaICMS, &isCopy);
const char* nUnidade = env->GetStringUTFChars(unidade, &isCopy);
const char* nTipoDescontoAcrescimo = env->GetStringUTFChars(tipoDescontoAcrescimo, &isCopy);
const char* nDescontoAcrescimo = env->GetStringUTFChars(descontoAcrescimo, &isCopy);
char __TipoDescontoAcrescimo[2];
__TipoDescontoAcrescimo[0] = nTipoDescontoAcrescimo[0];
__TipoDescontoAcrescimo[1] = 0;
char __DescontoAcrescimo[2];
__DescontoAcrescimo[0] = nDescontoAcrescimo[0];
__DescontoAcrescimo[1] = 0;
int ret = ECF_VendeItem(handle, (PCHAR)nCodigo, (PCHAR)nDescricao, (PCHAR)nAliquotaICMS, (double)qtd, (double)valorUnitario, (double)descontoPorc, (PCHAR)nUnidade, (PCHAR)__TipoDescontoAcrescimo, (PCHAR)__DescontoAcrescimo);
env->ReleaseStringUTFChars(codigo, nCodigo);
env->ReleaseStringUTFChars(descricao, nDescricao);
env->ReleaseStringUTFChars(aliquotaICMS, nAliquotaICMS);
env->ReleaseStringUTFChars(unidade, nUnidade);
env->ReleaseStringUTFChars(tipoDescontoAcrescimo, nTipoDescontoAcrescimo);
env->ReleaseStringUTFChars(descontoAcrescimo, nDescontoAcrescimo);
CheckResult(env, handle, ret);
}
示例14: TestDeque2
bool TestDeque2()
{
Deque d;
d.PushBack(-1);
d.PushBack(0);
d.PushBack(1);
d.PushBack(2);
d.PushBack(3);
d.PushBack(4);
d.PushBack(5);
d.PushBack(6);
d.PushBack(7);
d.PushBack(8);
d.PushBack(9);
d.PopFront();
int result[10] = {0};
int* i = Transform(d.Begin(), d.End(), Square, result);
if(i != result + 10)
return false;
if(!CheckResult(result))
return false;
return true;
}
示例15: Java_jACBrFramework_ACBrECF_carregaComprovantesNaoFiscaisN
JNIEXPORT jint JNICALL Java_jACBrFramework_ACBrECF_carregaComprovantesNaoFiscaisN(JNIEnv *env, jobject obj)
{
INTPTR handle = GetACBrHandle(env, obj);
int ret = ECF_CarregaComprovantesNaoFiscais(handle);
CheckResult(env, handle, ret);
return (jint)ret;
}