more warning fixes

This commit is contained in:
Borja Ferrer 2006-08-18 19:08:51 +00:00
parent e2932fb61a
commit f3a833dd1b
17 changed files with 22 additions and 19 deletions

View File

@ -114,7 +114,7 @@ edict_t *FindEntityByString(edict_t *pentStart, const char *szKeyword, const cha
#define GET_CAPTURE_AREA(x) \
if ( mObjects.obj[x].areaflags == 0 ){\
mObjects.obj[x].areaflags = 1;\
while ( mObjects.obj[x].pAreaEdict = FindEntityByString(mObjects.obj[x].pAreaEdict,"target",STRING(mObjects.obj[x].pEdict->v.targetname)) )\
while ( (mObjects.obj[x].pAreaEdict = FindEntityByString(mObjects.obj[x].pAreaEdict,"target",STRING(mObjects.obj[x].pEdict->v.targetname))) )\
if ( strcmp( STRING(mObjects.obj[x].pAreaEdict->v.classname),"dod_capture_area" )==0){\
mObjects.obj[x].areaflags = 2;\
break;\

View File

@ -174,7 +174,7 @@ void PlayerPreThink_Post( edict_t *pEntity ) {
}
if (pPlayer->sendScore && pPlayer->sendScore < gpGlobals->time){
pPlayer->sendScore = 0.0f;
pPlayer->sendScore = 0;
MF_ExecuteForward( iFScore,pPlayer->index, pPlayer->lastScore, pPlayer->savedScore );
}

View File

@ -88,10 +88,10 @@ void Client_ObjScore(void* mValue)
break;
case 1:
score = *(int*)mValue;
if ( (pPlayer->lastScore = score - pPlayer->savedScore) && isModuleActive() )
if ( (pPlayer->lastScore = score - (int)(pPlayer->savedScore)) && isModuleActive() )
{
pPlayer->updateScore(pPlayer->current,pPlayer->lastScore);
pPlayer->sendScore = gpGlobals->time + 0.25f;
pPlayer->sendScore = (int)(gpGlobals->time + 0.25f);
}
pPlayer->savedScore = score;
break;

View File

@ -5,7 +5,7 @@
using namespace SourceMod;
MysqlResultRow::MysqlResultRow() :
m_Columns(0), m_CurRow(NULL)
m_CurRow(NULL), m_Columns(0)
{
}

View File

@ -239,7 +239,7 @@ bool SWThreadHandle::WaitForThread()
}
SWThreadHandle::SWThreadHandle(IThreadCreator *parent, const ThreadParams *p, IThread *thread) :
m_parent(parent), m_params(*p), pThread(thread), m_state(Thread_Paused)
m_state(Thread_Paused), m_params(*p), m_parent(parent), pThread(thread)
{
}

View File

@ -146,7 +146,7 @@ void PosixThreader::PosixMutex::DestroyThis()
******************/
PosixThreader::ThreadHandle::ThreadHandle(IThreader *parent, IThread *run, const ThreadParams *params) :
m_parent(parent), m_run(run), m_params(*params), m_state(Thread_Paused)
m_parent(parent), m_params(*params), m_run(run), m_state(Thread_Paused)
{
pthread_mutex_init(&m_runlock, NULL);
pthread_mutex_init(&m_statelock, NULL);

View File

@ -327,7 +327,7 @@ AtomicResult::AtomicResult()
{
m_IsFree = true;
m_CurRow = 1;
m_RowCount = NULL;
m_RowCount = 0;
m_Table = NULL;
m_AllocSize = 0;
}

View File

@ -95,7 +95,7 @@ static cell AMX_NATIVE_CALL ns_get_speedchange(AMX *amx, cell *params)
{
// Params: get_speedchange(index)
int index=params[1];
if (!(params[1]>0 && params[1]<=gpGlobals->maxClients))
if (!(index>0 && index<=gpGlobals->maxClients))
return 0;
CPlayer *player = GET_PLAYER_I(params[1]);
return player->speedchange;

View File

@ -401,8 +401,7 @@ int LogToIndex(char logline[128])
}
cindex[x]='\0';
// Now we have their name, now cycle through all players to find which index it is
x=1;
for (x;x<=gpGlobals->maxClients;x++)
for (x=1;x<=gpGlobals->maxClients;x++)
{
cname=strdup(cindex);
if (!FNullEnt(INDEXENT2(x)))
@ -418,7 +417,7 @@ int LogToIndex(char logline[128])
int Find_Building_Hive(void)
{
edict_t *pEntity=NULL;
while (pEntity = UTIL_FindEntityByString(pEntity,"classname","team_hive"))
while ((pEntity = UTIL_FindEntityByString(pEntity,"classname","team_hive")))
{
if (pEntity->v.health > 0 && pEntity->v.solid > 0 && pEntity->v.fuser1 < 1000)
{

View File

@ -14,7 +14,10 @@ int HashFunction<String>(const String & k)
unsigned long hash = 5381;
const char *str = k.c_str();
char c;
while (c = *str++) hash = ((hash << 5) + hash) + c; // hash*33 + c
while ((c = *str++))
{
hash = ((hash << 5) + hash) + c; // hash*33 + c
}
return hash;
}

View File

@ -239,7 +239,7 @@ bool SWThreadHandle::WaitForThread()
}
SWThreadHandle::SWThreadHandle(IThreadCreator *parent, const ThreadParams *p, IThread *thread) :
m_parent(parent), m_params(*p), pThread(thread), m_state(Thread_Paused)
m_state(Thread_Paused), m_params(*p), m_parent(parent), pThread(thread)
{
}

View File

@ -146,7 +146,7 @@ void PosixThreader::PosixMutex::DestroyThis()
******************/
PosixThreader::ThreadHandle::ThreadHandle(IThreader *parent, IThread *run, const ThreadParams *params) :
m_parent(parent), m_run(run), m_params(*params), m_state(Thread_Paused)
m_parent(parent), m_params(*params), m_run(run), m_state(Thread_Paused)
{
pthread_mutex_init(&m_runlock, NULL);
pthread_mutex_init(&m_statelock, NULL);

View File

@ -322,7 +322,7 @@ AtomicResult::AtomicResult()
{
m_IsFree = true;
m_CurRow = 1;
m_RowCount = NULL;
m_RowCount = 0;
m_Table = NULL;
m_AllocSize = 0;
}

View File

@ -356,3 +356,4 @@ void OnPluginsLoaded()
g_damage_info = MF_RegisterForward("client_damage", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
g_death_info = MF_RegisterForward("client_death", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
}

View File

@ -204,7 +204,7 @@ END_USER_FUNC()
BEGIN_USER_FUNC(is_in_slowmo)
if (pPlayer->GetOffsetF(TSX_ISSLO_OFFSET))
return pPlayer->GetOffsetF(TSX_SLOMO2_OFFSET);
return amx_ftoc(pPlayer->GetOffsetF(TSX_SLOMO2_OFFSET));
return 0;
END_USER_FUNC()