From efd54c7657bfb55482b354eff3b3c24e5f61b3ab Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 13 Jul 2013 17:20:31 -0700 Subject: [PATCH] cmTimeLine.c,cmAudioPort.c,cmPgmOpts.c,cmProc.c,cmRtSys.c: Changes to remove compiler warnings on OSX build. --- app/cmTimeLine.c | 6 +++--- cmAudioPort.c | 20 ++++++++++++-------- cmPgmOpts.c | 12 +++++++++--- cmProc4.c | 8 +++++--- cmRtSys.c | 4 +++- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/app/cmTimeLine.c b/app/cmTimeLine.c index eed95b0..6757c6f 100644 --- a/app/cmTimeLine.c +++ b/app/cmTimeLine.c @@ -271,9 +271,9 @@ _cmTlObj_t* _cmTlFindRecdBefore( _cmTl_t* p, const _cmTlObj_t* np ) // calc the absolute time of this object //int absSmpIdx = _cmTlStartTime(np->obj); - int rsi; - _cmTlObj_t* rp = NULL; - _cmTlObj_t* op = p->seq[np->obj->seqId].first; + int rsi = 0; + _cmTlObj_t* rp = NULL; + _cmTlObj_t* op = p->seq[np->obj->seqId].first; //printf("type:%i %i\n",np->obj->typeId,absSmpIdx); diff --git a/cmAudioPort.c b/cmAudioPort.c index 7df6367..92987d4 100644 --- a/cmAudioPort.c +++ b/cmAudioPort.c @@ -51,6 +51,10 @@ cmAp_t* _ap = NULL; cmApRC_t _cmApIndexToDev( unsigned devIdx, cmApDriver_t** drvPtrPtr, unsigned* devIdxPtr ) { + assert( drvPtrPtr != NULL && devIdxPtr != NULL ); + *drvPtrPtr = NULL; + *devIdxPtr = cmInvalidIdx; + unsigned i; for(i=0; i<_ap->drvCnt; ++i) if( _ap->drvArray[i].begDevIdx != cmInvalidIdx ) @@ -204,8 +208,8 @@ unsigned cmApDeviceCount() const char* cmApDeviceLabel( unsigned devIdx ) { - cmApDriver_t* dp; - unsigned di; + cmApDriver_t* dp = NULL; + unsigned di = cmInvalidIdx; cmApRC_t rc; if( devIdx == cmInvalidIdx ) @@ -233,8 +237,8 @@ unsigned cmApDeviceLabelToIndex( const cmChar_t* label ) unsigned cmApDeviceChannelCount( unsigned devIdx, bool inputFl ) { - cmApDriver_t* dp; - unsigned di; + cmApDriver_t* dp = NULL; + unsigned di = cmInvalidIdx; cmApRC_t rc; if( devIdx == cmInvalidIdx ) @@ -248,8 +252,8 @@ unsigned cmApDeviceChannelCount( unsigned devIdx, bool inputFl ) double cmApDeviceSampleRate( unsigned devIdx ) { - cmApDriver_t* dp; - unsigned di; + cmApDriver_t* dp = NULL; + unsigned di = cmInvalidIdx; cmApRC_t rc; if((rc = _cmApIndexToDev(devIdx,&dp,&di)) != kOkApRC ) @@ -260,8 +264,8 @@ double cmApDeviceSampleRate( unsigned devIdx ) unsigned cmApDeviceFramesPerCycle( unsigned devIdx, bool inputFl ) { - cmApDriver_t* dp; - unsigned di; + cmApDriver_t* dp = NULL; + unsigned di = cmInvalidIdx; cmApRC_t rc; if( devIdx == cmInvalidIdx ) diff --git a/cmPgmOpts.c b/cmPgmOpts.c index 6e3ab56..735c388 100644 --- a/cmPgmOpts.c +++ b/cmPgmOpts.c @@ -856,6 +856,9 @@ cmPoRC_t _cmPgmOptIndexToPtr( _cmPo_t* p, unsigned idx, const _cmPoArg_t** app unsigned n = 0; const _cmPoArg_t* a = p->args; + assert(app != NULL ); + *app = NULL; + while( a != NULL && n < idx ) { ++n; @@ -872,28 +875,31 @@ cmPoRC_t _cmPgmOptIndexToPtr( _cmPo_t* p, unsigned idx, const _cmPoArg_t** app unsigned cmPgmOptNumId( cmPgmOptH_t h, unsigned argIdx ) { - const _cmPoArg_t* a; + const _cmPoArg_t* a = NULL; cmPoRC_t rc; if((rc = _cmPgmOptIndexToPtr(_cmPoHandleToPtr(h),argIdx,&a)) != kOkPoRC ) return cmInvalidId; + assert( a != NULL ); return a->opt->numId; } unsigned cmPgmOptCharId( cmPgmOptH_t h, unsigned argIdx ) { - const _cmPoArg_t* a; + const _cmPoArg_t* a = NULL; cmPoRC_t rc; if((rc = _cmPgmOptIndexToPtr(_cmPoHandleToPtr(h),argIdx,&a)) != kOkPoRC ) return cmInvalidId; + assert(a != NULL ); return a->opt->charId; } const cmChar_t* cmPgmOptWordId( cmPgmOptH_t h, unsigned argIdx ) { - const _cmPoArg_t* a; + const _cmPoArg_t* a = NULL; cmPoRC_t rc; if((rc = _cmPgmOptIndexToPtr(_cmPoHandleToPtr(h),argIdx,&a)) != kOkPoRC ) return NULL; + assert(a!=NULL); return a->opt->wordId; } diff --git a/cmProc4.c b/cmProc4.c index 9c9f1a3..1f12643 100644 --- a/cmProc4.c +++ b/cmProc4.c @@ -2437,8 +2437,8 @@ void cmScMatcherPrint( cmScMatcher* p ) // if this result did not match a score event if( cmIsFlag(rp->flags,kSmFalsePosFl) ) { - unsigned d_min; - cmScMatcherPrint_t* dp = NULL; + unsigned d_min = 0; + cmScMatcherPrint_t* dp = NULL; unsigned scLocIdx = cmInvalidIdx; // if this result does not have a valid locIdx @@ -3942,6 +3942,8 @@ cmRC_t _cmScModGetParam( cmScModulator* p, const cmScModParam_t* pp, double* va switch( pp->pid ) { case kInvalidModPId: + rc = cmCtxRtCondition( &p->obj, cmInvalidArgRC, "An invalid parameter was encountered."); + goto errLabel; break; case kLiteralModPId: @@ -4059,7 +4061,7 @@ bool _cmScModExec( cmScModulator* p, cmScModVar_t* vp ) case kSetLineModTId: case kLineModTId: { - double v1, td; + double v1=0, td=0; // get the target value if((rc = _cmScModGetParam(p,&vp->entry->end,&v1)) != cmOkRC) diff --git a/cmRtSys.c b/cmRtSys.c index 425168d..60e030a 100644 --- a/cmRtSys.c +++ b/cmRtSys.c @@ -1464,7 +1464,9 @@ void cmRtSysTest( cmCtx_t* ctx, int argc, const char* argv[] ) cmRtSysStatus_t status; _cmRtTestCbRecd cbRecd = {1000.0,0,48000.0,0}; cmRpt_t* rpt = &ctx->rpt; - + memset(&status,0,sizeof(status)); + + unsigned meterMs = 50; unsigned ssCnt = 1; unsigned rtSubIdx = 0;