fixed some coverity warnings

This commit is contained in:
jeefo 2015-06-29 20:51:25 +03:00
commit 95c121ef43
10 changed files with 127 additions and 56 deletions

View file

@ -148,12 +148,18 @@ public:
{
m_textSize = 0;
m_codeSize = 0;
m_matchPosition = 0;
m_matchLength = 0;
}
~Compressor (void)
{
m_textSize = 0;
m_codeSize = 0;
m_matchPosition = 0;
m_matchLength = 0;
}
int InternalEncode (const char *fileName, byte *header, int headerSize, byte *buffer, int bufferSize)

View file

@ -110,14 +110,12 @@ public:
Library (const char *fileName)
{
m_ptr = NULL;
if (fileName == NULL)
return;
#ifdef PLATFORM_WIN32
m_ptr = LoadLibrary (fileName);
#else
m_ptr = dlopen (fileName, RTLD_NOW);
#endif
LoadLib (fileName);
}
~Library (void)
@ -133,6 +131,16 @@ public:
}
public:
inline void *LoadLib (const char *fileName)
{
#ifdef PLATFORM_WIN32
m_ptr = LoadLibrary (fileName);
#else
m_ptr = dlopen (fileName, RTLD_NOW);
#endif
return m_ptr;
}
void *GetFunctionAddr (const char *functionName)
{
if (!IsLoaded ())
@ -1050,7 +1058,7 @@ private:
void RunPlayerMovement (void);
byte ThrottledMsec (void);
void GetValidWaypoint (void);
void ChangeWptIndex (int waypointIndex);
int ChangeWptIndex (int waypointIndex);
bool IsDeadlyDrop (const Vector &to);
bool OutOfBombTimer (void);
void SelectLeaderEachTeam (int team);
@ -1580,6 +1588,8 @@ public:
public:
ConVar (const char *name, const char *initval, VarType type = VT_NORMAL)
{
m_eptr = NULL;
g_convarWrapper->RegisterVariable (name, initval, type, this);
}