コード例 #1
0
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
0
ファイル: PDMFactory.cpp プロジェクト: bgrins/gecko-dev
 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
0
ファイル: offload_myo_target.cpp プロジェクト: AlexMioMio/gcc
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
0
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
0
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
0
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
0
ファイル: TestHashMultiSet.cpp プロジェクト: boostpro/labs
    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
0
ファイル: posixdb_lock.c プロジェクト: MeghanaM/nfs-ganesha
/** 
 * @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
0
    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
0
ファイル: offload_myo_target.cpp プロジェクト: AlexMioMio/gcc
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
0
ファイル: Test.cpp プロジェクト: boostpro/labs
    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
0
ファイル: t_find.cpp プロジェクト: bavanisp/qtmobility-1.1.0
LOCAL_C void runAsyncFindL(CAsyncFinder *aFinder, CContactIdArray* aResultIds)
	{
	CActiveScheduler::Start();
	CContactIdArray* ids=aFinder->TakeContactIds();
	CheckResult(ids,aResultIds);
	delete ids;
	}
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
0
ファイル: Test.cpp プロジェクト: boostpro/labs
    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
0
    void RunTestExToNulBuf(const TextBuf &input,
                           const TextBuf &expected,
                           size_t bufsize,
                           ib_status_t expected_rc)
    {
        char buf[bufsize];
        size_t len;
        ib_status_t rc;
        ib_flags_t result;

        rc = ExecExToNulBuf(input.GetUBuf(), input.GetLen(),
                            buf, bufsize, len,
                            result);
        if (rc == IB_ENOTIMPL) {
            return;
        }
        const char *name = TestName(IB_STROP_BUF, TYPE_EX_TO_STR);
        ASSERT_EQ(expected_rc, rc) << name;

        TextBuf output(buf);
        CheckResult(name, input,
                    expected,
                    IB_STRFLAG_NONE,
                    IB_STRFLAG_MODIFIED,
                    rc, result, output);
    }
コード例 #16
0
    virtual void CheckResults(const TestDatum &test,
                              ib_status_t rc,
                              ib_flags_t result)
    {
        size_t lno = test.LineNo();
        const char *out = m_outbuf.GetBuf();
        const TextBuf &exout = ExpectedOut(test);
        bool exmod = (test.InBuf() != exout);
        ib_flags_t exresult = ExpectedResult(Op(), exmod);

        CheckResult(lno, test, rc, exresult, result);

        EXPECT_STRNE(NULL, out)
            << "Line " << lno << ": "
            << Stringize(test)
            << " Data out is NULL";

        if (out != NULL) {
            const char *exbuf = exout.GetBuf();
            EXPECT_STREQ(exbuf, out)
                << "Line " << lno << ": " << Stringize(test)
                << " expected=\"" << exout.GetFmt()
                << " actual=\""   << m_outbuf.GetFmt() << "\"";
        }
    }
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;
}
JNIEXPORT jint JNICALL Java_jACBrFramework_ACBrECF_carregaFormasPagamentoN(JNIEnv *env, jobject obj)
{
	INTPTR handle = GetACBrHandle(env, obj);
	int ret = ECF_CarregaFormasPagamento(handle);
	CheckResult(env, handle, ret);

	return (jint)ret;
}
JNIEXPORT void JNICALL Java_jACBrFramework_ACBrECF_create(JNIEnv *env, jobject obj)
{
	INTPTR handle;
	int ret = ECF_Create(&handle);
	CheckResult(env, handle, ret);
	
	if (ret >= 0) SetACBrHandle(env, obj, handle);
}
JNIEXPORT jboolean JNICALL Java_jACBrFramework_ACBrECF_getEmLinha(JNIEnv *env, jobject obj, jint timeOut)
{
	INTPTR handle = GetACBrHandle(env, obj);
	int ret = ECF_GetEmLinha(handle, (int)timeOut);
	CheckResult(env, handle, ret);
	
	return (jboolean)(ret == 1);
}
コード例 #21
0
FRFXLL_RESULT FRFXLLCreateFeatureSet(
  FRFXLL_HANDLE hContext,          ///< [in] Handle to a fingerprint recognition context
  const unsigned char fpData[],  ///< [in] sample
  size_t size,                   ///< [in] size of the sample buffer
  FRFXLL_DATA_TYPE dataType,       ///< [in] type of the sample, for instance image format
  unsigned int flags,            ///< [in] Set to 0 for default or bitwise or of any of the FRFXLL_FEX_xxx flags
  FRFXLL_HANDLE_PT phFeatureSet    ///< [out] pointer to where to put an open handle to the feature set
) {
  if (fpData == NULL)  return CheckResult(FRFXLL_ERR_INVALID_PARAM);
  if (phFeatureSet == NULL) return CheckResult(FRFXLL_ERR_INVALID_PARAM);
  CheckInvalidFlagsCombinationR(flags, FRFXLL_FEX_DISABLE_ENHANCEMENT | FRFXLL_FEX_ENABLE_ENHANCEMENT);
  Ptr<const Context> ctx(hContext);
  if (!ctx) return CheckResult(FRFXLL_ERR_INVALID_HANDLE);
  Ptr<FexObj> fex(new(ctx) FexObj(ctx));
  if (!fex) return CheckResult(FRFXLL_ERR_NO_MEMORY);
  return fex->CreateFeatureSet(fpData, size, dataType, flags, phFeatureSet);
}
コード例 #22
0
ファイル: offload_myo_host.cpp プロジェクト: 0day-ci/gcc
 void ArenaRelease(
     MyoArena arena
 ) const
 {
     OFFLOAD_DEBUG_TRACE_1(4, 0, c_offload_myoarenarelease,
                         "%s()\n", __func__);
     CheckResult(__func__, m_arena_release(arena));
 }
コード例 #23
0
int main(void) {
	//读取测试数据文件中的矩阵
	data_type rA[] = {
	#include "DataSet_Test\Mat_A.h"
			};
	data_type rB[] = {
	#include "DataSet_Test\Mat_B.h"
			};
	data_type rD[] = {
	#include "DataSet_Test\Mat_D.h"
			};
	data_type rustC[]  = {
	#include "DataSet_Test\MultAD.h"
			};
	data_type rustCDot[]  = {
	#include "DataSet_Test\MultDot.h"
			};
	data_type rustCAOB[]  = {
	#include "DataSet_Test\MultAOB.h"
			};
	data_type rustCABO[]  = {
	#include "DataSet_Test\MultABO.h"
			};
    //变量定义
	data_type rawA[rawm][rawn];//定义局部二维数组表示矩阵A
	data_type rawB[rawm][rawn];
	data_type rawD[rawn][rawp];
	data_type rawCAD[rawm][rawp]; //矩阵乘法:CAD=A*D,二维数组所有元素初始化为0的形式为{{0.0}}
	data_type rawCABot[rawm][rawn]; //矩阵点积:CABot=A.*B
	data_type rawCAOB[rawn][rawn]; //转置矩阵乘法:CAOB=A’*B
	data_type rawCABO[rawm][rawm]; //转置矩阵乘法:CABO=A*B’

	//读取矩阵元素
	VtoMat(rA, rawA[0], rawm, rawn);
	VtoMat(&rB[0], rawB[0], rawm, rawn);
	VtoMat(&rD[0], rawD[0], rawn, rawp);

	//顶层函数
	Matix_Blkmulti(&rawA[0],&rawB[0],&rawD[0],&rawCAD[0],&rawCABot[0],&rawCAOB[0],&rawCABO[0]);

	CheckResult(&rustC[0], rawCAD[0], rawm, rawp);
	CheckResult(&rustCDot[0], rawCABot[0], rawm, rawn);
	CheckResult(&rustCABO[0], rawCABO[0], rawm, rawm);
	CheckResult(&rustCAOB[0], rawCAOB[0], rawn, rawn);
	return 0;
}
JNIEXPORT void JNICALL Java_jACBrFramework_ACBrECF_destroy(JNIEnv *env, jobject obj)
{
	INTPTR handle = GetACBrHandle(env, obj);
	int ret = ECF_Destroy(&handle);
	CheckResult(env, handle, ret);
	
	if (ret >= 0) SetACBrHandle(env, obj, (INTPTR)NULL);
}
コード例 #25
0
ファイル: offload_myo_host.cpp プロジェクト: 0day-ci/gcc
 void HostFptrTableRegister(void *table, int num_entries,
                            int ordered) const {
     OFFLOAD_DEBUG_TRACE_1(4, 0, c_offload_myoregister,
                         "%s(%p, %d, %d)\n", __func__, table,
                         num_entries, ordered);
     CheckResult(__func__,
                 m_host_fptr_table_register(table, num_entries, ordered));
 }
コード例 #26
0
ファイル: Main.cpp プロジェクト: NakOh/MyNetworkGameProject
void Pae(){

	myFirstPae = random();
	while (myFirstPae == yourFirstPae){
		yourFirstPae = random();
	}
	mySecondPae = random();
	while (mySecondPae == myFirstPae || mySecondPae == yourFirstPae || mySecondPae == yourSecondPae){
		mySecondPae = random();
	}
	myResult = CheckResult(myFirstPae, mySecondPae);

	if (myResult == 70){
		myResult = CheckResult(mySecondPae, myFirstPae);
	}


}
コード例 #27
0
ファイル: InitPower.c プロジェクト: memsdsp/SINS_RTOS_CoreA
void InitPower(void)
{
	uint32_t   fcclk = 0;
	uint32_t   fsclk = 0;
	uint32_t   fvco = 0;
	uint32_t   core;
	uint32_t   system;
	uint32_t expectedEvents;
	ADI_PWR_RESULT result;


	bError = false;
	callbackEvents = 0;
	expectedEvents = 0;

	result = adi_pwr_Init(CLKIN, CORE_MAX, SYSTEM_MAX, VCO_MIN);
	CheckResult(result);

//	result = adi_pwr_InstallCallback(PWRCallback);
//	CheckResult(result);

	setDefaultPower();

	// set max freq
	result = adi_pwr_SetFreq(CORE_MAX, SYSTEM_MAX);
	CheckResult(result);

	expectedEvents += 2; //pre and post event

	// get the freq settings
	result = adi_pwr_GetCoreFreq(&fcclk);
	CheckResult(result);

	result = adi_pwr_GetSystemFreq(&fsclk);
	CheckResult(result);
	if ((fcclk < (CORE_MAX-CLKIN)) || (fsclk < (SYSTEM_MAX-CLKIN)))
	{
		bError = true;
	}
	system_parameters.fcclk = fcclk;
	system_parameters.fsclk = fsclk;


}
コード例 #28
0
ファイル: offload_myo_host.cpp プロジェクト: 0day-ci/gcc
 void ArenaCreate(
     MyoOwnershipType ownership,
     int consistency,
     MyoArena* arena
 ) const
 {
     OFFLOAD_DEBUG_TRACE(4, "%s(%d, %d, %p)\n",
         __func__, ownership, consistency, arena);
     CheckResult(__func__, m_arena_create(ownership, consistency, arena));
 }
コード例 #29
0
int	main(int argc, const char *argv[])
{
 	MyAudioConverterSettings audioConverterSettings = {0};
	
	// open the input with ExtAudioFile
	CFURLRef inputFileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, kInputFileLocation, kCFURLPOSIXPathStyle, false);
	CheckResult(ExtAudioFileOpenURL(inputFileURL, 
									&audioConverterSettings.inputFile),
				"ExtAudioFileOpenURL failed");
	
	// 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
	CFURLRef outputFileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("output.aif"), kCFURLPOSIXPathStyle, false);
	CheckResult (AudioFileCreateWithURL(outputFileURL, kAudioFileAIFFType, &audioConverterSettings.outputFormat, kAudioFileFlags_EraseFile, &audioConverterSettings.outputFile),
				 "AudioFileCreateWithURL failed");
    CFRelease(outputFileURL);
	
	// set the PCM format as the client format on the input ext audio file
	CheckResult(ExtAudioFileSetProperty(audioConverterSettings.inputFile,
										kExtAudioFileProperty_ClientDataFormat,
										sizeof (AudioStreamBasicDescription),
										&audioConverterSettings.outputFormat),
				"Couldn't set client data format on input ext file");
	
	fprintf(stdout, "Converting...\n");
	Convert(&audioConverterSettings);
	
cleanup:
	// AudioFileClose(audioConverterSettings.inputFile);
	ExtAudioFileDispose(audioConverterSettings.inputFile);
	AudioFileClose(audioConverterSettings.outputFile);
	return 0;
}
コード例 #30
0
ファイル: PDMFactory.cpp プロジェクト: bgrins/gecko-dev
 SupportChecker::CheckResult
 Check()
 {
   for (auto& checker : mCheckerList) {
     auto result = checker();
       if (result.mReason != SupportChecker::Reason::kSupported) {
         return result;
     }
   }
   return CheckResult(SupportChecker::Reason::kSupported);
 }