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) \ #define GET_CAPTURE_AREA(x) \
if ( mObjects.obj[x].areaflags == 0 ){\ if ( mObjects.obj[x].areaflags == 0 ){\
mObjects.obj[x].areaflags = 1;\ 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){\ if ( strcmp( STRING(mObjects.obj[x].pAreaEdict->v.classname),"dod_capture_area" )==0){\
mObjects.obj[x].areaflags = 2;\ mObjects.obj[x].areaflags = 2;\
break;\ break;\

View File

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

View File

@ -88,10 +88,10 @@ void Client_ObjScore(void* mValue)
break; break;
case 1: case 1:
score = *(int*)mValue; 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->updateScore(pPlayer->current,pPlayer->lastScore);
pPlayer->sendScore = gpGlobals->time + 0.25f; pPlayer->sendScore = (int)(gpGlobals->time + 0.25f);
} }
pPlayer->savedScore = score; pPlayer->savedScore = score;
break; break;

View File

@ -5,7 +5,7 @@
using namespace SourceMod; using namespace SourceMod;
MysqlResultRow::MysqlResultRow() : 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) : 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) : 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_runlock, NULL);
pthread_mutex_init(&m_statelock, NULL); pthread_mutex_init(&m_statelock, NULL);

View File

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

View File

@ -108,4 +108,4 @@ void CPlayer::Reset()
olddeadflag=0; olddeadflag=0;
oldteam=0; oldteam=0;
} }

View File

@ -43,4 +43,4 @@ vec3_t CSpawn::getpoint(int type, int num)
a=a->next; a=a->next;
} }
return Vector(0.0,0.0,0.0); return Vector(0.0,0.0,0.0);
} }

View File

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

View File

@ -401,8 +401,7 @@ int LogToIndex(char logline[128])
} }
cindex[x]='\0'; cindex[x]='\0';
// Now we have their name, now cycle through all players to find which index it is // Now we have their name, now cycle through all players to find which index it is
x=1; for (x=1;x<=gpGlobals->maxClients;x++)
for (x;x<=gpGlobals->maxClients;x++)
{ {
cname=strdup(cindex); cname=strdup(cindex);
if (!FNullEnt(INDEXENT2(x))) if (!FNullEnt(INDEXENT2(x)))
@ -418,7 +417,7 @@ int LogToIndex(char logline[128])
int Find_Building_Hive(void) int Find_Building_Hive(void)
{ {
edict_t *pEntity=NULL; 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) 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; unsigned long hash = 5381;
const char *str = k.c_str(); const char *str = k.c_str();
char c; 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; return hash;
} }

View File

@ -239,7 +239,7 @@ bool SWThreadHandle::WaitForThread()
} }
SWThreadHandle::SWThreadHandle(IThreadCreator *parent, const ThreadParams *p, IThread *thread) : 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) : 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_runlock, NULL);
pthread_mutex_init(&m_statelock, NULL); pthread_mutex_init(&m_statelock, NULL);

View File

@ -322,7 +322,7 @@ AtomicResult::AtomicResult()
{ {
m_IsFree = true; m_IsFree = true;
m_CurRow = 1; m_CurRow = 1;
m_RowCount = NULL; m_RowCount = 0;
m_Table = NULL; m_Table = NULL;
m_AllocSize = 0; 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_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); 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) BEGIN_USER_FUNC(is_in_slowmo)
if (pPlayer->GetOffsetF(TSX_ISSLO_OFFSET)) if (pPlayer->GetOffsetF(TSX_ISSLO_OFFSET))
return pPlayer->GetOffsetF(TSX_SLOMO2_OFFSET); return amx_ftoc(pPlayer->GetOffsetF(TSX_SLOMO2_OFFSET));
return 0; return 0;
END_USER_FUNC() END_USER_FUNC()