From e7e7a942f8e547bb1722e882d5d90d2a02d20bab Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 27 Sep 2013 01:11:19 +0200 Subject: [PATCH] Fix warnings --- code/ryzom/common/src/game_share/security_check.cpp | 4 ++-- code/ryzom/common/src/game_share/security_check.h | 4 ++-- .../server/src/entities_game_service/harvest_source.cpp | 2 +- .../phrase_manager/fg_prospection_phrase.cpp | 2 +- .../player_manager/character_interface.h | 8 ++++++-- .../server/src/shard_unifier_service/name_manager.cpp | 7 ++++++- .../src/shard_unifier_service/ring_session_manager.cpp | 2 +- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/code/ryzom/common/src/game_share/security_check.cpp b/code/ryzom/common/src/game_share/security_check.cpp index bbc0d46d1..6acd2aeac 100644 --- a/code/ryzom/common/src/game_share/security_check.cpp +++ b/code/ryzom/common/src/game_share/security_check.cpp @@ -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"); diff --git a/code/ryzom/common/src/game_share/security_check.h b/code/ryzom/common/src/game_share/security_check.h index 60c736f72..640fec93a 100644 --- a/code/ryzom/common/src/game_share/security_check.h +++ b/code/ryzom/common/src/game_share/security_check.h @@ -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); diff --git a/code/ryzom/server/src/entities_game_service/harvest_source.cpp b/code/ryzom/server/src/entities_game_service/harvest_source.cpp index 6c5f85a61..dcae55a60 100644 --- a/code/ryzom/server/src/entities_game_service/harvest_source.cpp +++ b/code/ryzom/server/src/entities_game_service/harvest_source.cpp @@ -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) ) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp index fbb16a296..010176023 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp @@ -1936,7 +1936,7 @@ void CDepositMapsBatchTask::run() CSString res; disp.write( res ); res = res.replace( "\n", "
\n" ); - fprintf( outputF, res.c_str() ); + fprintf( outputF, "%s", res.c_str() ); // Close files fclose( inputF ); diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_interface.h b/code/ryzom/server/src/entities_game_service/player_manager/character_interface.h index ecc133f54..7e6a47064 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_interface.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_interface.h @@ -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; diff --git a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp index ff05659c1..5b50f6359 100644 --- a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp @@ -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'; diff --git a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp index 987d4c86b..8d6c2a91f 100644 --- a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp @@ -208,7 +208,7 @@ namespace RSMGR public: CRingSessionManager() : _DontUsePerm(false), - _CharSync(false) + _CharSync(NULL) { CRingSessionManagerSkel::init(this); CWelcomeServiceClientSkel::init(this);