From 48ebc5354999f1d142d3a7119edd397fec5b26c7 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 4 Sep 2005 16:55:21 +0000 Subject: [PATCH] return NULL -> return CString() for clarity and efficiency --- stepmania/src/Character.cpp | 10 +++++----- stepmania/src/Command.cpp | 2 +- stepmania/src/CourseUtil.cpp | 2 +- stepmania/src/CryptManager.cpp | 2 +- stepmania/src/DateTime.cpp | 2 +- stepmania/src/Font.cpp | 4 ++-- stepmania/src/GameManager.cpp | 6 +++--- stepmania/src/MsdFile.cpp | 4 ++-- stepmania/src/MsdFile.h | 2 +- stepmania/src/NetworkSyncManager.cpp | 4 ++-- stepmania/src/NoteSkinManager.cpp | 2 +- stepmania/src/Profile.cpp | 2 +- stepmania/src/RageDisplay.cpp | 8 ++++---- stepmania/src/RageDisplay.h | 4 ++-- stepmania/src/RageDisplay_D3D.cpp | 4 ++-- stepmania/src/RageDisplay_Null.h | 2 +- stepmania/src/RageDisplay_OGL.cpp | 8 ++++---- stepmania/src/RageFile.cpp | 4 ++-- stepmania/src/RageFileBasic.h | 4 ++-- stepmania/src/RageFileManager.cpp | 4 ++-- stepmania/src/RageInputDevice.cpp | 6 +++--- stepmania/src/RageSoundReader_WAV.cpp | 2 +- stepmania/src/RageUtil.cpp | 16 ++++++++-------- stepmania/src/RageUtil_BackgroundLoader.cpp | 4 ++-- stepmania/src/ScreenEdit.cpp | 2 +- stepmania/src/ScreenEnding.cpp | 8 ++++---- stepmania/src/ScreenMessage.cpp | 2 +- stepmania/src/ScreenOptions.cpp | 2 +- stepmania/src/ScreenPackages.cpp | 2 +- stepmania/src/ScreenProfileOptions.cpp | 4 ++-- stepmania/src/ScreenSMOnlineLogin.cpp | 2 +- stepmania/src/ScreenSystemLayer.cpp | 4 ++-- stepmania/src/Song.cpp | 4 ++-- stepmania/src/SongManager.cpp | 12 ++++++------ stepmania/src/SongUtil.cpp | 12 ++++++------ stepmania/src/Sprite.cpp | 2 +- stepmania/src/StepMania.cpp | 2 +- stepmania/src/StepMania.dsp | 4 ++-- stepmania/src/StepMania.h | 2 +- stepmania/src/arch/Dialog/DialogDriver.h | 2 +- stepmania/src/arch/LoadingWindow/LoadingWindow.h | 2 +- .../src/arch/LowLevelWindow/LowLevelWindow.h | 2 +- .../arch/LowLevelWindow/LowLevelWindow_Win32.cpp | 2 +- stepmania/src/arch/MovieTexture/MovieTexture.h | 2 +- .../src/arch/MovieTexture/MovieTexture_DShow.cpp | 4 ++-- .../arch/MovieTexture/MovieTexture_FFMpeg.cpp | 4 ++-- stepmania/src/arch/Sound/DSoundHelpers.cpp | 4 ++-- stepmania/src/arch/Sound/RageSoundDriver.h | 2 +- .../src/arch/Sound/RageSoundDriver_DSound.cpp | 2 +- .../Sound/RageSoundDriver_DSound_Software.cpp | 2 +- .../src/arch/Sound/RageSoundDriver_WaveOut.cpp | 2 +- .../src/archutils/Win32/GetFileInformation.cpp | 2 +- stepmania/src/archutils/Win32/GraphicsWindow.cpp | 4 ++-- stepmania/src/archutils/Win32/USB.cpp | 2 +- .../src/archutils/Win32/VideoDriverInfo.cpp | 4 ++-- 55 files changed, 107 insertions(+), 107 deletions(-) diff --git a/stepmania/src/Character.cpp b/stepmania/src/Character.cpp index 1a7dd983d4..224f45b207 100644 --- a/stepmania/src/Character.cpp +++ b/stepmania/src/Character.cpp @@ -66,7 +66,7 @@ CString GetRandomFileInDir( CString sDir ) CStringArray asFiles; GetDirListing( sDir, asFiles, false, true ); if( asFiles.empty() ) - return NULL; + return CString(); else return asFiles[rand()%asFiles.size()]; } @@ -78,7 +78,7 @@ CString Character::GetModelPath() const if( DoesFileExist(s) ) return s; else - return NULL; + return CString(); } CString Character::GetRestAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Rest/")); } @@ -92,7 +92,7 @@ CString Character::GetTakingABreakPath() const GetDirListing( m_sCharDir+"break.gif", as, false, true ); GetDirListing( m_sCharDir+"break.bmp", as, false, true ); if( as.empty() ) - return NULL; + return CString(); else return as[0]; } @@ -115,7 +115,7 @@ CString Character::GetSongSelectIconPath() const GetDirListing( m_sCharDir+"icon.gif", as, false, true ); GetDirListing( m_sCharDir+"icon.bmp", as, false, true ); if( as.empty() ) - return NULL; + return CString(); else return as[0]; } @@ -141,7 +141,7 @@ CString Character::GetStageIconPath() const GetDirListing( m_sCharDir+"card.gif", as, false, true ); GetDirListing( m_sCharDir+"card.bmp", as, false, true ); if( as.empty() ) - return NULL; + return CString(); else return as[0]; } diff --git a/stepmania/src/Command.cpp b/stepmania/src/Command.cpp index d4efd0ca7b..c31abe512c 100644 --- a/stepmania/src/Command.cpp +++ b/stepmania/src/Command.cpp @@ -17,7 +17,7 @@ void IncorrectNumberArgsWarning( const Command &command, int iMaxIndexAccessed ) CString Command::GetName() const { if( m_vsArgs.empty() ) - return NULL; + return CString(); CString s = m_vsArgs[0]; s.MakeLower(); return s; diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index 3e3a82a17e..40bcd845bd 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -278,7 +278,7 @@ CString CourseID::ToString() const return sPath; if( !sFullTitle.empty() ) return sFullTitle; - return NULL; + return CString(); } bool CourseID::IsValid() const diff --git a/stepmania/src/CryptManager.cpp b/stepmania/src/CryptManager.cpp index 7655ee5e18..9bebd88db5 100644 --- a/stepmania/src/CryptManager.cpp +++ b/stepmania/src/CryptManager.cpp @@ -245,7 +245,7 @@ CString CryptManager::GetMD5( CString fn ) if( !file.Open( fn, RageFile::READ ) ) { LOG->Warn( "GetMD5: Failed to open file '%s'", fn.c_str() ); - return NULL; + return CString(); } MD5Init(&md5c); diff --git a/stepmania/src/DateTime.cpp b/stepmania/src/DateTime.cpp index 3c773a7afb..c4810f6ade 100644 --- a/stepmania/src/DateTime.cpp +++ b/stepmania/src/DateTime.cpp @@ -197,7 +197,7 @@ static const CString MONTH_TO_NAME[MONTHS_IN_YEAR] = CString MonthToString( int iMonthIndex ) { if( iMonthIndex < 0 || iMonthIndex >= (int) sizeof(MONTH_TO_NAME) ) - return NULL; + return CString(); return MONTH_TO_NAME[iMonthIndex]; } LuaFunction( MonthToString, MonthToString( IArg(1) ) ); diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index b9a19afd9b..0198bdd772 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -600,7 +600,7 @@ CString FontPageSettings::MapRange( CString sMapping, int iMapOffset, int iGlyph iCount--; } - return NULL; + return CString(); } const wchar_t *pMapping = FontCharmaps::get_char_map( sMapping ); @@ -631,7 +631,7 @@ CString FontPageSettings::MapRange( CString sMapping, int iMapOffset, int iGlyph if( iCount ) return "Map overflow"; /* there aren't enough characters in the map */ - return NULL; + return CString(); } static CStringArray LoadStack; diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index b2e9171d0d..e6353b0037 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -2763,7 +2763,7 @@ CString GameManager::GetMenuButtonSecondaryFunction( const Game *pGame, GameButt * it) and/or map to a menu button (if m_DedicatedMenuButton or m_SecondaryMenuButton * map to it). * - * If a button is only used in gameplay or is only used in menus, return NULL; the + * If a button is only used in gameplay or is only used in menus, return CString(); the * primary description is sufficient. * * If a button is used in both gameplay and menus, return szSecondaryNames[] for @@ -2799,12 +2799,12 @@ CString GameManager::GetMenuButtonSecondaryFunction( const Game *pGame, GameButt FOREACH_MenuButton(m) { if( !bUsedInGameplay && pGame->m_DedicatedMenuButton[m] == gb ) - return NULL; + return CString(); else if( bUsedInGameplay && pGame->m_SecondaryMenuButton[m] == gb ) return szSecondaryNames[m]; } - return NULL; // only used in gameplay + return CString(); // only used in gameplay } diff --git a/stepmania/src/MsdFile.cpp b/stepmania/src/MsdFile.cpp index 2fb55aa91b..05dece9c5b 100644 --- a/stepmania/src/MsdFile.cpp +++ b/stepmania/src/MsdFile.cpp @@ -160,8 +160,8 @@ void MsdFile::ReadFromString( const CString &sString ) CString MsdFile::GetParam(unsigned val, unsigned par) const { - if(val >= GetNumValues()) return NULL; - if(par >= GetNumParams(val)) return NULL; + if(val >= GetNumValues()) return CString(); + if(par >= GetNumParams(val)) return CString(); return values[val].params[par]; } diff --git a/stepmania/src/MsdFile.h b/stepmania/src/MsdFile.h index 6e4f49f55e..99eb9b5321 100644 --- a/stepmania/src/MsdFile.h +++ b/stepmania/src/MsdFile.h @@ -11,7 +11,7 @@ public: { vector params; - CString operator[](unsigned i) const { if(i >= params.size()) return NULL; return params[i]; } + CString operator[](unsigned i) const { if(i >= params.size()) return CString(); return params[i]; } }; virtual ~MsdFile() { } diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index 7ecb528e86..003874c6ab 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -13,7 +13,7 @@ NetworkSyncManager::~NetworkSyncManager () { } void NetworkSyncManager::CloseConnection() { } void NetworkSyncManager::PostStartUp(const CString& ServerIP ) { } bool NetworkSyncManager::Connect(const CString& addy, unsigned short port) { return false; } -CString NetworkSyncManager::GetServerName() { return NULL; } +CString NetworkSyncManager::GetServerName() { return CString(); } void NetworkSyncManager::ReportNSSOnOff(int i) { } void NetworkSyncManager::ReportTiming(float offset, int PlayerNumber) { } void NetworkSyncManager::ReportScore(int playerID, int step, int score, int combo) { } @@ -25,7 +25,7 @@ void NetworkSyncManager::Update( float fDeltaTime ) { } bool NetworkSyncManager::ChangedScoreboard(int Column) { return false; } void NetworkSyncManager::SendChat(const CString& message) { } void NetworkSyncManager::SelectUserSong() { } -CString NetworkSyncManager::MD5Hex( const CString &sInput ) { return NULL; } +CString NetworkSyncManager::MD5Hex( const CString &sInput ) { return CString(); } int NetworkSyncManager::GetSMOnlineSalt() { return 0; } #else #include "ezsockets.h" diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 7d3d5ed054..d853a0c58c 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -273,7 +273,7 @@ CString NoteSkinManager::GetPathFromDirAndFile( const CString &sDir, const CStri GetDirListing( sDir+sFileName+"*", matches, false, true ); if( matches.empty() ) - return NULL; + return CString(); if( matches.size() > 1 ) { diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index b81ce15d72..20f8fbdff3 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -185,7 +185,7 @@ CString Profile::GetDisplayNameOrHighScoreName() const else if( !m_sLastUsedHighScoreName.empty() ) return m_sLastUsedHighScoreName; else - return NULL; + return CString(); } Character *Profile::GetCharacter() const diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 2cd254b59a..d0d981faa0 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -54,20 +54,20 @@ CString RageDisplay::SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures CString err; err = this->TryVideoMode(p,bNeedReloadTextures); if( err == "" ) - return NULL; + return CString(); LOG->Trace( "TryVideoMode failed: %s", err.c_str() ); // fall back p.windowed = false; if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) - return NULL; + return CString(); p.bpp = 16; if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) - return NULL; + return CString(); p.width = 640; p.height = 480; if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) - return NULL; + return CString(); return ssprintf( "SetVideoMode failed: %s", err.c_str() ); } diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 1fd7a2bd70..401c91713d 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -222,7 +222,7 @@ public: }; bool SaveScreenshot( CString sPath, GraphicsFileFormat format ); - virtual CString GetTextureDiagnostics( unsigned id ) const { return NULL; } + virtual CString GetTextureDiagnostics( unsigned id ) const { return CString(); } virtual RageSurface* CreateScreenshot() = 0; // allocates a surface. Caller must delete it. protected: @@ -235,7 +235,7 @@ protected: virtual void DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float LineWidth ); virtual void DrawCircleInternal( const RageSpriteVertex &v, float radius ); - // return NULL if mode change was successful, an error message otherwise. + // return CString() if mode change was successful, an error message otherwise. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. virtual CString TryVideoMode( VideoModeParams params, bool &bNewDeviceOut ) = 0; diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index 6c0b628ad2..40851066f0 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -391,7 +391,7 @@ CString SetD3DParams( bool &bNewDeviceOut ) } } - return NULL; + return CString(); } /* If the given parameters have failed, try to lower them. */ @@ -604,7 +604,7 @@ CString RageDisplay_D3D::TryVideoMode( VideoModeParams p, bool &bNewDeviceOut ) /* Palettes were lost by Reset(), so mark them unloaded. */ g_TexResourceToPaletteIndex.clear(); - return NULL; // mode change successful + return CString(); // mode change successful } void RageDisplay_D3D::ResolutionChanged() diff --git a/stepmania/src/RageDisplay_Null.h b/stepmania/src/RageDisplay_Null.h index 0ba9b8cbfa..6694e1fb67 100644 --- a/stepmania/src/RageDisplay_Null.h +++ b/stepmania/src/RageDisplay_Null.h @@ -74,7 +74,7 @@ protected: void DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float LineWidth ) { } VideoModeParams m_Params; - CString TryVideoMode( VideoModeParams params, bool &bNewDeviceOut ) { m_Params = params; return NULL; } + CString TryVideoMode( VideoModeParams params, bool &bNewDeviceOut ) { m_Params = params; return CString(); } RageSurface* CreateScreenshot(); void SetViewport(int shift_left, int shift_down) { } RageMatrix GetOrthoMatrix( float l, float r, float b, float t, float zn, float zf ); diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 7fe0f8d44c..6b510a99d6 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -334,7 +334,7 @@ CString GetInfoLog( GLhandleARB h ) GLint iLength; GLExt.glGetObjectParameterivARB( h, GL_OBJECT_INFO_LOG_LENGTH_ARB, &iLength ); if( !iLength ) - return NULL; + return CString(); GLcharARB *pInfoLog = new GLcharARB[iLength]; GLExt.glGetInfoLogARB( h, iLength, &iLength, pInfoLog ); @@ -477,7 +477,7 @@ CString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRender InitScalingScript(); - return NULL; + return CString(); } #if defined(UNIX) && defined(HAVE_LIBXTST) @@ -698,7 +698,7 @@ CString RageDisplay_OGL::TryVideoMode( VideoModeParams p, bool &bNewDeviceOut ) ResolutionChanged(); - return NULL; // successfully set mode + return CString(); // successfully set mode } void RageDisplay_OGL::SetViewport(int shift_left, int shift_down) @@ -1884,7 +1884,7 @@ void RageDisplay_OGL::SetLineWidth( float fWidth ) CString RageDisplay_OGL::GetTextureDiagnostics( unsigned id ) const { - return NULL; + return CString(); } void RageDisplay_OGL::SetAlphaTest( bool b ) diff --git a/stepmania/src/RageFile.cpp b/stepmania/src/RageFile.cpp index 738f730ade..515f4e1f8a 100644 --- a/stepmania/src/RageFile.cpp +++ b/stepmania/src/RageFile.cpp @@ -33,7 +33,7 @@ RageFileBasic *RageFile::Copy() const CString RageFile::GetPath() const { if ( !IsOpen() ) - return NULL; + return CString(); CString sRet = m_File->GetDisplayPath(); if( sRet != "" ) @@ -218,7 +218,7 @@ void FileReading::ReadBytes( RageFileBasic &f, void *buf, int size, CString &sEr CString FileReading::ReadString( RageFileBasic &f, int size, CString &sError ) { if( sError.size() != 0 ) - return NULL; + return CString(); CString sBuf; int ret = f.Read( sBuf, size ); diff --git a/stepmania/src/RageFileBasic.h b/stepmania/src/RageFileBasic.h index d03bae1952..f014e13602 100644 --- a/stepmania/src/RageFileBasic.h +++ b/stepmania/src/RageFileBasic.h @@ -42,7 +42,7 @@ public: virtual int Flush() = 0; /* This returns a descriptive path for the file, or "". */ - virtual CString GetDisplayPath() const { return NULL; } + virtual CString GetDisplayPath() const { return CString(); } virtual RageFileBasic *Copy() const = 0; @@ -88,7 +88,7 @@ public: bool GetCRC32( uint32_t *iRet ); virtual int GetFileSize() const = 0; - virtual CString GetDisplayPath() const { return NULL; } + virtual CString GetDisplayPath() const { return CString(); } virtual RageFileBasic *Copy() const { FAIL_M( "Copying unimplemented" ); } protected: diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 0fd5082d85..c2a81825ea 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -335,11 +335,11 @@ CString LoadedDriver::GetPath( const CString &sPath ) const if( sPath.size() >= 2 && sPath[1] == '@' ) { if( m_sMountPoint.size() < 2 || m_sMountPoint[1] != '@' ) - return NULL; + return CString(); } if( sPath.Left(m_sMountPoint.size()).CompareNoCase(m_sMountPoint) ) - return NULL; /* no match */ + return CString(); /* no match */ /* Add one, so we don't cut off the leading slash. */ CString sRet = sPath.Right( sPath.size() - m_sMountPoint.size() + 1 ); diff --git a/stepmania/src/RageInputDevice.cpp b/stepmania/src/RageInputDevice.cpp index 5944bbe058..97ec17aa45 100644 --- a/stepmania/src/RageInputDevice.cpp +++ b/stepmania/src/RageInputDevice.cpp @@ -270,8 +270,8 @@ CString DeviceButtonToString( InputDevice device, DeviceButton i ) case DEVICE_PUMP2: return PumpPadButtonToString( (PumpPadButton)i ); case DEVICE_MIDI: return MidiButtonToString( i ); case DEVICE_PARA1: return ParaPadButtonToString( (ParaPadButton)i ); - case DEVICE_NONE: return NULL; - default: ASSERT(0); return NULL; + case DEVICE_NONE: return CString(); + default: ASSERT(0); return CString(); } } @@ -337,7 +337,7 @@ int GetNumDeviceButtons( InputDevice device ) CString DeviceInput::toString() const { if( device == DEVICE_NONE ) - return NULL; + return CString(); CString s = InputDeviceToString(device) + "_" + DeviceButtonToString(device,button); return s; diff --git a/stepmania/src/RageSoundReader_WAV.cpp b/stepmania/src/RageSoundReader_WAV.cpp index 78a0a02653..2b5c60c5c8 100644 --- a/stepmania/src/RageSoundReader_WAV.cpp +++ b/stepmania/src/RageSoundReader_WAV.cpp @@ -357,7 +357,7 @@ public: CString ReadString( RageFile &f, int iSize, CString &sError ) { if( sError.size() != 0 ) - return NULL; + return CString(); CString sBuf; char *pBuf = sBuf.GetBuffer( iSize ); diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 705acbd767..0a57145ea0 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -277,7 +277,7 @@ CString werr_ssprintf( int err, const char *fmt, ...) CString ConvertWstringToACP( wstring s ) { if( s.empty() ) - return NULL; + return CString(); int iBytes = WideCharToMultiByte( CP_ACP, 0, s.data(), s.size(), NULL, 0, NULL, FALSE ); @@ -301,7 +301,7 @@ CString ConvertUTF8ToACP( CString s ) CString join( const CString &Deliminator, const CStringArray& Source) { if( Source.empty() ) - return NULL; + return CString(); CString csTmp; @@ -317,7 +317,7 @@ CString join( const CString &Deliminator, const CStringArray& Source) CString join( const CString &Delimitor, CStringArray::const_iterator begin, CStringArray::const_iterator end ) { if( begin == end ) - return NULL; + return CString(); CString ret; while( begin != end ) @@ -512,11 +512,11 @@ CString GetExtension( const CString &sPath ) { size_t pos = sPath.rfind( '.' ); if( pos == sPath.npos ) - return NULL; + return CString(); size_t slash = sPath.find( '/', pos ); if( slash != sPath.npos ) - return NULL; /* rare: path/dir.ext/fn */ + return CString(); /* rare: path/dir.ext/fn */ return sPath.substr( pos+1, sPath.size()-pos+1 ); } @@ -695,7 +695,7 @@ CString DerefRedir(const CString &_path) /* Empty is invalid. */ if( sNewFileName == "" ) - return NULL; + return CString(); FixSlashesInPlace( sNewFileName ); @@ -1253,7 +1253,7 @@ CString Basename( const CString &dir ) { size_t end = dir.find_last_not_of( "/\\" ); if( end == dir.npos ) - return NULL; + return CString(); size_t start = dir.find_last_of( "/\\", end ); if( start == dir.npos ) @@ -1295,7 +1295,7 @@ CString Dirname( const CString &dir ) CString Capitalize( const CString &s ) { if( s.GetLength()==0 ) - return NULL; + return CString(); CString s2 = s; /* XXX: utf-8 */ if( !(s2[0] & 0x80) ) diff --git a/stepmania/src/RageUtil_BackgroundLoader.cpp b/stepmania/src/RageUtil_BackgroundLoader.cpp index 32bc544c5b..6d2a82c7da 100644 --- a/stepmania/src/RageUtil_BackgroundLoader.cpp +++ b/stepmania/src/RageUtil_BackgroundLoader.cpp @@ -69,11 +69,11 @@ BackgroundLoader::~BackgroundLoader() CString BackgroundLoader::GetRequest() { if( !g_bEnableBackgroundLoading ) - return NULL; + return CString(); LockMut( m_Mutex ); if( !m_CacheRequests.size() ) - return NULL; + return CString(); CString ret; ret = m_CacheRequests.front(); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 0a02376451..87e05a6510 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -540,7 +540,7 @@ static CString GetOneBakedRandomFile( Song *pSong, bool bTryGenre = true ) if( !vsNamesOut.empty() ) return vsNamesOut[rand()%vsNamesOut.size()]; else - return NULL; + return CString(); } static MenuDef g_InsertTapAttack( diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index 0ae0406c39..feb40cdfcd 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -43,7 +43,7 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); ASSERT( cd >= 0 && cd < NUM_COURSE_DIFFICULTIES ); if( !GAMESTATE->IsCourseDifficultyShown(cd) ) - return NULL; + return CString(); return CourseDifficultyToThemedString(cd); } else @@ -53,7 +53,7 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) return DifficultyToThemedString(dc); } } - default: ASSERT(0); return NULL; + default: ASSERT(0); return CString(); } } @@ -107,7 +107,7 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line ) CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); ASSERT( cd >= 0 && cd < NUM_COURSE_DIFFICULTIES ); if( !GAMESTATE->IsCourseDifficultyShown(cd) ) - return NULL; + return CString(); CString sDifficulty = CourseDifficultyToThemedString(cd); fPercent = pProfile->GetCoursesPercentComplete(st,cd); } @@ -120,7 +120,7 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line ) } return ssprintf( "%05.2f%%", fPercent*100 ); } - default: ASSERT(0); return NULL; + default: ASSERT(0); return CString(); } } diff --git a/stepmania/src/ScreenMessage.cpp b/stepmania/src/ScreenMessage.cpp index 83df5e225d..27dc3967d1 100644 --- a/stepmania/src/ScreenMessage.cpp +++ b/stepmania/src/ScreenMessage.cpp @@ -45,7 +45,7 @@ CString ASMHClass::NumberToString( ScreenMessage SM ) if ( SM == iter->second ) return (*iter).first; - return NULL; + return CString(); } /* diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 0dc2bc16d3..cd08a6cd48 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -386,7 +386,7 @@ CString ScreenOptions::GetExplanationText( int iRow ) const bool bAllowExplanation = row.GetRowDef().m_bAllowExplanation; bool bShowExplanations = bAllowExplanation && SHOW_EXPLANATIONS.GetValue(); if( !bShowExplanations ) - return NULL; + return CString(); CString sLineName = row.GetRowDef().m_sName; ASSERT( !sLineName.empty() ); diff --git a/stepmania/src/ScreenPackages.cpp b/stepmania/src/ScreenPackages.cpp index 02491126d8..cc27139dcb 100644 --- a/stepmania/src/ScreenPackages.cpp +++ b/stepmania/src/ScreenPackages.cpp @@ -409,7 +409,7 @@ CString ScreenPackages::URLEncode( const CString &URL ) CString ScreenPackages::StripOutContainers( const CString & In ) { if( In.size() == 0 ) - return NULL; + return CString(); unsigned i = 0; char t = In.at(i); diff --git a/stepmania/src/ScreenProfileOptions.cpp b/stepmania/src/ScreenProfileOptions.cpp index d090a52bcf..e10861e653 100644 --- a/stepmania/src/ScreenProfileOptions.cpp +++ b/stepmania/src/ScreenProfileOptions.cpp @@ -228,7 +228,7 @@ CString ScreenProfileOptions::GetSelectedProfileID() const OptionRow &row = *m_pRows[GetCurrentRow()]; const int Selection = row.GetOneSharedSelection(); if( !Selection ) - return NULL; + return CString(); return vsProfiles[ Selection-1 ]; } @@ -237,7 +237,7 @@ CString ScreenProfileOptions::GetSelectedProfileName() const OptionRow &row = *m_pRows[GetCurrentRow()]; const int Selection = row.GetOneSharedSelection(); if( !Selection ) - return NULL; + return CString(); return g_ProfileOptionsLines[PO_PLAYER1].m_vsChoices[ Selection ]; } diff --git a/stepmania/src/ScreenSMOnlineLogin.cpp b/stepmania/src/ScreenSMOnlineLogin.cpp index fbea96136a..fd9f072d1b 100644 --- a/stepmania/src/ScreenSMOnlineLogin.cpp +++ b/stepmania/src/ScreenSMOnlineLogin.cpp @@ -169,7 +169,7 @@ CString ScreenSMOnlineLogin::GetSelectedProfileID() const OptionRow &row = *m_pRows[GetCurrentRow()]; const int Selection = row.GetOneSharedSelection(); if( !Selection ) - return NULL; + return CString(); return vsProfiles[ Selection-1 ]; } diff --git a/stepmania/src/ScreenSystemLayer.cpp b/stepmania/src/ScreenSystemLayer.cpp index 21f08843d6..1fe7b45707 100644 --- a/stepmania/src/ScreenSystemLayer.cpp +++ b/stepmania/src/ScreenSystemLayer.cpp @@ -132,7 +132,7 @@ void ScreenSystemLayer::ReloadCreditsText() CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const { if( (bool)CREDITS_JOIN_ONLY && !GAMESTATE->PlayersCanJoin() ) - return NULL; + return CString(); bool bShowCreditsMessage; if( SCREENMAN && SCREENMAN->GetTopScreen() && SCREENMAN->GetTopScreen()->GetScreenType() == system_menu ) @@ -160,7 +160,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const else if( GAMESTATE->PlayersCanJoin() ) return CREDITS_INSERT_CARD.GetValue(); else - return NULL; + return CString(); case MEMORY_CARD_STATE_ERROR: return THEME->GetMetric( m_sName, "CreditsCard" + MEMCARDMAN->GetCardError(pn) ); case MEMORY_CARD_STATE_TOO_LATE: return CREDITS_CARD_TOO_LATE.GetValue(); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index ba7c483efc..54cf229c90 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -1240,7 +1240,7 @@ vector &Song::GetForegroundChanges() CString GetSongAssetPath( CString sPath, const CString &sSongPath ) { if( sPath == "" ) - return NULL; + return CString(); /* If there's no path in the file, the file is in the same directory * as the song. (This is the preferred configuration.) */ @@ -1259,7 +1259,7 @@ CString GetSongAssetPath( CString sPath, const CString &sSongPath ) /* If the path still begins with "../", then there were an unreasonable number * of them at the beginning of the path. Ignore the path entirely. */ if( sPath.Left(3) == "../" ) - return NULL; + return CString(); return sPath; } diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 24b0cfd6c2..8a422e066f 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -315,7 +315,7 @@ CString SongManager::GetSongGroupBannerPath( CString sSongGroup ) return m_sSongGroupBannerPaths[i]; } - return NULL; + return CString(); } void SongManager::GetSongGroupNames( CStringArray &AddTo ) @@ -384,7 +384,7 @@ CString SongManager::GetCourseGroupBannerPath( const CString &sCourseGroup ) if( iter == m_mapCourseGroupToInfo.end() ) { ASSERT_M( 0, ssprintf("requested banner for course group '%s' that doesn't exist",sCourseGroup.c_str()) ); - return NULL; + return CString(); } else { @@ -1451,7 +1451,7 @@ CString GetCurrentSongDisplayTitle() { const Song* pSong = GAMESTATE->m_pCurSong; if( pSong == NULL ) - return NULL; + return CString(); return pSong->GetDisplayFullTitle(); } @@ -1459,7 +1459,7 @@ CString GetCurrentSongDisplayArtist() { const Song* pSong = GAMESTATE->m_pCurSong; if( pSong == NULL ) - return NULL; + return CString(); return pSong->GetDisplayArtist(); } @@ -1467,7 +1467,7 @@ CString GetCurrentSongCredit() { const Song* pSong = GAMESTATE->m_pCurSong; if( pSong == NULL ) - return NULL; + return CString(); return pSong->m_sCredit; } @@ -1475,7 +1475,7 @@ CString GetCurrentStepsCredits() { const Song* pSong = GAMESTATE->m_pCurSong; if( pSong == NULL ) - return NULL; + return CString(); CString s; diff --git a/stepmania/src/SongUtil.cpp b/stepmania/src/SongUtil.cpp index 3cab86c2af..c3dd4dd07c 100644 --- a/stepmania/src/SongUtil.cpp +++ b/stepmania/src/SongUtil.cpp @@ -212,12 +212,12 @@ void SongUtil::SortSongPointerArrayByNumPlays( vector &vpSongsInOut, cons CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so ) { if( pSong == NULL ) - return NULL; + return CString(); switch( so ) { case SORT_PREFERRED: - return NULL; + return CString(); case SORT_GROUP: // guaranteed not empty return pSong->m_sGroupName; @@ -234,7 +234,7 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so s = MakeSortString(s); // resulting string will be uppercase if( s.empty() ) - return NULL; + return CString(); else if( s[0] >= '0' && s[0] <= '9' ) return "NUM"; else if( s[0] < 'A' || s[0] > 'Z') @@ -256,7 +256,7 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM); } case SORT_POPULARITY: - return NULL; + return CString(); case SORT_TOP_GRADES: { int iCounts[NUM_Grade]; @@ -299,14 +299,14 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so return "N/A"; } case SORT_MODE_MENU: - return NULL; + return CString(); case SORT_ALL_COURSES: case SORT_NONSTOP_COURSES: case SORT_ONI_COURSES: case SORT_ENDLESS_COURSES: default: ASSERT(0); - return NULL; + return CString(); } } diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index a20325869b..11fe71ff60 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -733,7 +733,7 @@ void Sprite::SetSecondsIntoAnimation( float fSeconds ) CString Sprite::GetTexturePath() const { if( m_pTexture==NULL ) - return NULL; + return CString(); return m_pTexture->GetID().filename; } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index c09e79f4f5..7067e5c687 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1236,7 +1236,7 @@ CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, if( !bResult ) { SCREENMAN->PlayInvalidSound(); - return NULL; + return CString(); } SCREENMAN->PlayScreenshotSound(); diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 6d787268eb..5160188c1d 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -55,11 +55,11 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" # SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib -# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../Program/StepMania-debug.exe" +# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../../itg/Program/StepMania-debug.exe" # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # Begin Special Build Tool IntDir=.\../Debug6 -TargetDir=\cvs\stepmania\Program +TargetDir=\cvs\itg\Program TargetName=StepMania-debug SOURCE="$(InputPath)" PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ diff --git a/stepmania/src/StepMania.h b/stepmania/src/StepMania.h index 66b9274ecd..06a7ed8109 100644 --- a/stepmania/src/StepMania.h +++ b/stepmania/src/StepMania.h @@ -18,7 +18,7 @@ void ChangeCurrentGame( const Game* g ); void FocusChanged( bool bHasFocus ); bool AppHasFocus(); -// If successful, return filename of screenshot in sDir, else return NULL +// If successful, return filename of screenshot in sDir, else return CString() CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex = -1 ); void InsertCoin( int iNum = 1, const RageTimer *pTime = NULL ); diff --git a/stepmania/src/arch/Dialog/DialogDriver.h b/stepmania/src/arch/Dialog/DialogDriver.h index ae1c194e3a..384add7b7b 100644 --- a/stepmania/src/arch/Dialog/DialogDriver.h +++ b/stepmania/src/arch/Dialog/DialogDriver.h @@ -11,7 +11,7 @@ public: virtual Dialog::Result AbortRetryIgnore( CString sMessage, CString sID ) { return Dialog::ignore; } virtual Dialog::Result AbortRetry( CString sMessage, CString sID ) { return Dialog::abort; } - virtual CString Init() { return ""; } + virtual CString Init() { return CString(); } virtual ~DialogDriver() { } }; diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow.h b/stepmania/src/arch/LoadingWindow/LoadingWindow.h index 2f3128bff4..8cf760295b 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow.h @@ -7,7 +7,7 @@ struct RageSurface; class LoadingWindow { public: - virtual CString Init() { return ""; } + virtual CString Init() { return CString(); } virtual ~LoadingWindow() { } virtual void Paint() = 0; diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h index d55c0b9b86..88dd687ec0 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h @@ -14,7 +14,7 @@ public: virtual void *GetProcAddress(CString s) = 0; - // Return "" if mode change was successful, otherwise an error message. + // return NULL if mode change was successful, otherwise an error message. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. virtual CString TryVideoMode( RageDisplay::VideoModeParams p, bool &bNewDeviceOut ) = 0; diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp index 6afb9625c7..64713e36c3 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp @@ -208,7 +208,7 @@ CString LowLevelWindow_Win32::TryVideoMode( RageDisplay::VideoModeParams p, bool return hr_ssprintf( GetLastError(), "wglCreateContext" ); } } - return ""; // we set the video mode successfully + return CString(); // we set the video mode successfully } void LowLevelWindow_Win32::SwapBuffers() diff --git a/stepmania/src/arch/MovieTexture/MovieTexture.h b/stepmania/src/arch/MovieTexture/MovieTexture.h index 870e459134..fed2378543 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture.h +++ b/stepmania/src/arch/MovieTexture/MovieTexture.h @@ -8,7 +8,7 @@ class RageMovieTexture : public RageTexture public: RageMovieTexture( RageTextureID ID ): RageTexture(ID) { } virtual ~RageMovieTexture() { } - virtual CString Init() { return ""; } + virtual CString Init() { return CString(); } virtual void Update(float fDeltaTime) { } virtual void Reload() = 0; diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp index 40317edbdb..e9940b9fa1 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp @@ -157,7 +157,7 @@ CString MovieTexture_DShow::Init() // flip all frame rects because movies are upside down for( unsigned i=0; im_stream = stream; - return ""; + return CString(); } diff --git a/stepmania/src/arch/Sound/DSoundHelpers.cpp b/stepmania/src/arch/Sound/DSoundHelpers.cpp index 6f3f0a0527..d108363f17 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.cpp +++ b/stepmania/src/arch/Sound/DSoundHelpers.cpp @@ -138,7 +138,7 @@ CString DSound::Init() SetPrimaryBufferMode(); - return ""; + return CString(); } DSound::~DSound() @@ -292,7 +292,7 @@ CString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware, m_pTempBuffer = new char[m_iBufferSize]; - return ""; + return CString(); } void DSoundBuf::SetSampleRate( int hz ) diff --git a/stepmania/src/arch/Sound/RageSoundDriver.h b/stepmania/src/arch/Sound/RageSoundDriver.h index 01710b7499..5a4972f4bf 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver.h +++ b/stepmania/src/arch/Sound/RageSoundDriver.h @@ -8,7 +8,7 @@ public: friend class RageSoundManager; /* Initialize. On failure, an error message is returned. */ - virtual CString Init() { return ""; } + virtual CString Init() { return CString(); } /* A RageSound calls this to request to be played. * XXX: define what we should do when it can't be played (eg. out of diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp index 0eb183dfee..6555cde27a 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp @@ -251,7 +251,7 @@ CString RageSound_DSound::Init() MixingThread.SetName("Mixer thread"); MixingThread.Create( MixerThread_start, this ); - return ""; + return CString(); } RageSound_DSound::~RageSound_DSound() diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp index ebf1b76c80..0f282ba068 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp @@ -103,7 +103,7 @@ CString RageSound_DSound_Software::Init() MixingThread.SetName("Mixer thread"); MixingThread.Create( MixerThread_start, this ); - return ""; + return CString(); } RageSound_DSound_Software::~RageSound_DSound_Software() diff --git a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp index 99a6c4ad5a..fe90ee0ef7 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp @@ -140,7 +140,7 @@ CString RageSound_WaveOut::Init() MixingThread.SetName( "Mixer thread" ); MixingThread.Create( MixerThread_start, this ); - return ""; + return CString(); } RageSound_WaveOut::~RageSound_WaveOut() diff --git a/stepmania/src/archutils/Win32/GetFileInformation.cpp b/stepmania/src/archutils/Win32/GetFileInformation.cpp index 9a35e82500..b9f5e01b34 100644 --- a/stepmania/src/archutils/Win32/GetFileInformation.cpp +++ b/stepmania/src/archutils/Win32/GetFileInformation.cpp @@ -78,7 +78,7 @@ CString FindSystemFile( CString fn ) if( !stat( sPath, &buf ) ) return sPath; - return ""; + return CString(); } /* Get the full path of the process running in iProcessID. On error, false is diff --git a/stepmania/src/archutils/Win32/GraphicsWindow.cpp b/stepmania/src/archutils/Win32/GraphicsWindow.cpp index 217e77e099..d26f77e904 100644 --- a/stepmania/src/archutils/Win32/GraphicsWindow.cpp +++ b/stepmania/src/archutils/Win32/GraphicsWindow.cpp @@ -140,7 +140,7 @@ CString GraphicsWindow::SetScreenMode( const RageDisplay::VideoModeParams &p ) if( !g_CurrentParams.windowed ) ChangeDisplaySettings( NULL, 0 ); - return ""; + return CString(); } DEVMODE DevMode; @@ -169,7 +169,7 @@ CString GraphicsWindow::SetScreenMode( const RageDisplay::VideoModeParams &p ) if( ret != DISP_CHANGE_SUCCESSFUL ) return "Couldn't set screen mode"; - return ""; + return CString(); } static int GetWindowStyle( const RageDisplay::VideoModeParams &p ) diff --git a/stepmania/src/archutils/Win32/USB.cpp b/stepmania/src/archutils/Win32/USB.cpp index b4519f7e86..b8027e4f3a 100644 --- a/stepmania/src/archutils/Win32/USB.cpp +++ b/stepmania/src/archutils/Win32/USB.cpp @@ -29,7 +29,7 @@ static CString GetUSBDevicePath (int num) NULL, &guid, num, &DeviceInterface)) { SetupDiDestroyDeviceInfoList (DeviceInfo); - return ""; + return CString(); } unsigned long size; diff --git a/stepmania/src/archutils/Win32/VideoDriverInfo.cpp b/stepmania/src/archutils/Win32/VideoDriverInfo.cpp index 8629e6695f..7b3f63a4eb 100644 --- a/stepmania/src/archutils/Win32/VideoDriverInfo.cpp +++ b/stepmania/src/archutils/Win32/VideoDriverInfo.cpp @@ -14,14 +14,14 @@ CString GetPrimaryVideoName() hInstUser32 = LoadLibrary("User32.DLL"); if( !hInstUser32 ) - return ""; + return CString(); // VC6 don't have a stub to static link with, so link dynamically. EnumDisplayDevices = (pfnEnumDisplayDevices)GetProcAddress(hInstUser32,"EnumDisplayDevicesA"); if( EnumDisplayDevices == NULL ) { FreeLibrary(hInstUser32); - return ""; + return CString(); } CString sPrimaryDeviceName;