1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00

Fix a whole bunch of clang warnings.

This commit is contained in:
Darryl Pogue
2012-12-15 16:46:20 -08:00
parent ca87b47ca8
commit 4221b57baa
11 changed files with 23 additions and 13 deletions

View File

@ -169,8 +169,7 @@ void DebugMsg(const char fmt[], ...)
OutputDebugStringA("\n"); OutputDebugStringA("\n");
#endif #endif
} else { } else {
fprintf(stderr, msg); fprintf(stderr, "%s\n", msg);
fprintf(stderr, "\n");
} }
} }
@ -315,6 +314,7 @@ int hsMessageBoxWithOwner(hsWindowHndl owner, const char message[], const char c
} }
#endif #endif
return hsMBoxCancel;
} }
int hsMessageBoxWithOwner(hsWindowHndl owner, const wchar_t message[], const wchar_t caption[], int kind, int icon) int hsMessageBoxWithOwner(hsWindowHndl owner, const wchar_t message[], const wchar_t caption[], int kind, int icon)
@ -367,6 +367,7 @@ int hsMessageBoxWithOwner(hsWindowHndl owner, const wchar_t message[], const wch
} }
#endif #endif
return hsMBoxCancel;
} }
int hsMessageBox(const char message[], const char caption[], int kind, int icon) int hsMessageBox(const char message[], const char caption[], int kind, int icon)

View File

@ -90,7 +90,7 @@ void plLightModifier::AddTarget(plSceneObject* so)
void plLightModifier::RemoveTarget(plSceneObject* so) void plLightModifier::RemoveTarget(plSceneObject* so)
{ {
if( so = fTarget ) if ((so = fTarget))
fLight = nil; fLight = nil;
plSimpleModifier::RemoveTarget(so); plSimpleModifier::RemoveTarget(so);
} }

View File

