From f8c3f7ac316a21ab5bc065dd18580417f4ae27e9 Mon Sep 17 00:00:00 2001 From: Skoader Date: Sun, 22 Apr 2012 13:13:32 +1000 Subject: [PATCH] Update3 for MSVC10 Fix some const problems. --- .../Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp | 4 ++-- .../Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp | 6 +++--- .../Plasma/PubUtilLib/plNetClient/plNetClientGroup.h | 5 ++++- .../Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp | 2 +- .../PubUtilLib/plNetClientRecorder/plNetClientRecorder.cpp | 2 +- .../Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.cpp | 6 +++--- .../Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h | 6 +++--- .../Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp | 2 +- .../Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h | 2 +- 9 files changed, 19 insertions(+), 16 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp index 925142f2..6196b76e 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp @@ -1970,11 +1970,11 @@ bool IsExpired() void* desc = nil; if (VerQueryValue(data, "\\StringFileInfo\\040904B0\\FileDescription", &desc, &descLen)) { - char* buildDateStart = strstr((const char*)desc, " - Built "); + const char* buildDateStart = strstr((const char*)desc, " - Built "); if (buildDateStart) { buildDateStart += strlen(" - Built "); - char* buildDateEnd = strstr(buildDateStart, " at"); + const char* buildDateEnd = strstr(buildDateStart, " at"); if (buildDateEnd) { int len = buildDateEnd-buildDateStart; diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp index 250eec62..e0c71f8b 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp @@ -218,12 +218,12 @@ void plAgeDescription::SetAgeNameFromPath( const char *path ) } // Construct our name from the path - char *pathSep1 = strrchr( path, '\\' ); - char *pathSep2 = strrchr( path, '/' ); + const char *pathSep1 = strrchr( path, '\\' ); + const char *pathSep2 = strrchr( path, '/' ); if( pathSep2 > pathSep1 ) pathSep1 = pathSep2; if( pathSep1 == nil ) - pathSep1 = (char *)path; + pathSep1 = path; else pathSep1++; // Get past the actual character we found diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h index d29cf391..31ac859e 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h @@ -99,7 +99,10 @@ public: { std::set::iterator it=IFind(grpId); if (it != fGroups.end()) - (*it).fOwnIt=ownIt; + { + fGroups.erase(it); + fGroups.insert(OwnedGroup(grpId, ownIt)); + } else { ISetGroupDesc(grpId); diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp index fa055f03..5eaa2e75 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp @@ -275,7 +275,7 @@ void plNetObjectDebugger::LogMsgIfMatch(const char* msg) const std::string tmp = msg; hsStrLower((char*)tmp.c_str()); std::string objTag="object"; - char* c=strstr(tmp.c_str(), objTag.c_str()); + const char* c=strstr(tmp.c_str(), objTag.c_str()); if (c && c != tmp.c_str()) { c+=objTag.size(); diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientRecorder.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientRecorder.cpp index 6f456065..7fb07d17 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientRecorder.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientRecorder.cpp @@ -82,7 +82,7 @@ void plNetClientRecorder::IMakeFilename(const char* recName, char* path) CreateDirectory(path, NULL); #endif - char* lastDot = strrchr(recName, '.'); + const char* lastDot = strrchr(recName, '.'); if (lastDot) strncat(path, recName, lastDot-recName); else diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.cpp index 070d34f1..819597e9 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.cpp @@ -84,7 +84,7 @@ void plPhysicsSoundMgr::Update() fCurCollisions.clear(); } -void plPhysicsSoundMgr::IStartCollision(CollidePair& cp) +void plPhysicsSoundMgr::IStartCollision(const CollidePair& cp) { hsVector3 v1, v2; const hsScalar strengthThreshold = 20.0f; @@ -120,7 +120,7 @@ void plPhysicsSoundMgr::IStartCollision(CollidePair& cp) } } -void plPhysicsSoundMgr::IStopCollision(CollidePair& cp) +void plPhysicsSoundMgr::IStopCollision(const CollidePair& cp) { plPhysical* physicalA = cp.FirstPhysical(); plPhysical* physicalB = cp.SecondPhysical(); @@ -146,7 +146,7 @@ void plPhysicsSoundMgr::IStopCollision(CollidePair& cp) } } -void plPhysicsSoundMgr::IUpdateCollision(CollidePair& cp) +void plPhysicsSoundMgr::IUpdateCollision(const CollidePair& cp) { const hsScalar slideThreshhold = 0.f; hsVector3 v1, v2; diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h index 918ce2c1..e9c849af 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h @@ -81,9 +81,9 @@ private: plPhysical* SecondPhysical() const; }; - void IStartCollision(CollidePair& cp); - void IStopCollision(CollidePair& cp); - void IUpdateCollision(CollidePair& cp); + void IStartCollision(const CollidePair& cp); + void IStopCollision(const CollidePair& cp); + void IUpdateCollision(const CollidePair& cp); void IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, hsScalar strength); typedef std::set CollideSet; diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 1e33ac05..6fa4a290 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp @@ -10575,7 +10575,7 @@ inline void inlTESTPOINT(const hsPoint3& destP, void plDXPipeline::IBlendVertsIntoBuffer( plSpan* span, hsMatrix44* matrixPalette, int numMatrices, - UInt8 *src, UInt8 format, UInt32 srcStride, + const UInt8 *src, UInt8 format, UInt32 srcStride, UInt8 *dest, UInt32 destStride, UInt32 count, UInt16 localUVWChans ) { diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h index e5b6b343..9f165008 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h @@ -464,7 +464,7 @@ protected: hsBool IAvatarSort(plDrawableSpans* d, const hsTArray& visList); void IBlendVertsIntoBuffer( plSpan* span, hsMatrix44* matrixPalette, int numMatrices, - UInt8 *src, UInt8 format, UInt32 srcStride, + const UInt8 *src, UInt8 format, UInt32 srcStride, UInt8 *dest, UInt32 destStride, UInt32 count, UInt16 localUVWChans ); hsBool ISoftwareVertexBlend( plDrawableSpans* drawable, const hsTArray& visList );