From 77f859c38ebc1677b2ed1aa2d615e84fb131e9d4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 1 Dec 2001 12:56:01 +0000 Subject: [PATCH] fixed assert to avoid compilation warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/textfile.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index 77510ace07..63f02f1a37 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -61,21 +61,22 @@ bool wxTextFile::OnExists() const bool wxTextFile::OnOpen(const wxString &strBufferName, wxTextBufferOpenMode OpenMode) { - wxFile::OpenMode FileOpenMode = wxFile::read; - int nAssertVal = 0; + wxFile::OpenMode FileOpenMode; + + switch ( OpenMode ) + { + default: + wxFAIL_MSG( _T("unknown open mode in wxTextFile::Open") ); + // fall through - switch (OpenMode) - { case ReadAccess : FileOpenMode = wxFile::read; break; + case WriteAccess : FileOpenMode = wxFile::write; break; - default : - wxASSERT(nAssertVal); // Should not happen. - break; - } + } return m_file.Open(strBufferName.c_str(), FileOpenMode); } -- 2.47.2