@ -510,11 +510,11 @@ void plWinAudible::DeActivate()
bool plWinAudible::MsgReceive(plMessage* msg) bool plWinAudible::MsgReceive(plMessage* msg)
{ {
plGenRefMsg *refMsg; plGenRefMsg *refMsg = plGenRefMsg::ConvertNoRef(msg);
if (refMsg = plGenRefMsg::ConvertNoRef(msg)) if (refMsg)
{ {
plSound *snd; plSound *snd = plSound::ConvertNoRef(refMsg->GetRef());
if (snd = plSound::ConvertNoRef(refMsg->GetRef())) if (snd)
{ {
int index = refMsg->fWhich; int index = refMsg->fWhich;
if( refMsg->GetContext() & (plRefMsg::kOnCreate | plRefMsg::kOnRequest) ) if( refMsg->GetContext() & (plRefMsg::kOnCreate | plRefMsg::kOnRequest) )

View File

@ -94,6 +94,7 @@ protected:
friend class plDynaDecalMgr; friend class plDynaDecalMgr;
public: public:
virtual ~plDynaDecal() { }
virtual bool Age(double t, float ramp, float decay, float life) = 0; virtual bool Age(double t, float ramp, float decay, float life) = 0;
}; };

View File

@ -291,7 +291,7 @@ void plSpaceTree::HarvestEnabledLeaves(plVolumeIsect* cull, const hsBitVector& c
if( IsEmpty() ) if( IsEmpty() )
return; return;
if( fCullFunc = cull ) if((fCullFunc = cull))
IHarvestAndCullEnabledLeaves(fRoot, cache, list); IHarvestAndCullEnabledLeaves(fRoot, cache, list);
else else
IHarvestEnabledLeaves(fRoot, cache, list); IHarvestEnabledLeaves(fRoot, cache, list);
@ -372,7 +372,7 @@ void plSpaceTree::HarvestLeaves(plVolumeIsect* cull, hsBitVector& list) const
{ {
if( !IsEmpty() ) if( !IsEmpty() )
{ {
if( fCullFunc = cull ) if((fCullFunc = cull))
IHarvestAndCullLeaves(fTree[fRoot], scratchTotVec, list); IHarvestAndCullLeaves(fTree[fRoot], scratchTotVec, list);
else else
IHarvestLeaves(fTree[fRoot], scratchTotVec, list); IHarvestLeaves(fTree[fRoot], scratchTotVec, list);

View File

@ -191,7 +191,7 @@ plMipmap* plPNG::ReadFromFile(const wchar_t* fileName)
hsUNIXStream in; hsUNIXStream in;
if (!in.Open(fileName, L"rb")) { if (!in.Open(fileName, L"rb")) {
return false; return nil;
} }
plMipmap* ret = IRead(&in); plMipmap* ret = IRead(&in);

View File

@ -99,6 +99,8 @@ public:
kPositional = 0x80 kPositional = 0x80
}; };
virtual ~plShadowSlave() { }
void SetFlag(SlaveFlag f, bool on) { if(on) fFlags |= f; else fFlags &= ~f; } void SetFlag(SlaveFlag f, bool on) { if(on) fFlags |= f; else fFlags &= ~f; }
bool HasFlag(SlaveFlag f) const { return 0 != (fFlags & f); } bool HasFlag(SlaveFlag f) const { return 0 != (fFlags & f); }

View File

@ -246,7 +246,7 @@ plMipmap* plJPEG::ReadFromFile( const wchar_t *fileName )
hsRAMStream tempstream; hsRAMStream tempstream;
hsUNIXStream in; hsUNIXStream in;
if (!in.Open(fileName, L"rb")) if (!in.Open(fileName, L"rb"))
return false; return nil;
// The stream reader for JPEGs expects a 32-bit size at the start, // The stream reader for JPEGs expects a 32-bit size at the start,
// so insert that into the stream before passing it on // so insert that into the stream before passing it on

View File

@ -551,7 +551,7 @@ void plGraphPlate::SetDataColors( const std::vector<uint32_t> & hexColors )
//// SetLabelText //////////////////////////////////////////////////////////// //// SetLabelText ////////////////////////////////////////////////////////////
void plGraphPlate::SetLabelText( char *text1, char *text2, char *text3, char *text4 ) void plGraphPlate::SetLabelText(const char *text1, const char *text2, const char *text3, const char *text4 )
{ {
std::vector<std::string> strings; std::vector<std::string> strings;
if( text1 != nil ) if( text1 != nil )

View File

@ -170,7 +170,7 @@ class plGraphPlate : public plPlate
void SetDataRange( uint32_t min, uint32_t max, uint32_t width ); void SetDataRange( uint32_t min, uint32_t max, uint32_t width );
void SetDataLabels( uint32_t min, uint32_t max ); void SetDataLabels( uint32_t min, uint32_t max );
void SetLabelText( char *text1, char *text2 = nil, char *text3 = nil, char *text4 = nil ); void SetLabelText(const char *text1, const char *text2 = nil, const char *text3 = nil, const char *text4 = nil );
void SetLabelText( const std::vector<std::string> & text ); void SetLabelText( const std::vector<std::string> & text );
void ClearData( void ); void ClearData( void );

View File

@ -423,12 +423,18 @@ bool plResManager::IReadObject(plKeyImp* pKey, hsStream *stream)
ko = hsKeyedObject::ConvertNoRef(cre); ko = hsKeyedObject::ConvertNoRef(cre);
if (ko != nil) if (ko != nil)
{
kResMgrLog(4, ILog(4, " ...Creatable read and valid")); kResMgrLog(4, ILog(4, " ...Creatable read and valid"));
}
else else
{
kResMgrLog(3, ILog(3, " ...Creatable read from stream not keyed object!")); kResMgrLog(3, ILog(3, " ...Creatable read from stream not keyed object!"));
}
if (fProgressProc != nil) if (fProgressProc != nil)
{
fProgressProc(plKey::Make(pKey)); fProgressProc(plKey::Make(pKey));
}
} }
else else
{ {