|
From: <cn...@us...> - 2010-01-10 22:27:09
|
Revision: 648
http://hgengine.svn.sourceforge.net/hgengine/?rev=648&view=rev
Author: cnlohr
Date: 2010-01-10 22:27:01 +0000 (Sun, 10 Jan 2010)
Log Message:
-----------
fix warnings
Modified Paths:
--------------
Mercury2/src/GLHelpers.cpp
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryBacktrace.c
Mercury2/src/MercuryFileDriverDirect.cpp
Mercury2/src/MercuryLog.cpp
Mercury2/src/MercurySoundDriverALSA.cpp
Mercury2/src/MercurySoundSourceRAM.cpp
Mercury2/src/MercurySoundSourceVorbis.cpp
Mercury2/src/MercuryUtil.cpp
Mercury2/src/StateChanger.cpp
Modified: Mercury2/src/GLHelpers.cpp
===================================================================
--- Mercury2/src/GLHelpers.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/GLHelpers.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -59,7 +59,7 @@
MercuryVertex pointFromScreenLoc(int screen_x, int screen_y, float fForceDepth)
{
- GLfloat winX, winY, winZ;
+ GLfloat winX, winY;
GLdouble mouseX = 0, mouseY = 0, mouseZ = 0;
GLint viewport[4];
GLdouble modelview[16];
@@ -93,7 +93,7 @@
void CameraPointAndRay(int screen_x, int screen_y, MercuryVertex & p, MercuryVertex & r)
{
- GLfloat winX, winY, winZ;
+ GLfloat winX, winY;
GLdouble dox = 0, doy = 0, doz = 0;
GLint viewport[4];
GLdouble modelview[16];
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercuryAsset.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -6,8 +6,7 @@
extern bool DOOCCLUSIONCULL;
MercuryAsset::MercuryAsset( const MString & key, bool bInstanced )
- :m_isInstanced(bInstanced), m_boundingVolume(NULL),
- m_path( key ), m_loadState(NONE), m_ignoreCull(false), m_iPasses( DEFAULT_PASSES ), slType( 0 )
+ :slType( 0 ), m_isInstanced(bInstanced), m_boundingVolume(NULL), m_path( key ), m_loadState(NONE), m_ignoreCull(false), m_iPasses( DEFAULT_PASSES )
{
}
Modified: Mercury2/src/MercuryBacktrace.c
===================================================================
--- Mercury2/src/MercuryBacktrace.c 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercuryBacktrace.c 2010-01-10 22:27:01 UTC (rev 648)
@@ -208,7 +208,11 @@
#else
sprintf( execline, "addr2line -fC -e %s 0x%lx 1>&%d", file, (unsigned long)offset, fds[1] );
#endif
- system( execline );
+ if( system( execline ) != 0 )
+ {
+ printf( "Failed to execute backtrace app. Command line:\"%s\".", execline );
+ return 0;
+ }
readbytes = read( fds[0], buffer, 1024 );
if( readbytes + 1 >= maxlen )
@@ -336,7 +340,10 @@
if( DBGSetup )
return;
DBGSetup = 1;
- pipe( fds );
+ if( pipe( fds ) != 0 )
+ {
+ printf( "Warning: Could not pipe for backtrace.\n" );
+ }
#ifdef _CMAC
sprintf( execline, "atos 2>&%d", fds[0] );
Modified: Mercury2/src/MercuryFileDriverDirect.cpp
===================================================================
--- Mercury2/src/MercuryFileDriverDirect.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercuryFileDriverDirect.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -237,7 +237,10 @@
return;
}
*path_end = 0;
- chdir( buffer );
+ if( chdir( buffer ) != 0 )
+ {
+ fprintf( stderr, "WARNING: Could not change path of executable to \"%s\"\n", buffer );
+ }
#endif
#endif
}
Modified: Mercury2/src/MercuryLog.cpp
===================================================================
--- Mercury2/src/MercuryLog.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercuryLog.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -13,6 +13,7 @@
log->WriteQueue();
msleep(100); //10x/sec
}
+ return 0;
}
MercuryLog::MercuryLog()
Modified: Mercury2/src/MercurySoundDriverALSA.cpp
===================================================================
--- Mercury2/src/MercurySoundDriverALSA.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercurySoundDriverALSA.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -207,7 +207,7 @@
SOUNDMAN->FillBuffer( ibuf, nrframes );
- for( unsigned i = 0; i < nrframes; ++i )
+ for( int i = 0; i < nrframes; ++i )
{
float fi = ibuf[i*2+0];
float fb = ibuf[i*2+1];
Modified: Mercury2/src/MercurySoundSourceRAM.cpp
===================================================================
--- Mercury2/src/MercurySoundSourceRAM.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercurySoundSourceRAM.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -6,8 +6,6 @@
void MercurySoundSourceRAM::FillBuffer( float * cBufferToFill, int iCount )
{
- int i;
-
int iOffset = 0;
if( m_iSampleHold > 0 )
@@ -28,7 +26,7 @@
int placeBytes = m_iSoundPlace* MercurySoundManager::iChannels;
- for( unsigned i = iOffset; i < iCopyFrames * MercurySoundManager::iChannels; i++ )
+ for( int i = iOffset; i < iCopyFrames * MercurySoundManager::iChannels; i++ )
{
cBufferToFill[i] = m_Sound->fSound[placeBytes+i];
}
Modified: Mercury2/src/MercurySoundSourceVorbis.cpp
===================================================================
--- Mercury2/src/MercurySoundSourceVorbis.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercurySoundSourceVorbis.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -118,7 +118,7 @@
REGISTER_SOUND_SOURCE( MercurySoundSourceVorbis, "Vorbis" );
MercurySoundSourceVorbis::MercurySoundSourceVorbis( MercurySoundSource * chain ) :
- MercurySoundSource( chain ), iBufferSize( 32768 ), iBufferLoad(1), iBufferPlay(0)
+ MercurySoundSource( chain ), iBufferSize( 32768 ), iBufferPlay(0), iBufferLoad(1)
{
iBuffer = (short*)malloc( sizeof( short ) * iBufferSize * 2 );
}
@@ -134,7 +134,7 @@
bool MercurySoundSourceVorbis::Load( const MString & sDescriptor )
{
MAutoPtr< HGRawSound > r;
- MAutoPtr< HGRawSound > * g;
+// MAutoPtr< HGRawSound > * g;
m_File = FILEMAN.Open( sDescriptor );
@@ -148,12 +148,13 @@
ov_open_callbacks( m_File, vorbisFile, NULL, 0, vorbisCallbacks );
- vorbis_info* info = ov_info(vorbisFile, -1);
+// vorbis_info* info = ov_info(vorbisFile, -1);
// unsigned VorbisChannels = info->channels;
// unsigned VorbisSamplerate = info->rate;
+
unsigned VorbisSamples = ov_pcm_total( vorbisFile, 0 );
- unsigned Vorbisbytes_read;
+// unsigned Vorbisbytes_read;
if( VorbisSamples <= 0 )
{
@@ -169,7 +170,7 @@
void MercurySoundSourceVorbis::FillBuffer( float * cBufferToFill, int iCount )
{
//Don't worry our circular queue is threadsafe.
- for( unsigned i = 0; i < iCount; i++ )
+ for( int i = 0; i < iCount; i++ )
{
if( PlayLeft() <= 2 ) break;
cBufferToFill[i*2+0] = float(iBuffer[iBufferPlay*2+0])/32768.;
Modified: Mercury2/src/MercuryUtil.cpp
===================================================================
--- Mercury2/src/MercuryUtil.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/MercuryUtil.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -234,6 +234,7 @@
if( !f ) return false;
f->Write( data.c_str(), data.length() );
delete f;
+ return true;
}
Modified: Mercury2/src/StateChanger.cpp
===================================================================
--- Mercury2/src/StateChanger.cpp 2010-01-10 22:13:44 UTC (rev 647)
+++ Mercury2/src/StateChanger.cpp 2010-01-10 22:27:01 UTC (rev 648)
@@ -61,7 +61,7 @@
void Stringify( MString & sOut )
{
- sOut = ssprintf( "%f", bEnable );
+ sOut = (bEnable)?"1":"0";
}
void Activate()
@@ -99,7 +99,7 @@
void Stringify( MString & sOut )
{
- sOut = ssprintf( "%f", bEnable );
+ sOut = (bEnable)?"1":"0";
}
void Activate()
@@ -136,7 +136,7 @@
void Stringify( MString & sOut )
{
- sOut = ssprintf( "%f", bEnable );
+ sOut = (bEnable)?"1":"0";
}
void Activate()
@@ -188,6 +188,7 @@
STRTOGL(s, CONSTANT_ALPHA);
STRTOGL(s, ONE_MINUS_CONSTANT_ALPHA);
STRTOGL(s, SRC_ALPHA_SATURATE);
+ return -1;
}
#define GLTOSTR(x,s) case GL_##s: return #s;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|