Browse Source

Fix a bunch of warnings from clang.

Darryl Pogue 13 years ago
parent
commit
3398938d31
  1. 7
      Sources/Plasma/Apps/plPythonPack/PythonInterface.cpp
  2. 9
      Sources/Plasma/Apps/plPythonPack/PythonInterface.h
  3. 20
      Sources/Plasma/Apps/plPythonPack/main.cpp
  4. 2
      Sources/Plasma/CoreLib/hsCritSect.cpp
  5. 4
      Sources/Plasma/CoreLib/hsFastMath.cpp
  6. 20
      Sources/Plasma/CoreLib/hsStringTokenizer.cpp
  7. 1
      Sources/Plasma/CoreLib/hsTemplates.h
  8. 10
      Sources/Plasma/CoreLib/hsWide.h
  9. 4
      Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp
  10. 6
      Sources/Plasma/NucleusLib/pnDispatch/plDispatch.h
  11. 2
      Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp
  12. 4
      Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.cpp
  13. 4
      Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.cpp
  14. 2
      Sources/Plasma/NucleusLib/pnTimer/hsTimer.cpp
  15. 2
      Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.cpp
  16. 2
      Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.h
  17. 24
      Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp
  18. 6
      Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp
  19. 22
      Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp
  20. 2
      Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp
  21. 8
      Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp
  22. 8
      Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp
  23. 2
      Sources/Plasma/PubUtilLib/plInterp/plController.cpp
  24. 2
      Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp
  25. 14
      Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp
  26. 4
      Sources/Plasma/PubUtilLib/plResMgr/plBSDiffBuffer.cpp
  27. 2
      Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
  28. 2
      Sources/Plasma/PubUtilLib/plSDL/plSDL.h
  29. 9
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp
  30. 4
      Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
  31. 4
      Sources/Plasma/PubUtilLib/plSurface/plLayerAnimation.cpp
  32. 4
      Sources/Plasma/PubUtilLib/plTransform/mat_decomp.cpp

7
Sources/Plasma/Apps/plPythonPack/PythonInterface.cpp

@ -39,7 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021 Mead, WA 99021
*==LICENSE==*/ *==LICENSE==*/
#include "hsTypes.h"
#include "PythonInterface.h" #include "PythonInterface.h"
#include "compile.h" #include "compile.h"
@ -139,7 +138,7 @@ void PythonInterface::finiPython()
// //
// PURPOSE : run a python string in a specific module name // PURPOSE : run a python string in a specific module name
// //
PyObject* PythonInterface::CompileString(char *command, char* filename) PyObject* PythonInterface::CompileString(const char *command, const char* filename)
{ {
PyObject* pycode = Py_CompileString(command, filename, Py_file_input); PyObject* pycode = Py_CompileString(command, filename, Py_file_input);
return pycode; return pycode;
@ -220,7 +219,7 @@ int PythonInterface::getOutputAndReset(char** line)
// //
// PURPOSE : create a new module with built-ins // PURPOSE : create a new module with built-ins
// //
PyObject* PythonInterface::CreateModule(char* module) PyObject* PythonInterface::CreateModule(const char* module)
{ {
PyObject *m, *d; PyObject *m, *d;
// first we must get rid of any old modules of the same name, we'll replace it // first we must get rid of any old modules of the same name, we'll replace it
@ -291,7 +290,7 @@ hsBool PythonInterface::RunPYC(PyObject* code, PyObject* module)
// //
// PURPOSE : get an item (probably a function) from a specific module // PURPOSE : get an item (probably a function) from a specific module
// //
PyObject* PythonInterface::GetModuleItem(char* item, PyObject* module) PyObject* PythonInterface::GetModuleItem(const char* item, PyObject* module)
{ {
if ( module ) if ( module )
{ {

9
Sources/Plasma/Apps/plPythonPack/PythonInterface.h

@ -39,7 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021 Mead, WA 99021
*==LICENSE==*/ *==LICENSE==*/
#include "Python.h" #include <Python.h>
#include "hsTypes.h"
#include <string> #include <string>
@ -50,10 +51,10 @@ namespace PythonInterface
// So the Python packer can add extra paths // So the Python packer can add extra paths
void addPythonPath(std::string dir); void addPythonPath(std::string dir);
PyObject* CompileString(char *command, char* filename); PyObject* CompileString(const char *command, const char* filename);
hsBool DumpObject(PyObject* pyobj, char** pickle, Int32* size); hsBool DumpObject(PyObject* pyobj, char** pickle, Int32* size);
int getOutputAndReset(char** line=nil); int getOutputAndReset(char** line=nil);
PyObject* CreateModule(char* module); PyObject* CreateModule(const char* module);
hsBool RunPYC(PyObject* code, PyObject* module); hsBool RunPYC(PyObject* code, PyObject* module);
PyObject* GetModuleItem(char* item, PyObject* module); PyObject* GetModuleItem(const char* item, PyObject* module);
} }

20
Sources/Plasma/Apps/plPythonPack/main.cpp

@ -39,11 +39,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021 Mead, WA 99021
*==LICENSE==*/ *==LICENSE==*/
#include "PythonInterface.h"
#include "hsStream.h" #include "hsStream.h"
#include "plFile/hsFiles.h" #include "plFile/hsFiles.h"
#include "PythonInterface.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <algorithm> #include <algorithm>
@ -123,14 +123,14 @@ void WritePythonFile(std::string fileName, std::string path, hsStream *s)
} }
// import the module first, to make packages work correctly // import the module first, to make packages work correctly
PyImport_ImportModule((char*)fileName.c_str()); PyImport_ImportModule(fileName.c_str());
PyObject* pythonCode = PythonInterface::CompileString(code, (char*)fileName.c_str()); PyObject* pythonCode = PythonInterface::CompileString(code, fileName.c_str());
if (pythonCode) if (pythonCode)
{ {
// we need to find out if this is PythonFile module // we need to find out if this is PythonFile module
// create a module name... with the '.' as an X // create a module name... with the '.' as an X
// and create a python file name that is without the ".py" // and create a python file name that is without the ".py"
PyObject* fModule = PythonInterface::CreateModule((char*)fileName.c_str()); PyObject* fModule = PythonInterface::CreateModule(fileName.c_str());
// run the code // run the code
if (PythonInterface::RunPYC(pythonCode, fModule) ) if (PythonInterface::RunPYC(pythonCode, fModule) )
{ {
@ -166,7 +166,7 @@ void WritePythonFile(std::string fileName, std::string path, hsStream *s)
// else // else
// skip the CRs // skip the CRs
} }
pythonCode = PythonInterface::CompileString(code, (char*)fileName.c_str()); pythonCode = PythonInterface::CompileString(code, fileName.c_str());
hsAssert(pythonCode,"Not sure why this didn't compile the second time???"); hsAssert(pythonCode,"Not sure why this didn't compile the second time???");
printf("an import file "); printf("an import file ");
} }
@ -181,8 +181,7 @@ void WritePythonFile(std::string fileName, std::string path, hsStream *s)
int chars_read = PythonInterface::getOutputAndReset(&errmsg); int chars_read = PythonInterface::getOutputAndReset(&errmsg);
if (chars_read > 0) if (chars_read > 0)
{ {
printf(errmsg); printf("%s\n", errmsg);
printf("\n");
} }
} }
} }
@ -200,8 +199,7 @@ void WritePythonFile(std::string fileName, std::string path, hsStream *s)
int chars_read = PythonInterface::getOutputAndReset(&errmsg); int chars_read = PythonInterface::getOutputAndReset(&errmsg);
if (chars_read > 0) if (chars_read > 0)
{ {
printf(errmsg); printf("%s\n", errmsg);
printf("\n");
} }
s->WriteLE32(size); s->WriteLE32(size);
s->Write(size, pycode); s->Write(size, pycode);
@ -218,7 +216,7 @@ void WritePythonFile(std::string fileName, std::string path, hsStream *s)
int chars_read = PythonInterface::getOutputAndReset(&errmsg); int chars_read = PythonInterface::getOutputAndReset(&errmsg);
if (chars_read > 0) if (chars_read > 0)
{ {
printf(errmsg); printf("%s\n", errmsg);
} }
} }

