uninitialized variables-sfx

This commit is contained in:
AzaezelX 2020-05-11 15:24:49 -05:00
parent 7392d598da
commit a1a6143e01
11 changed files with 32 additions and 16 deletions

View file

@ -40,6 +40,7 @@ SFXVorbisStream* SFXVorbisStream::create( Stream *stream )
SFXVorbisStream::SFXVorbisStream()
: mVF( NULL ),
mBitstream(-1),
mBytesRead( 0 )
{
}
@ -47,6 +48,9 @@ SFXVorbisStream::SFXVorbisStream()
SFXVorbisStream::SFXVorbisStream( const SFXVorbisStream& cloneFrom )
: Parent( cloneFrom )
{
mVF = NULL;
mBitstream = -1;
mBytesRead = 0;
if( !mStream->hasCapability( Stream::StreamPosition ) )
{
Con::errorf( "SFXVorbisStream::SFXVorbisStream() - Source stream does not allow seeking" );

View file

@ -94,6 +94,7 @@ SFXWavStream* SFXWavStream::create( Stream *stream )
}
SFXWavStream::SFXWavStream()
:mDataStart(-1)
{
}

View file

@ -35,8 +35,11 @@ SFXALDevice::SFXALDevice( SFXProvider *provider,
: Parent( name, provider, useHardware, maxBuffers ),
mOpenAL( openal ),
mContext( NULL ),
mDevice( NULL ),
mRolloffFactor( 1.0f )
mDevice( NULL ),
mDistanceModel(SFXDistanceModelLinear),
mDistanceFactor(1.0f),
mRolloffFactor( 1.0f ),
mUserRolloffFactor(1.0f)
{
mMaxBuffers = getMax( maxBuffers, 8 );
@ -80,6 +83,10 @@ SFXALDevice::SFXALDevice( SFXProvider *provider,
SFXInternal::gUpdateThread->start();
}
#endif
dMemset(effectSlot, 0, sizeof(effectSlot));
dMemset(effect, 0, sizeof(effect));
uLoop = 0;
}
//-----------------------------------------------------------------------------

View file

@ -36,7 +36,7 @@ class SFXALProvider : public SFXProvider
public:
SFXALProvider()
: SFXProvider( "OpenAL" ) { mALDL = NULL; }
: SFXProvider( "OpenAL" ) { dMemset(&mOpenAL,0,sizeof(mOpenAL)); mALDL = NULL; }
virtual ~SFXALProvider();
protected:

View file

@ -75,7 +75,8 @@ ConsoleDocClass( SFXController,
SFXController::SFXController( SFXPlayList* playList )
: Parent( playList ),
mTrace( playList->trace() )
mTrace( playList->trace() ),
mLoopCounter(0)
{
VECTOR_SET_ASSOCIATION( mInsns );
VECTOR_SET_ASSOCIATION( mSources );

View file

@ -93,13 +93,14 @@ class SFXController : public SFXSource
U32 mLoopCount;
} mArg;
Insn() {}
Insn()
: mOpcode(SFXController::OP_Delay), mSlotIndex(0), mState(NULL) {mArg.mLoopCount=0;}
Insn( EOp opcode )
: mOpcode( opcode ), mSlotIndex( U32_MAX ), mState( NULL ) {}
: mOpcode( opcode ), mSlotIndex( U32_MAX ), mState( NULL ) {mArg.mLoopCount=0;}
Insn( U32 slotIndex, SFXState* state )
: mSlotIndex( slotIndex ), mState( state ) {}
: mOpcode(SFXController::OP_Delay), mSlotIndex( slotIndex ), mState( state ){mArg.mLoopCount=0;}
Insn( EOp opcode, U32 slotIndex, SFXState* state )
: mOpcode( opcode ), mSlotIndex( slotIndex ), mState( state ) {}
: mOpcode( opcode ), mSlotIndex( slotIndex ), mState( state ) {mArg.mLoopCount=0;}
};
///
@ -130,7 +131,7 @@ class SFXController : public SFXSource
F32 mFadeOutTime;
Source()
: mState( 0 ) {}
: mState( 0 ), mSlotIndex(0), mVolumeScale(1.0f), mPitchScale(1.0f), mFadeInTime(0), mFadeOutTime(0) {}
};
/// The current instruction in "mInsns".
@ -169,7 +170,7 @@ class SFXController : public SFXSource
void _genTransition( Insn& insn, SFXPlayList::ETransitionMode transition );
///
void _dumpInsns();
void _dumpInsns() {};
///
void _initInsn();
@ -198,7 +199,7 @@ class SFXController : public SFXSource
~SFXController();
/// Constructor for the sake of ConsoleObject.
explicit SFXController() {}
explicit SFXController(): mIp(0), mTrace(false), mDelayEndTime(0), mLoopCounter(0) {}
/// Return the playlist being played back by the controller.
SFXPlayList* getPlayList() const;

View file

@ -324,7 +324,7 @@ class SFXWrapAroundBuffer : public SFXBuffer
SFXWrapAroundBuffer( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description );
SFXWrapAroundBuffer( SFXDescription* description )
: Parent( description ), mBufferSize( 0 ) {}
: Parent( description ), mBufferSize( 0 ), mWriteOffset(0) {}
virtual U32 getMemoryUsed() const { return mBufferSize; }
};

View file

@ -107,6 +107,8 @@ bool SFXRangeModifier::update()
SFXFadeModifier::SFXFadeModifier( SFXSource* source, F32 time, F32 endVolume, F32 startTime, EOnEnd onEndDo, bool removeWhenDone )
: Parent( source, startTime, startTime + time, removeWhenDone ),
mStartVolume(source->getVolume()),
mCurrentVolume(source->getVolume()),
mEndVolume( endVolume ),
mOnEnd( onEndDo )
{

View file

@ -47,7 +47,7 @@ class SFXModifier : public IPolled
/// Create an effect that operates on "source".
SFXModifier( SFXSource* source, bool removeWhenDone = false )
: mSource( source ) {}
: mSource( source ), mRemoveWhenDone(removeWhenDone) {}
virtual ~SFXModifier() {}
};

View file

@ -68,7 +68,7 @@ ConsoleDocClass( SFXSound,
//-----------------------------------------------------------------------------
SFXSound::SFXSound()
: mVoice( NULL )
: mVoice( NULL ), mDuration(0), mSetPositionValue(0)
{
// NOTE: This should never be used directly
// and is only here to satisfy satisfy the
@ -79,7 +79,7 @@ SFXSound::SFXSound()
SFXSound::SFXSound( SFXProfile *profile, SFXDescription* desc )
: Parent( profile, desc ),
mVoice( NULL )
mVoice( NULL ), mDuration(0)
{
mSetPositionValue = 0;
}

View file

@ -208,7 +208,7 @@ class SFXWorld : public ScopeTracker< NUM_DIMENSIONS, Object >
/// between this space and the space above us in the stack.
Object mObject;
Scope() {}
Scope() :mSortValue(0), mSoundscape(NULL) {}
Scope( F32 sortValue, Object object )
: mSortValue( sortValue ),
mSoundscape( NULL ),