Use nullptr instead of NULL in the code and documentation

This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
This commit is contained in:
Vadim Zeitlin 2022-10-16 01:24:34 +02:00
parent 39ea524943
commit 4f4c5fcfdf
1844 changed files with 13721 additions and 13734 deletions

View file

@ -129,7 +129,7 @@ bool MyApp::OnInit()
// frame constructor // frame constructor
MyFrame::MyFrame(const wxString& title) MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title) : wxFrame(nullptr, wxID_ANY, title)
{ {
// set the frame icon // set the frame icon

View file

@ -32,7 +32,7 @@ wxIMPLEMENT_APP(BombsApp);
// Called to initialize the program // Called to initialize the program
bool BombsApp::OnInit() bool BombsApp::OnInit()
{ {
srand((unsigned) time(NULL)); srand((unsigned) time(nullptr));
m_frame = new BombsFrame(&m_game); m_frame = new BombsFrame(&m_game);
@ -52,7 +52,7 @@ wxBEGIN_EVENT_TABLE(BombsFrame, wxFrame)
wxEND_EVENT_TABLE() wxEND_EVENT_TABLE()
BombsFrame::BombsFrame(BombsGame *game) BombsFrame::BombsFrame(BombsGame *game)
: wxFrame(NULL, wxID_ANY, wxT("wxBombs"), wxDefaultPosition, : wxFrame(nullptr, wxID_ANY, wxT("wxBombs"), wxDefaultPosition,
wxSize(300, 300), wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX) wxSize(300, 300), wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX)
{ {
m_game = game; m_game = game;
@ -248,7 +248,7 @@ BombsCanvas::BombsCanvas(wxFrame *parent, BombsGame *game)
m_cellWidth = (sx+3+X_UNIT)/X_UNIT; m_cellWidth = (sx+3+X_UNIT)/X_UNIT;
m_cellHeight = (sy+3+Y_UNIT)/Y_UNIT; m_cellHeight = (sy+3+Y_UNIT)/Y_UNIT;
dc.SetMapMode(wxMM_TEXT); dc.SetMapMode(wxMM_TEXT);
m_bmp = NULL; m_bmp = nullptr;
} }
BombsCanvas::~BombsCanvas() BombsCanvas::~BombsCanvas()
@ -256,7 +256,7 @@ BombsCanvas::~BombsCanvas()
if (m_bmp) if (m_bmp)
{ {
delete m_bmp; delete m_bmp;
m_bmp = NULL; m_bmp = nullptr;
} }
} }
@ -302,7 +302,7 @@ void BombsCanvas::UpdateGridSize()
if (m_bmp) if (m_bmp)
{ {
delete m_bmp; delete m_bmp;
m_bmp = NULL; m_bmp = nullptr;
} }
SetSize(GetGridSizeInPixels()); SetSize(GetGridSizeInPixels());
Refresh(); Refresh();

View file

@ -26,7 +26,7 @@ public:
BombsGame() BombsGame()
{ {
m_width = m_height = 0; m_width = m_height = 0;
m_field = NULL; m_field = nullptr;
} }
~BombsGame(); ~BombsGame();

View file

@ -179,7 +179,7 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest)
if (HaveYouWon()) if (HaveYouWon())
{ {
wxWindow *frame = wxTheApp->GetTopWindow(); wxWindow *frame = wxTheApp->GetTopWindow();
wxWindow *canvas = (wxWindow *) NULL; wxWindow *canvas = nullptr;
if (frame) if (frame)
{ {

View file

@ -57,7 +57,7 @@ Pile::Pile(int x, int y, int dx, int dy)
//+-------------------------------------------------------------+ //+-------------------------------------------------------------+
//| Description: | //| Description: |
//| Redraw the pile on the screen. If the pile is empty | //| Redraw the pile on the screen. If the pile is empty |
//| just draw a NULL card as a place holder for the pile. | //| just draw a null card as a place holder for the pile. |
//| Otherwise draw the pile from the bottom up, starting | //| Otherwise draw the pile from the bottom up, starting |
//| at the origin of the pile, shifting each subsequent | //| at the origin of the pile, shifting each subsequent |
//| card by the pile's x and y offsets. | //| card by the pile's x and y offsets. |
@ -65,7 +65,7 @@ Pile::Pile(int x, int y, int dx, int dy)
void Pile::Redraw(wxDC& dc ) void Pile::Redraw(wxDC& dc )
{ {
FortyFrame *frame = (FortyFrame*) wxTheApp->GetTopWindow(); FortyFrame *frame = (FortyFrame*) wxTheApp->GetTopWindow();
wxWindow *canvas = (wxWindow *) NULL; wxWindow *canvas = nullptr;
if (frame) if (frame)
{ {
canvas = frame->GetCanvas(); canvas = frame->GetCanvas();
@ -103,7 +103,7 @@ void Pile::Redraw(wxDC& dc )
//| Pile::GetTopCard() | //| Pile::GetTopCard() |
//+-------------------------------------------------------------+ //+-------------------------------------------------------------+
//| Description: | //| Description: |
//| Return a pointer to the top card in the pile or NULL | //| Return a pointer to the top card in the pile or nullptr |
//| if the pile is empty. | //| if the pile is empty. |
//| NB: Gets a copy of the card without removing it from the | //| NB: Gets a copy of the card without removing it from the |
//| pile. | //| pile. |
@ -126,7 +126,7 @@ Card* Pile::GetTopCard()
//| Description: | //| Description: |
//| If the pile is not empty, remove the top card from the | //| If the pile is not empty, remove the top card from the |
//| pile and return the pointer to the removed card. | //| pile and return the pointer to the removed card. |
//| If the pile is empty return a NULL pointer. | //| If the pile is empty return a null pointer. |
//+-------------------------------------------------------------+ //+-------------------------------------------------------------+
Card* Pile::RemoveTopCard() Card* Pile::RemoveTopCard()
{ {
@ -229,7 +229,7 @@ int Pile::CalcDistance(int x, int y)
// Return the card at x, y. Check the top card first, then // Return the card at x, y. Check the top card first, then
// work down the pile. If a card is found then return a pointer // work down the pile. If a card is found then return a pointer
// to the card, otherwise return NULL // to the card, otherwise return nullptr
Card* Pile::GetCard(int x, int y) Card* Pile::GetCard(int x, int y)
{ {
int cardX; int cardX;

View file

@ -40,12 +40,12 @@ hack doesn't fix.
#include <time.h> #include <time.h>
#define Random(x) (rand() % x) #define Random(x) (rand() % x)
#define Randomize() (srand((unsigned int)time(NULL))) #define Randomize() (srand((unsigned int)time(nullptr)))
static int detail = 9; // CHANGE THIS... 7,8,9 etc static int detail = 9; // CHANGE THIS... 7,8,9 etc
static bool running = false; static bool running = false;
static wxMenuBar *menuBar = NULL; static wxMenuBar *menuBar = nullptr;
// Define a new application type // Define a new application type
class MyApp: public wxApp class MyApp: public wxApp
@ -89,7 +89,7 @@ private:
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
// Create the main frame window // Create the main frame window
MyFrame *frame = new MyFrame(NULL, wxT("Fractal Mountains for wxWidgets"), wxDefaultPosition, wxSize(640, 480)); MyFrame *frame = new MyFrame(nullptr, wxT("Fractal Mountains for wxWidgets"), wxDefaultPosition, wxSize(640, 480));
// Make a menubar // Make a menubar
wxMenu *file_menu = new wxMenu; wxMenu *file_menu = new wxMenu;

View file

@ -89,7 +89,7 @@ LifeSamplesDialog::LifeSamplesDialog(wxWindow *parent)
m_list = new wxListBox( this, ID_LISTBOX, m_list = new wxListBox( this, ID_LISTBOX,
wxDefaultPosition, wxDefaultPosition,
listSize, listSize,
0, NULL, 0, nullptr,
wxLB_SINGLE | wxLB_NEEDED_SB | wxLB_HSCROLL ); wxLB_SINGLE | wxLB_NEEDED_SB | wxLB_HSCROLL );
for (unsigned i = 0; i < (sizeof(g_patterns) / sizeof(LifePattern)); i++) for (unsigned i = 0; i < (sizeof(g_patterns) / sizeof(LifePattern)); i++)

View file

@ -112,10 +112,10 @@ Life::Life()
// pattern data // pattern data
m_numcells = 0; m_numcells = 0;
m_boxes = new LifeCellBox *[HASHSIZE]; m_boxes = new LifeCellBox *[HASHSIZE];
m_head = NULL; m_head = nullptr;
m_available = NULL; m_available = nullptr;
for (int i = 0; i < HASHSIZE; i++) for (int i = 0; i < HASHSIZE; i++)
m_boxes[i] = NULL; m_boxes[i] = nullptr;
// state vars for BeginFind & FindMore // state vars for BeginFind & FindMore
m_cells = new LifeCell[CELLSARRAYSIZE]; m_cells = new LifeCell[CELLSARRAYSIZE];
@ -141,7 +141,7 @@ void Life::Clear()
// clear the hash table pointers // clear the hash table pointers
for (int i = 0; i < HASHSIZE; i++) for (int i = 0; i < HASHSIZE; i++)
m_boxes[i] = NULL; m_boxes[i] = nullptr;
// free used boxes // free used boxes
c = m_head; c = m_head;
@ -151,7 +151,7 @@ void Life::Clear()
delete c; delete c;
c = nc; c = nc;
} }
m_head = NULL; m_head = nullptr;
// free available boxes // free available boxes
c = m_available; c = m_available;
@ -161,7 +161,7 @@ void Life::Clear()
delete c; delete c;
c = nc; c = nc;
} }
m_available = NULL; m_available = nullptr;
// reset state // reset state
m_name = wxEmptyString; m_name = wxEmptyString;
@ -295,7 +295,7 @@ LifeCellBox* Life::CreateBox(wxInt32 x, wxInt32 y, wxUint32 hv)
// LinkBox: // LinkBox:
// Returns a pointer to the box (x, y); if it didn't exist yet, // Returns a pointer to the box (x, y); if it didn't exist yet,
// it returns NULL or creates a new one, depending on the value // it returns nullptr or creates a new one, depending on the value
// of the 'create' parameter. // of the 'create' parameter.
// //
LifeCellBox* Life::LinkBox(wxInt32 x, wxInt32 y, bool create) LifeCellBox* Life::LinkBox(wxInt32 x, wxInt32 y, bool create)
@ -312,7 +312,7 @@ LifeCellBox* Life::LinkBox(wxInt32 x, wxInt32 y, bool create)
if ((c->m_x == x) && (c->m_y == y)) return c; if ((c->m_x == x) && (c->m_y == y)) return c;
// if not found, and (create == true), create a new one // if not found, and (create == true), create a new one
return create? CreateBox(x, y, hv) : (LifeCellBox*) NULL; return create? CreateBox(x, y, hv) : nullptr;
} }
// KillBox: // KillBox:
@ -338,10 +338,10 @@ void Life::KillBox(LifeCellBox *c)
// update neighbours // update neighbours
if (c->m_next) c->m_next->m_prev = c->m_prev; if (c->m_next) c->m_next->m_prev = c->m_prev;
if (c->m_hnext) c->m_hnext->m_hprev = c->m_hprev; if (c->m_hnext) c->m_hnext->m_hprev = c->m_hprev;
if (c->m_up) c->m_up->m_dn = NULL; if (c->m_up) c->m_up->m_dn = nullptr;
if (c->m_dn) c->m_dn->m_up = NULL; if (c->m_dn) c->m_dn->m_up = nullptr;
if (c->m_lf) c->m_lf->m_rt = NULL; if (c->m_lf) c->m_lf->m_rt = nullptr;
if (c->m_rt) c->m_rt->m_lf = NULL; if (c->m_rt) c->m_rt->m_lf = nullptr;
// append to the list of available boxes // append to the list of available boxes
c->m_next = m_available; c->m_next = m_available;
@ -515,7 +515,7 @@ bool Life::FindMore(LifeCell *cells[], size_t *ncells)
for ( ; m_y <= m_y1; m_y += 8, m_x = m_x0) for ( ; m_y <= m_y1; m_y += 8, m_x = m_x0)
for ( ; m_x <= m_x1; m_x += 8) for ( ; m_x <= m_x1; m_x += 8)
{ {
if ((c = LinkBox(m_x, m_y, false)) == NULL) if ((c = LinkBox(m_x, m_y, false)) == nullptr)
continue; continue;
// check whether there is enough space left in the array // check whether there is enough space left in the array
@ -540,7 +540,7 @@ bool Life::FindMore(LifeCell *cells[], size_t *ncells)
for ( ; m_y <= m_y1; m_y += 8, m_x = m_x0) for ( ; m_y <= m_y1; m_y += 8, m_x = m_x0)
for ( ; m_x <= m_x1; m_x += 8) for ( ; m_x <= m_x1; m_x += 8)
{ {
if ((c = LinkBox(m_x, m_y, false)) == NULL) if ((c = LinkBox(m_x, m_y, false)) == nullptr)
continue; continue;
// check whether there is enough space left in the array // check whether there is enough space left in the array

View file

@ -173,8 +173,8 @@ bool LifeApp::OnInit()
// frame constructor // frame constructor
LifeFrame::LifeFrame() : LifeFrame::LifeFrame() :
wxFrame( (wxFrame *) NULL, wxID_ANY, _("Life!"), wxDefaultPosition ), wxFrame( nullptr, wxID_ANY, _("Life!"), wxDefaultPosition ),
m_navigator(NULL) m_navigator(nullptr)
{ {
// frame icon // frame icon
SetIcon(wxICON(mondrian)); SetIcon(wxICON(mondrian));
@ -1104,12 +1104,12 @@ void LifeCanvas::OnScroll(wxScrollWinEvent& event)
if (orient == wxHORIZONTAL) if (orient == wxHORIZONTAL)
{ {
m_viewportX += scrollinc; m_viewportX += scrollinc;
ScrollWindow( -m_cellsize * scrollinc, 0, (const wxRect *) NULL); ScrollWindow( -m_cellsize * scrollinc, 0, nullptr);
} }
else else
{ {
m_viewportY += scrollinc; m_viewportY += scrollinc;
ScrollWindow( 0, -m_cellsize * scrollinc, (const wxRect *) NULL); ScrollWindow( 0, -m_cellsize * scrollinc, nullptr);
} }
} }

View file

@ -62,8 +62,8 @@ static int XPos; // Startup X position
static int YPos; // Startup Y position static int YPos; // Startup Y position
static int pointSize = 12; // Font size static int pointSize = 12; // Font size
static const wxChar *index_filename = NULL; // Index filename static const wxChar *index_filename = nullptr; // Index filename
static const wxChar *data_filename = NULL; // Data filename static const wxChar *data_filename = nullptr; // Data filename
static wxChar error_buf[300]; // Error message buffer static wxChar error_buf[300]; // Error message buffer
static bool loaded_ok = false; // Poem loaded ok static bool loaded_ok = false; // Poem loaded ok
static bool index_ok = false; // Index loaded ok static bool index_ok = false; // Index loaded ok
@ -72,7 +72,7 @@ static bool paging = false; // Are we paging?
static int current_page = 0; // Currently viewed page static int current_page = 0; // Currently viewed page
// Backing bitmap // Backing bitmap
wxBitmap *backingBitmap = NULL; wxBitmap *backingBitmap = nullptr;
void PoetryError(const wxChar *, const wxChar *caption=wxT("wxPoem Error")); void PoetryError(const wxChar *, const wxChar *caption=wxT("wxPoem Error"));
void PoetryNotify(const wxChar *Msg, const wxChar *caption=wxT("wxPoem")); void PoetryNotify(const wxChar *Msg, const wxChar *caption=wxT("wxPoem"));
@ -90,7 +90,7 @@ void FindMax(int *max_thing, int thing);
wxIMPLEMENT_APP(MyApp); wxIMPLEMENT_APP(MyApp);
MainWindow *TheMainWindow = NULL; MainWindow *TheMainWindow = nullptr;
// Create the fonts // Create the fonts
void MainWindow::CreateFonts() void MainWindow::CreateFonts()
@ -110,7 +110,7 @@ MainWindow::MainWindow(wxFrame *frame, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, long style): const wxPoint& pos, const wxSize& size, long style):
wxFrame(frame, id, title, pos, size, style) wxFrame(frame, id, title, pos, size, style)
{ {
m_corners[0] = m_corners[1] = m_corners[2] = m_corners[3] = NULL; m_corners[0] = m_corners[1] = m_corners[2] = m_corners[3] = nullptr;
ReadPreferences(); ReadPreferences();
CreateFonts(); CreateFonts();
@ -510,7 +510,7 @@ bool MyApp::OnInit()
// randomize(); // randomize();
pages[0] = 0; pages[0] = 0;
TheMainWindow = new MainWindow(NULL, TheMainWindow = new MainWindow(nullptr,
wxID_ANY, wxID_ANY,
wxT("wxPoem"), wxT("wxPoem"),
wxPoint(XPos, YPos), wxPoint(XPos, YPos),
@ -592,7 +592,7 @@ MyCanvas::~MyCanvas()
// Note: this must be done before the main window/canvas are destroyed // Note: this must be done before the main window/canvas are destroyed
// or we get an error (no parent window for menu item button) // or we get an error (no parent window for menu item button)
delete m_popupMenu; delete m_popupMenu;
m_popupMenu = NULL; m_popupMenu = nullptr;
} }
// Define the repainting behaviour // Define the repainting behaviour
@ -693,13 +693,13 @@ int LoadIndex(const wxChar *file_name)
wxChar buf[100]; wxChar buf[100];
if (file_name == NULL) if (file_name == nullptr)
return 0; return 0;
wxSprintf(buf, wxT("%s.idx"), file_name); wxSprintf(buf, wxT("%s.idx"), file_name);
index_file = wxFopen(buf, wxT("r")); index_file = wxFopen(buf, wxT("r"));
if (index_file == NULL) if (index_file == nullptr)
return 0; return 0;
wxFscanf(index_file, wxT("%ld"), &nitems); wxFscanf(index_file, wxT("%ld"), &nitems);
@ -769,7 +769,7 @@ bool LoadPoem(const wxChar *file_name, long position)
paging = false; paging = false;
current_page = 0; current_page = 0;
if (file_name == NULL) if (file_name == nullptr)
{ {
wxSprintf(error_buf, wxT("Error in Poem loading.")); wxSprintf(error_buf, wxT("Error in Poem loading."));
PoetryError(error_buf); PoetryError(error_buf);
@ -779,7 +779,7 @@ bool LoadPoem(const wxChar *file_name, long position)
wxSprintf(buf, wxT("%s.dat"), file_name); wxSprintf(buf, wxT("%s.dat"), file_name);
data_file = wxFopen(buf, wxT("rb")); data_file = wxFopen(buf, wxT("rb"));
if (data_file == NULL) if (data_file == nullptr)
{ {
wxSprintf(error_buf, wxT("Data file %s not found."), buf); wxSprintf(error_buf, wxT("Data file %s not found."), buf);
PoetryError(error_buf); PoetryError(error_buf);

View file

@ -129,7 +129,7 @@ bool MyApp::OnInit()
// frame constructor // frame constructor
MyFrame::MyFrame(const wxString& title) MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title) : wxFrame(nullptr, wxID_ANY, title)
{ {
// set the frame icon // set the frame icon

View file

@ -73,7 +73,7 @@ DO:
It's also very important to make a consistent use of the ALIASES It's also very important to make a consistent use of the ALIASES
defined by wxWidgets' Doxyfile. Open that file for more info. defined by wxWidgets' Doxyfile. Open that file for more info.
- when you write true, false and NULL with their C++ semantic meaning, - when you write true, false and nullptr with their C++ semantic meaning,
then use the @true, @false and @NULL commands. then use the @true, @false and @NULL commands.
- separate different paragraphs with an empty comment line. - separate different paragraphs with an empty comment line.

View file

@ -140,7 +140,7 @@ ALIASES += header{1}="Include file:^^ \verbatim #include <\1> \endverbatim"
# some formatting aliases # some formatting aliases
ALIASES += true="<span class='literal'>true</span>" ALIASES += true="<span class='literal'>true</span>"
ALIASES += false="<span class='literal'>false</span>" ALIASES += false="<span class='literal'>false</span>"
ALIASES += NULL="<span class='literal'>NULL</span>" ALIASES += NULL="<span class='literal'>nullptr</span>"
ALIASES += NUL="<span class='literal'>NUL</span>" ALIASES += NUL="<span class='literal'>NUL</span>"
# NOTE: these are important as you can't write in the docs # NOTE: these are important as you can't write in the docs

View file

@ -189,7 +189,7 @@ See @ref overview_config for the descriptions of all features of this class.
This sample shows how to use wxDebugReport class to This sample shows how to use wxDebugReport class to
generate a debug report in case of a program crash or otherwise. On start up, generate a debug report in case of a program crash or otherwise. On start up,
it proposes to either crash itself (by dereferencing a NULL pointer) or it proposes to either crash itself (by dereferencing a @NULL) or
generate debug report without doing it. Next it initializes the debug report generate debug report without doing it. Next it initializes the debug report
with standard information adding a custom file to it (just a timestamp) and with standard information adding a custom file to it (just a timestamp) and
allows to view the information gathered using allows to view the information gathered using

View file

@ -45,7 +45,7 @@ wxIMPLEMENT_APP(DerivedApp);
bool DerivedApp::OnInit() bool DerivedApp::OnInit()
{ {
wxFrame *the_frame = new wxFrame(NULL, ID_MYFRAME, argv[0]); wxFrame *the_frame = new wxFrame(nullptr, ID_MYFRAME, argv[0]);
... ...
the_frame->Show(true); the_frame->Show(true);

View file

@ -73,7 +73,7 @@ auto_ptr<wxZipEntry> entry;
wxFFileInputStream in(wxT("test.zip")); wxFFileInputStream in(wxT("test.zip"));
wxZipInputStream zip(in); wxZipInputStream zip(in);
while (entry.reset(zip.GetNextEntry()), entry.get() != NULL) while (entry.reset(zip.GetNextEntry()), entry.get() != nullptr)
{ {
// access meta-data // access meta-data
wxString name = entry->GetName(); wxString name = entry->GetName();
@ -114,7 +114,7 @@ auto_ptr<wxZipEntry> entry;
outzip.CopyArchiveMetaData(inzip); outzip.CopyArchiveMetaData(inzip);
// call CopyEntry for each entry except those matching the pattern // call CopyEntry for each entry except those matching the pattern
while (entry.reset(inzip.GetNextEntry()), entry.get() != NULL) while (entry.reset(inzip.GetNextEntry()), entry.get() != nullptr)
if (!entry->GetName().Matches(wxT("*.txt"))) if (!entry->GetName().Matches(wxT("*.txt")))
if (!outzip.CopyEntry(entry.release(), inzip)) if (!outzip.CopyEntry(entry.release(), inzip))
break; break;
@ -165,9 +165,9 @@ do
{ {
entry.reset(zip.GetNextEntry()); entry.reset(zip.GetNextEntry());
} }
while (entry.get() != NULL && entry->GetInternalName() != name); while (entry.get() != nullptr && entry->GetInternalName() != name);
if (entry.get() != NULL) if (entry.get() != nullptr)
{ {
// read the entry's data... // read the entry's data...
} }
@ -189,7 +189,7 @@ wxFFileInputStream in(wxT("test.zip"));
wxZipInputStream zip(in); wxZipInputStream zip(in);
// load the zip catalog // load the zip catalog
while ((entry = zip.GetNextEntry()) != NULL) while ((entry = zip.GetNextEntry()) != nullptr)
{ {
wxZipEntry*& current = cat[entry->GetInternalName()]; wxZipEntry*& current = cat[entry->GetInternalName()];
// some archive formats can have multiple entries with the same name // some archive formats can have multiple entries with the same name
@ -296,7 +296,7 @@ if (in->IsOk())
auto_ptr<wxArchiveEntry> entry; auto_ptr<wxArchiveEntry> entry;
// list the contents of the archive // list the contents of the archive
while ((entry.reset(arc->GetNextEntry())), entry.get() != NULL) while ((entry.reset(arc->GetNextEntry())), entry.get() != nullptr)
std::wcout << entry->GetName() << "\n"; std::wcout << entry->GetName() << "\n";
} }
else else
@ -381,7 +381,7 @@ auto_ptr<wxArchiveEntry> entry;
outarc->CopyArchiveMetaData(*arc); outarc->CopyArchiveMetaData(*arc);
while (entry.reset(arc->GetNextEntry()), entry.get() != NULL) while (entry.reset(arc->GetNextEntry()), entry.get() != nullptr)
{ {
if (entry->GetName() == from) if (entry->GetName() == from)
entry->SetName(to); entry->SetName(to);
@ -418,7 +418,7 @@ MyNotifier notifier;
outarc->CopyArchiveMetaData(*arc); outarc->CopyArchiveMetaData(*arc);
while (entry.reset(arc->GetNextEntry()), entry.get() != NULL) while (entry.reset(arc->GetNextEntry()), entry.get() != nullptr)
{ {
entry->SetNotifier(notifier); entry->SetNotifier(notifier);
if (!outarc->CopyEntry(entry.release(), *arc)) if (!outarc->CopyEntry(entry.release(), *arc))

View file

@ -81,7 +81,7 @@ Example of using an assertion macro:
@code @code
void GetTheAnswer(int *p) void GetTheAnswer(int *p)
{ {
wxCHECK_RET( p, "pointer can't be NULL in GetTheAnswer()" ); wxCHECK_RET( p, "pointer can't be null in GetTheAnswer()" );
*p = 42; *p = 42;
}; };
@ -89,7 +89,7 @@ void GetTheAnswer(int *p)
If the condition is false, i.e. @c p is @NULL, the assertion handler is called If the condition is false, i.e. @c p is @NULL, the assertion handler is called
and, in any case (even when wxDEBUG_LEVEL is 0), the function returns without and, in any case (even when wxDEBUG_LEVEL is 0), the function returns without
dereferencing the NULL pointer on the next line thus avoiding a crash. dereferencing the null pointer on the next line thus avoiding a crash.
The default assertion handler behaviour depends on whether the application The default assertion handler behaviour depends on whether the application
using wxWidgets was compiled in release build (with @c NDEBUG defined) or debug using wxWidgets was compiled in release build (with @c NDEBUG defined) or debug

View file

@ -127,7 +127,7 @@ window. Both have to be bound to the frame with respective calls.
@code @code
MyFrame::MyFrame() MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Hello World") : wxFrame(nullptr, wxID_ANY, "Hello World")
{ {
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H", menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
@ -272,7 +272,7 @@ bool MyApp::OnInit()
} }
MyFrame::MyFrame() MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Hello World") : wxFrame(nullptr, wxID_ANY, "Hello World")
{ {
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H", menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",

View file

@ -200,7 +200,7 @@ connection = (MyConnection *)client->MakeConnection(hostName, server, "IPC TEST"
if (!connection) if (!connection)
{ {
wxMessageBox("Failed to make connection to server", "Client Demo Error"); wxMessageBox("Failed to make connection to server", "Client Demo Error");
return NULL; return nullptr;
} }
connection->StartAdvise("Item"); connection->StartAdvise("Item");

View file

@ -270,7 +270,7 @@ A very simple example:
// Using wxChar* array // Using wxChar* array
// //
const wxChar* arrayDiet[] = const wxChar* arrayDiet[] =
{ wxT("Herbivore"), wxT("Carnivore"), wxT("Omnivore"), NULL }; { wxT("Herbivore"), wxT("Carnivore"), wxT("Omnivore"), nullptr };
pg->Append( new wxEnumProperty("Diet", pg->Append( new wxEnumProperty("Diet",
wxPG_LABEL, wxPG_LABEL,
@ -348,7 +348,7 @@ wxFlagsProperty has similar construction:
@code @code
const wxChar* flags_prop_labels[] = { wxT("wxICONIZE"), const wxChar* flags_prop_labels[] = { wxT("wxICONIZE"),
wxT("wxCAPTION"), wxT("wxMINIMIZE_BOX"), wxT("wxMAXIMIZE_BOX"), NULL }; wxT("wxCAPTION"), wxT("wxMINIMIZE_BOX"), wxT("wxMAXIMIZE_BOX"), nullptr };
// this value array would be optional if values matched string indexes // this value array would be optional if values matched string indexes
long flags_prop_values[] = { wxICONIZE, wxCAPTION, wxMINIMIZE_BOX, long flags_prop_values[] = { wxICONIZE, wxCAPTION, wxMINIMIZE_BOX,

View file

@ -71,7 +71,7 @@ Example:
// it's a single Unicode code-point encoded as: // it's a single Unicode code-point encoded as:
// - a UTF16 surrogate pair under Windows // - a UTF16 surrogate pair under Windows
// - a UTF8 multiple-bytes sequence under Linux // - a UTF8 multiple-bytes sequence under Linux
// (without considering the final NULL) // (without considering the final NUL)
wxPrintf("wxString reports a length of %d character(s)", test.length()); wxPrintf("wxString reports a length of %d character(s)", test.length());
// prints "wxString reports a length of 1 character(s)" on Linux // prints "wxString reports a length of 1 character(s)" on Linux
@ -88,7 +88,7 @@ Example:
// they are 3 Unicode code-points encoded as: // they are 3 Unicode code-points encoded as:
// - 3 UTF16 code units under Windows // - 3 UTF16 code units under Windows
// - 6 UTF8 code units under Linux // - 6 UTF8 code units under Linux
// (without considering the final NULL) // (without considering the final NUL)
wxPrintf("wxString reports a length of %d character(s)", test2.length()); wxPrintf("wxString reports a length of %d character(s)", test2.length());
// prints "wxString reports a length of 3 character(s)" on Linux // prints "wxString reports a length of 3 character(s)" on Linux
@ -96,7 +96,7 @@ Example:
@endcode @endcode
To better explain what stated above, consider the second string of the example To better explain what stated above, consider the second string of the example
above; it's composed by 3 characters and the final @c NULL: above; it's composed by 3 characters and the final @NUL:
@image html overview_wxstring_encoding.png @image html overview_wxstring_encoding.png
@ -303,12 +303,12 @@ for (i = s.begin(); i != s.end(); ++i)
As most programs use character strings, the standard C library provides quite As most programs use character strings, the standard C library provides quite
a few functions to work with them. Unfortunately, some of them have rather a few functions to work with them. Unfortunately, some of them have rather
counter-intuitive behaviour (like @c strncpy() which doesn't always terminate counter-intuitive behaviour (like @c strncpy() which doesn't always terminate
the resulting string with a @NULL) and are in general not very safe (passing the resulting string with a @NUL) and are in general not very safe (passing
@NULL to them will probably lead to program crash). Moreover, some very useful @NULL to them will probably lead to program crash). Moreover, some very useful
functions are not standard at all. This is why in addition to all wxString functions are not standard at all. This is why in addition to all wxString
functions, there are also a few global string functions which try to correct functions, there are also a few global string functions which try to correct
these problems: wxIsEmpty() verifies whether the string is empty (returning these problems: wxIsEmpty() verifies whether the string is empty (returning
@true for @NULL pointers), wxStrlen() also handles @NULL correctly and returns @true for @NULL), wxStrlen() also handles @NULL correctly and returns
0 for them and wxStricmp() is just a platform-independent version of 0 for them and wxStricmp() is just a platform-independent version of
case-insensitive string comparison function known either as @c stricmp() or case-insensitive string comparison function known either as @c stricmp() or
@c strcasecmp() on different platforms. @c strcasecmp() on different platforms.

View file

@ -142,7 +142,7 @@ This is how you would use the above simple dialog in your code.
void MyClass::ShowDialog() void MyClass::ShowDialog()
{ {
wxDialog dlg; wxDialog dlg;
if (wxXmlResource::Get()->LoadDialog(&dlg, NULL, "SimpleDialog")) if (wxXmlResource::Get()->LoadDialog(&dlg, nullptr, "SimpleDialog"))
dlg.ShowModal(); dlg.ShowModal();
} }
@endcode @endcode
@ -165,7 +165,7 @@ the XRCCTRL macro to get a pointer to the child. To expand the previous code:
void MyClass::ShowDialog() void MyClass::ShowDialog()
{ {
wxDialog dlg; wxDialog dlg;
if (!wxXmlResource::Get()->LoadDialog(&dlg, NULL, "SimpleDialog")) if (!wxXmlResource::Get()->LoadDialog(&dlg, nullptr, "SimpleDialog"))
return; return;
wxTextCtrl* pText = XRCCTRL(dlg, "text", wxTextCtrl); wxTextCtrl* pText = XRCCTRL(dlg, "text", wxTextCtrl);
@ -195,7 +195,7 @@ control to the XRCID macro:
void MyClass::ShowDialog() void MyClass::ShowDialog()
{ {
wxDialog dlg; wxDialog dlg;
if (!wxXmlResource::Get()->LoadDialog(&dlg, NULL, "SimpleDialog")) if (!wxXmlResource::Get()->LoadDialog(&dlg, nullptr, "SimpleDialog"))
return; return;
XRCCTRL(dlg, "text", wxTextCtrl)->Bind(wxEVT_TEXT, XRCCTRL(dlg, "text", wxTextCtrl)->Bind(wxEVT_TEXT,
@ -367,7 +367,7 @@ protected:
private: private:
void InitWidgetsFromXRC() void InitWidgetsFromXRC()
{ {
wxXmlResource::Get()->LoadObject(this, NULL, "TestWnd", "wxFrame"); wxXmlResource::Get()->LoadObject(this, nullptr, "TestWnd", "wxFrame");
A = XRCCTRL(*this, "A", wxTextCtrl); A = XRCCTRL(*this, "A", wxTextCtrl);
B = XRCCTRL(*this, "B", wxButton); B = XRCCTRL(*this, "B", wxButton);
} }

View file

@ -59,7 +59,7 @@ The approach chosen was to use templates to help inherit QObject's (QWidget), pr
### Delete later ### Delete later
Both templates also have some safety checks to avoid invalid spurious access to deleted wx objects (using a special pointer to the wx instance stored in the Qt object, that is reset to NULL when the wx counterpart is marked to deletion). Both templates also have some safety checks to avoid invalid spurious access to deleted wx objects (using a special pointer to the wx instance stored in the Qt object, that is reset to @NULL when the wx counterpart is marked to deletion).
This is due that in some situations, Qt object could still be referenced in the Qt event queue, so it cannot be removed immediately. This is due that in some situations, Qt object could still be referenced in the Qt event queue, so it cannot be removed immediately.

View file

@ -161,7 +161,7 @@ private:
}; };
// functions to show the about dialog box // functions to show the about dialog box
WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL); WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = nullptr);
#endif // wxUSE_ABOUTDLG #endif // wxUSE_ABOUTDLG

View file

@ -48,18 +48,18 @@ class WXDLLIMPEXP_CORE wxAcceleratorEntry
{ {
public: public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0, wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0,
wxMenuItem *item = NULL) wxMenuItem *item = nullptr)
: m_flags(flags) : m_flags(flags)
, m_keyCode(keyCode) , m_keyCode(keyCode)
, m_command(cmd) , m_command(cmd)
, m_item(item) , m_item(item)
{ } { }
// create accelerator corresponding to the specified string, return NULL if // create accelerator corresponding to the specified string, return nullptr if
// string couldn't be parsed or a pointer to be deleted by the caller // string couldn't be parsed or a pointer to be deleted by the caller
static wxAcceleratorEntry *Create(const wxString& str); static wxAcceleratorEntry *Create(const wxString& str);
void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL) void Set(int flags, int keyCode, int cmd, wxMenuItem *item = nullptr)
{ {
m_flags = flags; m_flags = flags;
m_keyCode = keyCode; m_keyCode = keyCode;
@ -121,7 +121,7 @@ private:
int m_keyCode; // ASCII or virtual keycode int m_keyCode; // ASCII or virtual keycode
int m_command; // Command id to generate int m_command; // Command id to generate
// the menu item this entry corresponds to, may be NULL // the menu item this entry corresponds to, may be null
wxMenuItem *m_item; wxMenuItem *m_item;
// for compatibility with old code, use accessors now! // for compatibility with old code, use accessors now!

View file

@ -263,13 +263,13 @@ public:
{ return wxACC_NOT_IMPLEMENTED; } { return wxACC_NOT_IMPLEMENTED; }
// Gets the specified child (starting from 1). // Gets the specified child (starting from 1).
// If *child is NULL and return value is wxACC_OK, // If *child is null and return value is wxACC_OK,
// this means that the child is a simple element and // this means that the child is a simple element and
// not an accessible object. // not an accessible object.
virtual wxAccStatus GetChild(int WXUNUSED(childId), wxAccessible** WXUNUSED(child)) virtual wxAccStatus GetChild(int WXUNUSED(childId), wxAccessible** WXUNUSED(child))
{ return wxACC_NOT_IMPLEMENTED; } { return wxACC_NOT_IMPLEMENTED; }
// Gets the parent, or NULL. // Gets the parent, or nullptr.
virtual wxAccStatus GetParent(wxAccessible** WXUNUSED(parent)) virtual wxAccStatus GetParent(wxAccessible** WXUNUSED(parent))
{ return wxACC_NOT_IMPLEMENTED; } { return wxACC_NOT_IMPLEMENTED; }
@ -320,7 +320,7 @@ public:
{ return wxACC_NOT_IMPLEMENTED; } { return wxACC_NOT_IMPLEMENTED; }
// Gets the window with the keyboard focus. // Gets the window with the keyboard focus.
// If childId is 0 and child is NULL, no object in // If childId is 0 and child is null, no object in
// this subhierarchy has the focus. // this subhierarchy has the focus.
// If this object has the focus, child should be 'this'. // If this object has the focus, child should be 'this'.
virtual wxAccStatus GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child)) virtual wxAccStatus GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child))

View file

@ -96,7 +96,7 @@ private:
// Common part of all ctors. // Common part of all ctors.
void Init() void Init()
{ {
m_impl = NULL; m_impl = nullptr;
} }
class wxAddRemoveImpl* m_impl; class wxAddRemoveImpl* m_impl;

View file

@ -92,7 +92,7 @@ public:
void TransformPoint(wxDouble* x, wxDouble* y) const void TransformPoint(wxDouble* x, wxDouble* y) const
{ {
wxCHECK_RET( x && y, "Can't be NULL" ); wxCHECK_RET( x && y, "Can't be null" );
const wxPoint2DDouble dst = DoTransformPoint(wxPoint2DDouble(*x, *y)); const wxPoint2DDouble dst = DoTransformPoint(wxPoint2DDouble(*x, *y));
*x = dst.m_x; *x = dst.m_x;
@ -107,7 +107,7 @@ public:
void TransformDistance(wxDouble* dx, wxDouble* dy) const void TransformDistance(wxDouble* dx, wxDouble* dy) const
{ {
wxCHECK_RET( dx && dy, "Can't be NULL" ); wxCHECK_RET( dx && dy, "Can't be null" );
const wxPoint2DDouble const wxPoint2DDouble
dst = DoTransformDistance(wxPoint2DDouble(*dx, *dy)); dst = DoTransformDistance(wxPoint2DDouble(*dx, *dy));

View file

@ -44,7 +44,7 @@ union wxAnyValueBuffer
wxAnyValueBuffer() wxAnyValueBuffer()
{ {
m_ptr = NULL; m_ptr = nullptr;
} }
}; };
@ -324,7 +324,7 @@ public:
#if wxUSE_EXTENDED_RTTI #if wxUSE_EXTENDED_RTTI
virtual const wxTypeInfo* GetTypeInfo() const virtual const wxTypeInfo* GetTypeInfo() const
{ {
return wxGetTypeInfo((T*)NULL); return wxGetTypeInfo((T*)nullptr);
} }
#endif #endif
}; };
@ -389,7 +389,7 @@ public: \
_WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\ _WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\
virtual const wxTypeInfo* GetTypeInfo() const \ virtual const wxTypeInfo* GetTypeInfo() const \
{ \ { \
return wxGetTypeInfo((T*)NULL); \ return wxGetTypeInfo((T*)nullptr); \
} \ } \
}; };
#else #else
@ -673,7 +673,7 @@ public:
/* /*
Let's define a discrete Null value so we don't have to really Let's define a discrete Null value so we don't have to really
ever check if wxAny.m_type pointer is NULL or not. This is an ever check if wxAny.m_type pointer is null or not. This is an
optimization, mostly. Implementation of this value type is optimization, mostly. Implementation of this value type is
"hidden" in the source file. "hidden" in the source file.
*/ */
@ -965,7 +965,7 @@ public:
const char* and const wchar_t*) has been assigned to wxAny. const char* and const wchar_t*) has been assigned to wxAny.
*/ */
template <typename T> template <typename T>
T As(T* = NULL) const T As(T* = nullptr) const
{ {
return wxPrivate::wxAnyAsImpl<T>::DoAs(*this); return wxPrivate::wxAnyAsImpl<T>::DoAs(*this);
} }
@ -1124,7 +1124,7 @@ struct wxAnyAsImpl<wxString>
// This macro shouldn't be used any longer for the same reasons as // This macro shouldn't be used any longer for the same reasons as
// wxANY_VALUE_TYPE_CHECK_TYPE(), just call As() directly. // wxANY_VALUE_TYPE_CHECK_TYPE(), just call As() directly.
#define wxANY_AS(any, T) \ #define wxANY_AS(any, T) \
(any).As(static_cast<T*>(NULL)) (any).As(static_cast<T*>(nullptr))
template<typename T> template<typename T>

View file

@ -22,7 +22,7 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// This is a helper class convertible to either narrow or wide string pointer. // This is a helper class convertible to either narrow or wide string pointer.
// It is similar to wxCStrData but, unlike it, can be NULL which is required to // It is similar to wxCStrData but, unlike it, can be null which is required to
// represent the return value of wxDateTime::ParseXXX() methods for example. // represent the return value of wxDateTime::ParseXXX() methods for example.
// //
// NB: this class is fully inline and so doesn't need to be DLL-exported // NB: this class is fully inline and so doesn't need to be DLL-exported
@ -30,12 +30,12 @@ class wxAnyStrPtr
{ {
public: public:
// ctors: this class must be created from the associated string or using // ctors: this class must be created from the associated string or using
// its default ctor for an invalid NULL-like object; notice that it is // its default ctor for an invalid nullptr-like object; notice that it is
// immutable after creation. // immutable after creation.
// ctor for invalid pointer // ctor for invalid pointer
wxAnyStrPtr() wxAnyStrPtr()
: m_str(NULL) : m_str(nullptr)
{ {
} }
@ -58,7 +58,7 @@ public:
// e.g. "if ( FuncReturningAnyStrPtr() && ... )" (unfortunately using // e.g. "if ( FuncReturningAnyStrPtr() && ... )" (unfortunately using
// unspecified_bool_type here wouldn't help with ambiguity between all the // unspecified_bool_type here wouldn't help with ambiguity between all the
// different conversions to pointers) // different conversions to pointers)
operator bool() const { return m_str != NULL; } operator bool() const { return m_str != nullptr; }
// at least VC7 also needs this one or it complains about ambiguity // at least VC7 also needs this one or it complains about ambiguity
// for !anystr expressions // for !anystr expressions
@ -71,7 +71,7 @@ public:
operator const char *() const operator const char *() const
{ {
if ( !m_str ) if ( !m_str )
return NULL; return nullptr;
// check if the string is convertible to char at all // check if the string is convertible to char at all
// //
@ -100,7 +100,7 @@ public:
operator const wchar_t *() const operator const wchar_t *() const
{ {
if ( !m_str ) if ( !m_str )
return NULL; return nullptr;
// no complications with wide strings (as long as we discount // no complications with wide strings (as long as we discount
// surrogates as we do for now) // surrogates as we do for now)
@ -112,8 +112,8 @@ public:
} }
// Because the objects of this class are only used as return type for // Because the objects of this class are only used as return type for
// functions which can return NULL we can skip providing dereferencing // functions which can return nullptr we can skip providing dereferencing
// operators: the code using this class must test it for NULL first and if // operators: the code using this class must test it for null first and if
// it does anything else with it has to assign it to either char* or // it does anything else with it has to assign it to either char* or
// wchar_t* itself, before dereferencing. // wchar_t* itself, before dereferencing.
// //
@ -130,7 +130,7 @@ public:
private: private:
// the original string and the position in it we correspond to, if the // the original string and the position in it we correspond to, if the
// string is NULL this object is NULL pointer-like // string is null this object is null pointer-like
const wxString * const m_str; const wxString * const m_str;
const wxString::const_iterator m_iter; const wxString::const_iterator m_iter;

View file

@ -226,14 +226,14 @@ public:
// wxTheApp->GetTraits() during startup or termination when the global // wxTheApp->GetTraits() during startup or termination when the global
// application object itself may be unavailable // application object itself may be unavailable
// //
// of course, it still returns NULL in this case and the caller must check // of course, it still returns nullptr in this case and the caller must check
// for it // for it
static wxAppTraits *GetTraitsIfExists(); static wxAppTraits *GetTraitsIfExists();
// Return some valid traits object. // Return some valid traits object.
// //
// This method checks if we have wxTheApp and returns its traits if it does // This method checks if we have wxTheApp and returns its traits if it does
// exist and the traits are non-NULL, similarly to GetTraitsIfExists(), but // exist and the traits are non-null, similarly to GetTraitsIfExists(), but
// falls back to wxConsoleAppTraits to ensure that it always returns // falls back to wxConsoleAppTraits to ensure that it always returns
// something valid. // something valid.
static wxAppTraits& GetValidTraits(); static wxAppTraits& GetValidTraits();
@ -241,8 +241,8 @@ public:
// returns the main event loop instance, i.e. the event loop which is started // returns the main event loop instance, i.e. the event loop which is started
// by OnRun() and which dispatches all events sent from the native toolkit // by OnRun() and which dispatches all events sent from the native toolkit
// to the application (except when new event loops are temporarily set-up). // to the application (except when new event loops are temporarily set-up).
// The returned value maybe NULL. Put initialization code which needs a // The returned value maybe null. Put initialization code which needs a
// non-NULL main event loop into OnEventLoopEnter(). // non-null main event loop into OnEventLoopEnter().
wxEventLoopBase* GetMainLoop() const wxEventLoopBase* GetMainLoop() const
{ return m_mainLoop; } { return m_mainLoop; }
@ -495,7 +495,7 @@ protected:
// the one and only global application object // the one and only global application object
static wxAppConsole *ms_appInstance; static wxAppConsole *ms_appInstance;
// create main loop from AppTraits or return NULL if // create main loop from AppTraits or return nullptr if
// there is no main loop implementation // there is no main loop implementation
wxEventLoopBase *CreateMainLoop(); wxEventLoopBase *CreateMainLoop();
@ -506,11 +506,11 @@ protected:
m_appDisplayName, // app display name ("My Application") m_appDisplayName, // app display name ("My Application")
m_className; // class name m_className; // class name
// the class defining the application behaviour, NULL initially and created // the class defining the application behaviour, nullptr initially and created
// by GetTraits() when first needed // by GetTraits() when first needed
wxAppTraits *m_traits; wxAppTraits *m_traits;
// the main event loop of the application (may be NULL if the loop hasn't // the main event loop of the application (may be null if the loop hasn't
// been started yet or has already terminated) // been started yet or has already terminated)
wxEventLoopBase *m_mainLoop; wxEventLoopBase *m_mainLoop;
@ -622,11 +622,11 @@ public:
// return the "main" top level window (if it hadn't been set previously // return the "main" top level window (if it hadn't been set previously
// with SetTopWindow(), will return just some top level window and, if // with SetTopWindow(), will return just some top level window and, if
// there are none, will return NULL) // there are none, will return nullptr)
virtual wxWindow *GetTopWindow() const; virtual wxWindow *GetTopWindow() const;
// convenient helper which is safe to use even if there is no wxApp at // convenient helper which is safe to use even if there is no wxApp at
// all, it will just return NULL in this case // all, it will just return nullptr in this case
static wxWindow *GetMainTopWindow(); static wxWindow *GetMainTopWindow();
// control the exit behaviour: by default, the program will exit the // control the exit behaviour: by default, the program will exit the
@ -697,7 +697,7 @@ public:
{ {
return ms_appInstance && ms_appInstance->IsGUI() return ms_appInstance && ms_appInstance->IsGUI()
? static_cast<wxAppBase*>(ms_appInstance) ? static_cast<wxAppBase*>(ms_appInstance)
: NULL; : nullptr;
} }
protected: protected:
@ -709,7 +709,7 @@ protected:
void DeleteAllTLWs(); void DeleteAllTLWs();
// the main top level window (may be NULL) // the main top level window (may be null)
wxWindow *m_topWindow; wxWindow *m_topWindow;
// if Yes, exit the main loop when the last top level window is deleted, if // if Yes, exit the main loop when the last top level window is deleted, if

View file

@ -37,7 +37,7 @@ private:
class wxAppProgressIndicator : public wxAppProgressIndicatorBase class wxAppProgressIndicator : public wxAppProgressIndicatorBase
{ {
public: public:
wxAppProgressIndicator(wxWindow* WXUNUSED(parent) = NULL, wxAppProgressIndicator(wxWindow* WXUNUSED(parent) = nullptr,
int WXUNUSED(maxValue) = 100) int WXUNUSED(maxValue) = 100)
{ {
} }

View file

@ -66,8 +66,8 @@ public:
#endif // wxUSE_FONTMAP #endif // wxUSE_FONTMAP
// get the renderer to use for drawing the generic controls (return value // get the renderer to use for drawing the generic controls (return value
// may be NULL in which case the default renderer for the current platform // may be null in which case the default renderer for the current platform
// is used); this is used in GUI only and always returns NULL in console // is used); this is used in GUI only and always returns nullptr in console
// //
// NB: returned pointer will be deleted by the caller // NB: returned pointer will be deleted by the caller
virtual wxRendererNative *CreateRenderer() = 0; virtual wxRendererNative *CreateRenderer() = 0;
@ -139,9 +139,9 @@ public:
// runtime (not compile-time) version. // runtime (not compile-time) version.
// returns wxPORT_BASE for console applications and one of the remaining // returns wxPORT_BASE for console applications and one of the remaining
// wxPORT_* values for GUI applications. // wxPORT_* values for GUI applications.
virtual wxPortId GetToolkitVersion(int *majVer = NULL, virtual wxPortId GetToolkitVersion(int *majVer = nullptr,
int *minVer = NULL, int *minVer = nullptr,
int *microVer = NULL) const = 0; int *microVer = nullptr) const = 0;
// return true if the port is using wxUniversal for the GUI, false if not // return true if the port is using wxUniversal for the GUI, false if not
virtual bool IsUsingUniversalWidgets() const = 0; virtual bool IsUsingUniversalWidgets() const = 0;
@ -206,7 +206,7 @@ class WXDLLIMPEXP_BASE wxConsoleAppTraitsBase : public wxAppTraits
{ {
public: public:
#if !wxUSE_CONSOLE_EVENTLOOP #if !wxUSE_CONSOLE_EVENTLOOP
virtual wxEventLoopBase *CreateEventLoop() override { return NULL; } virtual wxEventLoopBase *CreateEventLoop() override { return nullptr; }
#endif // !wxUSE_CONSOLE_EVENTLOOP #endif // !wxUSE_CONSOLE_EVENTLOOP
#if wxUSE_LOG #if wxUSE_LOG
@ -224,9 +224,9 @@ public:
const wxString& title) override; const wxString& title) override;
// the GetToolkitVersion for console application is always the same // the GetToolkitVersion for console application is always the same
wxPortId GetToolkitVersion(int *verMaj = NULL, wxPortId GetToolkitVersion(int *verMaj = nullptr,
int *verMin = NULL, int *verMin = nullptr,
int *verMicro = NULL) const override int *verMicro = nullptr) const override
{ {
// no toolkits (wxBase is for console applications without GUI support) // no toolkits (wxBase is for console applications without GUI support)
// NB: zero means "no toolkit", -1 means "not initialized yet" // NB: zero means "no toolkit", -1 means "not initialized yet"

View file

@ -58,11 +58,11 @@ public:
wxArchiveEntry *Clone() const { return DoClone(); } wxArchiveEntry *Clone() const { return DoClone(); }
void SetNotifier(wxArchiveNotifier& notifier); void SetNotifier(wxArchiveNotifier& notifier);
virtual void UnsetNotifier() { m_notifier = NULL; } virtual void UnsetNotifier() { m_notifier = nullptr; }
protected: protected:
wxArchiveEntry() : m_notifier(NULL) { } wxArchiveEntry() : m_notifier(nullptr) { }
wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(NULL) { } wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(nullptr) { }
virtual void SetOffset(wxFileOffset offset) = 0; virtual void SetOffset(wxFileOffset offset) = 0;
virtual wxArchiveEntry* DoClone() const = 0; virtual wxArchiveEntry* DoClone() const = 0;
@ -85,7 +85,7 @@ private:
// the wxArchiveInputStream then returns the entry's data. Eof() becomes true // the wxArchiveInputStream then returns the entry's data. Eof() becomes true
// after an attempt has been made to read past the end of the entry's data. // after an attempt has been made to read past the end of the entry's data.
// //
// When there are no more entries, GetNextEntry() returns NULL and sets Eof(). // When there are no more entries, GetNextEntry() returns nullptr and sets Eof().
class WXDLLIMPEXP_BASE wxArchiveInputStream : public wxFilterInputStream class WXDLLIMPEXP_BASE wxArchiveInputStream : public wxFilterInputStream
{ {
@ -191,11 +191,11 @@ public:
typedef T* pointer; typedef T* pointer;
typedef T& reference; typedef T& reference;
wxArchiveIterator() : m_rep(NULL) { } wxArchiveIterator() : m_rep(nullptr) { }
wxArchiveIterator(Arc& arc) { wxArchiveIterator(Arc& arc) {
typename Arc::entry_type* entry = arc.GetNextEntry(); typename Arc::entry_type* entry = arc.GetNextEntry();
m_rep = entry ? new Rep(arc, entry) : NULL; m_rep = entry ? new Rep(arc, entry) : nullptr;
} }
wxArchiveIterator(const wxArchiveIterator& it) : m_rep(it.m_rep) { wxArchiveIterator(const wxArchiveIterator& it) : m_rep(it.m_rep) {
@ -270,7 +270,7 @@ private:
typename Arc::entry_type* entry = m_arc.GetNextEntry(); typename Arc::entry_type* entry = m_arc.GetNextEntry();
if (!entry) { if (!entry) {
UnRef(); UnRef();
return NULL; return nullptr;
} }
if (m_ref > 1) { if (m_ref > 1) {
m_ref--; m_ref--;
@ -285,7 +285,7 @@ private:
const T& GetValue() { const T& GetValue() {
if (m_entry) { if (m_entry) {
_wxSetArchiveIteratorValue(m_value, m_entry, m_entry); _wxSetArchiveIteratorValue(m_value, m_entry, m_entry);
m_entry = NULL; m_entry = nullptr;
} }
return m_value; return m_value;
} }
@ -361,7 +361,7 @@ protected:
virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0; virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0;
virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0; virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0;
wxArchiveClassFactory() : m_pConv(NULL), m_next(this) { } wxArchiveClassFactory() : m_pConv(nullptr), m_next(this) { }
wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f)) wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f))
{ return *this; } { return *this; }

View file

@ -287,7 +287,7 @@ public:
friend difference_type operator -(const itor& i1, const itor& i2); friend difference_type operator -(const itor& i1, const itor& i2);
public: public:
pointer m_ptr; pointer m_ptr;
reverse_iterator() : m_ptr(NULL) { } reverse_iterator() : m_ptr(nullptr) { }
explicit reverse_iterator(pointer ptr) : m_ptr(ptr) { } explicit reverse_iterator(pointer ptr) : m_ptr(ptr) { }
reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
reference operator*() const { return *m_ptr; } reference operator*() const { return *m_ptr; }
@ -313,7 +313,7 @@ public:
friend difference_type operator -(const itor& i1, const itor& i2); friend difference_type operator -(const itor& i1, const itor& i2);
public: public:
pointer m_ptr; pointer m_ptr;
const_reverse_iterator() : m_ptr(NULL) { } const_reverse_iterator() : m_ptr(nullptr) { }
explicit const_reverse_iterator(pointer ptr) : m_ptr(ptr) { } explicit const_reverse_iterator(pointer ptr) : m_ptr(ptr) { }
const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
@ -395,7 +395,7 @@ protected:
private: private:
// Allocate the new buffer big enough to hold m_nCount + nIncrement items and // Allocate the new buffer big enough to hold m_nCount + nIncrement items and
// return the pointer to the old buffer, which must be deleted by the caller // return the pointer to the old buffer, which must be deleted by the caller
// (if the old buffer is big enough, just return NULL). // (if the old buffer is big enough, just return nullptr).
wxString *Grow(size_t nIncrement); wxString *Grow(size_t nIncrement);
// Binary search in the sorted array: return the index of the string if it's // Binary search in the sorted array: return the index of the string if it's
@ -432,7 +432,7 @@ class WXDLLIMPEXP_BASE wxCArrayString
{ {
public: public:
wxCArrayString( const wxArrayString& array ) wxCArrayString( const wxArrayString& array )
: m_array( array ), m_strings( NULL ) : m_array( array ), m_strings( nullptr )
{ } { }
~wxCArrayString() { delete[] m_strings; } ~wxCArrayString() { delete[] m_strings; }
@ -450,7 +450,7 @@ public:
wxString* Release() wxString* Release()
{ {
wxString *r = GetStrings(); wxString *r = GetStrings();
m_strings = NULL; m_strings = nullptr;
return r; return r;
} }
@ -513,7 +513,7 @@ public:
wxArrayStringsAdapter(const std::vector<wxString>& strings) wxArrayStringsAdapter(const std::vector<wxString>& strings)
: m_type(wxSTRING_POINTER), m_size(strings.size()) : m_type(wxSTRING_POINTER), m_size(strings.size())
{ {
m_data.ptr = m_size == 0 ? NULL : &strings[0]; m_data.ptr = m_size == 0 ? nullptr : &strings[0];
} }
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY #endif // wxUSE_STD_CONTAINERS_COMPATIBLY

View file

@ -195,12 +195,12 @@ public:
// Gets native size for given 'client' or wxDefaultSize if it doesn't // Gets native size for given 'client' or wxDefaultSize if it doesn't
// have native equivalent. The first version returns the size in logical // have native equivalent. The first version returns the size in logical
// pixels while the second one returns it in DIPs. // pixels while the second one returns it in DIPs.
static wxSize GetNativeSizeHint(const wxArtClient& client, wxWindow* win = NULL); static wxSize GetNativeSizeHint(const wxArtClient& client, wxWindow* win = nullptr);
static wxSize GetNativeDIPSizeHint(const wxArtClient& client); static wxSize GetNativeDIPSizeHint(const wxArtClient& client);
// Get the size hint of an icon from a specific wxArtClient from the // Get the size hint of an icon from a specific wxArtClient from the
// topmost (i.e. first used) provider. // topmost (i.e. first used) provider.
static wxSize GetSizeHint(const wxArtClient& client, wxWindow* win = NULL); static wxSize GetSizeHint(const wxArtClient& client, wxWindow* win = nullptr);
static wxSize GetDIPSizeHint(const wxArtClient& client); static wxSize GetDIPSizeHint(const wxArtClient& client);
#if WXWIN_COMPATIBILITY_3_0 #if WXWIN_COMPATIBILITY_3_0

View file

@ -110,8 +110,8 @@ public:
wxAuiToolBarItem() wxAuiToolBarItem()
{ {
m_window = NULL; m_window = nullptr;
m_sizerItem = NULL; m_sizerItem = nullptr;
m_spacerPixels = 0; m_spacerPixels = 0;
m_toolId = 0; m_toolId = 0;
m_kind = wxITEM_NORMAL; m_kind = wxITEM_NORMAL;
@ -507,7 +507,7 @@ public:
const wxBitmapBundle& bitmap, const wxBitmapBundle& bitmap,
const wxBitmapBundle& disabledBitmap, const wxBitmapBundle& disabledBitmap,
bool toggle = false, bool toggle = false,
wxObject* clientData = NULL, wxObject* clientData = nullptr,
const wxString& shortHelpString = wxEmptyString, const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString) const wxString& longHelpString = wxEmptyString)
{ {

View file

@ -68,7 +68,7 @@ public:
int winId = 0) int winId = 0)
: wxBookCtrlEvent(commandType, winId) : wxBookCtrlEvent(commandType, winId)
{ {
m_dragSource = NULL; m_dragSource = nullptr;
} }
wxEvent *Clone() const override { return new wxAuiNotebookEvent(*this); } wxEvent *Clone() const override { return new wxAuiNotebookEvent(*this); }
@ -151,7 +151,7 @@ public:
void SetColour(const wxColour& colour); void SetColour(const wxColour& colour);
void SetActiveColour(const wxColour& colour); void SetActiveColour(const wxColour& colour);
void DoShowHide(); void DoShowHide();
void SetRect(const wxRect& rect, wxWindow* wnd = NULL); void SetRect(const wxRect& rect, wxWindow* wnd = nullptr);
void RemoveButton(int id); void RemoveButton(int id);
void AddButton(int id, void AddButton(int id,
@ -344,7 +344,7 @@ public:
//wxBookCtrlBase functions //wxBookCtrlBase functions
virtual void SetPageSize (const wxSize &size) override; virtual void SetPageSize (const wxSize &size) override;
virtual int HitTest (const wxPoint &pt, long *flags=NULL) const override; virtual int HitTest (const wxPoint &pt, long *flags=nullptr) const override;
virtual int GetPageImage(size_t n) const override; virtual int GetPageImage(size_t n) const override;
virtual bool SetPageImage(size_t n, int imageId) override; virtual bool SetPageImage(size_t n, int imageId) override;
@ -383,7 +383,7 @@ protected:
virtual wxSize CalculateNewSplitSize(); virtual wxSize CalculateNewSplitSize();
// remove the page and return a pointer to it // remove the page and return a pointer to it
virtual wxWindow *DoRemovePage(size_t WXUNUSED(page)) override { return NULL; } virtual wxWindow *DoRemovePage(size_t WXUNUSED(page)) override { return nullptr; }
//A general selection function //A general selection function
virtual int DoModifySelection(size_t n, bool events); virtual int DoModifySelection(size_t n, bool events);
@ -415,7 +415,7 @@ protected:
void OnNavigationKeyNotebook(wxNavigationKeyEvent& event); void OnNavigationKeyNotebook(wxNavigationKeyEvent& event);
void OnSysColourChanged(wxSysColourChangedEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event);
// set selection to the given window (which must be non-NULL and be one of // set selection to the given window (which must be non-null and be one of
// our pages, otherwise an assert is raised) // our pages, otherwise an assert is raised)
void SetSelectionToWindow(wxWindow *win); void SetSelectionToWindow(wxWindow *win);
void SetSelectionToPage(const wxAuiNotebookPage& page) void SetSelectionToPage(const wxAuiNotebookPage& page)

View file

@ -152,8 +152,8 @@ public:
, floating_pos(wxDefaultPosition) , floating_pos(wxDefaultPosition)
, floating_size(wxDefaultSize) , floating_size(wxDefaultSize)
{ {
window = NULL; window = nullptr;
frame = NULL; frame = nullptr;
state = 0; state = 0;
dock_direction = wxAUI_DOCK_LEFT; dock_direction = wxAUI_DOCK_LEFT;
dock_layer = 0; dock_layer = 0;
@ -180,7 +180,7 @@ public:
*this = source; *this = source;
} }
bool IsOk() const { return window != NULL; } bool IsOk() const { return window != nullptr; }
bool IsFixed() const { return !HasFlag(optionResizable); } bool IsFixed() const { return !HasFlag(optionResizable); }
bool IsResizable() const { return HasFlag(optionResizable); } bool IsResizable() const { return HasFlag(optionResizable); }
bool IsShown() const { return !HasFlag(optionHidden); } bool IsShown() const { return !HasFlag(optionHidden); }
@ -405,7 +405,7 @@ class WXDLLIMPEXP_AUI wxAuiManager : public wxEvtHandler
public: public:
wxAuiManager(wxWindow* managedWnd = NULL, wxAuiManager(wxWindow* managedWnd = nullptr,
unsigned int flags = wxAUI_MGR_DEFAULT); unsigned int flags = wxAUI_MGR_DEFAULT);
virtual ~wxAuiManager(); virtual ~wxAuiManager();
void UnInit(); void UnInit();
@ -533,7 +533,7 @@ protected:
void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt); void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt);
void OnFloatingPaneResized(wxWindow* window, const wxRect& rect); void OnFloatingPaneResized(wxWindow* window, const wxRect& rect);
void Render(wxDC* dc); void Render(wxDC* dc);
void Repaint(wxDC* dc = NULL); void Repaint(wxDC* dc = nullptr);
void ProcessMgrEvent(wxAuiManagerEvent& event); void ProcessMgrEvent(wxAuiManagerEvent& event);
void UpdateButtonOnScreen(wxAuiDockUIPart* buttonUiPart, void UpdateButtonOnScreen(wxAuiDockUIPart* buttonUiPart,
const wxMouseEvent& event); const wxMouseEvent& event);
@ -596,7 +596,7 @@ protected:
wxPoint m_actionStart; // position where the action click started wxPoint m_actionStart; // position where the action click started
wxPoint m_actionOffset; // offset from upper left of the item clicked wxPoint m_actionOffset; // offset from upper left of the item clicked
wxAuiDockUIPart* m_actionPart; // ptr to the part the action happened to wxAuiDockUIPart* m_actionPart; // ptr to the part the action happened to
wxWindow* m_actionWindow; // action frame or window (NULL if none) wxWindow* m_actionWindow; // action frame or window (nullptr if none)
wxRect m_actionHintRect; // hint rectangle for the action wxRect m_actionHintRect; // hint rectangle for the action
wxRect m_lastRect; wxRect m_lastRect;
wxAuiDockUIPart* m_hoverButton;// button uipart being hovered over wxAuiDockUIPart* m_hoverButton;// button uipart being hovered over
@ -630,12 +630,12 @@ class WXDLLIMPEXP_AUI wxAuiManagerEvent : public wxEvent
public: public:
wxAuiManagerEvent(wxEventType type=wxEVT_NULL) : wxEvent(0, type) wxAuiManagerEvent(wxEventType type=wxEVT_NULL) : wxEvent(0, type)
{ {
manager = NULL; manager = nullptr;
pane = NULL; pane = nullptr;
button = 0; button = 0;
veto_flag = false; veto_flag = false;
canveto_flag = true; canveto_flag = true;
dc = NULL; dc = nullptr;
} }
wxEvent *Clone() const override { return new wxAuiManagerEvent(*this); } wxEvent *Clone() const override { return new wxAuiManagerEvent(*this); }

View file

@ -48,7 +48,7 @@ public:
virtual void SetSizingInfo(const wxSize& tabCtrlSize, virtual void SetSizingInfo(const wxSize& tabCtrlSize,
size_t tabCount, size_t tabCount,
wxWindow* wnd = NULL) = 0; wxWindow* wnd = nullptr) = 0;
virtual void SetNormalFont(const wxFont& font) = 0; virtual void SetNormalFont(const wxFont& font) = 0;
virtual void SetSelectedFont(const wxFont& font) = 0; virtual void SetSelectedFont(const wxFont& font) = 0;
@ -128,7 +128,7 @@ public:
void SetFlags(unsigned int flags) override; void SetFlags(unsigned int flags) override;
void SetSizingInfo(const wxSize& tabCtrlSize, void SetSizingInfo(const wxSize& tabCtrlSize,
size_t tabCount, size_t tabCount,
wxWindow* wnd = NULL) override; wxWindow* wnd = nullptr) override;
void SetNormalFont(const wxFont& font) override; void SetNormalFont(const wxFont& font) override;
void SetSelectedFont(const wxFont& font) override; void SetSelectedFont(const wxFont& font) override;
@ -231,7 +231,7 @@ public:
void SetSizingInfo(const wxSize& tabCtrlSize, void SetSizingInfo(const wxSize& tabCtrlSize,
size_t tabCount, size_t tabCount,
wxWindow* wnd = NULL) override; wxWindow* wnd = nullptr) override;
void SetNormalFont(const wxFont& font) override; void SetNormalFont(const wxFont& font) override;
void SetSelectedFont(const wxFont& font) override; void SetSelectedFont(const wxFont& font) override;

View file

@ -29,7 +29,7 @@ inline size_t wxBase64EncodedSize(size_t len) { return 4*((len+2)/3); }
// //
// returns the length of the encoded data or wxCONV_FAILED if the buffer is not // returns the length of the encoded data or wxCONV_FAILED if the buffer is not
// large enough; to determine the needed size you can either allocate a buffer // large enough; to determine the needed size you can either allocate a buffer
// of wxBase64EncodedSize(srcLen) size or call the function with NULL buffer in // of wxBase64EncodedSize(srcLen) size or call the function with null buffer in
// which case the required size will be returned // which case the required size will be returned
WXDLLIMPEXP_BASE size_t WXDLLIMPEXP_BASE size_t
wxBase64Encode(char *dst, size_t dstLen, const void *src, size_t srcLen); wxBase64Encode(char *dst, size_t dstLen, const void *src, size_t srcLen);
@ -83,18 +83,18 @@ inline size_t wxBase64DecodedSize(size_t srcLen) { return 3*srcLen/4; }
// returns the length of the decoded data or wxCONV_FAILED if an error occurs // returns the length of the decoded data or wxCONV_FAILED if an error occurs
// such as the buffer is too small or the encoded string is invalid; in the // such as the buffer is too small or the encoded string is invalid; in the
// latter case the posErr is filled with the position where the decoding // latter case the posErr is filled with the position where the decoding
// stopped if it is not NULL // stopped if it is not null
WXDLLIMPEXP_BASE size_t WXDLLIMPEXP_BASE size_t
wxBase64Decode(void *dst, size_t dstLen, wxBase64Decode(void *dst, size_t dstLen,
const char *src, size_t srcLen = wxNO_LEN, const char *src, size_t srcLen = wxNO_LEN,
wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict,
size_t *posErr = NULL); size_t *posErr = nullptr);
inline size_t inline size_t
wxBase64Decode(void *dst, size_t dstLen, wxBase64Decode(void *dst, size_t dstLen,
const wxString& src, const wxString& src,
wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict,
size_t *posErr = NULL) size_t *posErr = nullptr)
{ {
// don't use str.length() here as the ASCII buffer is shorter than it for // don't use str.length() here as the ASCII buffer is shorter than it for
// strings with embedded NULs // strings with embedded NULs
@ -106,12 +106,12 @@ wxBase64Decode(void *dst, size_t dstLen,
WXDLLIMPEXP_BASE wxMemoryBuffer WXDLLIMPEXP_BASE wxMemoryBuffer
wxBase64Decode(const char *src, size_t srcLen = wxNO_LEN, wxBase64Decode(const char *src, size_t srcLen = wxNO_LEN,
wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict,
size_t *posErr = NULL); size_t *posErr = nullptr);
inline wxMemoryBuffer inline wxMemoryBuffer
wxBase64Decode(const wxString& src, wxBase64Decode(const wxString& src,
wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict,
size_t *posErr = NULL) size_t *posErr = nullptr)
{ {
// don't use str.length() here as the ASCII buffer is shorter than it for // don't use str.length() here as the ASCII buffer is shorter than it for
// strings with embedded NULs // strings with embedded NULs

View file

@ -135,7 +135,7 @@ public:
{ return false; } { return false; }
virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name),
wxBitmapType WXUNUSED(type), const wxPalette *WXUNUSED(palette) = NULL) const wxBitmapType WXUNUSED(type), const wxPalette *WXUNUSED(palette) = nullptr) const
{ return false; } { return false; }
void SetName(const wxString& name) { m_name = name; } void SetName(const wxString& name) { m_name = name; }
@ -233,7 +233,7 @@ public:
virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0; virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0;
virtual bool SaveFile(const wxString &name, wxBitmapType type, virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = NULL) const = 0; const wxPalette *palette = nullptr) const = 0;
virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0; virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0;
/* /*

View file

@ -112,7 +112,7 @@ public:
static wxBitmapBundle FromImpl(wxBitmapBundleImpl* impl); static wxBitmapBundle FromImpl(wxBitmapBundleImpl* impl);
// Check if bitmap bundle is non-empty. // Check if bitmap bundle is non-empty.
bool IsOk() const { return m_impl.get() != NULL; } bool IsOk() const { return m_impl.get() != nullptr; }
// Clear the bundle contents, IsOk() will return false after doing this. // Clear the bundle contents, IsOk() will return false after doing this.
void Clear(); void Clear();

View file

@ -94,11 +94,11 @@ public:
// get the panel which represents the given page // get the panel which represents the given page
virtual wxWindow *GetPage(size_t n) const { return m_pages.at(n); } virtual wxWindow *GetPage(size_t n) const { return m_pages.at(n); }
// get the current page or NULL if none // get the current page or nullptr if none
wxWindow *GetCurrentPage() const wxWindow *GetCurrentPage() const
{ {
const int n = GetSelection(); const int n = GetSelection();
return n == wxNOT_FOUND ? NULL : GetPage(n); return n == wxNOT_FOUND ? nullptr : GetPage(n);
} }
// get the currently selected page or wxNOT_FOUND if none // get the currently selected page or wxNOT_FOUND if none
@ -162,7 +162,7 @@ public:
virtual bool RemovePage(size_t n) virtual bool RemovePage(size_t n)
{ {
DoInvalidateBestSize(); DoInvalidateBestSize();
return DoRemovePage(n) != NULL; return DoRemovePage(n) != nullptr;
} }
// remove all pages and delete them // remove all pages and delete them
@ -217,7 +217,7 @@ public:
// hit test: returns which page is hit and, optionally, where (icon, label) // hit test: returns which page is hit and, optionally, where (icon, label)
virtual int HitTest(const wxPoint& WXUNUSED(pt), virtual int HitTest(const wxPoint& WXUNUSED(pt),
long * WXUNUSED(flags) = NULL) const long * WXUNUSED(flags) = nullptr) const
{ {
return wxNOT_FOUND; return wxNOT_FOUND;
} }
@ -279,7 +279,7 @@ protected:
// create a new "page changing" event // create a new "page changing" event
virtual wxBookCtrlEvent* CreatePageChangingEvent() const virtual wxBookCtrlEvent* CreatePageChangingEvent() const
{ wxFAIL_MSG(wxT("Override this function!")); return NULL; } { wxFAIL_MSG(wxT("Override this function!")); return nullptr; }
// modify the event created by CreatePageChangingEvent() to "page changed" // modify the event created by CreatePageChangingEvent() to "page changed"
// event, usually by just calling SetEventType() on it // event, usually by just calling SetEventType() on it
@ -292,15 +292,15 @@ protected:
virtual void DoShowPage(wxWindow* page, bool show) { page->Show(show); } virtual void DoShowPage(wxWindow* page, bool show) { page->Show(show); }
// Should we accept NULL page pointers in Add/InsertPage()? // Should we accept null page pointers in Add/InsertPage()?
// //
// Default is no but derived classes may override it if they can treat NULL // Default is no but derived classes may override it if they can treat null
// pages in some sensible way (e.g. wxTreebook overrides this to allow // pages in some sensible way (e.g. wxTreebook overrides this to allow
// having nodes without any associated page) // having nodes without any associated page)
virtual bool AllowNullPage() const { return false; } virtual bool AllowNullPage() const { return false; }
// For classes that allow null pages, we also need a way to find the // For classes that allow null pages, we also need a way to find the
// closest non-NULL page corresponding to the given index, e.g. the first // closest non-null page corresponding to the given index, e.g. the first
// leaf item in wxTreebook tree and this method must be overridden to // leaf item in wxTreebook tree and this method must be overridden to
// return it if AllowNullPage() is overridden. Note that it can still // return it if AllowNullPage() is overridden. Note that it can still
// return null if there are no valid pages after this one. // return null if there are no valid pages after this one.
@ -349,7 +349,7 @@ protected:
// event handlers // event handlers
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
// controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook) // controller buddy if available, nullptr otherwise (usually for native book controls like wxNotebook)
wxWindow *m_bookctrl; wxWindow *m_bookctrl;
// Whether to shrink to fit current page // Whether to shrink to fit current page

View file

@ -133,7 +133,7 @@ public:
CharType *release() const CharType *release() const
{ {
if ( m_data == GetNullData() ) if ( m_data == GetNullData() )
return NULL; return nullptr;
wxASSERT_MSG( m_data->m_owned, wxT("can't release non-owned buffer") ); wxASSERT_MSG( m_data->m_owned, wxT("can't release non-owned buffer") );
wxASSERT_MSG( m_data->m_ref == 1, wxT("can't release shared buffer") ); wxASSERT_MSG( m_data->m_ref == 1, wxT("can't release shared buffer") );
@ -141,7 +141,7 @@ public:
CharType * const p = m_data->Get(); CharType * const p = m_data->Get();
wxScopedCharTypeBuffer *self = const_cast<wxScopedCharTypeBuffer*>(this); wxScopedCharTypeBuffer *self = const_cast<wxScopedCharTypeBuffer*>(this);
self->m_data->Set(NULL, 0); self->m_data->Set(nullptr, 0);
self->DecRef(); self->DecRef();
return p; return p;
@ -176,7 +176,7 @@ protected:
} }
}; };
// placeholder for NULL string, to simplify this code // placeholder for null string, to simplify this code
static Data *GetNullData() static Data *GetNullData()
{ {
return static_cast<Data *>(wxPrivate::GetUntypedNullData()); return static_cast<Data *>(wxPrivate::GetUntypedNullData());
@ -252,7 +252,7 @@ protected:
public: public:
typedef T CharType; typedef T CharType;
wxCharTypeBuffer(const CharType *str = NULL, size_t len = wxNO_LEN) wxCharTypeBuffer(const CharType *str = nullptr, size_t len = wxNO_LEN)
{ {
if ( str ) if ( str )
{ {
@ -365,7 +365,7 @@ public:
wxCharBuffer(const wxScopedCharTypeBufferBase& buf) wxCharBuffer(const wxScopedCharTypeBufferBase& buf)
: wxCharTypeBufferBase(buf) {} : wxCharTypeBufferBase(buf) {}
wxCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} wxCharBuffer(const CharType *str = nullptr) : wxCharTypeBufferBase(str) {}
wxCharBuffer(size_t len) : wxCharTypeBufferBase(len) {} wxCharBuffer(size_t len) : wxCharTypeBufferBase(len) {}
wxCharBuffer(const wxCStrData& cstr); wxCharBuffer(const wxCStrData& cstr);
@ -382,7 +382,7 @@ public:
wxWCharBuffer(const wxScopedCharTypeBufferBase& buf) wxWCharBuffer(const wxScopedCharTypeBufferBase& buf)
: wxCharTypeBufferBase(buf) {} : wxCharTypeBufferBase(buf) {}
wxWCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} wxWCharBuffer(const CharType *str = nullptr) : wxCharTypeBufferBase(str) {}
wxWCharBuffer(size_t len) : wxCharTypeBufferBase(len) {} wxWCharBuffer(size_t len) : wxCharTypeBufferBase(len) {}
wxWCharBuffer(const wxCStrData& cstr); wxWCharBuffer(const wxCStrData& cstr);
@ -401,7 +401,7 @@ public:
// always return a buffer // always return a buffer
// + we should derive this class from wxScopedCharTypeBuffer // + we should derive this class from wxScopedCharTypeBuffer
// then // then
wxWritableCharTypeBuffer(const CharType *str = NULL) wxWritableCharTypeBuffer(const CharType *str = nullptr)
: wxCharTypeBuffer<T>(str) {} : wxCharTypeBuffer<T>(str) {}
operator CharType*() { return this->data(); } operator CharType*() { return this->data(); }
@ -448,7 +448,7 @@ public:
// everything is private as it can only be used by wxMemoryBuffer // everything is private as it can only be used by wxMemoryBuffer
private: private:
wxMemoryBufferData(size_t size = wxMemoryBufferData::DefBufSize) wxMemoryBufferData(size_t size = wxMemoryBufferData::DefBufSize)
: m_data(size ? malloc(size) : NULL), m_size(size), m_len(0), m_ref(0) : m_data(size ? malloc(size) : nullptr), m_size(size), m_len(0), m_ref(0)
{ {
} }
~wxMemoryBufferData() { free(m_data); } ~wxMemoryBufferData() { free(m_data); }
@ -483,13 +483,13 @@ private:
void *release() void *release()
{ {
if ( m_data == NULL ) if ( m_data == nullptr )
return NULL; return nullptr;
wxASSERT_MSG( m_ref == 1, "can't release shared buffer" ); wxASSERT_MSG( m_ref == 1, "can't release shared buffer" );
void *p = m_data; void *p = m_data;
m_data = NULL; m_data = nullptr;
m_len = m_len =
m_size = 0; m_size = 0;

View file

@ -31,7 +31,7 @@ class wxBusyInfoFlags
public: public:
wxBusyInfoFlags() wxBusyInfoFlags()
{ {
m_parent = NULL; m_parent = nullptr;
m_alpha = wxALPHA_OPAQUE; m_alpha = wxALPHA_OPAQUE;
} }

View file

@ -36,12 +36,12 @@ public:
// make this button the default button in its top level window // make this button the default button in its top level window
// //
// returns the old default item (possibly NULL) // returns the old default item (possibly null)
virtual wxWindow *SetDefault(); virtual wxWindow *SetDefault();
// returns the default button size for this platform, and optionally for a // returns the default button size for this platform, and optionally for a
// specific window when the platform supports per-monitor DPI // specific window when the platform supports per-monitor DPI
static wxSize GetDefaultSize(wxWindow* win = NULL); static wxSize GetDefaultSize(wxWindow* win = nullptr);
protected: protected:
wxDECLARE_NO_COPY_CLASS(wxButtonBase); wxDECLARE_NO_COPY_CLASS(wxButtonBase);

View file

@ -204,7 +204,7 @@ public:
} }
// retrieves the limits currently in use (wxDefaultDateTime if none) in the // retrieves the limits currently in use (wxDefaultDateTime if none) in the
// provided pointers (which may be NULL) and returns true if there are any // provided pointers (which may be null) and returns true if there are any
// limits or false if none // limits or false if none
virtual bool virtual bool
GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const
@ -223,8 +223,8 @@ public:
// notice that this is not implemented in all versions // notice that this is not implemented in all versions
virtual wxCalendarHitTestResult virtual wxCalendarHitTestResult
HitTest(const wxPoint& WXUNUSED(pos), HitTest(const wxPoint& WXUNUSED(pos),
wxDateTime* WXUNUSED(date) = NULL, wxDateTime* WXUNUSED(date) = nullptr,
wxDateTime::WeekDay* WXUNUSED(wd) = NULL) wxDateTime::WeekDay* WXUNUSED(wd) = nullptr)
{ {
return wxCAL_HITTEST_NOWHERE; return wxCAL_HITTEST_NOWHERE;
} }
@ -253,7 +253,7 @@ public:
virtual void Mark(size_t day, bool mark) = 0; virtual void Mark(size_t day, bool mark) = 0;
virtual wxCalendarDateAttr *GetAttr(size_t WXUNUSED(day)) const virtual wxCalendarDateAttr *GetAttr(size_t WXUNUSED(day)) const
{ return NULL; } { return nullptr; }
virtual void SetAttr(size_t WXUNUSED(day), wxCalendarDateAttr *attr) virtual void SetAttr(size_t WXUNUSED(day), wxCalendarDateAttr *attr)
{ delete attr; } { delete attr; }
virtual void ResetAttr(size_t WXUNUSED(day)) { } virtual void ResetAttr(size_t WXUNUSED(day)) { }

View file

@ -179,7 +179,7 @@ protected:
private: private:
void Init() void Init()
{ {
m_window = NULL; m_window = nullptr;
m_x = m_y = 0; m_x = m_y = 0;
m_width = m_height = 0; m_width = m_height = 0;
m_countVisible = 0; m_countVisible = 0;

View file

@ -168,7 +168,7 @@ typedef void (wxEvtHandler::*wxClipboardEventFunction)(wxClipboardEvent&);
class WXDLLIMPEXP_CORE wxClipboardLocker class WXDLLIMPEXP_CORE wxClipboardLocker
{ {
public: public:
wxClipboardLocker(wxClipboard *clipboard = NULL) wxClipboardLocker(wxClipboard *clipboard = nullptr)
{ {
m_clipboard = clipboard ? clipboard : wxTheClipboard; m_clipboard = clipboard ? clipboard : wxTheClipboard;
if ( m_clipboard ) if ( m_clipboard )

View file

@ -54,7 +54,7 @@ public:
return true; return true;
} }
void AddField( const wxString &name, void* initialValue = NULL ) void AddField( const wxString &name, void* initialValue = nullptr )
{ {
wxShadowObjectFields::iterator it = m_fields.find( name ); wxShadowObjectFields::iterator it = m_fields.find( name );
if (it == m_fields.end()) if (it == m_fields.end())
@ -71,7 +71,7 @@ public:
it->second = value; it->second = value;
} }
void* GetField( const wxString &name, void *defaultValue = NULL ) void* GetField( const wxString &name, void *defaultValue = nullptr )
{ {
wxShadowObjectFields::iterator it = m_fields.find( name ); wxShadowObjectFields::iterator it = m_fields.find( name );
if (it == m_fields.end()) if (it == m_fields.end())
@ -180,7 +180,7 @@ public:
void *GetClientData() const; void *GetClientData() const;
protected: protected:
bool HasClientDataContainer() const { return m_data.get() != NULL; } bool HasClientDataContainer() const { return m_data.get() != nullptr; }
void CopyClientDataContainer(const wxSharedClientDataContainer& other) void CopyClientDataContainer(const wxSharedClientDataContainer& other)
{ {
m_data = other.m_data; m_data = other.m_data;
@ -192,7 +192,7 @@ private:
{ {
}; };
// Helper function that will create m_data if it is currently NULL // Helper function that will create m_data if it is currently null
wxClientDataContainer *GetValidClientData(); wxClientDataContainer *GetValidClientData();
// m_data is shared, not deep copied, when cloned. If you make changes to // m_data is shared, not deep copied, when cloned. If you make changes to

View file

@ -28,7 +28,7 @@
class WXDLLIMPEXP_BASE wxCmdLineArgsArray class WXDLLIMPEXP_BASE wxCmdLineArgsArray
{ {
public: public:
wxCmdLineArgsArray() { m_argsA = NULL; m_argsW = NULL; } wxCmdLineArgsArray() { m_argsA = nullptr; m_argsW = nullptr; }
template <typename T> template <typename T>
void Init(int argc, T **argv) void Init(int argc, T **argv)
@ -53,7 +53,7 @@ public:
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
m_argsA[n] = wxStrdup(m_args[n].ToAscii()); m_argsA[n] = wxStrdup(m_args[n].ToAscii());
m_argsA[count] = NULL; m_argsA[count] = nullptr;
} }
return m_argsA; return m_argsA;
@ -68,7 +68,7 @@ public:
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
m_argsW[n] = wxStrdup(m_args[n].wc_str()); m_argsW[n] = wxStrdup(m_args[n].wc_str());
m_argsW[count] = NULL; m_argsW[count] = nullptr;
} }
return m_argsW; return m_argsW;
@ -125,7 +125,7 @@ private:
free(args[n]); free(args[n]);
delete [] args; delete [] args;
args = NULL; args = nullptr;
} }
void FreeArgs() void FreeArgs()

View file

@ -93,7 +93,7 @@ struct wxCmdLineEntryDesc
// the list of wxCmdLineEntryDesc objects should be terminated with this one // the list of wxCmdLineEntryDesc objects should be terminated with this one
#define wxCMD_LINE_DESC_END \ #define wxCMD_LINE_DESC_END \
{ wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 } { wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0x0 }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxCmdLineArg contains the value for one command line argument // wxCmdLineArg contains the value for one command line argument
@ -141,7 +141,7 @@ public:
typedef std::bidirectional_iterator_tag iterator_category; typedef std::bidirectional_iterator_tag iterator_category;
#endif // wx_USE_STD_STRING #endif // wx_USE_STD_STRING
const_iterator() : m_parser(NULL), m_index(0) {} const_iterator() : m_parser(nullptr), m_index(0) {}
reference operator *() const; reference operator *() const;
pointer operator ->() const; pointer operator ->() const;
const_iterator &operator ++ (); const_iterator &operator ++ ();

View file

@ -90,7 +90,7 @@ public:
const wxList& GetCommands() const { return m_commands; } const wxList& GetCommands() const { return m_commands; }
wxCommand *GetCurrentCommand() const wxCommand *GetCurrentCommand() const
{ {
return (wxCommand *)(m_currentCommand ? m_currentCommand->GetData() : NULL); return (wxCommand *)(m_currentCommand ? m_currentCommand->GetData() : nullptr);
} }
int GetMaxCommands() const { return m_maxNoCommands; } int GetMaxCommands() const { return m_maxNoCommands; }
virtual void ClearCommands(); virtual void ClearCommands();

View file

@ -78,10 +78,10 @@ wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COLOUR_CHANGED, wxColourDialogE
// get the colour from user and return it // get the colour from user and return it
WXDLLIMPEXP_CORE wxColour wxGetColourFromUser(wxWindow *parent = NULL, WXDLLIMPEXP_CORE wxColour wxGetColourFromUser(wxWindow *parent = nullptr,
const wxColour& colInit = wxNullColour, const wxColour& colInit = wxNullColour,
const wxString& caption = wxEmptyString, const wxString& caption = wxEmptyString,
wxColourData *data = NULL); wxColourData *data = nullptr);
#endif // wxUSE_COLOURDLG #endif // wxUSE_COLOURDLG

View file

@ -206,14 +206,14 @@ protected:
{ {
wxFAIL_MSG( "must be overridden if used" ); wxFAIL_MSG( "must be overridden if used" );
return NULL; return nullptr;
} }
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const override virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const override
{ {
wxFAIL_MSG( "must be overridden if used" ); wxFAIL_MSG( "must be overridden if used" );
return NULL; return nullptr;
} }
#endif #endif
}; };

View file

@ -181,7 +181,7 @@ public:
bool IsPopupShown() const { return m_popupWinState == Visible; } bool IsPopupShown() const { return m_popupWinState == Visible; }
// set interface class instance derived from wxComboPopup // set interface class instance derived from wxComboPopup
// NULL popup can be used to indicate default in a derived class // null popup can be used to indicate default in a derived class
void SetPopupControl( wxComboPopup* popup ) void SetPopupControl( wxComboPopup* popup )
{ {
DoSetPopupControl(popup); DoSetPopupControl(popup);
@ -538,7 +538,7 @@ protected:
virtual wxSize DoGetBestSize() const override; virtual wxSize DoGetBestSize() const override;
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const override; virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const override;
// NULL popup can be used to indicate default in a derived class // null popup can be used to indicate default in a derived class
virtual void DoSetPopupControl(wxComboPopup* popup); virtual void DoSetPopupControl(wxComboPopup* popup);
// ensures there is at least the default popup // ensures there is at least the default popup
@ -674,7 +674,7 @@ protected:
wxRect m_tcArea; wxRect m_tcArea;
wxRect m_btnArea; wxRect m_btnArea;
// Colour of the text area, in case m_text is NULL // Colour of the text area, in case m_text is null
wxColour m_tcBgCol; wxColour m_tcBgCol;
// current button state (uses renderer flags) // current button state (uses renderer flags)
@ -752,7 +752,7 @@ class WXDLLIMPEXP_CORE wxComboPopup
public: public:
wxComboPopup() wxComboPopup()
{ {
m_combo = NULL; m_combo = nullptr;
m_iFlags = 0; m_iFlags = 0;
} }
@ -796,7 +796,7 @@ public:
// implementation. If the found item matched the string, but is // implementation. If the found item matched the string, but is
// different, it should be written back to pItem. Default implementation // different, it should be written back to pItem. Default implementation
// always return true and does not alter trueItem. // always return true and does not alter trueItem.
virtual bool FindItem(const wxString& item, wxString* trueItem=NULL); virtual bool FindItem(const wxString& item, wxString* trueItem=nullptr);
// This is called to custom paint in the combo control itself (ie. not the popup). // This is called to custom paint in the combo control itself (ie. not the popup).
// Default implementation draws value as string. // Default implementation draws value as string.

View file

@ -147,7 +147,7 @@ private:
{ {
wxWindow * const child = *i; wxWindow * const child = *i;
// Allow NULL elements in the list, this makes the code of derived // Allow null elements in the list, this makes the code of derived
// composite controls which may have optionally shown children // composite controls which may have optionally shown children
// simpler and it doesn't cost us much here. // simpler and it doesn't cost us much here.
if ( child ) if ( child )
@ -165,7 +165,7 @@ class wxCompositeWindow : public wxCompositeWindowSettersOnly<W>
public: public:
virtual void SetFocus() override virtual void SetFocus() override
{ {
wxSetFocusToChild(this, NULL); wxSetFocusToChild(this, nullptr);
} }
protected: protected:

View file

@ -104,7 +104,7 @@ public:
// comments near definition wxUSE_CONFIG_NATIVE for details. It returns // comments near definition wxUSE_CONFIG_NATIVE for details. It returns
// the created object and also sets it as ms_pConfig. // the created object and also sets it as ms_pConfig.
static wxConfigBase *Create(); static wxConfigBase *Create();
// should Get() try to create a new log object if the current one is NULL? // should Get() try to create a new log object if the current one is null?
static void DontCreateOnDemand() { ms_bAutoCreate = false; } static void DontCreateOnDemand() { ms_bAutoCreate = false; }
// ctor & virtual dtor // ctor & virtual dtor

View file

@ -39,13 +39,13 @@ public:
// default ctor, SetContainerWindow() must be called later // default ctor, SetContainerWindow() must be called later
wxControlContainerBase() wxControlContainerBase()
{ {
m_winParent = NULL; m_winParent = nullptr;
// By default, we accept focus ourselves. // By default, we accept focus ourselves.
m_acceptsFocusSelf = true; m_acceptsFocusSelf = true;
m_inSetFocus = false; m_inSetFocus = false;
m_winLastFocused = NULL; m_winLastFocused = nullptr;
} }
virtual ~wxControlContainerBase() {} virtual ~wxControlContainerBase() {}

View file

@ -145,9 +145,9 @@ public:
int flags = wxELLIPSIZE_FLAGS_DEFAULT); int flags = wxELLIPSIZE_FLAGS_DEFAULT);
// return the accel index in the string or -1 if none and puts the modified // return the accel index in the string or -1 if none and puts the modified
// string into second parameter if non NULL // string into second parameter if non-null
static int FindAccelIndex(const wxString& label, static int FindAccelIndex(const wxString& label,
wxString *labelOnly = NULL); wxString *labelOnly = nullptr);
// this is a helper for the derived class GetClassDefaultAttributes() // this is a helper for the derived class GetClassDefaultAttributes()
// implementation: it returns the right colours for the classes which // implementation: it returns the right colours for the classes which

View file

@ -107,7 +107,7 @@ private:
{ {
// We don't initialize m_encDefault here as different ctors do it // We don't initialize m_encDefault here as different ctors do it
// differently. // differently.
m_conv = NULL; m_conv = nullptr;
m_bomType = wxBOM_Unknown; m_bomType = wxBOM_Unknown;
m_ownsConv = false; m_ownsConv = false;
m_consumedBOM = false; m_consumedBOM = false;
@ -139,7 +139,7 @@ private:
// wxFONTENCODING_MAX but not wxFONTENCODING_DEFAULT // wxFONTENCODING_MAX but not wxFONTENCODING_DEFAULT
static wxFontEncoding ms_defaultMBEncoding; static wxFontEncoding ms_defaultMBEncoding;
// conversion object which we really use, NULL until the first call to // conversion object which we really use, null until the first call to
// either ToWChar() or FromWChar() // either ToWChar() or FromWChar()
wxMBConv *m_conv; wxMBConv *m_conv;

View file

@ -109,7 +109,7 @@
/* /*
Define __WXFUNCTION__ which is like standard __FUNCTION__ but defined as Define __WXFUNCTION__ which is like standard __FUNCTION__ but defined as
NULL for the compilers which don't support the latter. nullptr for the compilers which don't support the latter.
*/ */
#ifndef __WXFUNCTION__ #ifndef __WXFUNCTION__
#if defined(__GNUC__) || \ #if defined(__GNUC__) || \
@ -118,7 +118,7 @@
#define __WXFUNCTION__ __FUNCTION__ #define __WXFUNCTION__ __FUNCTION__
#else #else
/* still define __WXFUNCTION__ to avoid #ifdefs elsewhere */ /* still define __WXFUNCTION__ to avoid #ifdefs elsewhere */
#define __WXFUNCTION__ (NULL) #define __WXFUNCTION__ (nullptr)
#endif #endif
#endif /* __WXFUNCTION__ already defined */ #endif /* __WXFUNCTION__ already defined */

View file

@ -38,7 +38,7 @@
class WXDLLIMPEXP_CORE wxContextHelp : public wxObject class WXDLLIMPEXP_CORE wxContextHelp : public wxObject
{ {
public: public:
wxContextHelp(wxWindow* win = NULL, bool beginHelp = true); wxContextHelp(wxWindow* win = nullptr, bool beginHelp = true);
virtual ~wxContextHelp(); virtual ~wxContextHelp();
bool BeginContextHelp(wxWindow* win); bool BeginContextHelp(wxWindow* win);
@ -146,7 +146,7 @@ public:
const wxPoint& pt, const wxPoint& pt,
wxHelpEvent::Origin origin) wxHelpEvent::Origin origin)
{ {
wxCHECK_MSG( window, false, wxT("window must not be NULL") ); wxCHECK_MSG( window, false, wxT("window must not be null") );
m_helptextAtPoint = pt; m_helptextAtPoint = pt;
m_helptextOrigin = origin; m_helptextOrigin = origin;
@ -229,7 +229,7 @@ class WXDLLIMPEXP_CORE wxHelpControllerHelpProvider : public wxSimpleHelpProvide
public: public:
// Note that it doesn't own the help controller. The help controller // Note that it doesn't own the help controller. The help controller
// should be deleted separately. // should be deleted separately.
wxHelpControllerHelpProvider(wxHelpControllerBase* hc = NULL); wxHelpControllerHelpProvider(wxHelpControllerBase* hc = nullptr);
// implement wxHelpProvider methods // implement wxHelpProvider methods

View file

@ -119,7 +119,7 @@ private:
int AppendItems(const wxArrayStringsAdapter& items) int AppendItems(const wxArrayStringsAdapter& items)
{ {
return AppendItems(items, NULL, wxClientData_None); return AppendItems(items, nullptr, wxClientData_None);
} }
int AppendItems(const wxArrayStringsAdapter& items, void **clientData) int AppendItems(const wxArrayStringsAdapter& items, void **clientData)
@ -162,7 +162,7 @@ private:
int InsertItems(const wxArrayStringsAdapter& items, unsigned int pos) int InsertItems(const wxArrayStringsAdapter& items, unsigned int pos)
{ {
return InsertItems(items, pos, NULL, wxClientData_None); return InsertItems(items, pos, nullptr, wxClientData_None);
} }
int InsertItems(const wxArrayStringsAdapter& items, int InsertItems(const wxArrayStringsAdapter& items,
@ -316,7 +316,7 @@ public:
// SetClientObject() takes ownership of the pointer, GetClientObject() // SetClientObject() takes ownership of the pointer, GetClientObject()
// returns it but keeps the ownership while DetachClientObject() expects // returns it but keeps the ownership while DetachClientObject() expects
// the caller to delete the pointer and also resets the internally stored // the caller to delete the pointer and also resets the internally stored
// one to NULL for this item // one to nullptr for this item
void SetClientObject(unsigned int n, wxClientData* clientData); void SetClientObject(unsigned int n, wxClientData* clientData);
wxClientData* GetClientObject(unsigned int n) const; wxClientData* GetClientObject(unsigned int n) const;
wxClientData* DetachClientObject(unsigned int n); wxClientData* DetachClientObject(unsigned int n);
@ -397,7 +397,7 @@ protected:
wxClientDataType type); wxClientDataType type);
// free the client object associated with the item at given position and // free the client object associated with the item at given position and
// set it to NULL (must only be called if HasClientObjectData()) // set it to nullptr (must only be called if HasClientObjectData())
void ResetItemClientObject(unsigned int n); void ResetItemClientObject(unsigned int n);
// set the type of the client data stored in this control: override this if // set the type of the client data stored in this control: override this if

View file

@ -268,7 +268,7 @@ public:
// out what kind of data object was received. // out what kind of data object was received.
wxDataFormat GetReceivedFormat() const; wxDataFormat GetReceivedFormat() const;
// Returns the pointer to the object which supports this format or NULL. // Returns the pointer to the object which supports this format or nullptr.
// The returned pointer is owned by wxDataObjectComposite and must // The returned pointer is owned by wxDataObjectComposite and must
// therefore not be destroyed by the caller. // therefore not be destroyed by the caller.
wxDataObjectSimple *GetObject(const wxDataFormat& format, wxDataObjectSimple *GetObject(const wxDataFormat& format,

View file

@ -108,8 +108,8 @@ WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray);
class WXDLLIMPEXP_CORE wxDataViewModelNotifier class WXDLLIMPEXP_CORE wxDataViewModelNotifier
{ {
public: public:
wxDataViewModelNotifier() { m_owner = NULL; } wxDataViewModelNotifier() { m_owner = nullptr; }
virtual ~wxDataViewModelNotifier() { m_owner = NULL; } virtual ~wxDataViewModelNotifier() { m_owner = nullptr; }
virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0; virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0; virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
@ -723,10 +723,10 @@ public:
wxDataViewItem GetCurrentItem() const; wxDataViewItem GetCurrentItem() const;
void SetCurrentItem(const wxDataViewItem& item); void SetCurrentItem(const wxDataViewItem& item);
virtual wxDataViewItem GetTopItem() const { return wxDataViewItem(NULL); } virtual wxDataViewItem GetTopItem() const { return wxDataViewItem(nullptr); }
virtual int GetCountPerPage() const { return wxNOT_FOUND; } virtual int GetCountPerPage() const { return wxNOT_FOUND; }
// Currently focused column of the current item or NULL if no column has focus // Currently focused column of the current item or nullptr if no column has focus
virtual wxDataViewColumn *GetCurrentColumn() const = 0; virtual wxDataViewColumn *GetCurrentColumn() const = 0;
// Selection: both GetSelection() and GetSelections() can be used for the // Selection: both GetSelection() and GetSelections() can be used for the
@ -754,9 +754,9 @@ public:
virtual bool IsExpanded( const wxDataViewItem & item ) const = 0; virtual bool IsExpanded( const wxDataViewItem & item ) const = 0;
virtual void EnsureVisible( const wxDataViewItem & item, virtual void EnsureVisible( const wxDataViewItem & item,
const wxDataViewColumn *column = NULL ) = 0; const wxDataViewColumn *column = nullptr ) = 0;
virtual void HitTest( const wxPoint & point, wxDataViewItem &item, wxDataViewColumn* &column ) const = 0; virtual void HitTest( const wxPoint & point, wxDataViewItem &item, wxDataViewColumn* &column ) const = 0;
virtual wxRect GetItemRect( const wxDataViewItem & item, const wxDataViewColumn *column = NULL ) const = 0; virtual wxRect GetItemRect( const wxDataViewItem & item, const wxDataViewColumn *column = nullptr ) const = 0;
virtual bool SetRowHeight( int WXUNUSED(rowHeight) ) { return false; } virtual bool SetRowHeight( int WXUNUSED(rowHeight) ) { return false; }
@ -857,7 +857,7 @@ public:
wxDataViewEvent() wxDataViewEvent()
: wxNotifyEvent() : wxNotifyEvent()
{ {
Init(NULL, NULL, wxDataViewItem()); Init(nullptr, nullptr, wxDataViewItem());
} }
// Constructor for the events affecting columns (and possibly also items). // Constructor for the events affecting columns (and possibly also items).
@ -876,7 +876,7 @@ public:
const wxDataViewItem& item) const wxDataViewItem& item)
: wxNotifyEvent(evtType, dvc->GetId()) : wxNotifyEvent(evtType, dvc->GetId())
{ {
Init(dvc, NULL, item); Init(dvc, nullptr, item);
} }
wxDataViewEvent(const wxDataViewEvent& event) wxDataViewEvent(const wxDataViewEvent& event)
@ -1241,7 +1241,7 @@ public:
wxDataViewTreeStoreNode( wxDataViewTreeStoreNode *parent, wxDataViewTreeStoreNode( wxDataViewTreeStoreNode *parent,
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
virtual ~wxDataViewTreeStoreNode(); virtual ~wxDataViewTreeStoreNode();
void SetText( const wxString &text ) void SetText( const wxString &text )
@ -1284,7 +1284,7 @@ public:
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(), const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
virtual ~wxDataViewTreeStoreContainerNode(); virtual ~wxDataViewTreeStoreContainerNode();
const wxDataViewTreeStoreNodes &GetChildren() const const wxDataViewTreeStoreNodes &GetChildren() const
@ -1328,31 +1328,31 @@ public:
wxDataViewItem AppendItem( const wxDataViewItem& parent, wxDataViewItem AppendItem( const wxDataViewItem& parent,
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem PrependItem( const wxDataViewItem& parent, wxDataViewItem PrependItem( const wxDataViewItem& parent,
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous, wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem PrependContainer( const wxDataViewItem& parent, wxDataViewItem PrependContainer( const wxDataViewItem& parent,
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(), const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem AppendContainer( const wxDataViewItem& parent, wxDataViewItem AppendContainer( const wxDataViewItem& parent,
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(), const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous, wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(), const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(), const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const; wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const;
int GetChildCount( const wxDataViewItem& parent ) const; int GetChildCount( const wxDataViewItem& parent ) const;
@ -1429,21 +1429,21 @@ public:
{ return GetStore()->IsContainer(item); } { return GetStore()->IsContainer(item); }
wxDataViewItem AppendItem( const wxDataViewItem& parent, wxDataViewItem AppendItem( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL ); const wxString &text, int icon = NO_IMAGE, wxClientData *data = nullptr );
wxDataViewItem PrependItem( const wxDataViewItem& parent, wxDataViewItem PrependItem( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL ); const wxString &text, int icon = NO_IMAGE, wxClientData *data = nullptr );
wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous, wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL ); const wxString &text, int icon = NO_IMAGE, wxClientData *data = nullptr );
wxDataViewItem PrependContainer( const wxDataViewItem& parent, wxDataViewItem PrependContainer( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE, const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem AppendContainer( const wxDataViewItem& parent, wxDataViewItem AppendContainer( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE, const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous, wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE, const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL ); wxClientData *data = nullptr );
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const
{ return GetStore()->GetNthChild(parent, pos); } { return GetStore()->GetNthChild(parent, pos); }

View file

@ -927,7 +927,7 @@ public:
// all conversions functions return true to indicate whether parsing // all conversions functions return true to indicate whether parsing
// succeeded or failed and fill in the provided end iterator, which must // succeeded or failed and fill in the provided end iterator, which must
// not be NULL, with the location of the character where the parsing // not be null, with the location of the character where the parsing
// stopped (this will be end() of the passed string if everything was // stopped (this will be end() of the passed string if everything was
// parsed) // parsed)
@ -1021,7 +1021,7 @@ public:
// backwards compatible versions of the parsing functions: they return an // backwards compatible versions of the parsing functions: they return an
// object representing the next character following the date specification // object representing the next character following the date specification
// (i.e. the one where the scan had to stop) or a special NULL-like object // (i.e. the one where the scan had to stop) or a special nullptr-like object
// on failure // on failure
// //
// they're not deprecated because a lot of existing code uses them and // they're not deprecated because a lot of existing code uses them and
@ -1120,7 +1120,7 @@ public:
inline wxLongLong GetValue() const; inline wxLongLong GetValue() const;
// a helper function to get the current time_t // a helper function to get the current time_t
static time_t GetTimeNow() { return time(NULL); } static time_t GetTimeNow() { return time(nullptr); }
// another one to get the current time broken down // another one to get the current time broken down
static struct tm *GetTmNow() static struct tm *GetTmNow()

View file

@ -183,10 +183,10 @@ public:
// get Cairo context // get Cairo context
virtual void* GetCairoContext() const virtual void* GetCairoContext() const
{ {
return NULL; return nullptr;
} }
virtual void* GetHandle() const { return NULL; } virtual void* GetHandle() const { return nullptr; }
// query dimension, colour deps, resolution // query dimension, colour deps, resolution
@ -347,14 +347,14 @@ public:
virtual void DoGetTextExtent(const wxString& string, virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL, wxCoord *descent = nullptr,
wxCoord *externalLeading = NULL, wxCoord *externalLeading = nullptr,
const wxFont *theFont = NULL) const = 0; const wxFont *theFont = nullptr) const = 0;
virtual void GetMultiLineTextExtent(const wxString& string, virtual void GetMultiLineTextExtent(const wxString& string,
wxCoord *width, wxCoord *width,
wxCoord *height, wxCoord *height,
wxCoord *heightLine = NULL, wxCoord *heightLine = nullptr,
const wxFont *font = NULL) const; const wxFont *font = nullptr) const;
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const;
// clearing // clearing
@ -592,7 +592,7 @@ public:
#if wxUSE_GRAPHICS_CONTEXT #if wxUSE_GRAPHICS_CONTEXT
virtual wxGraphicsContext* GetGraphicsContext() const virtual wxGraphicsContext* GetGraphicsContext() const
{ return NULL; } { return nullptr; }
virtual void SetGraphicsContext( wxGraphicsContext* WXUNUSED(ctx) ) virtual void SetGraphicsContext( wxGraphicsContext* WXUNUSED(ctx) )
{} {}
#endif #endif
@ -627,7 +627,7 @@ protected:
double GetMMToPXy() const; double GetMMToPXy() const;
// window on which the DC draws or NULL // window on which the DC draws or nullptr
wxWindow *m_window; wxWindow *m_window;
// flags // flags
@ -876,9 +876,9 @@ public:
void GetTextExtent(const wxString& string, void GetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL, wxCoord *descent = nullptr,
wxCoord *externalLeading = NULL, wxCoord *externalLeading = nullptr,
const wxFont *theFont = NULL) const const wxFont *theFont = nullptr) const
{ m_pimpl->DoGetTextExtent(string, x, y, descent, externalLeading, theFont); } { m_pimpl->DoGetTextExtent(string, x, y, descent, externalLeading, theFont); }
wxSize GetTextExtent(const wxString& string) const wxSize GetTextExtent(const wxString& string) const
@ -891,8 +891,8 @@ public:
void GetMultiLineTextExtent(const wxString& string, void GetMultiLineTextExtent(const wxString& string,
wxCoord *width, wxCoord *width,
wxCoord *height, wxCoord *height,
wxCoord *heightLine = NULL, wxCoord *heightLine = nullptr,
const wxFont *font = NULL) const const wxFont *font = nullptr) const
{ m_pimpl->GetMultiLineTextExtent( string, width, height, heightLine, font ); } { m_pimpl->GetMultiLineTextExtent( string, width, height, heightLine, font ); }
wxSize GetMultiLineTextExtent(const wxString& string) const wxSize GetMultiLineTextExtent(const wxString& string) const
@ -1190,7 +1190,7 @@ public:
const wxRect& rect, const wxRect& rect,
int alignment = wxALIGN_LEFT | wxALIGN_TOP, int alignment = wxALIGN_LEFT | wxALIGN_TOP,
int indexAccel = -1, int indexAccel = -1,
wxRect *rectBounding = NULL); wxRect *rectBounding = nullptr);
void DrawLabel(const wxString& text, const wxRect& rect, void DrawLabel(const wxString& text, const wxRect& rect,
int alignment = wxALIGN_LEFT | wxALIGN_TOP, int alignment = wxALIGN_LEFT | wxALIGN_TOP,
@ -1234,7 +1234,7 @@ public:
source, srcPt.x, srcPt.y, srcSize.x, srcSize.y, rop, useMask, srcMaskPt.x, srcMaskPt.y); source, srcPt.x, srcPt.y, srcSize.x, srcSize.y, rop, useMask, srcMaskPt.x, srcMaskPt.y);
} }
wxBitmap GetAsBitmap(const wxRect *subrect = (const wxRect *) NULL) const wxBitmap GetAsBitmap(const wxRect *subrect = (const wxRect *) nullptr) const
{ {
return m_pimpl->DoGetAsBitmap(subrect); return m_pimpl->DoGetAsBitmap(subrect);
} }
@ -1276,7 +1276,7 @@ public:
: m_dc(thdc.m_dc), : m_dc(thdc.m_dc),
m_hdc(thdc.m_hdc) m_hdc(thdc.m_hdc)
{ {
const_cast<TempHDC&>(thdc).m_hdc = NULL; const_cast<TempHDC&>(thdc).m_hdc = nullptr;
} }
~TempHDC() ~TempHDC()

View file

@ -40,8 +40,8 @@ class WXDLLIMPEXP_CORE wxBufferedDC : public wxMemoryDC
public: public:
// Default ctor, must subsequently call Init for two stage construction. // Default ctor, must subsequently call Init for two stage construction.
wxBufferedDC() wxBufferedDC()
: m_dc(NULL), : m_dc(nullptr),
m_buffer(NULL), m_buffer(nullptr),
m_style(0) m_style(0)
{ {
} }
@ -50,7 +50,7 @@ public:
wxBufferedDC(wxDC *dc, wxBufferedDC(wxDC *dc,
wxBitmap& buffer = wxNullBitmap, wxBitmap& buffer = wxNullBitmap,
int style = wxBUFFER_CLIENT_AREA) int style = wxBUFFER_CLIENT_AREA)
: m_dc(NULL), m_buffer(NULL) : m_dc(nullptr), m_buffer(nullptr)
{ {
Init(dc, buffer, style); Init(dc, buffer, style);
} }
@ -59,7 +59,7 @@ public:
// (where area is usually something like the size of the window // (where area is usually something like the size of the window
// being buffered) // being buffered)
wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA) wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA)
: m_dc(NULL), m_buffer(NULL) : m_dc(nullptr), m_buffer(nullptr)
{ {
Init(dc, area, style); Init(dc, area, style);
} }

View file

@ -209,9 +209,9 @@ public:
virtual void DoGetTextExtent(const wxString& string, virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL, wxCoord *descent = nullptr,
wxCoord *externalLeading = NULL, wxCoord *externalLeading = nullptr,
const wxFont *theFont = NULL) const override; const wxFont *theFont = nullptr) const override;
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const override; virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const override;

View file

@ -86,7 +86,7 @@ protected:
// exchange x and y components of all points in the array if necessary // exchange x and y components of all points in the array if necessary
wxPoint* Mirror(int n, const wxPoint*& points) const wxPoint* Mirror(int n, const wxPoint*& points) const
{ {
wxPoint* points_alloc = NULL; wxPoint* points_alloc = nullptr;
if ( m_mirror ) if ( m_mirror )
{ {
points_alloc = new wxPoint[n]; points_alloc = new wxPoint[n];
@ -256,9 +256,9 @@ protected:
virtual void DoGetTextExtent(const wxString& string, virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL, wxCoord *descent = nullptr,
wxCoord *externalLeading = NULL, wxCoord *externalLeading = nullptr,
const wxFont *theFont = NULL) const override const wxFont *theFont = nullptr) const override
{ {
// never mirrored // never mirrored
m_dc.DoGetTextExtent(string, x, y, descent, externalLeading, theFont); m_dc.DoGetTextExtent(string, x, y, descent, externalLeading, theFont);

View file

@ -21,7 +21,7 @@ public:
static bool StartDrawingOnTop(wxWindow * WXUNUSED(window)) static bool StartDrawingOnTop(wxWindow * WXUNUSED(window))
{ return true; } { return true; }
static bool StartDrawingOnTop(wxRect * WXUNUSED(rect) = NULL) static bool StartDrawingOnTop(wxRect * WXUNUSED(rect) = nullptr)
{ return true; } { return true; }
static bool EndDrawingOnTop() static bool EndDrawingOnTop()
{ return true; } { return true; }

View file

@ -135,7 +135,7 @@ public:
virtual void SetFont(const wxFont& font) override; virtual void SetFont(const wxFont& font) override;
virtual void SetPen(const wxPen& pen) override; virtual void SetPen(const wxPen& pen) override;
virtual void* GetHandle() const override { return NULL; } virtual void* GetHandle() const override { return nullptr; }
void SetBitmapHandler(wxSVGBitmapHandler* handler); void SetBitmapHandler(wxSVGBitmapHandler* handler);
@ -235,9 +235,9 @@ private:
virtual void DoGetTextExtent(const wxString& string, virtual void DoGetTextExtent(const wxString& string,
wxCoord* x, wxCoord* y, wxCoord* x, wxCoord* y,
wxCoord* descent = NULL, wxCoord* descent = nullptr,
wxCoord* externalLeading = NULL, wxCoord* externalLeading = nullptr,
const wxFont* theFont = NULL) const override; const wxFont* theFont = nullptr) const override;
virtual void DoSetDeviceClippingRegion(const wxRegion& region) override; virtual void DoSetDeviceClippingRegion(const wxRegion& region) override;

View file

@ -81,7 +81,7 @@ typedef void (*wxAssertHandler_t)(const wxString& file,
#if wxDEBUG_LEVEL #if wxDEBUG_LEVEL
// the global assert handler function, if it is NULL asserts don't check their // the global assert handler function, if it is null asserts don't check their
// conditions // conditions
extern WXDLLIMPEXP_DATA_BASE(wxAssertHandler_t) wxTheAssertHandler; extern WXDLLIMPEXP_DATA_BASE(wxAssertHandler_t) wxTheAssertHandler;
@ -99,7 +99,7 @@ extern WXDLLIMPEXP_DATA_BASE(wxAssertHandler_t) wxTheAssertHandler;
need to provide your assertion handler function. need to provide your assertion handler function.
This function also provides a simple way to disable all asserts: simply This function also provides a simple way to disable all asserts: simply
pass NULL pointer to it. Doing this will result in not even evaluating pass null pointer to it. Doing this will result in not even evaluating
assert conditions at all, avoiding almost all run-time cost of asserts. assert conditions at all, avoiding almost all run-time cost of asserts.
Notice that this function is not MT-safe, so you should call it before Notice that this function is not MT-safe, so you should call it before
@ -132,15 +132,15 @@ extern void WXDLLIMPEXP_BASE wxSetDefaultAssertHandler();
// defined // defined
inline wxAssertHandler_t wxSetAssertHandler(wxAssertHandler_t /* handler */) inline wxAssertHandler_t wxSetAssertHandler(wxAssertHandler_t /* handler */)
{ {
return NULL; return nullptr;
} }
inline void wxSetDefaultAssertHandler() { } inline void wxSetDefaultAssertHandler() { }
#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL #endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
// simply a synonym for wxSetAssertHandler(NULL) // simply a synonym for wxSetAssertHandler(nullptr)
inline void wxDisableAsserts() { wxSetAssertHandler(NULL); } inline void wxDisableAsserts() { wxSetAssertHandler(nullptr); }
/* /*
A macro which disables asserts for applications compiled in release build. A macro which disables asserts for applications compiled in release build.
@ -162,7 +162,7 @@ inline void wxDisableAsserts() { wxSetAssertHandler(NULL); }
overloads are needed because these macros can be used with or without wxT(). overloads are needed because these macros can be used with or without wxT().
All of them are implemented in src/common/appcmn.cpp and unconditionally All of them are implemented in src/common/appcmn.cpp and unconditionally
call wxTheAssertHandler so the caller must check that it is non-NULL call wxTheAssertHandler so the caller must check that it is non-null
(assert macros do it). (assert macros do it).
*/ */
@ -170,7 +170,7 @@ inline void wxDisableAsserts() { wxSetAssertHandler(NULL); }
// these overloads are the ones typically used by debugging macros: we have to // these overloads are the ones typically used by debugging macros: we have to
// provide wxChar* msg version because it's common to use wxT() in the macros // provide wxChar* msg version because it's common to use wxT() in the macros
// and finally, we can't use const wx(char)* msg = NULL, because that would // and finally, we can't use const wx(char)* msg = nullptr, because that would
// be ambiguous // be ambiguous
// //
// also notice that these functions can't be inline as wxString is not defined // also notice that these functions can't be inline as wxString is not defined
@ -200,7 +200,7 @@ extern WXDLLIMPEXP_BASE void wxOnAssert(const wxChar *file,
int line, int line,
const char *func, const char *func,
const wxChar *cond, const wxChar *cond,
const wxChar *msg = NULL); const wxChar *msg = nullptr);
// these overloads work when msg passed to debug macro is a string and we // these overloads work when msg passed to debug macro is a string and we
// also have to provide wxCStrData overload to resolve ambiguity which would // also have to provide wxCStrData overload to resolve ambiguity which would
@ -300,7 +300,7 @@ extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file,
// a version without any additional message, don't use unless condition // a version without any additional message, don't use unless condition
// itself is fully self-explanatory // itself is fully self-explanatory
#define wxASSERT(cond) wxASSERT_MSG(cond, (const char*)NULL) #define wxASSERT(cond) wxASSERT_MSG(cond, (const char*)nullptr)
// wxFAIL is a special form of assert: it always triggers (and so is // wxFAIL is a special form of assert: it always triggers (and so is
// usually used in normally unreachable code) // usually used in normally unreachable code)
@ -322,7 +322,7 @@ extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file,
wxFAIL_COND_MSG_AT(cond, msg, __FILE__, __LINE__, __WXFUNCTION__) wxFAIL_COND_MSG_AT(cond, msg, __FILE__, __LINE__, __WXFUNCTION__)
#define wxFAIL_MSG(msg) wxFAIL_COND_MSG("Assert failure", msg) #define wxFAIL_MSG(msg) wxFAIL_COND_MSG("Assert failure", msg)
#define wxFAIL wxFAIL_MSG((const char*)NULL) #define wxFAIL wxFAIL_MSG((const char*)nullptr)
#else // !wxDEBUG_LEVEL #else // !wxDEBUG_LEVEL
#define wxTrap() #define wxTrap()
@ -357,10 +357,10 @@ extern void WXDLLIMPEXP_BASE wxAbort();
debug level 1 -- they call the assert handler if the condition is false debug level 1 -- they call the assert handler if the condition is false
They are supposed to be used only in invalid situation: for example, an They are supposed to be used only in invalid situation: for example, an
invalid parameter (e.g. a NULL pointer) is passed to a function. Instead of invalid parameter (e.g. a null pointer) is passed to a function. Instead of
dereferencing it and causing core dump the function might use dereferencing it and causing core dump the function might use
wxCHECK_RET( p != NULL, "pointer can't be NULL" ) wxCHECK_RET( p != nullptr, "pointer can't be null" )
*/ */
// the generic macro: takes the condition to check, the statement to be executed // the generic macro: takes the condition to check, the statement to be executed
@ -379,10 +379,10 @@ extern void WXDLLIMPEXP_BASE wxAbort();
#define wxCHECK_MSG(cond, rc, msg) wxCHECK2_MSG(cond, return rc, msg) #define wxCHECK_MSG(cond, rc, msg) wxCHECK2_MSG(cond, return rc, msg)
// check that expression is true, "return" if not (also FAILs in debug mode) // check that expression is true, "return" if not (also FAILs in debug mode)
#define wxCHECK(cond, rc) wxCHECK_MSG(cond, rc, (const char*)NULL) #define wxCHECK(cond, rc) wxCHECK_MSG(cond, rc, (const char*)nullptr)
// check that expression is true, perform op if not // check that expression is true, perform op if not
#define wxCHECK2(cond, op) wxCHECK2_MSG(cond, op, (const char*)NULL) #define wxCHECK2(cond, op) wxCHECK2_MSG(cond, op, (const char*)nullptr)
// special form of wxCHECK2: as wxCHECK, but for use in void functions // special form of wxCHECK2: as wxCHECK, but for use in void functions
// //

View file

@ -707,9 +707,7 @@ typedef short int WXTYPE;
wxDEPRECATED(func) { body } wxDEPRECATED(func) { body }
#endif #endif
/* NULL declaration: it must be defined as 0 for C++ programs (in particular, */ /* Get size_t declaration. */
/* it must not be defined as "(void *)0" which is standard for C but completely */
/* breaks C++ code) */
#include <stddef.h> #include <stddef.h>
/* size of statically declared array */ /* size of statically declared array */
@ -852,29 +850,29 @@ typedef short int WXTYPE;
// everybody gets the assert and other debug macros // everybody gets the assert and other debug macros
#include "wx/debug.h" #include "wx/debug.h"
// delete pointer if it is not NULL and NULL it afterwards // delete pointer if it is not null and null it afterwards
template <typename T> template <typename T>
inline void wxDELETE(T*& ptr) inline void wxDELETE(T*& ptr)
{ {
typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED; typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
if ( ptr != NULL ) if ( ptr != nullptr )
{ {
delete ptr; delete ptr;
ptr = NULL; ptr = nullptr;
} }
} }
// delete an array and NULL it (see comments above) // delete an array and null it (see comments above)
template <typename T> template <typename T>
inline void wxDELETEA(T*& ptr) inline void wxDELETEA(T*& ptr)
{ {
typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED; typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
if ( ptr != NULL ) if ( ptr != nullptr )
{ {
delete [] ptr; delete [] ptr;
ptr = NULL; ptr = nullptr;
} }
} }
@ -973,16 +971,10 @@ typedef double wxDouble;
#endif /* wxWCHAR_T_IS_REAL_TYPE/!wxWCHAR_T_IS_REAL_TYPE */ #endif /* wxWCHAR_T_IS_REAL_TYPE/!wxWCHAR_T_IS_REAL_TYPE */
/* /*
This constant should be used instead of NULL in vararg functions taking Deprecated constant existing only for compatibility, use nullptr directly in
wxChar* arguments: passing NULL (which is the same as 0, unless the compiler the new code.
defines it specially, e.g. like gcc does with its __null built-in) doesn't
work in this case as va_arg() wouldn't interpret the integer 0 correctly
when trying to convert it to a pointer on architectures where sizeof(int) is
strictly less than sizeof(void *).
Examples of places where this must be used include wxFileTypeInfo ctor.
*/ */
#define wxNullPtr ((void *)NULL) #define wxNullPtr nullptr
/* Define wxChar16 and wxChar32 */ /* Define wxChar16 and wxChar32 */

View file

@ -59,7 +59,7 @@ public:
virtual wxBitmap GetSubBitmap(const wxRect& rect) const; virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
virtual bool SaveFile(const wxString &name, wxBitmapType type, virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = NULL) const; const wxPalette *palette = nullptr) const;
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
#if wxUSE_PALETTE #if wxUSE_PALETTE

View file

@ -25,14 +25,14 @@ class WXDLLIMPEXP_CORE wxDFBDCImpl : public wxDCImpl
{ {
public: public:
// ctors // ctors
wxDFBDCImpl(wxDC *owner) : wxDCImpl(owner) { m_surface = NULL; } wxDFBDCImpl(wxDC *owner) : wxDCImpl(owner) { m_surface = nullptr; }
wxDFBDCImpl(wxDC *owner, const wxIDirectFBSurfacePtr& surface) wxDFBDCImpl(wxDC *owner, const wxIDirectFBSurfacePtr& surface)
: wxDCImpl(owner) : wxDCImpl(owner)
{ {
DFBInit(surface); DFBInit(surface);
} }
bool IsOk() const { return m_surface != NULL; } bool IsOk() const { return m_surface != nullptr; }
// implement base class pure virtuals // implement base class pure virtuals
// ---------------------------------- // ----------------------------------
@ -62,9 +62,9 @@ public:
virtual wxCoord GetCharWidth() const; virtual wxCoord GetCharWidth() const;
virtual void DoGetTextExtent(const wxString& string, virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL, wxCoord *descent = nullptr,
wxCoord *externalLeading = NULL, wxCoord *externalLeading = nullptr,
const wxFont *theFont = NULL) const; const wxFont *theFont = nullptr) const;
virtual bool CanDrawBitmap() const { return true; } virtual bool CanDrawBitmap() const { return true; }
virtual bool CanGetTextExtent() const { return true; } virtual bool CanGetTextExtent() const { return true; }

View file

@ -26,7 +26,7 @@ public:
virtual ~wxWindowDCImpl(); virtual ~wxWindowDCImpl();
protected: protected:
// initializes the DC for painting on given window; if rect!=NULL, then // initializes the DC for painting on given window; if rect!=nullptr, then
// for painting only on the given region of the window // for painting only on the given region of the window
void InitForWin(wxWindow *win, const wxRect *rect); void InitForWin(wxWindow *win, const wxRect *rect);

View file

@ -54,7 +54,7 @@ public:
Takes ownership of @a ptr, i.e. AddRef() is @em not called on it. Takes ownership of @a ptr, i.e. AddRef() is @em not called on it.
*/ */
wxDfbPtr(T *ptr = NULL) : m_ptr(ptr) {} wxDfbPtr(T *ptr = nullptr) : m_ptr(ptr) {}
/// Copy ctor /// Copy ctor
wxDfbPtr(const wxDfbPtr& ptr) { InitFrom(ptr); } wxDfbPtr(const wxDfbPtr& ptr) { InitFrom(ptr); }
@ -62,13 +62,13 @@ public:
/// Dtor. Releases the interface /// Dtor. Releases the interface
~wxDfbPtr() { Reset(); } ~wxDfbPtr() { Reset(); }
/// Resets the pointer to NULL, decreasing reference count of the interface. /// Resets the pointer to nullptr, decreasing reference count of the interface.
void Reset() void Reset()
{ {
if ( m_ptr ) if ( m_ptr )
{ {
this->DoRelease((wxDfbWrapperBase*)m_ptr); this->DoRelease((wxDfbWrapperBase*)m_ptr);
m_ptr = NULL; m_ptr = nullptr;
} }
} }

View file

@ -72,7 +72,7 @@ public:
virtual void WarpPointer(int x, int y); virtual void WarpPointer(int x, int y);
virtual void Refresh(bool eraseBackground = true, virtual void Refresh(bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL); const wxRect *rect = nullptr);
virtual void Update(); virtual void Update();
virtual bool SetCursor(const wxCursor &cursor); virtual bool SetCursor(const wxCursor &cursor);
@ -105,9 +105,9 @@ protected:
// implement the base class pure virtuals // implement the base class pure virtuals
virtual void DoGetTextExtent(const wxString& string, virtual void DoGetTextExtent(const wxString& string,
int *x, int *y, int *x, int *y,
int *descent = NULL, int *descent = nullptr,
int *externalLeading = NULL, int *externalLeading = nullptr,
const wxFont *theFont = NULL) const; const wxFont *theFont = nullptr) const;
virtual void DoClientToScreen(int *x, int *y) const; virtual void DoClientToScreen(int *x, int *y) const;
virtual void DoScreenToClient(int *x, int *y) const; virtual void DoScreenToClient(int *x, int *y) const;
virtual void DoGetPosition(int *x, int *y) const; virtual void DoGetPosition(int *x, int *y) const;
@ -178,7 +178,7 @@ private:
// don't access it directly) // don't access it directly)
wxRect m_rect; wxRect m_rect;
// overlays for this window (or NULL if it doesn't have any) // overlays for this window (or nullptr if it doesn't have any)
wxDfbOverlaysList *m_overlays; wxDfbOverlaysList *m_overlays;
friend class wxNonOwnedWindow; // for HandleXXXEvent friend class wxNonOwnedWindow; // for HandleXXXEvent

View file

@ -126,7 +126,7 @@ protected:
The wrapper provides same API as DirectFB, with a few exceptions: The wrapper provides same API as DirectFB, with a few exceptions:
- methods return true/false instead of error code - methods return true/false instead of error code
- methods that return or create another interface return pointer to the - methods that return or create another interface return pointer to the
interface (or NULL on failure) instead of storing it in the last interface (or nullptr on failure) instead of storing it in the last
argument argument
- interface arguments use wxFooPtr type instead of raw DirectFB pointer - interface arguments use wxFooPtr type instead of raw DirectFB pointer
- methods taking flags use int type instead of an enum when the flags - methods taking flags use int type instead of an enum when the flags
@ -245,9 +245,9 @@ struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface>
/** /**
Updates the front buffer from the back buffer. If @a region is not Updates the front buffer from the back buffer. If @a region is not
NULL, only given rectangle is updated. nullptr, only given rectangle is updated.
*/ */
bool FlipToFront(const DFBRegion *region = NULL); bool FlipToFront(const DFBRegion *region = nullptr);
wxIDirectFBSurfacePtr GetSubSurface(const DFBRectangle *rect) wxIDirectFBSurfacePtr GetSubSurface(const DFBRectangle *rect)
{ {
@ -255,7 +255,7 @@ struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface>
if ( Check(m_ptr->GetSubSurface(m_ptr, rect, &s)) ) if ( Check(m_ptr->GetSubSurface(m_ptr, rect, &s)) )
return new wxIDirectFBSurface(s); return new wxIDirectFBSurface(s);
else else
return NULL; return nullptr;
} }
wxIDirectFBPalettePtr GetPalette() wxIDirectFBPalettePtr GetPalette()
@ -264,7 +264,7 @@ struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface>
if ( Check(m_ptr->GetPalette(m_ptr, &s)) ) if ( Check(m_ptr->GetPalette(m_ptr, &s)) )
return new wxIDirectFBPalette(s); return new wxIDirectFBPalette(s);
else else
return NULL; return nullptr;
} }
bool SetPalette(const wxIDirectFBPalettePtr& pal) bool SetPalette(const wxIDirectFBPalettePtr& pal)
@ -336,7 +336,7 @@ struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface>
: m_surface(surface) : m_surface(surface)
{ {
if ( !surface->Lock(flags, &ptr, &pitch) ) if ( !surface->Lock(flags, &ptr, &pitch) )
ptr = NULL; ptr = nullptr;
} }
~Locked() ~Locked()
@ -415,7 +415,7 @@ struct wxIDirectFBWindow : public wxDfbWrapper<IDirectFBWindow>
if ( Check(m_ptr->GetSurface(m_ptr, &s)) ) if ( Check(m_ptr->GetSurface(m_ptr, &s)) )
return new wxIDirectFBSurface(s); return new wxIDirectFBSurface(s);
else else
return NULL; return nullptr;
} }
bool AttachEventBuffer(const wxIDirectFBEventBufferPtr& buffer) bool AttachEventBuffer(const wxIDirectFBEventBufferPtr& buffer)
@ -443,7 +443,7 @@ struct wxIDirectFBDisplayLayer : public wxDfbWrapper<IDirectFBDisplayLayer>
if ( Check(m_ptr->CreateWindow(m_ptr, desc, &w)) ) if ( Check(m_ptr->CreateWindow(m_ptr, desc, &w)) )
return new wxIDirectFBWindow(w); return new wxIDirectFBWindow(w);
else else
return NULL; return nullptr;
} }
bool GetConfiguration(DFBDisplayLayerConfig *config) bool GetConfiguration(DFBDisplayLayerConfig *config)
@ -466,7 +466,7 @@ struct wxIDirectFBDisplayLayer : public wxDfbWrapper<IDirectFBDisplayLayer>
struct wxIDirectFB : public wxDfbWrapper<IDirectFB> struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
{ {
/** /**
Returns pointer to DirectFB singleton object, it never returns NULL Returns pointer to DirectFB singleton object, it never returns nullptr
after wxApp was initialized. The object is cached, so calling this after wxApp was initialized. The object is cached, so calling this
method is cheap. method is cheap.
*/ */
@ -485,7 +485,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->CreateSurface(m_ptr, desc, &s)) ) if ( Check(m_ptr->CreateSurface(m_ptr, desc, &s)) )
return new wxIDirectFBSurface(s); return new wxIDirectFBSurface(s);
else else
return NULL; return nullptr;
} }
wxIDirectFBEventBufferPtr CreateEventBuffer() wxIDirectFBEventBufferPtr CreateEventBuffer()
@ -494,7 +494,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->CreateEventBuffer(m_ptr, &b)) ) if ( Check(m_ptr->CreateEventBuffer(m_ptr, &b)) )
return new wxIDirectFBEventBuffer(b); return new wxIDirectFBEventBuffer(b);
else else
return NULL; return nullptr;
} }
wxIDirectFBFontPtr CreateFont(const char *filename, wxIDirectFBFontPtr CreateFont(const char *filename,
@ -504,7 +504,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->CreateFont(m_ptr, filename, desc, &f)) ) if ( Check(m_ptr->CreateFont(m_ptr, filename, desc, &f)) )
return new wxIDirectFBFont(f); return new wxIDirectFBFont(f);
else else
return NULL; return nullptr;
} }
wxIDirectFBDisplayLayerPtr wxIDirectFBDisplayLayerPtr
@ -514,7 +514,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->GetDisplayLayer(m_ptr, id, &l)) ) if ( Check(m_ptr->GetDisplayLayer(m_ptr, id, &l)) )
return new wxIDirectFBDisplayLayer(l); return new wxIDirectFBDisplayLayer(l);
else else
return NULL; return nullptr;
} }
/// Returns primary surface /// Returns primary surface

View file

@ -104,7 +104,7 @@ public:
// not set yet and hence must be passed explicitly to it so that we could // not set yet and hence must be passed explicitly to it so that we could
// check whether it contains wxDIALOG_NO_PARENT bit. // check whether it contains wxDIALOG_NO_PARENT bit.
// //
// This function always returns a valid top level window or NULL. // This function always returns a valid top level window or nullptr.
wxWindow *GetParentForModalDialog(wxWindow *parent, long style) const wxWindow *GetParentForModalDialog(wxWindow *parent, long style) const
{ {
return DoGetParentForDialog(wxDIALOG_MODALITY_APP_MODAL, parent, style); return DoGetParentForDialog(wxDIALOG_MODALITY_APP_MODAL, parent, style);
@ -142,7 +142,7 @@ public:
// returns a horizontal wxBoxSizer containing the given buttons // returns a horizontal wxBoxSizer containing the given buttons
// //
// notice that the returned sizer can be NULL if no buttons are put in the // notice that the returned sizer can be null if no buttons are put in the
// sizer (this mostly happens under smart phones and other atypical // sizer (this mostly happens under smart phones and other atypical
// platforms which have hardware buttons replacing OK/Cancel and such) // platforms which have hardware buttons replacing OK/Cancel and such)
wxSizer *CreateButtonSizer(long flags); wxSizer *CreateButtonSizer(long flags);
@ -171,7 +171,7 @@ public:
// Returns a content window if there is one. This can be used by the layout adapter, for // Returns a content window if there is one. This can be used by the layout adapter, for
// example to make the pages of a book control into scrolling windows // example to make the pages of a book control into scrolling windows
virtual wxWindow* GetContentWindow() const { return NULL; } virtual wxWindow* GetContentWindow() const { return nullptr; }
// Add an id to the list of main button identifiers that should be in the button sizer // Add an id to the list of main button identifiers that should be in the button sizer
void AddMainButtonId(wxWindowID id) { m_mainButtonIds.Add((int) id); } void AddMainButtonId(wxWindowID id) { m_mainButtonIds.Add((int) id); }
@ -262,7 +262,7 @@ private:
long style) const; long style) const;
// helper of DoGetParentForDialog(): returns the passed in window if it // helper of DoGetParentForDialog(): returns the passed in window if it
// can be used as parent for this kind of dialog or NULL if it can't // can be used as parent for this kind of dialog or nullptr if it can't
wxWindow *CheckIfCanBeUsedAsParent(wxDialogModality modality, wxWindow *CheckIfCanBeUsedAsParent(wxDialogModality modality,
wxWindow *parent) const; wxWindow *parent) const;
@ -349,8 +349,8 @@ public:
#endif // wxUSE_BUTTON #endif // wxUSE_BUTTON
// Reparent the controls to the scrolled window, except those in buttonSizer // Reparent the controls to the scrolled window, except those in buttonSizer
virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL); virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = nullptr);
static void DoReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL); static void DoReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = nullptr);
// A function to fit the dialog around its contents, and then adjust for screen size. // A function to fit the dialog around its contents, and then adjust for screen size.
// If scrolled windows are passed, scrolling is enabled in the required orientation(s). // If scrolled windows are passed, scrolling is enabled in the required orientation(s).

View file

@ -96,7 +96,7 @@ public:
// ----- // -----
// default, use Open() // default, use Open()
wxDir() { m_data = NULL; } wxDir() { m_data = nullptr; }
// opens the directory for enumeration, use IsOpened() to test success // opens the directory for enumeration, use IsOpened() to test success
wxDir(const wxString& dir); wxDir(const wxString& dir);
@ -162,7 +162,7 @@ public:
#if wxUSE_LONGLONG #if wxUSE_LONGLONG
// returns the size of all directories recursively found in given path // returns the size of all directories recursively found in given path
static wxULongLong GetTotalSize(const wxString &dir, wxArrayString *filesSkipped = NULL); static wxULongLong GetTotalSize(const wxString &dir, wxArrayString *filesSkipped = nullptr);
#endif // wxUSE_LONGLONG #endif // wxUSE_LONGLONG

View file

@ -136,7 +136,7 @@ wxDirSelector(const wxString& message = wxASCII_STR(wxDirSelectorPromptStr),
const wxString& defaultPath = wxEmptyString, const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE, long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
wxWindow *parent = NULL); wxWindow *parent = nullptr);
#endif // wxUSE_DIRDLG #endif // wxUSE_DIRDLG

View file

@ -73,7 +73,7 @@ public:
// return true if the object was initialized successfully // return true if the object was initialized successfully
bool IsOk() const { return m_impl != NULL; } bool IsOk() const { return m_impl != nullptr; }
// get the full display size // get the full display size
wxRect GetGeometry() const; wxRect GetGeometry() const;

View file

@ -42,7 +42,7 @@ public:
public: public:
compatibility_iterator() compatibility_iterator()
: m_iter(), m_list( NULL ) {} : m_iter(), m_list( nullptr ) {}
compatibility_iterator( ListType* li, iterator i ) compatibility_iterator( ListType* li, iterator i )
: m_iter( i ), m_list( li ) {} : m_iter( i ), m_list( li ) {}
compatibility_iterator( const ListType* li, iterator i ) compatibility_iterator( const ListType* li, iterator i )
@ -206,10 +206,10 @@ public:
class Node class Node
{ {
public: public:
Node(wxDList<T> *list = NULL, Node(wxDList<T> *list = nullptr,
Node *previous = NULL, Node *previous = nullptr,
Node *next = NULL, Node *next = nullptr,
T *data = NULL) T *data = nullptr)
{ {
m_list = list; m_list = list;
m_previous = previous; m_previous = previous;
@ -226,7 +226,7 @@ public:
// handle the case when we're being deleted from the list by // handle the case when we're being deleted from the list by
// the user (i.e. not by the list itself from DeleteNode) - // the user (i.e. not by the list itself from DeleteNode) -
// we must do it for compatibility with old code // we must do it for compatibility with old code
if (m_list != NULL) if (m_list != nullptr)
m_list->DetachNode(this); m_list->DetachNode(this);
} }
@ -267,7 +267,7 @@ public:
class compatibility_iterator class compatibility_iterator
{ {
public: public:
compatibility_iterator(nodetype *ptr = NULL) : m_ptr(ptr) { } compatibility_iterator(nodetype *ptr = nullptr) : m_ptr(ptr) { }
nodetype *operator->() const { return m_ptr; } nodetype *operator->() const { return m_ptr; }
operator nodetype *() const { return m_ptr; } operator nodetype *() const { return m_ptr; }
@ -279,7 +279,7 @@ private:
void Init() void Init()
{ {
m_nodeFirst = m_nodeFirst =
m_nodeLast = NULL; m_nodeLast = nullptr;
m_count = 0; m_count = 0;
m_destroy = false; m_destroy = false;
} }
@ -289,7 +289,7 @@ private:
if ( m_destroy ) if ( m_destroy )
node->DeleteData(); node->DeleteData();
// so that the node knows that it's being deleted by the list // so that the node knows that it's being deleted by the list
node->m_list = NULL; node->m_list = nullptr;
delete node; delete node;
} }
@ -328,7 +328,7 @@ public:
~wxDList() ~wxDList()
{ {
nodetype *each = m_nodeFirst; nodetype *each = m_nodeFirst;
while ( each != NULL ) while ( each != nullptr )
{ {
nodetype *next = each->GetNext(); nodetype *next = each->GetNext();
DoDeleteNode(each); DoDeleteNode(each);
@ -342,8 +342,8 @@ public:
"copying list which owns it's elements is a bad idea" ); "copying list which owns it's elements is a bad idea" );
Clear(); Clear();
m_destroy = list.m_destroy; m_destroy = list.m_destroy;
m_nodeFirst = NULL; m_nodeFirst = nullptr;
m_nodeLast = NULL; m_nodeLast = nullptr;
nodetype* node; nodetype* node;
for (node = list.GetFirst(); node; node = node->GetNext() ) for (node = list.GetFirst(); node; node = node->GetNext() )
Append(node->GetData()); Append(node->GetData());
@ -352,7 +352,7 @@ public:
nodetype *Append( T *object ) nodetype *Append( T *object )
{ {
nodetype *node = new nodetype( this, m_nodeLast, NULL, object ); nodetype *node = new nodetype( this, m_nodeLast, nullptr, object );
if ( !m_nodeFirst ) if ( !m_nodeFirst )
{ {
@ -370,7 +370,7 @@ public:
nodetype *Insert( T* object ) nodetype *Insert( T* object )
{ {
return Insert( NULL, object ); return Insert( nullptr, object );
} }
nodetype *Insert( size_t pos, T* object ) nodetype *Insert( size_t pos, T* object )
@ -383,7 +383,7 @@ public:
nodetype *Insert( nodetype *position, T* object ) nodetype *Insert( nodetype *position, T* object )
{ {
wxCHECK_MSG( !position || position->m_list == this, NULL, wxCHECK_MSG( !position || position->m_list == this, nullptr,
"can't insert before a node from another list" ); "can't insert before a node from another list" );
// previous and next node for the node being inserted // previous and next node for the node being inserted
@ -396,13 +396,13 @@ public:
else else
{ {
// inserting in the beginning of the list // inserting in the beginning of the list
prev = NULL; prev = nullptr;
next = m_nodeFirst; next = m_nodeFirst;
} }
nodetype *node = new nodetype( this, prev, next, object ); nodetype *node = new nodetype( this, prev, next, object );
if ( !m_nodeFirst ) if ( !m_nodeFirst )
m_nodeLast = node; m_nodeLast = node;
if ( prev == NULL ) if ( prev == nullptr )
m_nodeFirst = node; m_nodeFirst = node;
m_count++; m_count++;
return node; return node;
@ -424,19 +424,19 @@ public:
return current; return current;
} }
wxFAIL_MSG( "invalid index in Item()" ); wxFAIL_MSG( "invalid index in Item()" );
return NULL; return nullptr;
} }
T *operator[](size_t index) const T *operator[](size_t index) const
{ {
nodetype *node = Item(index); nodetype *node = Item(index);
return node ? node->GetData() : NULL; return node ? node->GetData() : nullptr;
} }
nodetype *DetachNode( nodetype *node ) nodetype *DetachNode( nodetype *node )
{ {
wxCHECK_MSG( node, NULL, "detaching NULL wxNodeBase" ); wxCHECK_MSG( node, nullptr, "detaching null wxNodeBase" );
wxCHECK_MSG( node->m_list == this, NULL, wxCHECK_MSG( node->m_list == this, nullptr,
"detaching node which is not from this list" ); "detaching node which is not from this list" );
// update the list // update the list
nodetype **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next nodetype **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next
@ -447,7 +447,7 @@ public:
*nextPrev = node->GetPrevious(); *nextPrev = node->GetPrevious();
m_count--; m_count--;
// mark the node as not belonging to this list any more // mark the node as not belonging to this list any more
node->m_list = NULL; node->m_list = nullptr;
return node; return node;
} }
@ -486,7 +486,7 @@ public:
return current; return current;
} }
// not found // not found
return NULL; return nullptr;
} }
int IndexOf(const T *object) const int IndexOf(const T *object) const
@ -511,7 +511,7 @@ public:
current = next; current = next;
} }
m_nodeFirst = m_nodeFirst =
m_nodeLast = NULL; m_nodeLast = nullptr;
m_count = 0; m_count = 0;
} }
@ -556,7 +556,7 @@ public:
if ( (*F)(current->GetData()) ) if ( (*F)(current->GetData()) )
return current->GetData(); return current->GetData();
} }
return NULL; return nullptr;
} }
T *LastThat(wxListIterateFunction F) T *LastThat(wxListIterateFunction F)
@ -566,7 +566,7 @@ public:
if ( (*F)(current->GetData()) ) if ( (*F)(current->GetData()) )
return current->GetData(); return current->GetData();
} }
return NULL; return nullptr;
} }
/* STL interface */ /* STL interface */
@ -593,7 +593,7 @@ public:
typedef ptr_type pointer_type; typedef ptr_type pointer_type;
iterator(Node* node, Node* init) : m_node(node), m_init(init) {} iterator(Node* node, Node* init) : m_node(node), m_init(init) {}
iterator() : m_node(NULL), m_init(NULL) { } iterator() : m_node(nullptr), m_init(nullptr) { }
reference_type operator*() const reference_type operator*() const
{ return *m_node->GetDataPtr(); } { return *m_node->GetDataPtr(); }
// ptrop // ptrop
@ -633,7 +633,7 @@ public:
const_iterator(Node* node, Node* init) const_iterator(Node* node, Node* init)
: m_node(node), m_init(init) { } : m_node(node), m_init(init) { }
const_iterator() : m_node(NULL), m_init(NULL) { } const_iterator() : m_node(nullptr), m_init(nullptr) { }
const_iterator(const iterator& it) const_iterator(const iterator& it)
: m_node(it.m_node), m_init(it.m_init) { } : m_node(it.m_node), m_init(it.m_init) { }
reference_type operator*() const reference_type operator*() const
@ -676,7 +676,7 @@ public:
reverse_iterator(Node* node, Node* init) reverse_iterator(Node* node, Node* init)
: m_node(node), m_init(init) { } : m_node(node), m_init(init) { }
reverse_iterator() : m_node(NULL), m_init(NULL) { } reverse_iterator() : m_node(nullptr), m_init(nullptr) { }
reference_type operator*() const reference_type operator*() const
{ return *m_node->GetDataPtr(); } { return *m_node->GetDataPtr(); }
// ptrop // ptrop
@ -715,7 +715,7 @@ public:
const_reverse_iterator(Node* node, Node* init) const_reverse_iterator(Node* node, Node* init)
: m_node(node), m_init(init) { } : m_node(node), m_init(init) { }
const_reverse_iterator() : m_node(NULL), m_init(NULL) { } const_reverse_iterator() : m_node(nullptr), m_init(nullptr) { }
const_reverse_iterator(const reverse_iterator& it) const_reverse_iterator(const reverse_iterator& it)
: m_node(it.m_node), m_init(it.m_init) { } : m_node(it.m_node), m_init(it.m_init) { }
reference_type operator*() const reference_type operator*() const
@ -746,15 +746,15 @@ public:
iterator begin() { return iterator(GetFirst(), GetLast()); } iterator begin() { return iterator(GetFirst(), GetLast()); }
const_iterator begin() const const_iterator begin() const
{ return const_iterator(GetFirst(), GetLast()); } { return const_iterator(GetFirst(), GetLast()); }
iterator end() { return iterator(NULL, GetLast()); } iterator end() { return iterator(nullptr, GetLast()); }
const_iterator end() const { return const_iterator(NULL, GetLast()); } const_iterator end() const { return const_iterator(nullptr, GetLast()); }
reverse_iterator rbegin() reverse_iterator rbegin()
{ return reverse_iterator(GetLast(), GetFirst()); } { return reverse_iterator(GetLast(), GetFirst()); }
const_reverse_iterator rbegin() const const_reverse_iterator rbegin() const
{ return const_reverse_iterator(GetLast(), GetFirst()); } { return const_reverse_iterator(GetLast(), GetFirst()); }
reverse_iterator rend() { return reverse_iterator(NULL, GetFirst()); } reverse_iterator rend() { return reverse_iterator(nullptr, GetFirst()); }
const_reverse_iterator rend() const const_reverse_iterator rend() const
{ return const_reverse_iterator(NULL, GetFirst()); } { return const_reverse_iterator(nullptr, GetFirst()); }
void resize(size_type n, value_type v = value_type()) void resize(size_type n, value_type v = value_type())
{ {
while (n < size()) while (n < size())

View file

@ -62,7 +62,7 @@ public:
: m_cursorCopy(cursorCopy), : m_cursorCopy(cursorCopy),
m_cursorMove(cursorMove), m_cursorMove(cursorMove),
m_cursorStop(cursorStop) m_cursorStop(cursorStop)
{ m_data = NULL; } { m_data = nullptr; }
virtual ~wxDropSourceBase() { } virtual ~wxDropSourceBase() { }
// set the data which is transferred by drag and drop // set the data which is transferred by drag and drop
@ -134,7 +134,7 @@ public:
// ctor takes a pointer to heap-allocated wxDataObject which will be owned // ctor takes a pointer to heap-allocated wxDataObject which will be owned
// by wxDropTarget and deleted by it automatically. If you don't give it // by wxDropTarget and deleted by it automatically. If you don't give it
// here, you can use SetDataObject() later. // here, you can use SetDataObject() later.
wxDropTargetBase(wxDataObject *dataObject = NULL) wxDropTargetBase(wxDataObject *dataObject = nullptr)
{ m_dataObject = dataObject; m_defaultAction = wxDragNone; } { m_dataObject = dataObject; m_defaultAction = wxDragNone; }
// dtor deletes our data object // dtor deletes our data object
virtual ~wxDropTargetBase() virtual ~wxDropTargetBase()

View file

@ -67,7 +67,7 @@ typedef wxVector<wxDocTemplate*> wxDocTemplateVector;
class WXDLLIMPEXP_CORE wxDocument : public wxEvtHandler class WXDLLIMPEXP_CORE wxDocument : public wxEvtHandler
{ {
public: public:
wxDocument(wxDocument *parent = NULL); wxDocument(wxDocument *parent = nullptr);
virtual ~wxDocument(); virtual ~wxDocument();
// accessors // accessors
@ -159,7 +159,7 @@ public:
wxView *GetFirstView() const; wxView *GetFirstView() const;
virtual void UpdateAllViews(wxView *sender = NULL, wxObject *hint = NULL); virtual void UpdateAllViews(wxView *sender = nullptr, wxObject *hint = nullptr);
virtual void NotifyClosing(); virtual void NotifyClosing();
// Remove all views (because we're closing the document) // Remove all views (because we're closing the document)
@ -183,7 +183,7 @@ public:
// Returns true if this document is a child document corresponding to a // Returns true if this document is a child document corresponding to a
// part of the parent document and not a disk file as usual. // part of the parent document and not a disk file as usual.
bool IsChildDocument() const { return m_documentParent != NULL; } bool IsChildDocument() const { return m_documentParent != nullptr; }
// Ask the user if the document should be saved if it's modified and save // Ask the user if the document should be saved if it's modified and save
// it if necessary. // it if necessary.
@ -199,7 +199,7 @@ protected:
wxDocTemplate* m_documentTemplate; wxDocTemplate* m_documentTemplate;
bool m_documentModified; bool m_documentModified;
// if the document parent is non-NULL, it's a pseudo-document corresponding // if the document parent is non-null, it's a pseudo-document corresponding
// to a part of the parent document which can't be saved or loaded // to a part of the parent document which can't be saved or loaded
// independently of its parent and is always closed when its parent is // independently of its parent and is always closed when its parent is
wxDocument* m_documentParent; wxDocument* m_documentParent;
@ -245,7 +245,7 @@ public:
wxView *deactiveView); wxView *deactiveView);
virtual void OnDraw(wxDC *dc) = 0; virtual void OnDraw(wxDC *dc) = 0;
virtual void OnPrint(wxDC *dc, wxObject *info); virtual void OnPrint(wxDC *dc, wxObject *info);
virtual void OnUpdate(wxView *sender, wxObject *hint = NULL); virtual void OnUpdate(wxView *sender, wxObject *hint = nullptr);
virtual void OnClosingDocument() {} virtual void OnClosingDocument() {}
virtual void OnChangeFilename(); virtual void OnChangeFilename();
@ -280,7 +280,7 @@ public:
// destroyed // destroyed
void SetDocChildFrame(wxDocChildFrameAnyBase *docChildFrame); void SetDocChildFrame(wxDocChildFrameAnyBase *docChildFrame);
// get the associated frame, may be NULL during destruction // get the associated frame, may be null during destruction
wxDocChildFrameAnyBase* GetDocChildFrame() const { return m_docChildFrame; } wxDocChildFrameAnyBase* GetDocChildFrame() const { return m_docChildFrame; }
protected: protected:
@ -314,8 +314,8 @@ public:
const wxString& ext, const wxString& ext,
const wxString& docTypeName, const wxString& docTypeName,
const wxString& viewTypeName, const wxString& viewTypeName,
wxClassInfo *docClassInfo = NULL, wxClassInfo *docClassInfo = nullptr,
wxClassInfo *viewClassInfo = NULL, wxClassInfo *viewClassInfo = nullptr,
long flags = wxDEFAULT_TEMPLATE_FLAGS); long flags = wxDEFAULT_TEMPLATE_FLAGS);
virtual ~wxDocTemplate(); virtual ~wxDocTemplate();
@ -446,10 +446,10 @@ public:
void AssociateTemplate(wxDocTemplate *temp); void AssociateTemplate(wxDocTemplate *temp);
void DisassociateTemplate(wxDocTemplate *temp); void DisassociateTemplate(wxDocTemplate *temp);
// Find template from document class info, may return NULL. // Find template from document class info, may return nullptr.
wxDocTemplate* FindTemplate(const wxClassInfo* documentClassInfo); wxDocTemplate* FindTemplate(const wxClassInfo* documentClassInfo);
// Find document from file name, may return NULL. // Find document from file name, may return nullptr.
wxDocument* FindDocumentByPath(const wxString& path) const; wxDocument* FindDocumentByPath(const wxString& path) const;
wxDocument *GetCurrentDocument() const; wxDocument *GetCurrentDocument() const;
@ -476,7 +476,7 @@ public:
virtual wxView *GetCurrentView() const { return m_currentView; } virtual wxView *GetCurrentView() const { return m_currentView; }
// This method tries to find an active view harder than GetCurrentView(): // This method tries to find an active view harder than GetCurrentView():
// if the latter is NULL, it also checks if we don't have just a single // if the latter is null, it also checks if we don't have just a single
// view and returns it then. // view and returns it then.
wxView *GetAnyUsableView() const; wxView *GetAnyUsableView() const;
@ -576,10 +576,10 @@ public:
// default ctor, use Create() after it // default ctor, use Create() after it
wxDocChildFrameAnyBase() wxDocChildFrameAnyBase()
{ {
m_childDocument = NULL; m_childDocument = nullptr;
m_childView = NULL; m_childView = nullptr;
m_win = NULL; m_win = nullptr;
m_lastEvent = NULL; m_lastEvent = nullptr;
} }
// full ctor equivalent to using the default one and Create() // full ctor equivalent to using the default one and Create()
@ -611,7 +611,7 @@ public:
// prevent the view from deleting us if we're being deleted directly // prevent the view from deleting us if we're being deleted directly
// (and not via Close() + Destroy()) // (and not via Close() + Destroy())
if ( m_childView ) if ( m_childView )
m_childView->SetDocChildFrame(NULL); m_childView->SetDocChildFrame(nullptr);
} }
wxDocument *GetDocument() const { return m_childDocument; } wxDocument *GetDocument() const { return m_childDocument; }
@ -808,7 +808,7 @@ public:
wxDocParentFrameAnyBase(wxWindow* frame) wxDocParentFrameAnyBase(wxWindow* frame)
: m_frame(frame) : m_frame(frame)
{ {
m_docManager = NULL; m_docManager = nullptr;
} }
wxDocManager *GetDocumentManager() const { return m_docManager; } wxDocManager *GetDocumentManager() const { return m_docManager; }
@ -949,7 +949,7 @@ private:
class WXDLLIMPEXP_CORE wxDocPrintout : public wxPrintout class WXDLLIMPEXP_CORE wxDocPrintout : public wxPrintout
{ {
public: public:
wxDocPrintout(wxView *view = NULL, const wxString& title = wxString()); wxDocPrintout(wxView *view = nullptr, const wxString& title = wxString());
// implement wxPrintout methods // implement wxPrintout methods
virtual bool OnPrintPage(int page) override; virtual bool OnPrintPage(int page) override;

View file

@ -203,7 +203,7 @@ public:
virtual wxWindow* CreateEditorCtrl(wxWindow * WXUNUSED(parent), virtual wxWindow* CreateEditorCtrl(wxWindow * WXUNUSED(parent),
wxRect WXUNUSED(labelRect), wxRect WXUNUSED(labelRect),
const wxVariant& WXUNUSED(value)) const wxVariant& WXUNUSED(value))
{ return NULL; } { return nullptr; }
virtual bool GetValueFromEditorCtrl(wxWindow * WXUNUSED(editor), virtual bool GetValueFromEditorCtrl(wxWindow * WXUNUSED(editor),
wxVariant& WXUNUSED(value)) wxVariant& WXUNUSED(value))
{ return false; } { return false; }

View file

@ -360,7 +360,7 @@ public:
T* const pItem = Traits::Clone(item); T* const pItem = Traits::Clone(item);
const size_t nOldSize = size(); const size_t nOldSize = size();
if ( pItem != NULL ) if ( pItem != nullptr )
base::insert(this->end(), nInsert, pItem); base::insert(this->end(), nInsert, pItem);
for ( size_t i = 1; i < nInsert; i++ ) for ( size_t i = 1; i < nInsert; i++ )
@ -381,7 +381,7 @@ public:
return; return;
T* const pItem = Traits::Clone(item); T* const pItem = Traits::Clone(item);
if ( pItem != NULL ) if ( pItem != nullptr )
base::insert(this->begin() + uiIndex, nInsert, pItem); base::insert(this->begin() + uiIndex, nInsert, pItem);
for ( size_t i = 1; i < nInsert; ++i ) for ( size_t i = 1; i < nInsert; ++i )

View file

@ -62,7 +62,7 @@ enum wxDLFlags
// and especially don't use directly, use wxLoadedDLL instead if you really // and especially don't use directly, use wxLoadedDLL instead if you really
// do need it // do need it
wxDL_GET_LOADED = 0x00000040, // Win32 only: return handle of already wxDL_GET_LOADED = 0x00000040, // Win32 only: return handle of already
// loaded DLL or NULL otherwise; Unload() // loaded DLL or nullptr otherwise; Unload()
// should not be called so don't forget to // should not be called so don't forget to
// Detach() if you use this function // Detach() if you use this function
@ -162,7 +162,7 @@ class WXDLLIMPEXP_BASE wxDynamicLibraryDetails
public: public:
// ctor, normally never used as these objects are only created by // ctor, normally never used as these objects are only created by
// wxDynamicLibrary::ListLoaded() // wxDynamicLibrary::ListLoaded()
wxDynamicLibraryDetails() { m_address = NULL; m_length = 0; } wxDynamicLibraryDetails() { m_address = nullptr; m_length = 0; }
// get the (base) name // get the (base) name
wxString GetName() const { return m_name; } wxString GetName() const { return m_name; }
@ -213,16 +213,16 @@ WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetails,
class WXDLLIMPEXP_BASE wxDynamicLibrary class WXDLLIMPEXP_BASE wxDynamicLibrary
{ {
public: public:
// return a valid handle for the main program itself or NULL if back // return a valid handle for the main program itself or nullptr if back
// linking is not supported by the current platform (e.g. Win32) // linking is not supported by the current platform (e.g. Win32)
static wxDllType GetProgramHandle(); static wxDllType GetProgramHandle();
// return the platform standard DLL extension (with leading dot) // return the platform standard DLL extension (with leading dot)
static wxString GetDllExt(wxDynamicLibraryCategory cat = wxDL_LIBRARY); static wxString GetDllExt(wxDynamicLibraryCategory cat = wxDL_LIBRARY);
wxDynamicLibrary() : m_handle(NULL) { } wxDynamicLibrary() : m_handle(nullptr) { }
wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT) wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT)
: m_handle(NULL) : m_handle(nullptr)
{ {
Load(libname, flags); Load(libname, flags);
} }
@ -232,14 +232,14 @@ public:
~wxDynamicLibrary() { Unload(); } ~wxDynamicLibrary() { Unload(); }
// return true if the library was loaded successfully // return true if the library was loaded successfully
bool IsLoaded() const { return m_handle != NULL; } bool IsLoaded() const { return m_handle != nullptr; }
// load the library with the given name (full or not), return true if ok // load the library with the given name (full or not), return true if ok
bool Load(const wxString& libname, int flags = wxDL_DEFAULT); bool Load(const wxString& libname, int flags = wxDL_DEFAULT);
// raw function for loading dynamic libs: always behaves as if // raw function for loading dynamic libs: always behaves as if
// wxDL_VERBATIM were specified and doesn't log error message if the // wxDL_VERBATIM were specified and doesn't log error message if the
// library couldn't be loaded but simply returns NULL // library couldn't be loaded but simply returns nullptr
static wxDllType RawLoad(const wxString& libname, int flags = wxDL_DEFAULT); static wxDllType RawLoad(const wxString& libname, int flags = wxDL_DEFAULT);
// attach to an existing handle // attach to an existing handle
@ -248,13 +248,13 @@ public:
// detach the library object from its handle, i.e. prevent the object from // detach the library object from its handle, i.e. prevent the object from
// unloading the library in its dtor -- the caller is now responsible for // unloading the library in its dtor -- the caller is now responsible for
// doing this // doing this
wxDllType Detach() { wxDllType h = m_handle; m_handle = NULL; return h; } wxDllType Detach() { wxDllType h = m_handle; m_handle = nullptr; return h; }
// unload the given library handle (presumably returned by Detach() before) // unload the given library handle (presumably returned by Detach() before)
static void Unload(wxDllType handle); static void Unload(wxDllType handle);
// unload the library, also done automatically in dtor // unload the library, also done automatically in dtor
void Unload() { if ( IsLoaded() ) { Unload(m_handle); m_handle = NULL; } } void Unload() { if ( IsLoaded() ) { Unload(m_handle); m_handle = nullptr; } }
// Return the raw handle from dlopen and friends. // Return the raw handle from dlopen and friends.
wxDllType GetLibHandle() const { return m_handle; } wxDllType GetLibHandle() const { return m_handle; }
@ -273,14 +273,14 @@ public:
// 'name' is the (possibly mangled) name of the symbol. (use extern "C" to // 'name' is the (possibly mangled) name of the symbol. (use extern "C" to
// export unmangled names) // export unmangled names)
// //
// Since it is perfectly valid for the returned symbol to actually be NULL, // Since it is perfectly valid for the returned symbol to actually be null,
// that is not always indication of an error. Pass and test the parameter // that is not always indication of an error. Pass and test the parameter
// 'success' for a true indication of success or failure to load the // 'success' for a true indication of success or failure to load the
// symbol. // symbol.
// //
// Returns a pointer to the symbol on success, or NULL if an error occurred // Returns a pointer to the symbol on success, or nullptr if an error occurred
// or the symbol wasn't found. // or the symbol wasn't found.
void *GetSymbol(const wxString& name, bool *success = NULL) const; void *GetSymbol(const wxString& name, bool *success = nullptr) const;
// low-level version of GetSymbol() // low-level version of GetSymbol()
static void *RawGetSymbol(wxDllType handle, const wxString& name); static void *RawGetSymbol(wxDllType handle, const wxString& name);
@ -334,11 +334,11 @@ public:
static wxString GetPluginsDirectory(); static wxString GetPluginsDirectory();
// Return the load address of the module containing the given address or // Return the load address of the module containing the given address or
// NULL if not found. // nullptr if not found.
// //
// If path output parameter is non-NULL, fill it with the full path to this // If path output parameter is non-null, fill it with the full path to this
// module disk file on success. // module disk file on success.
static void* GetModuleFromAddress(const void* addr, wxString* path = NULL); static void* GetModuleFromAddress(const void* addr, wxString* path = nullptr);
#ifdef __WINDOWS__ #ifdef __WINDOWS__
// return the handle (HMODULE/HINSTANCE) of the DLL with the given name // return the handle (HMODULE/HINSTANCE) of the DLL with the given name
@ -355,13 +355,13 @@ public:
protected: protected:
// common part of GetSymbol() and HasSymbol() // common part of GetSymbol() and HasSymbol()
void* DoGetSymbol(const wxString& name, bool* success = NULL) const; void* DoGetSymbol(const wxString& name, bool* success = nullptr) const;
// log the error after an OS dynamic library function failure // log the error after an OS dynamic library function failure
static void ReportError(const wxString& msg, static void ReportError(const wxString& msg,
const wxString& name = wxString()); const wxString& name = wxString());
// the handle to DLL or NULL // the handle to DLL or nullptr
wxDllType m_handle; wxDllType m_handle;
// no copy ctor/assignment operators (or we'd try to unload the library // no copy ctor/assignment operators (or we'd try to unload the library

View file

@ -81,7 +81,7 @@ public:
private: private:
// These pointers may be NULL but if they are not, then m_ourLast follows // These pointers may be null but if they are not, then m_ourLast follows
// m_ourFirst in the linked list, i.e. can be found by calling GetNext() a // m_ourFirst in the linked list, i.e. can be found by calling GetNext() a
// sufficient number of times. // sufficient number of times.
const wxClassInfo *m_ourFirst; // first class info in this plugin const wxClassInfo *m_ourFirst; // first class info in this plugin
@ -112,7 +112,7 @@ public:
// Instance methods. // Instance methods.
wxPluginManager() : m_entry(NULL) {} wxPluginManager() : m_entry(nullptr) {}
wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT) wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT)
{ {
Load(libname, flags); Load(libname, flags);
@ -123,22 +123,22 @@ public:
void Unload(); void Unload();
bool IsLoaded() const { return m_entry && m_entry->IsLoaded(); } bool IsLoaded() const { return m_entry && m_entry->IsLoaded(); }
void* GetSymbol(const wxString& symbol, bool* success = NULL) void* GetSymbol(const wxString& symbol, bool* success = nullptr)
{ {
return m_entry->GetSymbol( symbol, success ); return m_entry->GetSymbol( symbol, success );
} }
static void CreateManifest() { ms_manifest = new wxDLManifest(wxKEY_STRING); } static void CreateManifest() { ms_manifest = new wxDLManifest(wxKEY_STRING); }
static void ClearManifest() { delete ms_manifest; ms_manifest = NULL; } static void ClearManifest() { delete ms_manifest; ms_manifest = nullptr; }
private: private:
// return the pointer to the entry for the library with given name in // return the pointer to the entry for the library with given name in
// ms_manifest or NULL if none // ms_manifest or nullptr if none
static wxPluginLibrary *FindByName(const wxString& name) static wxPluginLibrary *FindByName(const wxString& name)
{ {
const wxDLManifest::iterator i = ms_manifest->find(name); const wxDLManifest::iterator i = ms_manifest->find(name);
return i == ms_manifest->end() ? NULL : i->second; return i == ms_manifest->end() ? nullptr : i->second;
} }
static wxDLManifest* ms_manifest; // Static hash of loaded libs. static wxDLManifest* ms_manifest; // Static hash of loaded libs.

View file

@ -74,8 +74,8 @@ protected:
{ {
m_style = 0; m_style = 0;
m_selection = 0; m_selection = 0;
m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = NULL; m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = nullptr;
m_listCtrl = NULL; m_listCtrl = nullptr;
} }
void OnItemSelected(wxListEvent& event); void OnItemSelected(wxListEvent& event);

View file

@ -87,7 +87,7 @@ typedef int wxEventType;
wxEventTableEntry(type, winid, idLast, wxNewEventTableFunctor(type, fn), obj) wxEventTableEntry(type, winid, idLast, wxNewEventTableFunctor(type, fn), obj)
#define wxDECLARE_EVENT_TABLE_TERMINATOR() \ #define wxDECLARE_EVENT_TABLE_TERMINATOR() \
wxEventTableEntry(wxEVT_NULL, 0, 0, NULL, NULL) wxEventTableEntry(wxEVT_NULL, 0, 0, nullptr, nullptr)
// generate a new unique event type // generate a new unique event type
extern WXDLLIMPEXP_BASE wxEventType wxNewEventType(); extern WXDLLIMPEXP_BASE wxEventType wxNewEventType();
@ -241,14 +241,14 @@ public:
// If the functor holds an wxEvtHandler, then get access to it and track // If the functor holds an wxEvtHandler, then get access to it and track
// its lifetime with wxEventConnectionRef: // its lifetime with wxEventConnectionRef:
virtual wxEvtHandler *GetEvtHandler() const virtual wxEvtHandler *GetEvtHandler() const
{ return NULL; } { return nullptr; }
// This is only used to maintain backward compatibility in // This is only used to maintain backward compatibility in
// wxAppConsoleBase::CallEventHandler and ensures that an overwritten // wxAppConsoleBase::CallEventHandler and ensures that an overwritten
// wxAppConsoleBase::HandleEvent is still called for functors which hold an // wxAppConsoleBase::HandleEvent is still called for functors which hold an
// wxEventFunction: // wxEventFunction:
virtual wxEventFunction GetEvtMethod() const virtual wxEventFunction GetEvtMethod() const
{ return NULL; } { return nullptr; }
private: private:
WX_DECLARE_ABSTRACT_TYPEINFO(wxEventFunctor) WX_DECLARE_ABSTRACT_TYPEINFO(wxEventFunctor)
@ -289,7 +289,7 @@ private:
wxEventFunction m_method; wxEventFunction m_method;
// Provide a dummy default ctor for type info purposes // Provide a dummy default ctor for type info purposes
wxObjectEventFunctor() : m_handler(NULL), m_method(NULL) { } wxObjectEventFunctor() : m_handler(nullptr), m_method(nullptr) { }
WX_DECLARE_TYPEINFO_INLINE(wxObjectEventFunctor) WX_DECLARE_TYPEINFO_INLINE(wxObjectEventFunctor)
}; };
@ -308,7 +308,7 @@ inline wxObjectEventFunctor *
wxNewEventTableFunctor(const wxEventType& WXUNUSED(evtType), wxNewEventTableFunctor(const wxEventType& WXUNUSED(evtType),
wxObjectEventFunction method) wxObjectEventFunction method)
{ {
return new wxObjectEventFunctor(method, NULL); return new wxObjectEventFunctor(method, nullptr);
} }
inline wxObjectEventFunctor inline wxObjectEventFunctor
@ -369,11 +369,11 @@ struct HandlerImpl<T, A, false>
static bool IsEvtHandler() static bool IsEvtHandler()
{ return false; } { return false; }
static T *ConvertFromEvtHandler(wxEvtHandler *) static T *ConvertFromEvtHandler(wxEvtHandler *)
{ return NULL; } { return nullptr; }
static wxEvtHandler *ConvertToEvtHandler(T *) static wxEvtHandler *ConvertToEvtHandler(T *)
{ return NULL; } { return nullptr; }
static wxEventFunction ConvertToEvtMethod(void (T::*)(A&)) static wxEventFunction ConvertToEvtMethod(void (T::*)(A&))
{ return NULL; } { return nullptr; }
}; };
} // namespace wxPrivate } // namespace wxPrivate
@ -416,7 +416,7 @@ public:
// if you get an error here it means that the signature of the handler // if you get an error here it means that the signature of the handler
// you're trying to use is not compatible with (i.e. is not the same as // you're trying to use is not compatible with (i.e. is not the same as
// or a base class of) the real event class used for this event type // or a base class of) the real event class used for this event type
CheckHandlerArgument(static_cast<EventClass *>(NULL)); CheckHandlerArgument(static_cast<EventClass *>(nullptr));
} }
virtual void operator()(wxEvtHandler *handler, wxEvent& event) override virtual void operator()(wxEvtHandler *handler, wxEvent& event) override
@ -447,8 +447,8 @@ public:
// the cast is valid because wxTypeId()s matched above // the cast is valid because wxTypeId()s matched above
const ThisFunctor& other = static_cast<const ThisFunctor &>(functor); const ThisFunctor& other = static_cast<const ThisFunctor &>(functor);
return (m_method == other.m_method || other.m_method == NULL) && return (m_method == other.m_method || other.m_method == nullptr) &&
(m_handler == other.m_handler || other.m_handler == NULL); (m_handler == other.m_handler || other.m_handler == nullptr);
} }
virtual wxEvtHandler *GetEvtHandler() const override virtual wxEvtHandler *GetEvtHandler() const override
@ -487,7 +487,7 @@ public:
// if you get an error here it means that the signature of the handler // if you get an error here it means that the signature of the handler
// you're trying to use is not compatible with (i.e. is not the same as // you're trying to use is not compatible with (i.e. is not the same as
// or a base class of) the real event class used for this event type // or a base class of) the real event class used for this event type
CheckHandlerArgument(static_cast<EventClass *>(NULL)); CheckHandlerArgument(static_cast<EventClass *>(nullptr));
} }
virtual void operator()(wxEvtHandler *WXUNUSED(handler), wxEvent& event) override virtual void operator()(wxEvtHandler *WXUNUSED(handler), wxEvent& event) override
@ -495,10 +495,10 @@ public:
// If you get an error here like "must use .* or ->* to call // If you get an error here like "must use .* or ->* to call
// pointer-to-member function" then you probably tried to call // pointer-to-member function" then you probably tried to call
// Bind/Unbind with a method pointer but without a handler pointer or // Bind/Unbind with a method pointer but without a handler pointer or
// NULL as a handler e.g.: // nullptr as a handler e.g.:
// Unbind( wxEVT_XXX, &EventHandler::method ); // Unbind( wxEVT_XXX, &EventHandler::method );
// or // or
// Unbind( wxEVT_XXX, &EventHandler::method, NULL ) // Unbind( wxEVT_XXX, &EventHandler::method, nullptr )
m_handler(static_cast<EventArg&>(event)); m_handler(static_cast<EventArg&>(event));
} }
@ -540,10 +540,10 @@ public:
// If you get an error here like "must use '.*' or '->*' to call // If you get an error here like "must use '.*' or '->*' to call
// pointer-to-member function" then you probably tried to call // pointer-to-member function" then you probably tried to call
// Bind/Unbind with a method pointer but without a handler pointer or // Bind/Unbind with a method pointer but without a handler pointer or
// NULL as a handler e.g.: // nullptr as a handler e.g.:
// Unbind( wxEVT_XXX, &EventHandler::method ); // Unbind( wxEVT_XXX, &EventHandler::method );
// or // or
// Unbind( wxEVT_XXX, &EventHandler::method, NULL ) // Unbind( wxEVT_XXX, &EventHandler::method, nullptr )
m_handler(static_cast<EventArg&>(event)); m_handler(static_cast<EventArg&>(event));
} }
@ -643,7 +643,7 @@ inline wxEventFunctorMethod<EventTag, Class, EventArg, Class> *
wxNewEventTableFunctor(const EventTag&, void (Class::*method)(EventArg&)) wxNewEventTableFunctor(const EventTag&, void (Class::*method)(EventArg&))
{ {
return new wxEventFunctorMethod<EventTag, Class, EventArg, Class>( return new wxEventFunctorMethod<EventTag, Class, EventArg, Class>(
method, NULL); method, nullptr);
} }
@ -1085,7 +1085,7 @@ public:
// never be used anywhere else. // never be used anywhere else.
void DidntHonourProcessOnlyIn() void DidntHonourProcessOnlyIn()
{ {
m_handlerToProcessOnlyIn = NULL; m_handlerToProcessOnlyIn = nullptr;
} }
protected: protected:
@ -1107,7 +1107,7 @@ protected:
// the parent window (if any) // the parent window (if any)
int m_propagationLevel; int m_propagationLevel;
// The object that the event is being propagated from, initially NULL and // The object that the event is being propagated from, initially nullptr and
// only set by wxPropagateOnce. // only set by wxPropagateOnce.
wxEvtHandler* m_propagatedFrom; wxEvtHandler* m_propagatedFrom;
@ -1170,10 +1170,10 @@ private:
class WXDLLIMPEXP_BASE wxPropagateOnce class WXDLLIMPEXP_BASE wxPropagateOnce
{ {
public: public:
// The handler argument should normally be non-NULL to allow the parent // The handler argument should normally be non-null to allow the parent
// event handler to know that it's being used to process an event coming // event handler to know that it's being used to process an event coming
// from the child, it's only NULL by default for backwards compatibility. // from the child, it's only nullptr by default for backwards compatibility.
wxPropagateOnce(wxEvent& event, wxEvtHandler* handler = NULL) wxPropagateOnce(wxEvent& event, wxEvtHandler* handler = nullptr)
: m_event(event), : m_event(event),
m_propagatedFromOld(event.m_propagatedFrom) m_propagatedFromOld(event.m_propagatedFrom)
{ {
@ -1607,8 +1607,8 @@ public:
wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxEvent(winid, commandType) : wxEvent(winid, commandType)
{ {
m_clientData = NULL; m_clientData = nullptr;
m_clientObject = NULL; m_clientObject = nullptr;
m_isCommandEvent = true; m_isCommandEvent = true;
// the command events are propagated upwards by default // the command events are propagated upwards by default
@ -2420,7 +2420,7 @@ class WXDLLIMPEXP_CORE wxPaintEvent : public wxEvent
#ifdef WXBUILDING #ifdef WXBUILDING
public: public:
#endif // WXBUILDING #endif // WXBUILDING
explicit wxPaintEvent(wxWindowBase* window = NULL); explicit wxPaintEvent(wxWindowBase* window = nullptr);
public: public:
// default copy ctor and dtor are fine // default copy ctor and dtor are fine
@ -2438,7 +2438,7 @@ class WXDLLIMPEXP_CORE wxNcPaintEvent : public wxEvent
#ifdef WXBUILDING #ifdef WXBUILDING
public: public:
#endif // WXBUILDING #endif // WXBUILDING
explicit wxNcPaintEvent(wxWindowBase* window = NULL); explicit wxNcPaintEvent(wxWindowBase* window = nullptr);
public: public:
virtual wxEvent *Clone() const override { return new wxNcPaintEvent(*this); } virtual wxEvent *Clone() const override { return new wxNcPaintEvent(*this); }
@ -2455,7 +2455,7 @@ private:
class WXDLLIMPEXP_CORE wxEraseEvent : public wxEvent class WXDLLIMPEXP_CORE wxEraseEvent : public wxEvent
{ {
public: public:
wxEraseEvent(int Id = 0, wxDC *dc = NULL) wxEraseEvent(int Id = 0, wxDC *dc = nullptr)
: wxEvent(Id, wxEVT_ERASE_BACKGROUND), : wxEvent(Id, wxEVT_ERASE_BACKGROUND),
m_dc(dc) m_dc(dc)
{ } { }
@ -2487,7 +2487,7 @@ class WXDLLIMPEXP_CORE wxFocusEvent : public wxEvent
public: public:
wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0) wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0)
: wxEvent(winid, type) : wxEvent(winid, type)
{ m_win = NULL; } { m_win = nullptr; }
wxFocusEvent(const wxFocusEvent& event) wxFocusEvent(const wxFocusEvent& event)
: wxEvent(event) : wxEvent(event)
@ -2495,7 +2495,7 @@ public:
// The window associated with this event is the window which had focus // The window associated with this event is the window which had focus
// before for SET event and the window which will have focus for the KILL // before for SET event and the window which will have focus for the KILL
// one. NB: it may be NULL in both cases! // one. NB: it may be null in both cases!
wxWindow *GetWindow() const { return m_win; } wxWindow *GetWindow() const { return m_win; }
void SetWindow(wxWindow *win) { m_win = win; } void SetWindow(wxWindow *win) { m_win = win; }
@ -2513,7 +2513,7 @@ private:
class WXDLLIMPEXP_CORE wxChildFocusEvent : public wxCommandEvent class WXDLLIMPEXP_CORE wxChildFocusEvent : public wxCommandEvent
{ {
public: public:
wxChildFocusEvent(wxWindow *win = NULL); wxChildFocusEvent(wxWindow *win = nullptr);
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
@ -2596,7 +2596,7 @@ private:
class WXDLLIMPEXP_CORE wxMenuEvent : public wxEvent class WXDLLIMPEXP_CORE wxMenuEvent : public wxEvent
{ {
public: public:
wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL) wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = nullptr)
: wxEvent(winid, type) : wxEvent(winid, type)
{ m_menuId = winid; m_menu = menu; } { m_menuId = winid; m_menu = menu; }
wxMenuEvent(const wxMenuEvent& event) wxMenuEvent(const wxMenuEvent& event)
@ -2885,7 +2885,7 @@ public:
wxDropFilesEvent(wxEventType type = wxEVT_NULL, wxDropFilesEvent(wxEventType type = wxEVT_NULL,
int noFiles = 0, int noFiles = 0,
wxString *files = NULL) wxString *files = nullptr)
: wxEvent(0, type), : wxEvent(0, type),
m_noFiles(noFiles), m_noFiles(noFiles),
m_pos(), m_pos(),
@ -2897,7 +2897,7 @@ public:
: wxEvent(other), : wxEvent(other),
m_noFiles(other.m_noFiles), m_noFiles(other.m_noFiles),
m_pos(other.m_pos), m_pos(other.m_pos),
m_files(NULL) m_files(nullptr)
{ {
m_files = new wxString[m_noFiles]; m_files = new wxString[m_noFiles];
for ( int n = 0; n < m_noFiles; n++ ) for ( int n = 0; n < m_noFiles; n++ )
@ -3057,7 +3057,7 @@ private:
class WXDLLIMPEXP_CORE wxMouseCaptureChangedEvent : public wxEvent class WXDLLIMPEXP_CORE wxMouseCaptureChangedEvent : public wxEvent
{ {
public: public:
wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL) wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = nullptr)
: wxEvent(winid, wxEVT_MOUSE_CAPTURE_CHANGED), : wxEvent(winid, wxEVT_MOUSE_CAPTURE_CHANGED),
m_gainedCapture(gainedCapture) m_gainedCapture(gainedCapture)
{ } { }
@ -3158,7 +3158,7 @@ class WXDLLIMPEXP_CORE wxPaletteChangedEvent : public wxEvent
public: public:
wxPaletteChangedEvent(wxWindowID winid = 0) wxPaletteChangedEvent(wxWindowID winid = 0)
: wxEvent(winid, wxEVT_PALETTE_CHANGED), : wxEvent(winid, wxEVT_PALETTE_CHANGED),
m_changedWindow(NULL) m_changedWindow(nullptr)
{ } { }
wxPaletteChangedEvent(const wxPaletteChangedEvent& event) wxPaletteChangedEvent(const wxPaletteChangedEvent& event)
@ -3219,7 +3219,7 @@ public:
wxNavigationKeyEvent() wxNavigationKeyEvent()
: wxEvent(0, wxEVT_NAVIGATION_KEY), : wxEvent(0, wxEVT_NAVIGATION_KEY),
m_flags(IsForward | FromTab), // defaults are for TAB m_flags(IsForward | FromTab), // defaults are for TAB
m_focus(NULL) m_focus(nullptr)
{ {
m_propagationLevel = wxEVENT_PROPAGATE_NONE; m_propagationLevel = wxEVENT_PROPAGATE_NONE;
} }
@ -3250,7 +3250,7 @@ public:
void SetFromTab(bool bIs) void SetFromTab(bool bIs)
{ if ( bIs ) m_flags |= FromTab; else m_flags &= ~FromTab; } { if ( bIs ) m_flags |= FromTab; else m_flags &= ~FromTab; }
// the child which has the focus currently (may be NULL - use // the child which has the focus currently (may be null - use
// wxWindow::FindFocus then) // wxWindow::FindFocus then)
wxWindow* GetCurrentFocus() const { return m_focus; } wxWindow* GetCurrentFocus() const { return m_focus; }
void SetCurrentFocus(wxWindow *win) { m_focus = win; } void SetCurrentFocus(wxWindow *win) { m_focus = win; }
@ -3288,7 +3288,7 @@ private:
class WXDLLIMPEXP_CORE wxWindowCreateEvent : public wxCommandEvent class WXDLLIMPEXP_CORE wxWindowCreateEvent : public wxCommandEvent
{ {
public: public:
wxWindowCreateEvent(wxWindow *win = NULL); wxWindowCreateEvent(wxWindow *win = nullptr);
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
@ -3301,7 +3301,7 @@ private:
class WXDLLIMPEXP_CORE wxWindowDestroyEvent : public wxCommandEvent class WXDLLIMPEXP_CORE wxWindowDestroyEvent : public wxCommandEvent
{ {
public: public:
wxWindowDestroyEvent(wxWindow *win = NULL); wxWindowDestroyEvent(wxWindow *win = nullptr);
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
@ -3484,7 +3484,7 @@ struct WXDLLIMPEXP_BASE wxEventTableEntryBase
// being initialized (a temporary instance is created and then this // being initialized (a temporary instance is created and then this
// constructor is called). // constructor is called).
const_cast<wxEventTableEntryBase&>( entry ).m_fn = NULL; const_cast<wxEventTableEntryBase&>( entry ).m_fn = nullptr;
} }
~wxEventTableEntryBase() ~wxEventTableEntryBase()
@ -3795,8 +3795,8 @@ public:
int lastId, int lastId,
wxEventType eventType, wxEventType eventType,
wxObjectEventFunction func, wxObjectEventFunction func,
wxObject *userData = NULL, wxObject *userData = nullptr,
wxEvtHandler *eventSink = NULL) wxEvtHandler *eventSink = nullptr)
{ {
DoBind(winid, lastId, eventType, DoBind(winid, lastId, eventType,
wxNewEventFunctor(eventType, func, eventSink), wxNewEventFunctor(eventType, func, eventSink),
@ -3807,23 +3807,23 @@ public:
void Connect(int winid, void Connect(int winid,
wxEventType eventType, wxEventType eventType,
wxObjectEventFunction func, wxObjectEventFunction func,
wxObject *userData = NULL, wxObject *userData = nullptr,
wxEvtHandler *eventSink = NULL) wxEvtHandler *eventSink = nullptr)
{ Connect(winid, wxID_ANY, eventType, func, userData, eventSink); } { Connect(winid, wxID_ANY, eventType, func, userData, eventSink); }
// Even more convenient: without id (same as using id of wxID_ANY) // Even more convenient: without id (same as using id of wxID_ANY)
void Connect(wxEventType eventType, void Connect(wxEventType eventType,
wxObjectEventFunction func, wxObjectEventFunction func,
wxObject *userData = NULL, wxObject *userData = nullptr,
wxEvtHandler *eventSink = NULL) wxEvtHandler *eventSink = nullptr)
{ Connect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink); } { Connect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink); }
bool Disconnect(int winid, bool Disconnect(int winid,
int lastId, int lastId,
wxEventType eventType, wxEventType eventType,
wxObjectEventFunction func = NULL, wxObjectEventFunction func = nullptr,
wxObject *userData = NULL, wxObject *userData = nullptr,
wxEvtHandler *eventSink = NULL) wxEvtHandler *eventSink = nullptr)
{ {
return DoUnbind(winid, lastId, eventType, return DoUnbind(winid, lastId, eventType,
wxMakeEventFunctor(eventType, func, eventSink), wxMakeEventFunctor(eventType, func, eventSink),
@ -3832,15 +3832,15 @@ public:
bool Disconnect(int winid = wxID_ANY, bool Disconnect(int winid = wxID_ANY,
wxEventType eventType = wxEVT_NULL, wxEventType eventType = wxEVT_NULL,
wxObjectEventFunction func = NULL, wxObjectEventFunction func = nullptr,
wxObject *userData = NULL, wxObject *userData = nullptr,
wxEvtHandler *eventSink = NULL) wxEvtHandler *eventSink = nullptr)
{ return Disconnect(winid, wxID_ANY, eventType, func, userData, eventSink); } { return Disconnect(winid, wxID_ANY, eventType, func, userData, eventSink); }
bool Disconnect(wxEventType eventType, bool Disconnect(wxEventType eventType,
wxObjectEventFunction func, wxObjectEventFunction func,
wxObject *userData = NULL, wxObject *userData = nullptr,
wxEvtHandler *eventSink = NULL) wxEvtHandler *eventSink = nullptr)
{ return Disconnect(wxID_ANY, eventType, func, userData, eventSink); } { return Disconnect(wxID_ANY, eventType, func, userData, eventSink); }
// Bind functions to an event: // Bind functions to an event:
@ -3849,7 +3849,7 @@ public:
void (*function)(EventArg &), void (*function)(EventArg &),
int winid = wxID_ANY, int winid = wxID_ANY,
int lastId = wxID_ANY, int lastId = wxID_ANY,
wxObject *userData = NULL) wxObject *userData = nullptr)
{ {
DoBind(winid, lastId, eventType, DoBind(winid, lastId, eventType,
wxNewEventFunctor(eventType, function), wxNewEventFunctor(eventType, function),
@ -3862,7 +3862,7 @@ public:
void (*function)(EventArg &), void (*function)(EventArg &),
int winid = wxID_ANY, int winid = wxID_ANY,
int lastId = wxID_ANY, int lastId = wxID_ANY,
wxObject *userData = NULL) wxObject *userData = nullptr)
{ {
return DoUnbind(winid, lastId, eventType, return DoUnbind(winid, lastId, eventType,
wxMakeEventFunctor(eventType, function), wxMakeEventFunctor(eventType, function),
@ -3875,7 +3875,7 @@ public:
const Functor &functor, const Functor &functor,
int winid = wxID_ANY, int winid = wxID_ANY,
int lastId = wxID_ANY, int lastId = wxID_ANY,
wxObject *userData = NULL) wxObject *userData = nullptr)
{ {
DoBind(winid, lastId, eventType, DoBind(winid, lastId, eventType,
wxNewEventFunctor(eventType, functor), wxNewEventFunctor(eventType, functor),
@ -3888,7 +3888,7 @@ public:
const Functor &functor, const Functor &functor,
int winid = wxID_ANY, int winid = wxID_ANY,
int lastId = wxID_ANY, int lastId = wxID_ANY,
wxObject *userData = NULL) wxObject *userData = nullptr)
{ {
return DoUnbind(winid, lastId, eventType, return DoUnbind(winid, lastId, eventType,
wxMakeEventFunctor(eventType, functor), wxMakeEventFunctor(eventType, functor),
@ -3905,7 +3905,7 @@ public:
EventHandler *handler, EventHandler *handler,
int winid = wxID_ANY, int winid = wxID_ANY,
int lastId = wxID_ANY, int lastId = wxID_ANY,
wxObject *userData = NULL) wxObject *userData = nullptr)
{ {
DoBind(winid, lastId, eventType, DoBind(winid, lastId, eventType,
wxNewEventFunctor(eventType, method, handler), wxNewEventFunctor(eventType, method, handler),
@ -3918,7 +3918,7 @@ public:
EventHandler *handler, EventHandler *handler,
int winid = wxID_ANY, int winid = wxID_ANY,
int lastId = wxID_ANY, int lastId = wxID_ANY,
wxObject *userData = NULL ) wxObject *userData = nullptr )
{ {
return DoUnbind(winid, lastId, eventType, return DoUnbind(winid, lastId, eventType,
wxMakeEventFunctor(eventType, method, handler), wxMakeEventFunctor(eventType, method, handler),
@ -3967,13 +3967,13 @@ private:
int lastId, int lastId,
wxEventType eventType, wxEventType eventType,
wxEventFunctor *func, wxEventFunctor *func,
wxObject* userData = NULL); wxObject* userData = nullptr);
bool DoUnbind(int winid, bool DoUnbind(int winid,
int lastId, int lastId,
wxEventType eventType, wxEventType eventType,
const wxEventFunctor& func, const wxEventFunctor& func,
wxObject *userData = NULL); wxObject *userData = nullptr);
static const wxEventTableEntry sm_eventTableEntries[]; static const wxEventTableEntry sm_eventTableEntries[];
@ -4099,7 +4099,7 @@ inline void wxObjectEventFunctor::operator()(wxEvtHandler *handler, wxEvent& eve
class wxEventConnectionRef : public wxTrackerNode class wxEventConnectionRef : public wxTrackerNode
{ {
public: public:
wxEventConnectionRef() : m_src(NULL), m_sink(NULL), m_refCount(0) { } wxEventConnectionRef() : m_src(nullptr), m_sink(nullptr), m_refCount(0) { }
wxEventConnectionRef(wxEvtHandler *src, wxEvtHandler *sink) wxEventConnectionRef(wxEvtHandler *src, wxEvtHandler *sink)
: m_src(src), m_sink(sink), m_refCount(1) : m_src(src), m_sink(sink), m_refCount(1)
{ {
@ -4474,7 +4474,7 @@ typedef void (wxEvtHandler::*wxPressAndTapEventFunction)(wxPressAndTapEvent&);
// - id1, id2 ids of the first/last id // - id1, id2 ids of the first/last id
// - fn the function (should be cast to the right type) // - fn the function (should be cast to the right type)
#define wx__DECLARE_EVT2(evt, id1, id2, fn) \ #define wx__DECLARE_EVT2(evt, id1, id2, fn) \
wxDECLARE_EVENT_TABLE_ENTRY(evt, id1, id2, fn, NULL), wxDECLARE_EVENT_TABLE_ENTRY(evt, id1, id2, fn, nullptr),
#define wx__DECLARE_EVT1(evt, id, fn) \ #define wx__DECLARE_EVT1(evt, id, fn) \
wx__DECLARE_EVT2(evt, id, wxID_ANY, fn) wx__DECLARE_EVT2(evt, id, wxID_ANY, fn)
#define wx__DECLARE_EVT0(evt, fn) \ #define wx__DECLARE_EVT0(evt, fn) \

View file

@ -40,7 +40,7 @@ public:
wxEventFilter() wxEventFilter()
{ {
m_next = NULL; m_next = nullptr;
} }
virtual ~wxEventFilter() virtual ~wxEventFilter()

View file

@ -174,7 +174,7 @@ public:
// active loop // active loop
// ----------- // -----------
// return currently active (running) event loop, may be NULL // return currently active (running) event loop, may be null
static wxEventLoopBase *GetActive() { return ms_activeLoop; } static wxEventLoopBase *GetActive() { return ms_activeLoop; }
// set currently active (running) event loop // set currently active (running) event loop
@ -307,7 +307,7 @@ class WXDLLIMPEXP_FWD_CORE wxEventLoopImpl;
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase
{ {
public: public:
wxGUIEventLoop() { m_impl = NULL; } wxGUIEventLoop() { m_impl = nullptr; }
virtual ~wxGUIEventLoop(); virtual ~wxGUIEventLoop();
virtual void ScheduleExit(int rc = 0); virtual void ScheduleExit(int rc = 0);
@ -380,7 +380,7 @@ protected:
virtual void OnExit() override virtual void OnExit() override
{ {
delete m_windowDisabler; delete m_windowDisabler;
m_windowDisabler = NULL; m_windowDisabler = nullptr;
wxGUIEventLoop::OnExit(); wxGUIEventLoop::OnExit();
} }
@ -424,7 +424,7 @@ class wxEventLoopGuarantor
public: public:
wxEventLoopGuarantor() wxEventLoopGuarantor()
{ {
m_evtLoopNew = NULL; m_evtLoopNew = nullptr;
if (!wxEventLoop::GetActive()) if (!wxEventLoop::GetActive())
{ {
m_evtLoopNew = new wxEventLoop; m_evtLoopNew = new wxEventLoop;
@ -436,7 +436,7 @@ public:
{ {
if (m_evtLoopNew) if (m_evtLoopNew)
{ {
wxEventLoop::SetActive(NULL); wxEventLoop::SetActive(nullptr);
delete m_evtLoopNew; delete m_evtLoopNew;
} }
} }

View file

@ -96,7 +96,7 @@ class WXDLLIMPEXP_CORE wxFindReplaceDialogBase : public wxDialog
{ {
public: public:
// ctors and such // ctors and such
wxFindReplaceDialogBase() { m_FindReplaceData = NULL; } wxFindReplaceDialogBase() { m_FindReplaceData = nullptr; }
wxFindReplaceDialogBase(wxWindow * WXUNUSED(parent), wxFindReplaceDialogBase(wxWindow * WXUNUSED(parent),
wxFindReplaceData *data, wxFindReplaceData *data,
const wxString& WXUNUSED(title), const wxString& WXUNUSED(title),

View file

@ -34,7 +34,7 @@ public:
// ctors // ctors
// ----- // -----
// def ctor // def ctor
wxFFile() { m_fp = NULL; } wxFFile() { m_fp = nullptr; }
// open specified file (may fail, use IsOpened()) // open specified file (may fail, use IsOpened())
wxFFile(const wxString& filename, const wxString& mode = wxT("r")); wxFFile(const wxString& filename, const wxString& mode = wxT("r"));
// attach to (already opened) file // attach to (already opened) file
@ -49,7 +49,7 @@ public:
// assign an existing file descriptor and get it back from wxFFile object // assign an existing file descriptor and get it back from wxFFile object
void Attach(FILE *lfp, const wxString& name = wxEmptyString) void Attach(FILE *lfp, const wxString& name = wxEmptyString)
{ Close(); m_fp = lfp; m_name = name; } { Close(); m_fp = lfp; m_name = name; }
FILE* Detach() { FILE* fpOld = m_fp; m_fp = NULL; return fpOld; } FILE* Detach() { FILE* fpOld = m_fp; m_fp = nullptr; return fpOld; }
FILE *fp() const { return m_fp; } FILE *fp() const { return m_fp; }
// read/write (unbuffered) // read/write (unbuffered)
@ -78,7 +78,7 @@ public:
// simple accessors: note that Eof() and Error() may only be called if // simple accessors: note that Eof() and Error() may only be called if
// IsOpened(). Otherwise they assert and return false. // IsOpened(). Otherwise they assert and return false.
// is file opened? // is file opened?
bool IsOpened() const { return m_fp != NULL; } bool IsOpened() const { return m_fp != nullptr; }
// is end of file reached? // is end of file reached?
bool Eof() const; bool Eof() const;
// has an error occurred? // has an error occurred?
@ -98,7 +98,7 @@ private:
wxFFile(const wxFFile&); wxFFile(const wxFFile&);
wxFFile& operator=(const wxFFile&); wxFFile& operator=(const wxFFile&);
FILE *m_fp; // IO stream or NULL if not opened FILE *m_fp; // IO stream or nullptr if not opened
wxString m_name; // the name of the file (for diagnostic messages) wxString m_name; // the name of the file (for diagnostic messages)
}; };

View file

@ -189,7 +189,7 @@ public:
// functions to work with this list // functions to work with this list
wxFileConfigLineList *LineListAppend(const wxString& str); wxFileConfigLineList *LineListAppend(const wxString& str);
wxFileConfigLineList *LineListInsert(const wxString& str, wxFileConfigLineList *LineListInsert(const wxString& str,
wxFileConfigLineList *pLine); // NULL => Prepend() wxFileConfigLineList *pLine); // nullptr => Prepend()
void LineListRemove(wxFileConfigLineList *pLine); void LineListRemove(wxFileConfigLineList *pLine);
bool LineListIsEmpty(); bool LineListIsEmpty();

Some files were not shown because too many files have changed in this diff Show more