Browse Source

fix some undefined behaviors

android
nillerusr 4 years ago
parent
commit
7bb2dbdb1e
  1. 4
      materialsystem/cmaterialvar.cpp
  2. 2
      materialsystem/shaderapidx9/shaderapidx8.cpp
  3. 2
      public/bitvec.h
  4. 2
      public/togl/linuxwin/cglmprogram.h
  5. 2
      tier1/bitbuf.cpp

4
materialsystem/cmaterialvar.cpp

@ -23,10 +23,6 @@
#define MATERIALVAR_CHAR_BUF_SIZE 512 #define MATERIALVAR_CHAR_BUF_SIZE 512
/*#if !defined( _X360 )
#pragma pack (1)
#endif*/
ConVar mat_texture_tracking( "mat_texture_tracking", IsDebug() ? "1" : "0" ); ConVar mat_texture_tracking( "mat_texture_tracking", IsDebug() ? "1" : "0" );
CUtlMap<ITexture*, CInterlockedInt> s_TextureRefList( DefLessFunc( ITexture* ) ); CUtlMap<ITexture*, CInterlockedInt> s_TextureRefList( DefLessFunc( ITexture* ) );
CUtlMap<ITexture*, CInterlockedInt> *g_pTextureRefList = &s_TextureRefList; CUtlMap<ITexture*, CInterlockedInt> *g_pTextureRefList = &s_TextureRefList;

2
materialsystem/shaderapidx9/shaderapidx8.cpp

@ -3499,7 +3499,7 @@ void CShaderAPIDx8::ResetRenderState( bool bFullReset )
SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW ); SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
// No shade mode yet // No shade mode yet
m_DynamicState.m_ShadeMode = (D3DSHADEMODE)-1; m_DynamicState.m_ShadeMode = NULL;
ShadeMode( SHADER_SMOOTH ); ShadeMode( SHADER_SMOOTH );
m_DynamicState.m_bHWMorphingEnabled = false; m_DynamicState.m_bHWMorphingEnabled = false;

2
public/bitvec.h

@ -141,7 +141,7 @@ inline unsigned GetEndMask( int numBits )
} }
inline int GetBitForBitnum( int bitNum ) inline uint GetBitForBitnum( int bitNum )
{ {
static int bitsForBitnum[] = static int bitsForBitnum[] =
{ {

2
public/togl/linuxwin/cglmprogram.h

@ -155,7 +155,7 @@ public:
EGLMProgramType m_type; // vertex or pixel EGLMProgramType m_type; // vertex or pixel
uint m_nHashTag; // serial number for hashing unsigned long m_nHashTag; // serial number for hashing
char *m_text; // copy of text passed into constructor. Can change if editable shaders is enabled. char *m_text; // copy of text passed into constructor. Can change if editable shaders is enabled.
// note - it can contain multiple flavors, so use CGLMTextSectioner to scan it and locate them // note - it can contain multiple flavors, so use CGLMTextSectioner to scan it and locate them

2
tier1/bitbuf.cpp

@ -114,7 +114,7 @@ public:
for ( unsigned int littleBit=0; littleBit < 32; littleBit++ ) for ( unsigned int littleBit=0; littleBit < 32; littleBit++ )
StoreLittleDWord( &g_LittleBits[littleBit], 0, 1u<<littleBit ); StoreLittleDWord( &g_LittleBits[littleBit], 0, 1u<<littleBit );
} }
}; };
static CBitWriteMasksInit g_BitWriteMasksInit; static CBitWriteMasksInit g_BitWriteMasksInit;

Loading…
Cancel
Save