diff --git a/src/ActorFrame.cpp b/src/ActorFrame.cpp index bb94b5b025..ee01feee57 100644 --- a/src/ActorFrame.cpp +++ b/src/ActorFrame.cpp @@ -146,7 +146,7 @@ void ActorFrame::AddChild( Actor *pActor ) Dialog::OK( ssprintf("Actor \"%s\" adds child \"%s\" more than once", GetLineage().c_str(), pActor->GetName().c_str()) ); #endif - ASSERT( pActor ); + ASSERT( pActor != NULL ); ASSERT( (void*)pActor != (void*)0xC0000005 ); m_SubActors.push_back( pActor ); diff --git a/src/ActorUtil.cpp b/src/ActorUtil.cpp index cc44b0b6ea..8c3d7e9b1e 100644 --- a/src/ActorUtil.cpp +++ b/src/ActorUtil.cpp @@ -104,7 +104,7 @@ retry: Actor* ActorUtil::LoadFromNode( const XNode* pNode, Actor *pParentActor ) { - ASSERT( pNode ); + ASSERT( pNode != NULL ); // Remove this in favor of using conditionals in Lua. -Chris // There are a number of themes out there that depend on this (including diff --git a/src/BGAnimation.cpp b/src/BGAnimation.cpp index 9d44fef447..66530cc350 100644 --- a/src/BGAnimation.cpp +++ b/src/BGAnimation.cpp @@ -50,7 +50,7 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo { const RString &sLayer = *s; const XNode* pKey = pNode->GetChild( sLayer ); - ASSERT( pKey ); + ASSERT( pKey != NULL ); RString sImportDir; if( pKey->GetAttrValue("Import", sImportDir) ) diff --git a/src/BannerCache.cpp b/src/BannerCache.cpp index 7b8b08110a..ef70fea7c6 100644 --- a/src/BannerCache.cpp +++ b/src/BannerCache.cpp @@ -203,7 +203,7 @@ struct BannerTexture: public RageTexture void Create() { - ASSERT( m_pImage ); + ASSERT( m_pImage != NULL ); /* The image is preprocessed; do as little work as possible. */ @@ -239,7 +239,7 @@ struct BannerTexture: public RageTexture ASSERT( DISPLAY->SupportsTextureFormat(pf) ); - ASSERT(m_pImage); + ASSERT(m_pImage != NULL); m_uTexHandle = DISPLAY->CreateTexture( pf, m_pImage, false ); CreateFrameRects(); @@ -290,7 +290,7 @@ RageTextureID BannerCache::LoadCachedBanner( RString sBannerPath ) * when converting; this way, the conversion will end up in the map so we * only have to convert once. */ RageSurface *&pImage = g_BannerPathToImage[sBannerPath]; - ASSERT( pImage ); + ASSERT( pImage != NULL ); int iSourceWidth = 0, iSourceHeight = 0; BannerData.GetValue( sBannerPath, "Width", iSourceWidth ); diff --git a/src/BitmapText.cpp b/src/BitmapText.cpp index b6dd148532..2d3998abe9 100644 --- a/src/BitmapText.cpp +++ b/src/BitmapText.cpp @@ -363,7 +363,7 @@ void BitmapText::DrawChars( bool bUseStrokeTexture ) * in sAlternateText, too, just use sText. */ void BitmapText::SetText( const RString& _sText, const RString& _sAlternateText, int iWrapWidthPixels ) { - ASSERT( m_pFont ); + ASSERT( m_pFont != NULL ); RString sNewText = StringWillUseAlternate(_sText,_sAlternateText) ? _sAlternateText : _sText; @@ -505,7 +505,7 @@ void BitmapText::UpdateBaseZoom() bool BitmapText::StringWillUseAlternate( const RString& sText, const RString& sAlternateText ) const { - ASSERT( m_pFont ); + ASSERT( m_pFont != NULL ); // Can't use the alternate if there isn't one. if( !sAlternateText.size() ) @@ -711,7 +711,7 @@ void BitmapText::SetHorizAlign( float f ) void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels ) { - ASSERT( m_pFont ); // always load a font first + ASSERT( m_pFont != NULL ); // always load a font first if( m_iWrapWidthPixels == iWrapWidthPixels ) return; m_iWrapWidthPixels = iWrapWidthPixels; diff --git a/src/Font.cpp b/src/Font.cpp index d6c72911a6..d2f7df7e8e 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -346,7 +346,7 @@ void Font::CapsOnly() void Font::SetDefaultGlyph( FontPage *pPage ) { - ASSERT( pPage ); + ASSERT( pPage != NULL ); ASSERT( !pPage->m_aGlyphs.empty() ); m_pDefault = pPage; } diff --git a/src/GameSoundManager.cpp b/src/GameSoundManager.cpp index 5c7679303b..b00536789a 100644 --- a/src/GameSoundManager.cpp +++ b/src/GameSoundManager.cpp @@ -410,7 +410,7 @@ int MusicThread_start( void *p ) GameSoundManager::GameSoundManager() { /* Init RageSoundMan first: */ - ASSERT( SOUNDMAN ); + ASSERT( SOUNDMAN != NULL ); g_Mutex = new RageEvent("GameSoundManager"); g_Playing = new MusicPlaying( new RageSound ); diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index 98e2bec749..7bbe533d67 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -243,7 +243,7 @@ LuaManager::LuaManager() LUA = this; // so that LUA is available when we call the Register functions lua_State *L = lua_open(); - ASSERT( L ); + ASSERT( L != NULL ); lua_atpanic( L, LuaPanic ); m_pLuaMain = L; @@ -478,7 +478,7 @@ int LuaThreadVariable::AdjustCount( lua_State *L, int iAdd ) ASSERT( lua_istable(L, -1) ); lua_rawgeti( L, -1, 0 ); - ASSERT( lua_isnumber(L, -1) ); + ASSERT( lua_isnumber(L, -1) != 0 ); int iCount = lua_tointeger( L, -1 ); lua_pop( L, 1 ); diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index f8ec088a67..0e7e0bd599 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -402,7 +402,7 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet ) case TapNote::lift: c = 'L'; break; case TapNote::fake: c = 'F'; break; default: - FAIL_M( ssprintf("tn %i", tn.type) ); // invalid enum value + c = '\0'; FAIL_M( ssprintf("tn %i", tn.type) ); // invalid enum value } sRet.append( 1, c ); diff --git a/src/Preference.cpp b/src/Preference.cpp index 383c6ae52b..50792ed0b5 100644 --- a/src/Preference.cpp +++ b/src/Preference.cpp @@ -40,7 +40,7 @@ void IPreference::LoadAllDefaults() void IPreference::ReadAllPrefsFromNode( const XNode* pNode, bool bIsStatic ) { - ASSERT( pNode ); + ASSERT( pNode != NULL ); FOREACHS_CONST( IPreference*, *m_Subscribers.m_pSubscribers, p ) (*p)->ReadFrom( pNode, bIsStatic ); } diff --git a/src/RageDisplay_D3D.cpp b/src/RageDisplay_D3D.cpp index 351e8bedb3..d3881ad6a8 100644 --- a/src/RageDisplay_D3D.cpp +++ b/src/RageDisplay_D3D.cpp @@ -1208,7 +1208,7 @@ void RageDisplay_D3D::SetZTestMode( ZTestMode mode ) case ZTEST_OFF: dw = D3DCMP_ALWAYS; break; case ZTEST_WRITE_ON_PASS: dw = D3DCMP_LESSEQUAL; break; case ZTEST_WRITE_ON_FAIL: dw = D3DCMP_GREATER; break; - default: ASSERT( 0 ); + default: dw = D3DCMP_NEVER; ASSERT( 0 ); } g_pd3dDevice->SetRenderState( D3DRS_ZFUNC, dw ); } diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 83bea8f33d..faa24a7f54 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -1358,7 +1358,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const #define BUFFER_OFFSET(o) ((char*)(o)) - ASSERT( glDrawRangeElements); + ASSERT( glDrawRangeElements != NULL ); glDrawRangeElements( GL_TRIANGLES, meshInfo.iVertexStart, // minimum array index contained in indices @@ -2109,7 +2109,7 @@ unsigned RageDisplay_Legacy::CreateTexture( // allocate OpenGL texture resource unsigned int iTexHandle; glGenTextures( 1, reinterpret_cast(&iTexHandle) ); - ASSERT( iTexHandle ); + ASSERT( iTexHandle != 0 ); glBindTexture( GL_TEXTURE_2D, iTexHandle ); @@ -2360,7 +2360,7 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam ¶m, int // Allocate OpenGL texture resource glGenTextures( 1, reinterpret_cast(&m_iTexHandle) ); - ASSERT( m_iTexHandle ); + ASSERT( m_iTexHandle != 0 ); int iTextureWidth = power_of_two( param.iWidth ); int iTextureHeight = power_of_two( param.iHeight ); @@ -2387,7 +2387,7 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam ¶m, int /* Create the framebuffer object. */ glGenFramebuffersEXT( 1, reinterpret_cast(&m_iFrameBufferHandle) ); - ASSERT( m_iFrameBufferHandle ); + ASSERT( m_iFrameBufferHandle != 0 ); /* Attach the texture to it. */ glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, m_iFrameBufferHandle ); @@ -2398,7 +2398,7 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam ¶m, int if (param.bWithDepthBuffer) { glGenRenderbuffersEXT( 1, reinterpret_cast(&m_iDepthBufferHandle) ); - ASSERT( m_iDepthBufferHandle ); + ASSERT( m_iDepthBufferHandle != 0 ); glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, iTextureWidth, iTextureHeight ); glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_iDepthBufferHandle ); diff --git a/src/RageFile.cpp b/src/RageFile.cpp index bc87dc17e7..72d110634f 100644 --- a/src/RageFile.cpp +++ b/src/RageFile.cpp @@ -44,7 +44,7 @@ RString RageFile::GetPath() const bool RageFile::Open( const RString& path, int mode ) { - ASSERT( FILEMAN ); + ASSERT( FILEMAN != NULL ); Close(); m_Path = path; diff --git a/src/RageFileDriver.h b/src/RageFileDriver.h index f6d204e48d..b486dc3d22 100644 --- a/src/RageFileDriver.h +++ b/src/RageFileDriver.h @@ -19,12 +19,12 @@ public: virtual int GetFileHash( const RString &sPath ); virtual int GetPathValue( const RString &sPath ); virtual void FlushDirCache( const RString &sPath ); - virtual void CacheFile( const RString &sPath ) { } - virtual bool Move( const RString &sOldPath, const RString &sNewPath ) { return false; } - virtual bool Remove( const RString &sPath ) { return false; } + virtual void CacheFile( const RString & /* sPath */ ) { } + virtual bool Move( const RString & /* sOldPath */, const RString & /* sNewPath */ ) { return false; } + virtual bool Remove( const RString & /* sPath */ ) { return false; } /* Optional: Move to a different place, as if reconstructed with a different path. */ - virtual bool Remount( const RString &sPath ) { return false; } + virtual bool Remount( const RString & /* sPath */ ) { return false; } /* Possible error returns from Open, in addition to standard errno.h values: */ enum { ERROR_WRITING_NOT_SUPPORTED = -1 }; diff --git a/src/RageFileDriverDirect.cpp b/src/RageFileDriverDirect.cpp index fffdf3d168..21c380d9cd 100644 --- a/src/RageFileDriverDirect.cpp +++ b/src/RageFileDriverDirect.cpp @@ -208,8 +208,8 @@ RageFileBasic *RageFileDriverDirectReadOnly::Open( const RString &sPath, int iMo return RageFileDriverDirect::Open( sPath, iMode, iError ); } -bool RageFileDriverDirectReadOnly::Move( const RString &sOldPath, const RString &sNewPath ) { return false; } -bool RageFileDriverDirectReadOnly::Remove( const RString &sPath ) { return false; } +bool RageFileDriverDirectReadOnly::Move( const RString & /* sOldPath */, const RString & /* sNewPath */ ) { return false; } +bool RageFileDriverDirectReadOnly::Remove( const RString & /* sPath */ ) { return false; } static const unsigned int BUFSIZE = 1024*64; RageFileObjDirect::RageFileObjDirect( const RString &sPath, int iFD, int iMode ) @@ -248,7 +248,7 @@ namespace return true; } #else - bool FlushDir( RString sPath, RString &sError ) + bool FlushDir( RString /* sPath */, RString & /* sError */ ) { return true; } diff --git a/src/RageFileDriverMemory.h b/src/RageFileDriverMemory.h index 6cc1e7a5e8..f431650698 100644 --- a/src/RageFileDriverMemory.h +++ b/src/RageFileDriverMemory.h @@ -37,7 +37,7 @@ public: ~RageFileDriverMem(); RageFileBasic *Open( const RString &sPath, int mode, int &err ); - void FlushDirCache( const RString &sPath ) { } + void FlushDirCache( const RString & /* sPath */ ) { } bool Remove( const RString &sPath ); diff --git a/src/RageSurface.cpp b/src/RageSurface.cpp index 5f34be8c9b..fd586849b9 100644 --- a/src/RageSurface.cpp +++ b/src/RageSurface.cpp @@ -64,7 +64,7 @@ void RageSurfaceFormat::GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b { if( BytesPerPixel == 1 ) { - ASSERT( palette ); + ASSERT( palette != NULL ); *r = palette->colors[val].r; *g = palette->colors[val].g; *b = palette->colors[val].b; diff --git a/src/RageSurfaceUtils.cpp b/src/RageSurfaceUtils.cpp index 3a0fa68f26..c265116a9e 100644 --- a/src/RageSurfaceUtils.cpp +++ b/src/RageSurfaceUtils.cpp @@ -134,7 +134,7 @@ void RageSurfaceUtils::CopySurface( const RageSurface *src, RageSurface *dest ) // Copy the palette, if we have one. if( src->format->BitsPerPixel == 8 && dest->format->BitsPerPixel == 8 ) { - ASSERT( dest->fmt.palette ); + ASSERT( dest->fmt.palette != NULL ); *dest->fmt.palette = *src->fmt.palette; } @@ -791,7 +791,7 @@ RageSurface *RageSurfaceUtils::LoadSurface( RString file ) // Create the surface. RageSurface *img = CreateSurface( h.width, h.height, h.bpp, h.Rmask, h.Gmask, h.Bmask, h.Amask ); - ASSERT( img ); + ASSERT( img != NULL ); /* If the pitch has changed, this surface is either corrupt, or was * created with a different version whose CreateSurface() behavior diff --git a/src/RageSurfaceUtils_Palettize.cpp b/src/RageSurfaceUtils_Palettize.cpp index 758eecf823..7957c0db43 100644 --- a/src/RageSurfaceUtils_Palettize.cpp +++ b/src/RageSurfaceUtils_Palettize.cpp @@ -330,9 +330,9 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i int boxes; bv = (box_vector) malloc( sizeof(struct box) * newcolors ); - ASSERT( bv ); + ASSERT( bv != NULL ); acolormap = (acolorhist_item*) malloc( sizeof(struct acolorhist_item) * newcolors); - ASSERT( acolormap ); + ASSERT( acolormap != NULL ); for ( int i = 0; i < newcolors; ++i ) PAM_ASSIGN( acolormap[i].acolor, 0, 0, 0, 0 ); diff --git a/src/RageSurface_Load.cpp b/src/RageSurface_Load.cpp index 1a2c4d2e20..ee2f69da02 100644 --- a/src/RageSurface_Load.cpp +++ b/src/RageSurface_Load.cpp @@ -31,7 +31,7 @@ static RageSurface *TryOpenFile( RString sPath, bool bHeaderOnly, RString &error if( result == RageSurfaceUtils::OPEN_OK ) { - ASSERT( ret ); + ASSERT( ret != NULL ); return ret; } diff --git a/src/RageSurface_Load_PNG.cpp b/src/RageSurface_Load_PNG.cpp index e5d37e5818..a2f3b9a4ed 100644 --- a/src/RageSurface_Load_PNG.cpp +++ b/src/RageSurface_Load_PNG.cpp @@ -229,7 +229,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro default: FAIL_M(ssprintf( "%i", type) ); } - ASSERT( img ); + ASSERT( img != NULL ); /* alloca to prevent memleaks if libpng longjmps us */ png_byte **row_pointers = (png_byte **) alloca( sizeof(png_byte*) * height ); diff --git a/src/RageTexturePreloader.cpp b/src/RageTexturePreloader.cpp index 8b22b789e9..772d5975cf 100644 --- a/src/RageTexturePreloader.cpp +++ b/src/RageTexturePreloader.cpp @@ -27,7 +27,7 @@ RageTexturePreloader &RageTexturePreloader::operator=( const RageTexturePreloade void RageTexturePreloader::Load( const RageTextureID &ID ) { - ASSERT( TEXTUREMAN ); + ASSERT( TEXTUREMAN != NULL ); RageTexture *pTexture = TEXTUREMAN->LoadTexture( ID ); m_apTextures.push_back( pTexture ); diff --git a/src/RageUtil_FileDB.cpp b/src/RageUtil_FileDB.cpp index 8b9bda6966..4997fe560a 100644 --- a/src/RageUtil_FileDB.cpp +++ b/src/RageUtil_FileDB.cpp @@ -175,7 +175,7 @@ bool FilenameDB::ResolvePath( RString &sPath ) const FileSet *fs = NULL; static const RString slash("/"); - while( 1 ) + for(;;) { split( sPath, slash, iBegin, iSize, true ); if( iBegin == (int) sPath.size() ) @@ -284,7 +284,7 @@ FileSet *FilenameDB::GetFileSet( const RString &sDir_, bool bCreate ) m_Mutex.Lock(); - while(1) + for(;;) { /* Look for the directory. */ map::iterator i = dirs.find( sLower ); @@ -476,12 +476,12 @@ void FilenameDB::DelFile( const RString &sPath ) m_Mutex.Unlock(); /* locked by GetFileSet */ } -void FilenameDB::FlushDirCache( const RString &sDir ) +void FilenameDB::FlushDirCache( const RString & /* sDir */ ) { FileSet *pFileSet = NULL; m_Mutex.Lock(); - while( true ) + for(;;) { if( dirs.empty() ) break; diff --git a/src/RageUtil_FileDB.h b/src/RageUtil_FileDB.h index f227145dcc..90449d7086 100644 --- a/src/RageUtil_FileDB.h +++ b/src/RageUtil_FileDB.h @@ -126,7 +126,7 @@ protected: void DelFileSet( map::iterator dir ); /* The given path wasn't cached. Cache it. */ - virtual void PopulateFileSet( FileSet &fs, const RString &sPath ) { } + virtual void PopulateFileSet( FileSet & /* fs */, const RString & /* sPath */ ) { } }; /* This FilenameDB must be populated in advance. */ @@ -134,7 +134,7 @@ class NullFilenameDB: public FilenameDB { public: NullFilenameDB() { ExpireSeconds = -1; } - void CacheFile( const RString &sPath ) { } + void CacheFile( const RString & /* sPath */ ) { } }; #endif diff --git a/src/ScoreKeeperRave.cpp b/src/ScoreKeeperRave.cpp index cee45fbcd8..9669ccd18f 100644 --- a/src/ScoreKeeperRave.cpp +++ b/src/ScoreKeeperRave.cpp @@ -163,7 +163,7 @@ void ScoreKeeperRave::AddSuperMeterDelta( float fUnscaledPercentChange ) { case PLAYER_1: bWinning = GAMESTATE->m_fTugLifePercentP1 > 0.5f; break; case PLAYER_2: bWinning = GAMESTATE->m_fTugLifePercentP1 < 0.5f; break; - default: ASSERT(0); + default: bWinning = false; ASSERT(0); } if( !bWinning ) m_pPlayerState->EndActiveAttacks(); diff --git a/src/ScreenOptionsEditCourse.cpp b/src/ScreenOptionsEditCourse.cpp index 020f328c1d..a489fc3839 100644 --- a/src/ScreenOptionsEditCourse.cpp +++ b/src/ScreenOptionsEditCourse.cpp @@ -335,7 +335,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vectorGetStepsForEntry( iEntryIndex ); - ASSERT_M( pSteps, "No Steps for this Song!" ); + ASSERT_M( pSteps != NULL, "No Steps for this Song!" ); CourseEntry ce; ce.songID.FromSong( pSong ); ce.stepsCriteria.m_difficulty = pSteps->GetDifficulty(); @@ -412,7 +412,7 @@ void ScreenOptionsEditCourse::SetCurrentSteps() OptionRow &row = *m_pRows[ EntryIndexAndRowTypeToRow(iEntryIndex, RowType_Steps) ]; int iStepsIndex = row.GetOneSharedSelection(); const EditCourseOptionRowHandlerSteps *pHand = dynamic_cast( row.GetHandler() ); - ASSERT( pHand ); + ASSERT( pHand != NULL ); Steps *pSteps = pHand->GetSteps( iStepsIndex ); GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps ); } diff --git a/src/ScreenOptionsEditProfile.cpp b/src/ScreenOptionsEditProfile.cpp index 16ad94705a..d5013a1827 100644 --- a/src/ScreenOptionsEditProfile.cpp +++ b/src/ScreenOptionsEditProfile.cpp @@ -30,7 +30,7 @@ void ScreenOptionsEditProfile::BeginScreen() vector vHands; Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID ); - ASSERT( pProfile ); + ASSERT( pProfile != NULL ); { vHands.push_back( OptionRowHandlerUtil::MakeNull() ); @@ -64,7 +64,7 @@ ScreenOptionsEditProfile::~ScreenOptionsEditProfile() void ScreenOptionsEditProfile::ImportOptions( int iRow, const vector &vpns ) { Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID ); - ASSERT( pProfile ); + ASSERT( pProfile != NULL ); OptionRow &row = *m_pRows[iRow]; switch( iRow ) @@ -78,7 +78,7 @@ void ScreenOptionsEditProfile::ImportOptions( int iRow, const vector &vpns ) { Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID ); - ASSERT( pProfile ); + ASSERT( pProfile != NULL ); OptionRow &row = *m_pRows[iRow]; int iIndex = row.GetOneSharedSelection( true ); RString sValue; diff --git a/src/ThemeManager.cpp b/src/ThemeManager.cpp index 981a211573..df2cb8d187 100644 --- a/src/ThemeManager.cpp +++ b/src/ThemeManager.cpp @@ -872,7 +872,7 @@ void ThemeManager::ReloadMetrics() RString ThemeManager::GetMetricsGroupFallback( const RString &sMetricsGroup ) { - ASSERT( g_pLoadedThemeData ); + ASSERT( g_pLoadedThemeData != NULL ); // always look in iniMetrics for "Fallback" RString sFallback; @@ -1166,7 +1166,7 @@ RString ThemeManager::GetString( const RString &sMetricsGroup, const RString &sV sValueName.Replace( "\r\n", "\\n" ); sValueName.Replace( "\n", "\\n" ); - ASSERT( g_pLoadedThemeData ); + ASSERT( g_pLoadedThemeData != NULL ); RString s = GetMetricRaw( g_pLoadedThemeData->iniStrings, sMetricsGroup, sValueName ); FontCharAliases::ReplaceMarkers( s ); diff --git a/src/arch/ArchHooks/ArchHooks_Win32.cpp b/src/arch/ArchHooks/ArchHooks_Win32.cpp index b6945bc29a..3b49cfb4be 100644 --- a/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -204,7 +204,7 @@ float ArchHooks_Win32::GetDisplayAspectRatio() ZERO( dm ); dm.dmSize = sizeof(dm); BOOL bResult = EnumDisplaySettings( NULL, ENUM_REGISTRY_SETTINGS, &dm ); - ASSERT( bResult ); + ASSERT( bResult != 0 ); return dm.dmPelsWidth / (float)dm.dmPelsHeight; } diff --git a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index ae42eae7a8..d23951f6b4 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -25,10 +25,10 @@ static HBITMAP LoadWin32Surface( RageSurface *&s ) RageSurfaceUtils::ConvertSurface( s, s->w, s->h, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0 ); HDC hScreen = GetDC(NULL); - ASSERT_M( hScreen, werr_ssprintf(GetLastError(), "hScreen") ); + ASSERT_M( hScreen != NULL, werr_ssprintf(GetLastError(), "hScreen") ); HBITMAP bitmap = CreateCompatibleBitmap( hScreen, s->w, s->h ); - ASSERT_M( bitmap, werr_ssprintf(GetLastError(), "CreateCompatibleBitmap") ); + ASSERT_M( bitmap != NULL, werr_ssprintf(GetLastError(), "CreateCompatibleBitmap") ); HDC BitmapDC = CreateCompatibleDC( hScreen ); SelectObject( BitmapDC, bitmap ); diff --git a/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp b/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp index cc81bbbb6f..7751667f8e 100644 --- a/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp +++ b/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp @@ -140,7 +140,7 @@ RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew bCanSetPixelFormat = false; } - ASSERT( GraphicsWindow::GetHwnd() ); + ASSERT( GraphicsWindow::GetHwnd() != NULL ); /* Set the display mode: switch to a fullscreen mode or revert to windowed mode. */ LOG->Trace("SetScreenMode ..."); diff --git a/src/arch/MovieTexture/MovieTexture.cpp b/src/arch/MovieTexture/MovieTexture.cpp index 6f4c154c3f..8c9190117f 100644 --- a/src/arch/MovieTexture/MovieTexture.cpp +++ b/src/arch/MovieTexture/MovieTexture.cpp @@ -106,7 +106,7 @@ RageMovieTexture *RageMovieTexture::Create( RageTextureID ID ) } RageMovieTextureDriver *pDriver = dynamic_cast( pDriverBase ); - ASSERT( pDriver ); + ASSERT( pDriver != NULL ); RString sError; ret = pDriver->Create( ID, sError ); diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 32caa259d4..8c75ef5ff5 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -219,7 +219,7 @@ RageSurface *RageMovieTextureDriver_FFMpeg::AVCodecCreateCompatibleSurface( int for( iAVTexfmtIndex = 0; AVPixelFormats[iAVTexfmtIndex].bpp; ++iAVTexfmtIndex ) if( AVPixelFormats[iAVTexfmtIndex].bHighColor == bPreferHighColor ) break; - ASSERT( AVPixelFormats[iAVTexfmtIndex].bpp ); + ASSERT( AVPixelFormats[iAVTexfmtIndex].bpp != 0 ); } const AVPixelFormat_t *pfd = &AVPixelFormats[iAVTexfmtIndex]; @@ -664,7 +664,7 @@ RString MovieDecoder_FFMpeg::OpenCodec() { Init(); - ASSERT( m_pStream ); + ASSERT( m_pStream != NULL ); if( m_pStream->codec->codec ) avcodec::avcodec_close( m_pStream->codec ); @@ -684,7 +684,7 @@ RString MovieDecoder_FFMpeg::OpenCodec() int ret = avcodec::avcodec_open2( m_pStream->codec, pCodec, NULL ); if( ret < 0 ) return RString( averr_ssprintf(ret, "Couldn't open codec \"%s\"", pCodec->name) ); - ASSERT( m_pStream->codec->codec ); + ASSERT( m_pStream->codec->codec != NULL ); return RString(); } diff --git a/src/arch/Sound/RageSoundDriver_WDMKS.cpp b/src/arch/Sound/RageSoundDriver_WDMKS.cpp index 860292e2f2..5e477a09b6 100644 --- a/src/arch/Sound/RageSoundDriver_WDMKS.cpp +++ b/src/arch/Sound/RageSoundDriver_WDMKS.cpp @@ -259,7 +259,7 @@ static bool WdmGetPinPropertyMulti( return false; *ksMultipleItem = (KSMULTIPLE_ITEM*) malloc( multipleItemSize ); - ASSERT( *ksMultipleItem ); + ASSERT( *ksMultipleItem != NULL ); if( !WdmSyncIoctl( hHandle, IOCTL_KS_PROPERTY, &ksPProp, sizeof(KSP_PIN), (void*)*ksMultipleItem, multipleItemSize, NULL, sError) ) { @@ -1004,7 +1004,7 @@ bool WinWdmStream::Open( WinWdmFilter *pFilter, /* Avoid any FileAlignment problems by using VirtualAlloc, which is always page aligned. */ p->Data = (char *) VirtualAlloc( NULL, m_iFramesPerChunk*m_iBytesPerOutputSample*m_iDeviceOutputChannels, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE ); - ASSERT( p->Data ); + ASSERT( p->Data != NULL ); p->FrameExtent = m_iFramesPerChunk*m_iBytesPerOutputSample*m_iDeviceOutputChannels; p->DataUsed = m_iFramesPerChunk*m_iBytesPerOutputSample*m_iDeviceOutputChannels; p->Size = sizeof(*p); @@ -1178,7 +1178,7 @@ void RageSoundDriver_WDMKS::MixerThread() /* Enable priority boosting. */ SetThreadPriorityBoost( GetCurrentThread(), FALSE ); - ASSERT( m_pStream->m_pPlaybackPin ); + ASSERT( m_pStream->m_pPlaybackPin != NULL ); /* Some drivers (stock USB audio in XP) misbehave if we go from KSSTATE_STOP to * KSSTATE_RUN. Always transition through KSSTATE_PAUSE. */ diff --git a/src/arch/Threads/Threads_Win32.cpp b/src/arch/Threads/Threads_Win32.cpp index acb13c1c8f..008d93597d 100644 --- a/src/arch/Threads/Threads_Win32.cpp +++ b/src/arch/Threads/Threads_Win32.cpp @@ -159,7 +159,7 @@ ThreadImpl *MakeThread( int (*pFunc)(void *pData), void *pData, uint64_t *piThre thread->ThreadHandle = CreateThread( NULL, 0, &StartThread, thread, CREATE_SUSPENDED, &thread->ThreadId ); *piThreadID = (uint64_t) thread->ThreadId; - ASSERT_M( thread->ThreadHandle, ssprintf("%s", werr_ssprintf(GetLastError(), "CreateThread")) ); + ASSERT_M( thread->ThreadHandle != NULL, ssprintf("%s", werr_ssprintf(GetLastError(), "CreateThread")) ); int slot = GetOpenSlot( thread->ThreadId ); g_ThreadHandles[slot] = thread->ThreadHandle; diff --git a/src/archutils/Win32/DialogUtil.cpp b/src/archutils/Win32/DialogUtil.cpp index 0bfdd3cd20..8ad854b55f 100644 --- a/src/archutils/Win32/DialogUtil.cpp +++ b/src/archutils/Win32/DialogUtil.cpp @@ -30,7 +30,7 @@ static HFONT CreatePointFontIndirect(const LOGFONT* lpLogFont) // nPointSize is actually scaled 10x static HFONT CreatePointFont(int nPointSize, LPCTSTR lpszFaceName) { - ASSERT(lpszFaceName); + ASSERT(lpszFaceName != NULL); LOGFONT logFont; memset(&logFont, 0, sizeof(LOGFONT)); @@ -43,10 +43,10 @@ static HFONT CreatePointFont(int nPointSize, LPCTSTR lpszFaceName) void DialogUtil::SetHeaderFont( HWND hdlg, int nID ) { - ASSERT( hdlg ); + ASSERT( hdlg != NULL ); HWND hControl = ::GetDlgItem( hdlg, nID ); - ASSERT( hControl ); + ASSERT( hControl != NULL ); // TODO: Fix font leak const int FONT_POINTS = 16; @@ -56,7 +56,7 @@ void DialogUtil::SetHeaderFont( HWND hdlg, int nID ) void DialogUtil::LocalizeDialogAndContents( HWND hdlg ) { - ASSERT( THEME ); + ASSERT( THEME != NULL ); const int LARGE_STRING = 256; char szTemp[LARGE_STRING] = "";