2
Sources/Plasma/CoreLib/hsCritSect.cpp

@ -83,7 +83,7 @@ void CCritSect::Leave () {
#elif HS_BUILD_FOR_UNIX #elif HS_BUILD_FOR_UNIX
//=========================================================================== //===========================================================================
CCritSect::CCritSect () { CCritSect::CCritSect () {
m_handle = PTHREAD_MUTEX_INITIALIZER; m_handle = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;
} }
//=========================================================================== //===========================================================================

4
Sources/Plasma/CoreLib/hsFastMath.cpp

@ -606,8 +606,8 @@ hsScalar hsFastMath::IATan2OverTwoPi(hsScalar y, hsScalar x)
return 0; return 0;
hsBool xNeg, yNeg; hsBool xNeg, yNeg;
if( yNeg = (y < 0) )y = -y; if((yNeg = (y < 0)))y = -y;
if( xNeg = (x < 0) )x = -x; if((xNeg = (x < 0)))x = -x;
hsBool yBigger = y >= x; hsBool yBigger = y >= x;
hsScalar div = yBigger ? x / y : y / x; hsScalar div = yBigger ? x / y : y / x;

20
Sources/Plasma/CoreLib/hsStringTokenizer.cpp

@ -57,8 +57,8 @@ fLastTerminator(nil)
hsStringTokenizer::~hsStringTokenizer() hsStringTokenizer::~hsStringTokenizer()
{ {
delete [] fString; delete[] fString;
delete [] fSeps; delete[] fSeps;
} }
hsBool hsStringTokenizer::HasMoreTokens() hsBool hsStringTokenizer::HasMoreTokens()
@ -134,11 +134,11 @@ void hsStringTokenizer::RestoreLastTerminator( void )
void hsStringTokenizer::Reset(const char *string, const char *seps) void hsStringTokenizer::Reset(const char *string, const char *seps)
{ {
if (fString) if (fString)
delete [] fString; delete[] fString;
fString = string ? hsStrcpy(string) : nil; fString = string ? hsStrcpy(string) : nil;
if (fSeps) if (fSeps)
delete [] fSeps; delete[] fSeps;
fSeps = seps ? hsStrcpy(seps) : nil; fSeps = seps ? hsStrcpy(seps) : nil;
fNumSeps = fSeps ? strlen(fSeps) : 0; fNumSeps = fSeps ? strlen(fSeps) : 0;
fCheckAlphaNum = false; fCheckAlphaNum = false;
@ -181,8 +181,8 @@ hsWStringTokenizer::hsWStringTokenizer(const wchar *string, const wchar *seps) :
hsWStringTokenizer::~hsWStringTokenizer() hsWStringTokenizer::~hsWStringTokenizer()
{ {
delete [] fString; delete[] fString;
delete [] fSeps; delete[] fSeps;
} }
hsBool hsWStringTokenizer::HasMoreTokens() hsBool hsWStringTokenizer::HasMoreTokens()
@ -259,11 +259,11 @@ void hsWStringTokenizer::RestoreLastTerminator( void )
void hsWStringTokenizer::Reset(const wchar *string, const wchar *seps) void hsWStringTokenizer::Reset(const wchar *string, const wchar *seps)
{ {
if (fString) if (fString)
delete [] fString; delete[] fString;
if (string) if (string)
{ {
int count = wcslen(string); int count = wcslen(string);
fString = TRACKED_NEW(wchar[count + 1]); fString = new wchar[count + 1];
wcscpy(fString, string); wcscpy(fString, string);
fString[count] = L'\0'; fString[count] = L'\0';
} }
@ -271,11 +271,11 @@ void hsWStringTokenizer::Reset(const wchar *string, const wchar *seps)
fString = nil; fString = nil;
if (fSeps) if (fSeps)
delete [] fSeps; delete[] fSeps;
if (seps) if (seps)
{ {
int count = wcslen(seps); int count = wcslen(seps);
fSeps = TRACKED_NEW(wchar[count + 1]); fSeps = new wchar[count + 1];
wcscpy(fSeps, seps); wcscpy(fSeps, seps);
fSeps[count] = L'\0'; fSeps[count] = L'\0';
} }

1
Sources/Plasma/CoreLib/hsTemplates.h

@ -524,6 +524,7 @@ public:
UInt16 GetNumAlloc() const { return fTotalCount; } UInt16 GetNumAlloc() const { return fTotalCount; }
}; };
template <class T> void hsTArray_CopyForward(const T src[], T dst[], int count);
template <class T> class hsTArray : public hsTArrayBase template <class T> class hsTArray : public hsTArrayBase
{ {

10
Sources/Plasma/CoreLib/hsWide.h

@ -58,8 +58,8 @@ struct hsWide {
hsBool operator==(const hsWide& b) const { return fHi == b.fHi && fLo == b.fLo; } hsBool operator==(const hsWide& b) const { return fHi == b.fHi && fLo == b.fLo; }
hsBool operator<(const hsWide& b) const { return fHi < b.fHi || fHi == b.fHi && fLo < b.fLo; } hsBool operator<(const hsWide& b) const { return fHi < b.fHi || (fHi == b.fHi && fLo < b.fLo); }
hsBool operator>( const hsWide& b) const { return fHi > b.fHi || fHi == b.fHi && fLo > b.fLo; } hsBool operator>( const hsWide& b) const { return fHi > b.fHi || (fHi == b.fHi && fLo > b.fLo); }
hsBool operator!=( const hsWide& b) const { return !( *this == b); } hsBool operator!=( const hsWide& b) const { return !( *this == b); }
hsBool operator<=(const hsWide& b) const { return !(*this > b); } hsBool operator<=(const hsWide& b) const { return !(*this > b); }
hsBool operator>=(const hsWide& b) const { return !(*this < b); } hsBool operator>=(const hsWide& b) const { return !(*this < b); }
@ -187,11 +187,11 @@ inline hsWide* hsWide::RoundRight(unsigned shift)
inline Int32 hsWide::AsLong() const inline Int32 hsWide::AsLong() const
{ {
#if HS_PIN_MATH_OVERFLOW #if HS_PIN_MATH_OVERFLOW
if (fHi > 0 || fHi == 0 && (Int32)fLo < 0) if (fHi > 0 || (fHi == 0 && (Int32)fLo < 0))
{ hsSignalMathOverflow(); { hsSignalMathOverflow();
return kPosInfinity32; return kPosInfinity32;
} }
if (fHi < -1L || fHi == -1L && (Int32)fLo >= 0) if (fHi < -1L || (fHi == -1L && (Int32)fLo >= 0))
{ hsSignalMathOverflow(); { hsSignalMathOverflow();
return kNegInfinity32; return kNegInfinity32;
} }
@ -201,7 +201,7 @@ inline Int32 hsWide::AsLong() const
inline hsBool hsWide::IsWide() const inline hsBool hsWide::IsWide() const
{ {
return (fHi > 0 || fHi == 0 && (Int32)fLo < 0) || (fHi < -1L || fHi == -1L && (Int32)fLo >= 0); return (fHi > 0 || (fHi == 0 && (Int32)fLo < 0)) || (fHi < -1L || (fHi == -1L && (Int32)fLo >= 0));
} }
inline hsFixed hsWide::AsFixed() const inline hsFixed hsWide::AsFixed() const

4
Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp

@ -286,7 +286,7 @@ void plDispatch::IMsgDispatch()
fMsgCurrentMutex.Lock(); fMsgCurrentMutex.Lock();
plMsgWrap* origTail = fMsgTail; plMsgWrap* origTail = fMsgTail;
while( fMsgCurrent = fMsgHead ) while((fMsgCurrent = fMsgHead))
{ {
IDequeue(&fMsgHead, &fMsgTail); IDequeue(&fMsgHead, &fMsgTail);
fMsgCurrentMutex.Unlock(); fMsgCurrentMutex.Unlock();
@ -460,7 +460,7 @@ hsBool plDispatch::MsgSend(plMessage* msg, hsBool async)
plTimeMsg* timeMsg; plTimeMsg* timeMsg;
if( msg->GetTimeStamp() > hsTimer::GetSysSeconds() ) if( msg->GetTimeStamp() > hsTimer::GetSysSeconds() )
return ISortToDeferred(msg); return ISortToDeferred(msg);
else if( timeMsg = plTimeMsg::ConvertNoRef(msg) ) else if((timeMsg = plTimeMsg::ConvertNoRef(msg)))
ICheckDeferred(timeMsg->DSeconds()); ICheckDeferred(timeMsg->DSeconds());
plMsgWrap* msgWrap = TRACKED_NEW plMsgWrap(msg); plMsgWrap* msgWrap = TRACKED_NEW plMsgWrap(msg);

6
Sources/Plasma/NucleusLib/pnDispatch/plDispatch.h

@ -145,9 +145,9 @@ public:
virtual void UnRegisterForType(UInt16 hClass, const plKey& receiver) {} virtual void UnRegisterForType(UInt16 hClass, const plKey& receiver) {}
virtual hsBool MsgSend(plMessage* msg) {} virtual hsBool MsgSend(plMessage* msg) { return true; }
virtual void MsgQueue(plMessage* msg){} virtual void MsgQueue(plMessage* msg) {}
virtual void MsgQueueProcess(){} virtual void MsgQueueProcess() {}
}; };

2
Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp

@ -274,7 +274,7 @@ plUoid& plUoid::operator=(const plUoid& rhs)
// THIS SHOULD BE FOR DEBUGGING ONLY <hint hint> // THIS SHOULD BE FOR DEBUGGING ONLY <hint hint>
char* plUoid::StringIze(char* str) const // Format to displayable string char* plUoid::StringIze(char* str) const // Format to displayable string
{ {
sprintf(str, "(0x%x:0x%x:%s:C:[%lu,%lu])", sprintf(str, "(0x%x:0x%x:%s:C:[%u,%u])",
fLocation.GetSequenceNumber(), fLocation.GetSequenceNumber(),
int(fLocation.GetFlags()), int(fLocation.GetFlags()),
fObjectName, fObjectName,

4
Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.cpp

@ -602,7 +602,7 @@ hsBool plCoordinateInterface::MsgReceive(plMessage* msg)
ITransformChanged(false, kReasonUnknown, false); ITransformChanged(false, kReasonUnknown, false);
return true; return true;
} }
else if( intRefMsg = plIntRefMsg::ConvertNoRef(msg) ) else if((intRefMsg = plIntRefMsg::ConvertNoRef(msg)))
{ {
switch( intRefMsg->fType ) switch( intRefMsg->fType )
{ {
@ -641,7 +641,7 @@ hsBool plCoordinateInterface::MsgReceive(plMessage* msg)
break; break;
} }
} }
else if( corrMsg = plCorrectionMsg::ConvertNoRef(msg) ) else if((corrMsg = plCorrectionMsg::ConvertNoRef(msg)))
{ {
SetTransformPhysical(corrMsg->fLocalToWorld, corrMsg->fWorldToLocal); SetTransformPhysical(corrMsg->fLocalToWorld, corrMsg->fWorldToLocal);

4
Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.cpp

@ -488,7 +488,7 @@ hsBool plSceneObject::MsgReceive(plMessage* msg)
return true; return true;
} }
else else
if( trans = plTransformMsg::ConvertNoRef(msg) ) // also catches the derived plDelayedTransformMsg if((trans = plTransformMsg::ConvertNoRef(msg))) // also catches the derived plDelayedTransformMsg
{ {
if( fCoordinateInterface ) if( fCoordinateInterface )
{ {
@ -498,7 +498,7 @@ hsBool plSceneObject::MsgReceive(plMessage* msg)
return true; return true;
} }
else else
if( att = plAttachMsg::ConvertNoRef(msg) ) if((att = plAttachMsg::ConvertNoRef(msg)))
{ {
if( fCoordinateInterface ) if( fCoordinateInterface )
{ {

2
Sources/Plasma/NucleusLib/pnTimer/hsTimer.cpp

@ -308,6 +308,8 @@ UInt32 hsTimer::GetPrecTickCount()
return GetTickCount(); return GetTickCount();
return ti.LowPart; return ti.LowPart;
#else
return 1;
#endif #endif
} }
UInt32 hsTimer::PrecSecsToTicks(hsScalar secs) UInt32 hsTimer::PrecSecsToTicks(hsScalar secs)

2
Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.cpp

@ -1,4 +1,4 @@
/*==LICENSE==* /*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc. Copyright (C) 2011 Cyan Worlds, Inc.

2
Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.h

@ -1,4 +1,4 @@
/*==LICENSE==* /*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc. Copyright (C) 2011 Cyan Worlds, Inc.

24
Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp

@ -670,14 +670,14 @@ bool plIniConfigSource::WriteOutOf(plConfigInfo & configInfo)
plConfigInfo::Values::const_iterator vi, ve; plConfigInfo::Values::const_iterator vi, ve;
fConfigInfo->GetSectionIterators(si,se); fConfigInfo->GetSectionIterators(si,se);
for (si; si!=se; ++si) for (; si!=se; ++si)
{ {
file << std::endl << "[" << si->first.c_str() << "]"<< std::endl; file << std::endl << "[" << si->first.c_str() << "]"<< std::endl;
if (fConfigInfo->GetKeyIterators(si->first, ki, ke)) if (fConfigInfo->GetKeyIterators(si->first, ki, ke))
for (ki; ki!=ke; ++ki) for (; ki!=ke; ++ki)
{ {
if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve)) if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve))
for (vi; vi!=ve; ++vi) for (; vi!=ve; ++vi)
{ {
file << ki->first.c_str() << "=" << vi->c_str() << std::endl; file << ki->first.c_str() << "=" << vi->c_str() << std::endl;
} }
@ -738,14 +738,14 @@ bool plIniStreamConfigSource::WriteOutOf(plConfigInfo & configInfo)
plConfigInfo::Values::const_iterator vi, ve; plConfigInfo::Values::const_iterator vi, ve;
fConfigInfo->GetSectionIterators(si,se); fConfigInfo->GetSectionIterators(si,se);
for (si; si!=se; ++si) for (; si!=se; ++si)
{ {
ss << std::endl << "[" << si->first.c_str() << "]"<< std::endl; ss << std::endl << "[" << si->first.c_str() << "]"<< std::endl;
if (fConfigInfo->GetKeyIterators(si->first, ki, ke)) if (fConfigInfo->GetKeyIterators(si->first, ki, ke))
for (ki; ki!=ke; ++ki) for (; ki!=ke; ++ki)
{ {
if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve)) if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve))
for (vi; vi!=ve; ++vi) for (; vi!=ve; ++vi)
{ {
ss << ki->first.c_str() << "=" << vi->c_str() << std::endl; ss << ki->first.c_str() << "=" << vi->c_str() << std::endl;
} }
@ -887,13 +887,13 @@ bool plIniNoSectionsConfigSource::WriteOutOf(plConfigInfo & configInfo)
plConfigInfo::Values::const_iterator vi, ve; plConfigInfo::Values::const_iterator vi, ve;
fConfigInfo->GetSectionIterators(si,se); fConfigInfo->GetSectionIterators(si,se);
for (si; si!=se; ++si) for (; si!=se; ++si)
{ {
if (fConfigInfo->GetKeyIterators(si->first, ki, ke)) if (fConfigInfo->GetKeyIterators(si->first, ki, ke))
for (ki; ki!=ke; ++ki) for (; ki!=ke; ++ki)
{ {
if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve)) if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve))
for (vi; vi!=ve; ++vi) for (; vi!=ve; ++vi)
{ {
file << ki->first.c_str() << "=" << vi->c_str() << std::endl; file << ki->first.c_str() << "=" << vi->c_str() << std::endl;
} }
@ -919,15 +919,15 @@ bool plDebugConfigSource::WriteOutOf(plConfigInfo & configInfo)
char buf[1024]; char buf[1024];
fConfigInfo->GetSectionIterators(si,se); fConfigInfo->GetSectionIterators(si,se);
for (si; si!=se; ++si) for (; si!=se; ++si)
{ {
sprintf(buf,"\n[%s]\n",si->first.c_str()); sprintf(buf,"\n[%s]\n",si->first.c_str());
hsStatusMessage(buf); hsStatusMessage(buf);
if (fConfigInfo->GetKeyIterators(si->first, ki, ke)) if (fConfigInfo->GetKeyIterators(si->first, ki, ke))
for (ki; ki!=ke; ++ki) for (; ki!=ke; ++ki)
{ {
if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve)) if (fConfigInfo->GetValueIterators(si->first, ki->first, vi, ve))
for (vi; vi!=ve; ++vi) for (; vi!=ve; ++vi)
{ {
sprintf(buf,"%s=%s\n",ki->first.c_str(),vi->c_str()); sprintf(buf,"%s=%s\n",ki->first.c_str(),vi->c_str());
hsStatusMessage(buf); hsStatusMessage(buf);

6
Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp

@ -111,6 +111,8 @@ bool plKeysAndValues::AddValue(const std::string & key, const std::string & valu
if (HasKey(key)) if (HasKey(key))
RemoveKey(key); RemoveKey(key);
break; break;
default:
break;
} }
fKeys[key.c_str()].push_front(value.c_str()); fKeys[key.c_str()].push_front(value.c_str());
return true; return true;
@ -259,7 +261,7 @@ void plKeysAndValues::Write(hsStream * s)
// iterate through keys // iterate through keys
Keys::const_iterator ki,ke; Keys::const_iterator ki,ke;
GetKeyIterators(ki,ke); GetKeyIterators(ki,ke);
for (ki;ki!=ke;++ki) for (;ki!=ke;++ki)
{ {
// write key string // write key string
s->WriteLE((UInt16)ki->first.size()); s->WriteLE((UInt16)ki->first.size());
@ -269,7 +271,7 @@ void plKeysAndValues::Write(hsStream * s)
// iterate through values for this key // iterate through values for this key
Values::const_iterator vi,ve; Values::const_iterator vi,ve;
GetValueIterators(ki->first,vi,ve); GetValueIterators(ki->first,vi,ve);
for (vi;vi!=ve;++vi) for (;vi!=ve;++vi)
{ {
// write value string // write value string
s->WriteLE((UInt16)vi->size()); s->WriteLE((UInt16)vi->size());

22
Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp

@ -104,8 +104,10 @@ hsBool plFileUtils::CreateDir( const wchar *path )
return ( _wmkdir( path ) == 0 ) ? true : ( errno==EEXIST ); return ( _wmkdir( path ) == 0 ) ? true : ( errno==EEXIST );
#elif HS_BUILD_FOR_UNIX #elif HS_BUILD_FOR_UNIX
const char* cpath = hsWStringToString(path); const char* cpath = hsWStringToString(path);
CreateDir(cpath); bool ret = CreateDir(cpath);
delete[] cpath; /* Free the string */ delete[] cpath; /* Free the string */
return ret;
#endif #endif
} }
@ -156,8 +158,10 @@ bool plFileUtils::RemoveFile(const wchar* filename, bool delReadOnly)
return (_wunlink(filename) == 0); return (_wunlink(filename) == 0);
#elif HS_BUILD_FOR_UNIX #elif HS_BUILD_FOR_UNIX
const char* cfilename = hsWStringToString(filename); const char* cfilename = hsWStringToString(filename);
RemoveFile(cfilename, delReadOnly); bool ret = RemoveFile(cfilename, delReadOnly);
delete[] cfilename; /* Free the string */ delete[] cfilename; /* Free the string */
return ret;
#endif #endif
} }
@ -542,13 +546,11 @@ bool plFileUtils::GetSecureEncryptionKey(const wchar* filename, UInt32* key, uns
return true; return true;
} }
else
{
// file doesn't exist, use default key
unsigned memSize = min(length, arrsize(plSecureStream::kDefaultKey));
memSize *= sizeof(UInt32);
memcpy(key, plSecureStream::kDefaultKey, memSize);
return false; // file doesn't exist, use default key
} unsigned memSize = min(length, arrsize(plSecureStream::kDefaultKey));
memSize *= sizeof(UInt32);
memcpy(key, plSecureStream::kDefaultKey, memSize);
return false;
} }

2
Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp

@ -251,7 +251,7 @@ void plDynamicTextMap::IDestroyOSSurface( void )
IRemoveFromMemRecord( (UInt8 *)fImage ); IRemoveFromMemRecord( (UInt8 *)fImage );
#endif #endif
delete [] fImage; delete[] (UInt32*)fImage;
fImage = nil; fImage = nil;
plProfile_Dec(DynaTexts); plProfile_Dec(DynaTexts);

8
Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp

@ -180,7 +180,7 @@ void plMipmap::Reset()
IRemoveFromMemRecord( (UInt8 *)fImage ); IRemoveFromMemRecord( (UInt8 *)fImage );
#endif #endif
delete [] fImage; delete[] (UInt8*)fImage;
plProfile_DelMem(MemMipmaps, fTotalSize); plProfile_DelMem(MemMipmaps, fTotalSize);
} }
fImage = nil; fImage = nil;
@ -758,7 +758,7 @@ void plMipmap::ClipToMaxSize( UInt32 maxDimension )
#ifdef MEMORY_LEAK_TRACER #ifdef MEMORY_LEAK_TRACER
IRemoveFromMemRecord( (UInt8 *)fImage ); IRemoveFromMemRecord( (UInt8 *)fImage );
#endif #endif
delete [] fImage; delete[] (UInt8*)fImage;
plProfile_DelMem(MemMipmaps, fTotalSize); plProfile_DelMem(MemMipmaps, fTotalSize);
fImage = destData; fImage = destData;
@ -789,7 +789,7 @@ void plMipmap::RemoveMipping()
#ifdef MEMORY_LEAK_TRACER #ifdef MEMORY_LEAK_TRACER
IRemoveFromMemRecord( (UInt8 *)fImage ); IRemoveFromMemRecord( (UInt8 *)fImage );
#endif #endif
delete [] fImage; delete[] (UInt8*)fImage;
plProfile_DelMem(MemMipmaps, fTotalSize); plProfile_DelMem(MemMipmaps, fTotalSize);
fImage = destData; fImage = destData;
@ -1556,7 +1556,7 @@ void plMipmap::CopyFrom( const plMipmap *source )
#ifdef MEMORY_LEAK_TRACER #ifdef MEMORY_LEAK_TRACER
IRemoveFromMemRecord( (UInt8 *)fImage ); IRemoveFromMemRecord( (UInt8 *)fImage );
#endif #endif
delete [] fImage; delete[] (UInt8*)fImage;
fWidth = source->fWidth; fWidth = source->fWidth;
fHeight = source->fHeight; fHeight = source->fHeight;

8
Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp

@ -397,7 +397,7 @@ void plAnimTimeConvert::IFlushOldStates()
plATCStateList::const_iterator i = fStates.begin(); plATCStateList::const_iterator i = fStates.begin();
UInt32 count = 0; UInt32 count = 0;
for (i; i != fStates.end(); i++) for (; i != fStates.end(); i++)
{ {
count++; count++;
state = *i; state = *i;
@ -426,7 +426,7 @@ plATCState *plAnimTimeConvert::IGetState(double wSecs) const
plATCState *state; plATCState *state;
plATCStateList::const_iterator i = fStates.begin(); plATCStateList::const_iterator i = fStates.begin();
for (i; i != fStates.end(); i++) for (; i != fStates.end(); i++)
{ {
state = *i; state = *i;
if (wSecs >= state->fStartWorldTime) if (wSecs >= state->fStartWorldTime)
@ -589,7 +589,7 @@ hsScalar plAnimTimeConvert::WorldToAnimTime(double wSecs)
// 2. Same as #1, but in the backwards case. // 2. Same as #1, but in the backwards case.
// 3. We started before the wrap point, now we're after it. Stop. // 3. We started before the wrap point, now we're after it. Stop.
// 4. Same as #3, backwards. // 4. Same as #3, backwards.
if ((wrapped && (forewards && secs >= fWrapTime) || if (((wrapped && (forewards && secs >= fWrapTime)) ||
(!forewards && secs <= fWrapTime)) || (!forewards && secs <= fWrapTime)) ||
(forewards && fCurrentAnimTime < fWrapTime && secs >= fWrapTime) || (forewards && fCurrentAnimTime < fWrapTime && secs >= fWrapTime) ||
(!forewards && fCurrentAnimTime > fWrapTime && secs <= fWrapTime)) (!forewards && fCurrentAnimTime > fWrapTime && secs <= fWrapTime))
@ -700,7 +700,7 @@ hsScalar plAnimTimeConvert::IWorldToAnimTimeNoUpdate(double wSecs, plATCState *s
if (state->fFlags & kWrap) if (state->fFlags & kWrap)
{ {
if ((wrapped && (forewards && secs >= state->fWrapTime) || if (((wrapped && (forewards && secs >= state->fWrapTime)) ||
(!forewards && secs <= state->fWrapTime)) || (!forewards && secs <= state->fWrapTime)) ||
(forewards && state->fStartAnimTime < state->fWrapTime && secs >= state->fWrapTime) || (forewards && state->fStartAnimTime < state->fWrapTime && secs >= state->fWrapTime) ||
(!forewards && state->fStartAnimTime > state->fWrapTime && secs <= state->fWrapTime)) (!forewards && state->fStartAnimTime > state->fWrapTime && secs <= state->fWrapTime))

2
Sources/Plasma/PubUtilLib/plInterp/plController.cpp

@ -76,7 +76,7 @@ void plControllerCacheInfo::SetATC(plAnimTimeConvert *atc)
plLeafController::~plLeafController() plLeafController::~plLeafController()
{ {
delete [] fKeys; delete[] fKeys;
} }
void plLeafController::Interp(hsScalar time, hsScalar* result, plControllerCacheInfo *cache) const void plLeafController::Interp(hsScalar time, hsScalar* result, plControllerCacheInfo *cache) const

2
Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp

@ -81,7 +81,7 @@ hsBool plParticleCollisionEffect::MsgReceive(plMessage* msg)
plSceneObject *so; plSceneObject *so;
if (refMsg) if (refMsg)
{ {
if (so = plSceneObject::ConvertNoRef(refMsg->GetRef())) if ((so = plSceneObject::ConvertNoRef(refMsg->GetRef())))
{ {
if( refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace) ) if( refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace) )
fSceneObj = so; fSceneObj = so;

14
Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp

@ -484,16 +484,16 @@ hsBool plParticleSystem::MsgReceive(plMessage* msg)
plRenderMsg *rend; plRenderMsg *rend;
plAgeLoadedMsg* ageLoaded; plAgeLoadedMsg* ageLoaded;
if (rend = plRenderMsg::ConvertNoRef(msg)) if ((rend = plRenderMsg::ConvertNoRef(msg)))
{ {
plProfile_BeginLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName()); plProfile_BeginLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName());
IHandleRenderMsg(rend->Pipeline()); IHandleRenderMsg(rend->Pipeline());
plProfile_EndLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName()); plProfile_EndLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName());
return true; return true;
} }
else if (refMsg = plGenRefMsg::ConvertNoRef(msg)) else if ((refMsg = plGenRefMsg::ConvertNoRef(msg)))
{ {
if (scene = plSceneObject::ConvertNoRef(refMsg->GetRef())) if ((scene = plSceneObject::ConvertNoRef(refMsg->GetRef())))
{ {
if (refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace)) if (refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace))
AddTarget(scene); AddTarget(scene);
@ -501,7 +501,7 @@ hsBool plParticleSystem::MsgReceive(plMessage* msg)
RemoveTarget(scene); RemoveTarget(scene);
return true; return true;
} }
if (mat = hsGMaterial::ConvertNoRef(refMsg->GetRef())) if ((mat = hsGMaterial::ConvertNoRef(refMsg->GetRef())))
{ {
if (refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace)) if (refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace))
fTexture = mat; fTexture = mat;
@ -509,7 +509,7 @@ hsBool plParticleSystem::MsgReceive(plMessage* msg)
fTexture = nil; fTexture = nil;
return true; return true;
} }
if (effect = plParticleEffect::ConvertNoRef(refMsg->GetRef())) if ((effect = plParticleEffect::ConvertNoRef(refMsg->GetRef())))
{ {
if (refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace)) if (refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace))
IAddEffect(effect, refMsg->fType); IAddEffect(effect, refMsg->fType);
@ -518,12 +518,12 @@ hsBool plParticleSystem::MsgReceive(plMessage* msg)
return true; return true;
} }
} }
else if (partMsg = plParticleUpdateMsg::ConvertNoRef(msg)) else if ((partMsg = plParticleUpdateMsg::ConvertNoRef(msg)))
{ {
UpdateGenerator(partMsg->GetParamID(), partMsg->GetParamValue()); UpdateGenerator(partMsg->GetParamID(), partMsg->GetParamValue());
return true; return true;
} }
else if (killMsg = plParticleKillMsg::ConvertNoRef(msg)) else if ((killMsg = plParticleKillMsg::ConvertNoRef(msg)))
{ {
KillParticles(killMsg->fNumToKill, killMsg->fTimeLeft, killMsg->fFlags); KillParticles(killMsg->fNumToKill, killMsg->fTimeLeft, killMsg->fFlags);
return true; return true;

4
Sources/Plasma/PubUtilLib/plResMgr/plBSDiffBuffer.cpp

@ -297,7 +297,7 @@ void plBSDiffBuffer::GetBuffer( UInt32 &length, void *&bufferPtr )
if (fPatchBuffer && fPatchLength) if (fPatchBuffer && fPatchLength)
{ {
length = fPatchLength; length = fPatchLength;
if (bufferPtr = (void *)TRACKED_NEW unsigned char[ length ]) if ((bufferPtr = (void *)new unsigned char[ length ]))
memcpy(bufferPtr, fPatchBuffer, length); memcpy(bufferPtr, fPatchBuffer, length);
} }
else else
@ -432,7 +432,7 @@ UInt32 plBSDiffBuffer::Patch( UInt32 oldLength, void *oldBuffer, UInt32 &newLeng
if(newpos != newend) if(newpos != newend)
{ {
delete[] newBuffer; delete[] (unsigned char*)newBuffer;
newLength = 0; newLength = 0;
} }

2
Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp

@ -376,7 +376,7 @@ class plPageFinder : public plRegistryPageIterator
} }
// Try for full location // Try for full location
sprintf( str, "%s_%s_%s", info.GetAge(), info.GetPage() ); sprintf( str, "%s_%s", info.GetAge(), info.GetPage() );
if( stricmp( str, fFindString ) == 0 ) if( stricmp( str, fFindString ) == 0 )
{ {
*fPagePtr = node; *fPagePtr = node;

2
Sources/Plasma/PubUtilLib/plSDL/plSDL.h

@ -446,7 +446,7 @@ public:
plSimpleStateVariable* FindVar(const char* name) const { return (plSimpleStateVariable*)IFindVar(fVarsList, name); } plSimpleStateVariable* FindVar(const char* name) const { return (plSimpleStateVariable*)IFindVar(fVarsList, name); }
plSDStateVariable* FindSDVar(const char* name) const { return (plSDStateVariable*)IFindVar(fSDVarsList, name); } plSDStateVariable* FindSDVar(const char* name) const { return (plSDStateVariable*)IFindVar(fSDVarsList, name); }
plStateDataRecord& operator=(const plStateDataRecord& other) { CopyFrom(other); } plStateDataRecord& operator=(const plStateDataRecord& other) { CopyFrom(other); return *this; }
void CopyFrom(const plStateDataRecord& other, UInt32 writeOptions=0); void CopyFrom(const plStateDataRecord& other, UInt32 writeOptions=0);
void UpdateFrom(const plStateDataRecord& other, UInt32 writeOptions=0); void UpdateFrom(const plStateDataRecord& other, UInt32 writeOptions=0);
void SetFromDefaults(bool timeStampNow); void SetFromDefaults(bool timeStampNow);

9
Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

@ -92,12 +92,12 @@ public:
int fDataLen; int fDataLen;
plSDLCreatableStub(UInt16 classIndex, int len) : fClassIndex(classIndex),fData(nil),fDataLen(len) {} plSDLCreatableStub(UInt16 classIndex, int len) : fClassIndex(classIndex),fData(nil),fDataLen(len) {}
~plSDLCreatableStub() { delete [] fData; } ~plSDLCreatableStub() { delete[] (char*)fData; }
const char* ClassName() const { return "SDLCreatable"; } const char* ClassName() const { return "SDLCreatable"; }
UInt16 ClassIndex() const { return fClassIndex; } UInt16 ClassIndex() const { return fClassIndex; }
void Read(hsStream* s, hsResMgr* mgr) { delete [] fData; fData = TRACKED_NEW char[fDataLen]; s->Read(fDataLen, fData); } void Read(hsStream* s, hsResMgr* mgr) { delete[] (char*)fData; fData = new char[fDataLen]; s->Read(fDataLen, fData); }
void Write(hsStream* s, hsResMgr* mgr) { s->Write(fDataLen, fData); } void Write(hsStream* s, hsResMgr* mgr) { s->Write(fDataLen, fData); }
}; };
@ -112,7 +112,7 @@ void plStateVarNotificationInfo::Read(hsStream* s, UInt32 readOptions)
if (hint && !(readOptions & plSDL::kSkipNotificationInfo)) if (hint && !(readOptions & plSDL::kSkipNotificationInfo))
fHintString = (const char*)hint; fHintString = (const char*)hint;
// we're done with it... // we're done with it...
delete [] hint; delete[] hint;
} }
void plStateVarNotificationInfo::Write(hsStream* s, UInt32 writeOptions) const void plStateVarNotificationInfo::Write(hsStream* s, UInt32 writeOptions) const
@ -1874,6 +1874,8 @@ bool plSimpleStateVariable::IWriteData(hsStream* s, float timeConvert, int idx,
} }
} }
break; break;
default:
break;
} }
return true; return true;
} }
@ -2162,6 +2164,7 @@ void plSimpleStateVariable::NotifyStateChange(const plSimpleStateVariable* other
NOTIFY_CHECK(plVarDescriptor::kByte, fBy) NOTIFY_CHECK(plVarDescriptor::kByte, fBy)
NOTIFY_CHECK(plVarDescriptor::kFloat, fF) NOTIFY_CHECK(plVarDescriptor::kFloat, fF)
NOTIFY_CHECK(plVarDescriptor::kDouble, fD) NOTIFY_CHECK(plVarDescriptor::kDouble, fD)
default: break;
} }
} }
if (notify) if (notify)

