From a1edba6267c8329b045a7cb1ac74711952c4306f Mon Sep 17 00:00:00 2001 From: Vincent Munsch Date: Wed, 16 Apr 2014 18:13:40 +0200 Subject: [PATCH] fix for g++: fix plVault LogMsg calls + remove useless wide char usage fix usage of plAvatarMgr::FindAvatar() and plLinkEffectsTriggerMsg::SetLinkKey() with temporary variables plNetServerSessionInfo.h need std::string fix plProgressMgr.h: NumLoadingFrames() have an useless class context information fix plSocket usage of non-standard NULL --- Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h | 2 +- Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h | 2 +- .../PubUtilLib/plNetCommon/plNetServerSessionInfo.h | 1 + Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h | 2 +- Sources/Plasma/PubUtilLib/plSockets/plSocket.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp | 8 ++++---- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp index 2ebe613b..bee6ad92 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp @@ -717,7 +717,7 @@ plArmatureMod *plAvatarMgr::GetFirstRemoteAvatar() return nil; } -plArmatureMod* plAvatarMgr::FindAvatar(plKey& avatarKey) +plArmatureMod* plAvatarMgr::FindAvatar(const plKey& avatarKey) { plSceneObject *so = plSceneObject::ConvertNoRef(avatarKey->ObjectIsLoaded()); if (so) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h index 7fad8851..c1add69c 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h @@ -141,7 +141,7 @@ public: plArmatureMod *GetLocalAvatar(); plKey GetLocalAvatarKey(); - static plArmatureMod *FindAvatar(plKey& avatarKey); // Key of the sceneObject + static plArmatureMod *FindAvatar(const plKey& avatarKey); // Key of the sceneObject plArmatureMod *FindAvatarByPlayerID(uint32_t pid); plArmatureMod *FindAvatarByModelName(const plString& name); // Probably only useful for custom NPCs. All players are // either "Male" or "Female". diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp index f01a4100..4c753f8c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp @@ -272,7 +272,7 @@ void plLinkEffectsTriggerMsg::WriteVersion(hsStream* s, hsResMgr* mgr) mgr->WriteKey(s, fLinkInAnimKey); } -void plLinkEffectsTriggerMsg::SetLinkKey(plKey &key) +void plLinkEffectsTriggerMsg::SetLinkKey(const plKey &key) { fLinkKey = key; } @@ -429,4 +429,4 @@ void plPseudoLinkAnimCallbackMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream,mgr); mgr->WriteKey(stream, fAvatarKey); -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h index 625f5ca5..4de92d26 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h @@ -150,7 +150,7 @@ public: void SetLeavingAge(bool leaving) { fLeavingAge = leaving; } bool IsLeavingAge() { return fLeavingAge; } - void SetLinkKey(plKey &key); + void SetLinkKey(const plKey &key); const plKey GetLinkKey() const { return fLinkKey; } void SetLinkInAnimKey(plKey &key); diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h index 7812b1c7..9e751312 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h @@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plNetServerSessionInfo_h_inc #define plNetServerSessionInfo_h_inc +#include #include "HeadSpin.h" #include "pnFactory/plCreatable.h" diff --git a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h index 903d07fb..28022a21 100644 --- a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h +++ b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h @@ -236,7 +236,7 @@ class plProgressMgr static plProgressMgr* GetInstance() { return fManager; } static const plString GetLoadingFrameID(int index); - uint32_t plProgressMgr::NumLoadingFrames() const; + uint32_t NumLoadingFrames() const; static const plString GetStaticTextID(StaticText staticTextType); virtual void Draw( plPipeline *p ) { } diff --git a/Sources/Plasma/PubUtilLib/plSockets/plSocket.cpp b/Sources/Plasma/PubUtilLib/plSockets/plSocket.cpp index 93fb2262..a329dcc3 100644 --- a/Sources/Plasma/PubUtilLib/plSockets/plSocket.cpp +++ b/Sources/Plasma/PubUtilLib/plSockets/plSocket.cpp @@ -151,7 +151,7 @@ bool plSocket::IsBlocking() #ifdef BSDBLOCK #error "BSDBLOCK: TODO: IsBlocking() for bsd." #else - int ans = plNet::Ioctl(fSocket,FIONBIO,NULL); + int ans = plNet::Ioctl(fSocket,FIONBIO,nullptr); return (ans!=0); #endif } @@ -208,4 +208,4 @@ int plSocket::IGetTimeOutsFromSocket() fSendTimeOut = stimeoutval; } return 0; -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index e3ab47ac..5a52f112 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -2790,7 +2790,7 @@ bool VaultRegisterOwnedAgeAndWait (const plAgeLinkStruct * link) { } if (IS_NET_ERROR(param.result)) { - LogMsg(kLogError, L"RegisterOwnedAge: Failed to init age %S", link->GetAgeInfo()->GetAgeFilename()); + LogMsg(kLogError, "RegisterOwnedAge: Failed to init age %s", link->GetAgeInfo()->GetAgeFilename().c_str()); break; } @@ -3164,7 +3164,7 @@ bool VaultRegisterVisitAgeAndWait (const plAgeLinkStruct * link) { } if (IS_NET_ERROR(param.result)) { - LogMsg(kLogError, L"RegisterVisitAge: Failed to init age %S", link->GetAgeInfo()->GetAgeFilename()); + LogMsg(kLogError, "RegisterVisitAge: Failed to init age %s", link->GetAgeInfo()->GetAgeFilename().c_str()); break; } @@ -4436,7 +4436,7 @@ bool VaultAgeFindOrCreateSubAgeLinkAndWait ( } if (IS_NET_ERROR(param.result)) { - LogMsg(kLogError, L"CreateSubAge: Failed to init age %S", link->GetAgeInfo()->GetAgeFilename()); + LogMsg(kLogError, "CreateSubAge: Failed to init age %s", link->GetAgeInfo()->GetAgeFilename().c_str()); return false; } @@ -4794,7 +4794,7 @@ bool VaultAgeFindOrCreateChildAgeLinkAndWait ( } if (IS_NET_ERROR(param.result)) { - LogMsg(kLogError, L"CreateChildAge: Failed to init age %S", link->GetAgeInfo()->GetAgeFilename()); + LogMsg(kLogError, "CreateChildAge: Failed to init age %s", link->GetAgeInfo()->GetAgeFilename().c_str()); return false; }