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++
// 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);
m_logWin->SetEditable(false);
wxLogTextCtrl* logger = new wxLogTextCtrl( m_logWin );
m_logOld = logger->SetActiveTarget( logger );
- logger->SetTimestamp( NULL );
+ logger->DisableTimestamp();
topSizer = new wxBoxSizer( wxVERTICAL );
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)
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);
{
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
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);
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 );
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 ++;
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