4
Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp

@ -826,12 +826,12 @@ bool plStatusLog::IPrintLineToFile( const char *line, UInt32 count )
} }
if (fFlags & kRawTimeStamp) if (fFlags & kRawTimeStamp)
{ {
snprintf(work, arrsize(work), "[t=%10u] ", hsTimer::GetSeconds()); snprintf(work, arrsize(work), "[t=%10f] ", hsTimer::GetSeconds());
strncat(buf, work, arrsize(work)); strncat(buf, work, arrsize(work));
} }
if (fFlags & kThreadID) if (fFlags & kThreadID)
{ {
snprintf(work, arrsize(work), "[t=%u] ", hsThread::GetMyThreadId()); snprintf(work, arrsize(work), "[t=%lu] ", hsThread::GetMyThreadId());
strncat(buf, work, arrsize(work)); strncat(buf, work, arrsize(work));
} }

4
Sources/Plasma/PubUtilLib/plSurface/plLayerAnimation.cpp

@ -583,7 +583,7 @@ hsBool plLayerLinkAnimation::MsgReceive( plMessage* pMsg )
if (msg->HasLinkFlag(plLinkEffectBCMsg::kSendCallback)) if (msg->HasLinkFlag(plLinkEffectBCMsg::kSendCallback))
{ {
plLinkEffectsMgr *mgr; plLinkEffectsMgr *mgr;
if (mgr = plLinkEffectsMgr::ConvertNoRef(msg->GetSender()->ObjectIsLoaded())) if ((mgr = plLinkEffectsMgr::ConvertNoRef(msg->GetSender()->ObjectIsLoaded())))
mgr->WaitForEffect(msg->fLinkKey, fTimeConvert.GetEnd() - fTimeConvert.GetBegin()); mgr->WaitForEffect(msg->fLinkKey, fTimeConvert.GetEnd() - fTimeConvert.GetBegin());
} }
} }
@ -603,7 +603,7 @@ hsBool plLayerLinkAnimation::MsgReceive( plMessage* pMsg )
// add a callback for when it's done if it's in forward // add a callback for when it's done if it's in forward
plLinkEffectsMgr *mgr; plLinkEffectsMgr *mgr;
if (mgr = plLinkEffectsMgr::ConvertNoRef(pMsg->GetSender()->ObjectIsLoaded())) if ((mgr = plLinkEffectsMgr::ConvertNoRef(pMsg->GetSender()->ObjectIsLoaded())))
if (pSeudoMsg->fForward) if (pSeudoMsg->fForward)
mgr->WaitForPseudoEffect(fLinkKey, fTimeConvert.GetEnd() - fTimeConvert.GetBegin()); mgr->WaitForPseudoEffect(fLinkKey, fTimeConvert.GetEnd() - fTimeConvert.GetBegin());

