Fix various code issues found using PVS-Studio
This commit is contained in:
@@ -92,7 +92,7 @@ void SceneAnimationPlayer::Pause()
|
||||
if (_state != PlayState::Playing)
|
||||
return;
|
||||
|
||||
if (IsActiveInHierarchy() && _state == PlayState::Playing)
|
||||
if (IsActiveInHierarchy())
|
||||
{
|
||||
UNREGISTER_TICK;
|
||||
}
|
||||
|
||||
@@ -1027,6 +1027,13 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator=(Iterator&& v)
|
||||
{
|
||||
_array = v._array;
|
||||
_index = v._index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator++()
|
||||
{
|
||||
if (_index != _array->_count)
|
||||
|
||||
@@ -173,6 +173,14 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator=(Iterator&& v)
|
||||
{
|
||||
_collection = v._collection;
|
||||
_chunkIndex = v._chunkIndex;
|
||||
_index = v._index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator++()
|
||||
{
|
||||
// Check if it is not at end
|
||||
|
||||
@@ -348,6 +348,13 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator=(Iterator&& v)
|
||||
{
|
||||
_collection = v._collection;
|
||||
_index = v._index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator++()
|
||||
{
|
||||
const int32 capacity = _collection->_size;
|
||||
|
||||
@@ -329,6 +329,13 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator=(Iterator&& v)
|
||||
{
|
||||
_collection = v._collection;
|
||||
_index = v._index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Iterator& operator++()
|
||||
{
|
||||
const int32 capacity = _collection->_size;
|
||||
|
||||
@@ -338,7 +338,7 @@ public:
|
||||
Platform::MemoryCopy(Base::_data, prev, prevLength * sizeof(T));
|
||||
Platform::MemoryCopy(Base::_data + prevLength * sizeof(T), data, length * sizeof(T));
|
||||
|
||||
if (_isAllocated && prev)
|
||||
if (_isAllocated)
|
||||
Allocator::Free(prev);
|
||||
_isAllocated = true;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,12 @@ protected:
|
||||
{
|
||||
}
|
||||
|
||||
StringViewBase(const StringViewBase& other)
|
||||
: _data(other._data)
|
||||
, _length(other._length)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
typedef T CharType;
|
||||
|
||||
|
||||
@@ -289,9 +289,9 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa
|
||||
// Check if need to setup ribbon modules
|
||||
int32 ribbonModuleIndex = 0;
|
||||
int32 ribbonModulesDrawIndicesPos = 0;
|
||||
int32 ribbonModulesDrawIndicesStart[PARTICLE_EMITTER_MAX_RIBBONS];
|
||||
int32 ribbonModulesDrawIndicesCount[PARTICLE_EMITTER_MAX_RIBBONS];
|
||||
int32 ribbonModulesSegmentCount[PARTICLE_EMITTER_MAX_RIBBONS];
|
||||
int32 ribbonModulesDrawIndicesStart[PARTICLE_EMITTER_MAX_RIBBONS] = {};
|
||||
int32 ribbonModulesDrawIndicesCount[PARTICLE_EMITTER_MAX_RIBBONS] = {};
|
||||
int32 ribbonModulesSegmentCount[PARTICLE_EMITTER_MAX_RIBBONS] = {};
|
||||
if (emitter->Graph.RibbonRenderingModules.HasItems())
|
||||
{
|
||||
// Prepare ribbon data
|
||||
|
||||
@@ -481,7 +481,7 @@ bool CachedPSO::Init(GPUShader* shader, bool useDepth)
|
||||
|
||||
// Create pipeline states
|
||||
GPUPipelineState::Description desc = GPUPipelineState::Description::DefaultFullscreenTriangle;
|
||||
desc.DepthEnable = desc.DepthWriteEnable = useDepth;
|
||||
desc.DepthEnable = useDepth;
|
||||
desc.DepthWriteEnable = false;
|
||||
desc.DepthClipEnable = false;
|
||||
desc.VS = shader->GetVS("VS");
|
||||
|
||||
@@ -40,6 +40,12 @@ struct FLAXENGINE_API ScriptingTypeHandle
|
||||
{
|
||||
}
|
||||
|
||||
FORCE_INLINE ScriptingTypeHandle(ScriptingTypeHandle&& other)
|
||||
: Module(other.Module)
|
||||
, TypeIndex(other.TypeIndex)
|
||||
{
|
||||
}
|
||||
|
||||
ScriptingTypeHandle(const ScriptingTypeInitializer& initializer);
|
||||
|
||||
FORCE_INLINE operator bool() const
|
||||
|
||||
@@ -1215,7 +1215,8 @@ Color32* TerrainPatch::GetSplatMapData(int32 index)
|
||||
void TerrainPatch::ClearSplatMapCache()
|
||||
{
|
||||
PROFILE_CPU_NAMED("Terrain.ClearSplatMapCache");
|
||||
_cachedSplatMap->Clear();
|
||||
if (_cachedSplatMap)
|
||||
_cachedSplatMap->Clear();
|
||||
}
|
||||
|
||||
void TerrainPatch::ClearCache()
|
||||
|
||||
Reference in New Issue
Block a user