|
I have decided to give PVS-Studio static code analyzer a try and ran its most recent version 4.53 over the newest revision of Hieroglyph3 - 73210. There are some interesting code parts pointed out by PVS-Studio:
On 32-bit platform, structure size can be reduced from 20 to 16 bytes by rearranging the fields according to their sizes in decreasing order.
Hieroglyph3 ms3dspec.h 56
struct MS3DVertex
{
unsigned char flags; // SELECTED | SELECTED2 | HIDDEN
float vertex[3]; //
char boneId; // -1 = no bone
unsigned char referenceCount;
};
On 32-bit platform, structure size can be reduced from 44 to 40 bytes by rearranging the fields according to their sizes in decreasing order.
Hieroglyph3 ms3dspec.h 75
struct MS3DGroup
{
unsigned char flags; // SELECTED | HIDDEN
char name[32]; //
unsigned short numtriangles; //
unsigned short *triangleIndices; // the groups group the triangles
char materialIndex; // -1 = no material
};
The 'pParameter' pointer was utilized before it was verified against nullptr. Check lines: 59, 62.
Hieroglyph3 parametermanagerdx11.cpp 59
void ParameterManagerDX11::SetParameter( RenderParameterDX11* pParameter )
{
const std::wstring& name = pParameter->GetName();
RenderParameterDX11* pCurrent = m_Parameters[name];
if ( pParameter )
{
A part of conditional expression is always true: true. Hieroglyph3
intrray3fbox3f.cpp 117
if ( bNotAllClipped && ( true || fT0 != fSaveT0 || fT1 != fSaveT1 ) )
The 'pRenderer' pointer was utilized before it was verified against nullptr. Check lines: 147, 148.
MFCwithD3D11 mfcwithd3d11.cpp 147
int CMFCwithD3D11App::ExitInstance()
{
pRenderer->Shutdown();
if ( pRenderer ) {
delete pRenderer;
}
Expression 'box.left < 0' is always false. Unsigned type value is never < 0.
ViewFromTheWindow app.cpp 253
if ( box.left < 0 ) box.left = 0;
Expression 'box.top < 0' is always false. Unsigned type value is never < 0.
ViewFromTheWindow app.cpp 255
if ( box.top < 0 ) box.top = 0;
These are probably the only relevant ones, at least I think so. I hope this report is helpful. :)
Greetings.
|