From bd0b594dff4bb100e3cdc08578ffa88874511eb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 27 Jun 2007 20:49:19 +0000 Subject: [PATCH] compilation fixes after string changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- demos/forty/scorefil.cpp | 2 +- demos/poem/wxpoem.cpp | 2 +- samples/combo/combo.cpp | 2 +- samples/debugrpt/debugrpt.cpp | 2 +- samples/exec/exec.cpp | 2 +- samples/ipc/client.cpp | 8 ++++---- samples/popup/popup.cpp | 2 +- utils/tex2rtf/src/tex2any.cpp | 8 +++----- utils/tex2rtf/src/tex2any.h | 2 +- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/demos/forty/scorefil.cpp b/demos/forty/scorefil.cpp index 83c2e6e..e49fb6a 100644 --- a/demos/forty/scorefil.cpp +++ b/demos/forty/scorefil.cpp @@ -128,7 +128,7 @@ void ScoreFile::ReadPlayersScore( void ScoreFile::WritePlayersScore(const wxString& player, int wins, int games, int score) { - if (player) + if (!player.empty()) { m_config->SetPath(_T("/General")); m_config->Write(_T("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++ diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index 2234c07..13da041 100644 --- a/demos/poem/wxpoem.cpp +++ b/demos/poem/wxpoem.cpp @@ -888,7 +888,7 @@ long MainWindow::DoSearch(void) // Only match if we're looking at a different poem // (no point in displaying the same poem again) - if ((ch == m_searchString[i]) && (last_poem_start != previous_poem_start)) + if ((m_searchString[i] == ch) && (last_poem_start != previous_poem_start)) { if (i == 0) last_find = ftell(file); diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index 2d705f1..cb2f523 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -747,7 +747,7 @@ MyFrame::MyFrame(const wxString& title) m_logWin->SetEditable(false); wxLogTextCtrl* logger = new wxLogTextCtrl( m_logWin ); m_logOld = logger->SetActiveTarget( logger ); - logger->SetTimestamp( NULL ); + logger->DisableTimestamp(); topSizer = new wxBoxSizer( wxVERTICAL ); diff --git a/samples/debugrpt/debugrpt.cpp b/samples/debugrpt/debugrpt.cpp index 9b379a1..1125ff6 100644 --- a/samples/debugrpt/debugrpt.cpp +++ b/samples/debugrpt/debugrpt.cpp @@ -125,7 +125,7 @@ static void bar(const wxChar *p) void baz(const wxString& s) { - printf("baz: %s\n", s.c_str()); + printf("baz: %s\n", (const char*)s.c_str()); } void foo(int n) diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index 75279b9..9326747 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -833,7 +833,7 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event)) wxString filename; #if wxUSE_FILEDLG - filename = wxLoadFileSelector(_T("any file"), NULL, s_filename, this); + filename = wxLoadFileSelector(_T("any file"), wxEmptyString, s_filename, this); #else // !wxUSE_FILEDLG filename = wxGetTextFromUser(_T("Enter the file name"), _T("exec sample"), s_filename, this); diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index 9141746..7bca7c5 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -337,8 +337,8 @@ void MyFrame::OnExecute(wxCommandEvent& WXUNUSED(event)) { wxString s = _T("Date"); - m_client->GetConnection()->Execute((wxChar *)s.c_str()); - m_client->GetConnection()->Execute((wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); + m_client->GetConnection()->Execute((const wxChar *)s.c_str()); + m_client->GetConnection()->Execute((const wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); #if wxUSE_DDE_FOR_IPC wxLogMessage(_T("DDE Execute can only be used to send text strings, not arbitrary data.\nThe type argument will be ignored, text truncated, converted to Unicode and null terminated.")); #endif @@ -353,9 +353,9 @@ void MyFrame::OnPoke(wxCommandEvent& WXUNUSED(event)) if (m_client->IsConnected()) { wxString s = wxDateTime::Now().Format(); - m_client->GetConnection()->Poke(_T("Date"), (wxChar *)s.c_str()); + m_client->GetConnection()->Poke(_T("Date"), (const wxChar *)s.c_str()); s = wxDateTime::Now().FormatTime() + _T(" ") + wxDateTime::Now().FormatDate(); - m_client->GetConnection()->Poke(_T("Date"), (wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); + m_client->GetConnection()->Poke(_T("Date"), (const wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); char bytes[3]; bytes[0] = '1'; bytes[1] = '2'; bytes[2] = '3'; m_client->GetConnection()->Poke(_T("bytes[3]"), (wxChar *)bytes, 3, wxIPC_PRIVATE); diff --git a/samples/popup/popup.cpp b/samples/popup/popup.cpp index 14075ea..6ea7c91 100644 --- a/samples/popup/popup.cpp +++ b/samples/popup/popup.cpp @@ -358,7 +358,7 @@ MyFrame::MyFrame(const wxString& title) m_logWin->SetEditable(false); wxLogTextCtrl* logger = new wxLogTextCtrl( m_logWin ); m_logOld = logger->SetActiveTarget( logger ); - logger->SetTimestamp( NULL ); + logger->DisableTimestamp(); wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); topSizer->Add( button1, 0, wxALL, 5 ); diff --git a/utils/tex2rtf/src/tex2any.cpp b/utils/tex2rtf/src/tex2any.cpp index 488a200..4984789 100644 --- a/utils/tex2rtf/src/tex2any.cpp +++ b/utils/tex2rtf/src/tex2any.cpp @@ -246,17 +246,15 @@ CustomMacro::~CustomMacro() delete [] macroBody; } -void TexOutput(const wxChar *s, bool ordinaryText) +void TexOutput(const wxString& s, bool ordinaryText) { - int len = wxStrlen(s); - // Update current column, but only if we're guaranteed to // be ordinary text (not mark-up stuff) int i; if (ordinaryText) - for (i = 0; i < len; i++) + for (wxString::const_iterator i = s.begin(); i != s.end(); ++i) { - if (s[i] == 13 || s[i] == 10) + if (*i == 13 || *i == 10) currentColumn = 0; else currentColumn ++; diff --git a/utils/tex2rtf/src/tex2any.h b/utils/tex2rtf/src/tex2any.h index d05a643..5bff6a9 100644 --- a/utils/tex2rtf/src/tex2any.h +++ b/utils/tex2rtf/src/tex2any.h @@ -162,7 +162,7 @@ extern FILE *CurrentOutput2; void AddMacroDef(int the_id, const wxChar *name, int n, bool ignore = false, bool forbidden = false); void TexInitialize(int bufSize); void TexCleanUp(void); -void TexOutput(const wxChar *s, bool ordinaryText = false); +void TexOutput(const wxString& s, bool ordinaryText = false); wxChar *GetArgData(TexChunk *chunk); wxChar *GetArgData(void); // Get the string for the current argument int GetNoArgs(void); // Get the number of arguments for the current macro -- 2.7.4