4
Sources/Plasma/PubUtilLib/plTransform/mat_decomp.cpp

@ -437,7 +437,7 @@ gemQuat snuggle(gemQuat q, HVect *k)
mag[0] = (double)q.z*q.z+(double)q.w*q.w-0.5; mag[0] = (double)q.z*q.z+(double)q.w*q.w-0.5;
mag[1] = (double)q.x*q.z-(double)q.y*q.w; mag[1] = (double)q.x*q.z-(double)q.y*q.w;
mag[2] = (double)q.y*q.z+(double)q.x*q.w; mag[2] = (double)q.y*q.z+(double)q.x*q.w;
for (i=0; i<3; i++) if (neg[i] = (mag[i]<0.0)) mag[i] = -mag[i]; for (i=0; i<3; i++) if ((neg[i] = (mag[i]<0.0))) mag[i] = -mag[i];
if (mag[0]>mag[1]) {if (mag[0]>mag[2]) win = 0; else win = 2;} if (mag[0]>mag[1]) {if (mag[0]>mag[2]) win = 0; else win = 2;}
else {if (mag[1]>mag[2]) win = 1; else win = 2;} else {if (mag[1]>mag[2]) win = 1; else win = 2;}
switch (win) { switch (win) {
@ -456,7 +456,7 @@ gemQuat snuggle(gemQuat q, HVect *k)
qa[0] = q.x; qa[1] = q.y; qa[2] = q.z; qa[3] = q.w; qa[0] = q.x; qa[1] = q.y; qa[2] = q.z; qa[3] = q.w;
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
pa[i] = 0.0; pa[i] = 0.0;
if (neg[i] = (qa[i]<0.0)) qa[i] = -qa[i]; if ((neg[i] = (qa[i]<0.0))) qa[i] = -qa[i];
par ^= neg[i]; par ^= neg[i];
} }
/* Find two largest components, indices in hi and lo */ /* Find two largest components, indices in hi and lo */

Loading…
Cancel
Save