From: Francesco Montorsi Date: Mon, 24 Mar 2008 12:23:31 +0000 (+0000) Subject: fix almost all deprecation warnings X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5045ca9ef34f27aa13ead64e0f1dd16793d3a917?hp=020eeaa8d98126909c23490c65bc5c353f0648dd fix almost all deprecation warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index 13da0411e9..ed88fd646a 100644 --- a/demos/poem/wxpoem.cpp +++ b/demos/poem/wxpoem.cpp @@ -33,7 +33,7 @@ #include "corner4.xpm" #include "wxpoem.xpm" -#define buf_size 10000 +#define BUFFER_SIZE 10000 #define DEFAULT_POETRY_DAT "wxpoem" #define DEFAULT_POETRY_IND "wxpoem" #define DEFAULT_CHAR_HEIGHT 18 @@ -48,7 +48,7 @@ #define X_SIZE 30 #define Y_SIZE 20 -static wxChar *poem_buffer; // Storage for each poem +static wxChar *poem_buffer; // Storage for each poem static wxChar line[150]; // Storage for a line static int pages[30]; // For multipage poems - // store the start of each page @@ -79,8 +79,8 @@ static int current_page = 0; // Currently viewed page // Backing bitmap wxBitmap *backingBitmap = NULL; -void PoetryError(wxChar *, wxChar *caption=_T("wxPoem Error")); -void PoetryNotify(wxChar *Msg, wxChar *caption=_T("wxPoem")); +void PoetryError(const wxChar *, const wxChar *caption=_T("wxPoem Error")); +void PoetryNotify(const wxChar *Msg, const wxChar *caption=_T("wxPoem")); void TryLoadIndex(); bool LoadPoem(wxChar *, long); int GetIndex(); @@ -325,7 +325,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) // Write (cont'd) if (page_break) { - wxChar *cont = _T("(cont'd)"); + const wxChar *cont = _T("(cont'd)"); dc->SetFont(* m_normalFont); @@ -517,7 +517,7 @@ void MainWindow::Search(bool ask) bool MyApp::OnInit() { - poem_buffer = new wxChar[buf_size]; + poem_buffer = new wxChar[BUFFER_SIZE]; // Seed the random number generator #ifdef __WXWINCE__ @@ -828,7 +828,7 @@ bool LoadPoem(wxChar *file_name, long position) poem_buffer[i] = (wxChar)ch; i ++; - if (i == buf_size) + if (i == BUFFER_SIZE) { wxSprintf(error_buf, _T("%s"), _T("Poetry buffer exceeded.")); PoetryError(error_buf); @@ -934,13 +934,13 @@ void TryLoadIndex() } // Error message -void PoetryError(wxChar *msg, wxChar *caption) +void PoetryError(const wxChar *msg, const wxChar *caption) { wxMessageBox(msg, caption, wxOK|wxICON_EXCLAMATION); } // Notification (change icon to something appropriate!) -void PoetryNotify(wxChar *Msg, wxChar *caption) +void PoetryNotify(const wxChar *Msg, const wxChar *caption) { wxMessageBox(Msg, caption, wxOK | wxICON_INFORMATION); } diff --git a/demos/poem/wxpoem.h b/demos/poem/wxpoem.h index 605ed69fa5..c8975779c2 100644 --- a/demos/poem/wxpoem.h +++ b/demos/poem/wxpoem.h @@ -14,6 +14,10 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#ifndef _WXPOEM_H_ +#define _WXPOEM_H_ + + // Define a new application class MyApp: public wxApp { @@ -46,7 +50,8 @@ class MainWindow: public wxFrame { public: MyCanvas *canvas; - MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style); + MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, + const wxPoint& pos, const wxSize& size, long style); virtual ~MainWindow(); void OnCloseWindow(wxCloseEvent& event); @@ -107,3 +112,5 @@ enum POEM_SEARCH = wxID_FIND, POEM_MINIMIZE = wxID_ICONIZE_FRAME }; + +#endif // _WXPOEM_H_