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) if (!passPhrase)
throw Exception("Null 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)) if (SecurityCode != encode(passPhrase))
throw Exception("Check not passed"); throw Exception("Check not passed");

View file

@ -61,9 +61,9 @@ public:
/// Set cookie /// 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 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 /// Return the security code
CSecurityCode encode(char *passPhrase); CSecurityCode encode(const char *passPhrase);
/// Check the security code /// Check the security code
void check(char *passPhrase); void check(const char *passPhrase);
/// Read some data from stream /// Read some data from stream
void receiveSecurityCode(NLMISC::IStream& msgin); 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 ); 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", fprintf( f, "%g;%g;%g;%g;%g;%g;%g;%g;%g;%u;%u;\n",
res[CHarvestSource::A], res[CHarvestSource::Q], res[CHarvestSource::A], res[CHarvestSource::Q],
testSource->getD(), testSource->getE(), 0 /*testSource->getC()*/, testSource->getD(), testSource->getE(), 0.f /*testSource->getC()*/,
reqS, reqA, reqQ, reqS, reqA, reqQ,
testSource->quantity(), testSource->getImpactScheme()*5, 127 ); testSource->quantity(), testSource->getImpactScheme()*5, 127 );
if ( (!eventD) && (testSource->getD() > 127) ) if ( (!eventD) && (testSource->getD() > 127) )

View file

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

View file

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

View file

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

View file

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