Fix warnings

This commit is contained in:
kaetemi 2013-09-27 01:11:19 +02:00
parent 04c28d5f63
commit 08eed8cb94
7 changed files with 19 additions and 10 deletions

View file

@ -43,7 +43,7 @@ void CSecurityCheckForFastDisconnection::forwardSecurityCode(NLMISC::IStream& ms
}
//
CSecurityCode CSecurityCheckForFastDisconnection::encode(char *passPhrase)
CSecurityCode CSecurityCheckForFastDisconnection::encode(const char *passPhrase)
{
if (!passPhrase)
throw Exception("Null passPhrase");
@ -56,7 +56,7 @@ CSecurityCode CSecurityCheckForFastDisconnection::encode(char *passPhrase)
}
//
void CSecurityCheckForFastDisconnection::check(char *passPhrase)
void CSecurityCheckForFastDisconnection::check(const char *passPhrase)
{
if (SecurityCode != encode(passPhrase))
throw Exception("Check not passed");

View file

@ -61,9 +61,9 @@ public:
/// Set cookie
void setCookie(const NLNET::CLoginCookie& cookie) { Block.Cookie.set(cookie.getUserAddr(), cookie.getUserKey(), cookie.getUserId()); } // don't use the default generated bitwise assignment operator, because of padding junk that would be copied
/// Return the security code
CSecurityCode encode(char *passPhrase);
CSecurityCode encode(const char *passPhrase);
/// Check the security code
void check(char *passPhrase);
void check(const char *passPhrase);
/// Read some data from stream
void receiveSecurityCode(NLMISC::IStream& msgin);

View file

@ -1270,7 +1270,7 @@ bool forageTestDoExtract(
testSource->extractMaterial( req, abs, ForageQualityCeilingFactor.get(), ForageQualitySlowFactor.get(), res, successFactor, 0, row, propDrop );
fprintf( f, "%g;%g;%g;%g;%g;%g;%g;%g;%g;%u;%u;\n",
res[CHarvestSource::A], res[CHarvestSource::Q],
testSource->getD(), testSource->getE(), 0 /*testSource->getC()*/,
testSource->getD(), testSource->getE(), 0.f /*testSource->getC()*/,
reqS, reqA, reqQ,
testSource->quantity(), testSource->getImpactScheme()*5, 127 );
if ( (!eventD) && (testSource->getD() > 127) )

View file

@ -1936,7 +1936,7 @@ void CDepositMapsBatchTask::run()
CSString res;
disp.write( res );
res = res.replace( "\n", "<BR>\n" );
fprintf( outputF, res.c_str() );
fprintf( outputF, "%s", res.c_str() );
// Close files
fclose( inputF );

View file

@ -22,13 +22,17 @@ class CEntityState;
class COfflineEntityState;
class CCharacterRespawnPoints;
class CFarPosition;
class NLNET::CMessage;
class CModuleParent;
namespace NLNET
{
class CMessage;
}
namespace R2
{
struct TUserRole;
};
}
class CRingRewardPoints;

View file

@ -1187,9 +1187,14 @@ bool CNameManager::loadForbiddenNames()
while (true)
{
char str[512];
fgets(str, 511, fp);
char *fgres = fgets(str, 511, fp);
if(feof(fp))
break;
if (fgres == NULL)
{
nlwarning("NAMEMGR: Error reading file");
break;
}
if (strlen(str) > 0)
{
str[strlen(str)-1] = '\0';

View file

@ -208,7 +208,7 @@ namespace RSMGR
public:
CRingSessionManager()
: _DontUsePerm(false),
_CharSync(false)
_CharSync(NULL)
{
CRingSessionManagerSkel::init(this);
CWelcomeServiceClientSkel::init(this);