[Coverity] Fix a bunch of partially-initialised structure warnings

This commit is contained in:
baldurk
2016-07-20 16:45:06 +02:00
parent 240bdc3156
commit 6545625874
27 changed files with 63 additions and 27 deletions
+2
View File
@@ -381,6 +381,8 @@ public:
Serialiser *ser = NULL;
GetPacket(type, ser);
m_PID = 0;
// failed handshaking
if(m_Socket == NULL || ser == NULL)
return;
-5
View File
@@ -1889,11 +1889,6 @@ APIProperties ProxySerialiser::GetAPIProperties()
m_FromReplaySerialiser->Serialise("", ret);
if(!m_ReplayHost)
{
m_APIProperties = ret;
}
return ret;
}
-1
View File
@@ -483,7 +483,6 @@ private:
bool m_RemoteHasResolver;
APIProperties m_APIProperties;
D3D11PipelineState m_D3D11PipelineState;
GLPipelineState m_GLPipelineState;
VulkanPipelineState m_VulkanPipelineState;
+3
View File
@@ -42,6 +42,9 @@ struct MapIntercept
RDCEraseEl(app);
RDCEraseEl(d3d);
numRows = numSlices = 1;
MapType = D3D11_MAP_WRITE_DISCARD;
MapFlags = 0;
verifyWrite = false;
}
void SetAppMemory(void *appMemory);
+1
View File
@@ -43,6 +43,7 @@ public:
D3D11Hook()
{
LibraryHooks::GetInstance().RegisterHook(DLL_NAME, this);
m_HasHooks = false;
m_EnabledHooks = true;
m_InsideCreate = false;
}
@@ -1566,6 +1566,7 @@ D3D11RenderState::ResourceRange::ResourceRange(ID3D11ShaderResourceView *srv)
{
resource = NULL;
maxMip = maxSlice = ~0U;
fullRange = true;
return;
}
@@ -1636,6 +1637,7 @@ D3D11RenderState::ResourceRange::ResourceRange(ID3D11UnorderedAccessView *uav)
{
resource = NULL;
maxMip = maxSlice = ~0U;
fullRange = true;
return;
}
@@ -1692,6 +1694,7 @@ D3D11RenderState::ResourceRange::ResourceRange(ID3D11RenderTargetView *rtv)
{
resource = NULL;
maxMip = maxSlice = ~0U;
fullRange = true;
return;
}
@@ -1753,6 +1756,7 @@ D3D11RenderState::ResourceRange::ResourceRange(ID3D11DepthStencilView *dsv)
{
resource = NULL;
maxMip = maxSlice = ~0U;
fullRange = true;
return;
}
+1
View File
@@ -44,6 +44,7 @@ public:
D3D9Hook()
{
LibraryHooks::GetInstance().RegisterHook(DLL_NAME, this);
m_HasHooks = false;
m_EnabledHooks = true;
}
@@ -598,6 +598,8 @@ WrappedID3D12GraphicsCommandList::WrappedID3D12GraphicsCommandList(ID3D12Graphic
// create a temporary and grab its resource ID
m_ResourceID = ResourceIDGen::GetNewUniqueID();
RDCEraseEl(m_Init);
m_ListRecord = NULL;
if(!RenderDoc::Inst().IsReplayApp())
+1
View File
@@ -77,6 +77,7 @@ public:
D3D12Hook()
{
LibraryHooks::GetInstance().RegisterHook(DLL_NAME, this);
m_HasHooks = false;
m_EnabledHooks = true;
m_InsideCreate = false;
}
+1 -1
View File
@@ -205,7 +205,7 @@ D3D12_GPU_DESCRIPTOR_HANDLE Unwrap(D3D12_GPU_DESCRIPTOR_HANDLE handle);
struct PortableHandle
{
PortableHandle() {}
PortableHandle() : index(0) {}
PortableHandle(ResourceId id, uint32_t i) : heap(id), index(i) {}
PortableHandle(uint32_t i) : index(i) {}
ResourceId heap;
+1
View File
@@ -38,6 +38,7 @@ public:
{
LibraryHooks::GetInstance().RegisterHook(DLL_NAME, this);
m_EnabledHooks = true;
m_HasHooks = false;
}
bool CreateHooks(const char *libName)
+3 -6
View File
@@ -807,6 +807,9 @@ WrappedOpenGL::WrappedOpenGL(const char *logfile, const GLHookSet &funcs) : m_Re
m_FakeIdxBuf = 0;
m_FakeIdxSize = 0;
m_CurChunkOffset = 0;
m_AddedDrawcall = false;
RDCDEBUG("Debug Text enabled - for development! remove before release!");
m_pSerialiser->SetDebugText(true);
@@ -2921,9 +2924,7 @@ bool WrappedOpenGL::Serialise_BeginCaptureFrame(bool applyInitialState)
if(m_State <= EXECUTING && applyInitialState)
{
m_DoStateVerify = false;
state.ApplyState(GetCtx(), this);
m_DoStateVerify = true;
}
return true;
@@ -3670,8 +3671,6 @@ void WrappedOpenGL::ContextReplayLog(LogState readType, uint32_t startEventID, u
{
m_State = readType;
m_DoStateVerify = true;
GLChunkType header = (GLChunkType)m_pSerialiser->PushContext(NULL, NULL, 1, false);
RDCASSERTEQUAL(header, CONTEXT_CAPTURE_HEADER);
@@ -3779,8 +3778,6 @@ void WrappedOpenGL::ContextReplayLog(LogState readType, uint32_t startEventID, u
GetResourceManager()->MarkInFrame(false);
m_State = READING;
m_DoStateVerify = false;
}
void WrappedOpenGL::ContextProcessChunk(uint64_t offset, GLChunkType chunk)
-3
View File
@@ -323,9 +323,6 @@ private:
ResourceId m_FakeVAOID;
bool m_DoStateVerify;
// GLRenderState *m_CurrentPipelineState;
Serialiser *GetSerialiser() { return m_pSerialiser; }
uint32_t GetLogVersion() { return m_InitParams.SerialiseVersion; }
void ProcessChunk(uint64_t offset, GLChunkType context);
+2
View File
@@ -37,6 +37,8 @@ GLReplay::GLReplay()
RDCEraseEl(m_ReplayCtx);
m_DebugCtx = NULL;
m_DebugID = 0;
m_OutputWindowID = 1;
}
+1 -1
View File
@@ -374,7 +374,7 @@ private:
void CreateOutputWindowBackbuffer(OutputWindow &outwin, bool depth);
GLWindowingData m_ReplayCtx;
int64_t m_DebugID;
uint64_t m_DebugID;
OutputWindow *m_DebugCtx;
void MakeCurrentReplayContext(GLWindowingData *ctx);
@@ -122,7 +122,10 @@ public:
quadIndex = 0;
nextInstruction = 0;
done = false;
trace = NULL;
dxbc = NULL;
device = NULL;
RDCEraseEl(semantics);
}
State(int quadIdx, const ShaderDebugTrace *t, DXBC::DXBCFile *f, WrappedID3D11Device *d)
{
@@ -132,6 +135,7 @@ public:
trace = t;
dxbc = f;
device = d;
RDCEraseEl(semantics);
}
void SetTrace(int quadIdx, const ShaderDebugTrace *t)
@@ -663,6 +663,7 @@ struct ASMOperand
values[0] = values[1] = values[2] = values[3] = 0;
modifier = OPERAND_MODIFIER_NONE;
precision = PRECISION_DEFAULT;
funcNum = 0;
}
bool operator==(const ASMOperand &o) const;
@@ -747,10 +748,13 @@ struct ASMDecl
instruction = 0;
declaration = NUM_OPCODES;
refactoringAllowed = doublePrecisionFloats = forceEarlyDepthStencil =
enableRawAndStructuredBuffers = false;
enableRawAndStructuredBuffers = skipOptimisation = enableMinPrecision =
enableD3D11_1DoubleExtensions = enableD3D11_1ShaderExtensions = false;
stride = 0;
hasCounter = false;
numTemps = 0;
tempReg = 0;
tempComponentCount = 0;
count = 0;
groupSize[0] = groupSize[1] = groupSize[2] = 0;
resType[0] = resType[1] = resType[2] = resType[3] = NUM_RETURN_TYPES;
@@ -766,6 +770,15 @@ struct ASMDecl
outPrim = OUTPUT_PRIMITIVE_UNDEFINED;
inPrim = PRIMITIVE_UNDEFINED;
outTopology = TOPOLOGY_UNDEFINED;
instanceCount = 0;
indexRange = 0;
maxTessFactor = 0.0f;
globallyCoherant = false;
functionBody = 0;
functionTable = 0;
interfaceID = 0;
numInterfaces = 0;
numTypes = 0;
}
string str;
@@ -526,6 +526,8 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength)
RDCASSERT(ByteCodeLength < UINT32_MAX);
RDCEraseEl(m_ShaderStats);
m_ShaderBlob.resize(ByteCodeLength);
memcpy(&m_ShaderBlob[0], ByteCode, m_ShaderBlob.size());
@@ -1277,6 +1279,9 @@ SDBGChunk::SDBGChunk(void *data)
{
m_HasDebugInfo = false;
m_ShaderFlags = 0;
RDCEraseEl(m_Header);
{
uint32_t *raw = (uint32_t *)data;
@@ -1415,6 +1420,8 @@ SPDBChunk::SPDBChunk(void *chunk)
byte *data = NULL;
m_ShaderFlags = 0;
uint32_t spdblength;
{
uint32_t *raw = (uint32_t *)chunk;
@@ -1427,8 +1434,6 @@ SPDBChunk::SPDBChunk(void *chunk)
data = (byte *)&raw[2];
}
m_ShaderFlags = 0;
FileHeaderPage *header = (FileHeaderPage *)data;
if(memcmp(header->identifier, "Microsoft C/C++ MSF 7.00\r\n\032DS\0\0", sizeof(header->identifier)))
+3
View File
@@ -160,6 +160,9 @@ const char *VkChunkNames[] = {
VkInitParams::VkInitParams()
{
SerialiseVersion = VK_SERIALISE_VERSION;
AppVersion = 0;
EngineVersion = 0;
APIVersion = 0;
}
ReplayCreateStatus VkInitParams::Serialise()
+2 -1
View File
@@ -360,7 +360,7 @@ private:
struct BakedCmdBufferInfo
{
BakedCmdBufferInfo() : draw(NULL) {}
BakedCmdBufferInfo() : draw(NULL), eventCount(0), curEventID(0), drawCount(0) {}
~BakedCmdBufferInfo() { SAFE_DELETE(draw); }
vector<FetchAPIEvent> curEvents;
vector<DebugMessage> debugMessages;
@@ -370,6 +370,7 @@ private:
struct CmdBufferState
{
CmdBufferState() : idxWidth(0), subpass(0) {}
ResourceId pipeline;
struct DescriptorAndOffsets
+1
View File
@@ -148,6 +148,7 @@ public:
align(0),
totalsize(0),
curoffset(0),
ringCount(0),
m_pDriver(NULL),
device(VK_NULL_HANDLE)
{
+5 -1
View File
@@ -1053,7 +1053,11 @@ public:
struct ImageLayouts
{
ImageLayouts() : layerCount(1), levelCount(1) {}
ImageLayouts() : layerCount(1), levelCount(1), format(VK_FORMAT_UNDEFINED)
{
extent.width = extent.height = extent.depth = 1;
}
vector<ImageRegionState> subresourceStates;
int layerCount, levelCount;
VkExtent3D extent;
+1
View File
@@ -51,6 +51,7 @@ public:
{
LibraryHooks::GetInstance().RegisterHook(DLL_NAME, this);
m_EnabledHooks = true;
m_HasHooks = false;
}
bool CreateHooks(const char *libName)
+1 -1
View File
@@ -244,7 +244,7 @@ struct RDCThumbnailProviderFactory : public IClassFactory
{
unsigned int m_iRefcount;
RDCThumbnailProviderFactory() : m_iRefcount(1) {}
RDCThumbnailProviderFactory() : m_iRefcount(1), locked(false) {}
virtual ~RDCThumbnailProviderFactory() {}
ULONG STDMETHODCALLTYPE AddRef()
{
+2
View File
@@ -39,6 +39,8 @@ ReplayOutput::ReplayOutput(ReplayRenderer *parent, void *w, OutputType type)
m_pDevice = parent->GetDevice();
m_EventID = parent->m_EventID;
m_OverlayResourceId = ResourceId();
RDCEraseEl(m_RenderData);
-3
View File
@@ -72,15 +72,12 @@ private:
void DisplayMesh();
ReplayRenderer *m_pRenderer;
size_t m_ID;
bool m_OverlayDirty;
bool m_ForceOverlayRefresh;
IReplayDriver *m_pDevice;
uint32_t m_TexWidth, m_TexHeight;
struct OutputPair
{
ResourceId texture;
+1 -1
View File
@@ -41,7 +41,7 @@
struct diy_fp
{
diy_fp() {}
diy_fp() : mantissa(0), exp(0) {}
diy_fp(uint64_t mant, int exponent) : mantissa(mant), exp(exponent) {}
uint64_t mantissa;
int exp;