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
MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title)
: wxFrame(nullptr, wxID_ANY, title)
{
// set the frame icon

View file

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

View file

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

View file

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

View file

@ -57,7 +57,7 @@ Pile::Pile(int x, int y, int dx, int dy)
//+-------------------------------------------------------------+
//| Description: |
//| 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 |
//| at the origin of the pile, shifting each subsequent |
//| 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 )
{
FortyFrame *frame = (FortyFrame*) wxTheApp->GetTopWindow();
wxWindow *canvas = (wxWindow *) NULL;
wxWindow *canvas = nullptr;
if (frame)
{
canvas = frame->GetCanvas();
@ -103,7 +103,7 @@ void Pile::Redraw(wxDC& dc )
//| Pile::GetTopCard() |
//+-------------------------------------------------------------+
//| 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. |
//| NB: Gets a copy of the card without removing it from the |
//| pile. |
@ -126,7 +126,7 @@ Card* Pile::GetTopCard()
//| Description: |
//| If the pile is not empty, remove the top card from the |
//| 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()
{
@ -229,7 +229,7 @@ int Pile::CalcDistance(int x, int y)
// 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
// to the card, otherwise return NULL
// to the card, otherwise return nullptr
Card* Pile::GetCard(int x, int y)
{
int cardX;

View file

@ -40,12 +40,12 @@ hack doesn't fix.
#include <time.h>
#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 bool running = false;
static wxMenuBar *menuBar = NULL;
static wxMenuBar *menuBar = nullptr;
// Define a new application type
class MyApp: public wxApp
@ -89,7 +89,7 @@ private:
bool MyApp::OnInit()
{
// 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
wxMenu *file_menu = new wxMenu;

View file

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

View file

@ -112,10 +112,10 @@ Life::Life()
// pattern data
m_numcells = 0;
m_boxes = new LifeCellBox *[HASHSIZE];
m_head = NULL;
m_available = NULL;
m_head = nullptr;
m_available = nullptr;
for (int i = 0; i < HASHSIZE; i++)
m_boxes[i] = NULL;
m_boxes[i] = nullptr;
// state vars for BeginFind & FindMore
m_cells = new LifeCell[CELLSARRAYSIZE];
@ -141,7 +141,7 @@ void Life::Clear()
// clear the hash table pointers
for (int i = 0; i < HASHSIZE; i++)
m_boxes[i] = NULL;
m_boxes[i] = nullptr;
// free used boxes
c = m_head;
@ -151,7 +151,7 @@ void Life::Clear()
delete c;
c = nc;
}
m_head = NULL;
m_head = nullptr;
// free available boxes
c = m_available;
@ -161,7 +161,7 @@ void Life::Clear()
delete c;
c = nc;
}
m_available = NULL;
m_available = nullptr;
// reset state
m_name = wxEmptyString;
@ -295,7 +295,7 @@ LifeCellBox* Life::CreateBox(wxInt32 x, wxInt32 y, wxUint32 hv)
// LinkBox:
// 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.
//
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 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:
@ -338,10 +338,10 @@ void Life::KillBox(LifeCellBox *c)
// update neighbours
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_up) c->m_up->m_dn = NULL;
if (c->m_dn) c->m_dn->m_up = NULL;
if (c->m_lf) c->m_lf->m_rt = NULL;
if (c->m_rt) c->m_rt->m_lf = NULL;
if (c->m_up) c->m_up->m_dn = nullptr;
if (c->m_dn) c->m_dn->m_up = nullptr;
if (c->m_lf) c->m_lf->m_rt = nullptr;
if (c->m_rt) c->m_rt->m_lf = nullptr;
// append to the list of available boxes
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_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;
// 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_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;
// check whether there is enough space left in the array

View file

@ -173,8 +173,8 @@ bool LifeApp::OnInit()
// frame constructor
LifeFrame::LifeFrame() :
wxFrame( (wxFrame *) NULL, wxID_ANY, _("Life!"), wxDefaultPosition ),
m_navigator(NULL)
wxFrame( nullptr, wxID_ANY, _("Life!"), wxDefaultPosition ),
m_navigator(nullptr)
{
// frame icon
SetIcon(wxICON(mondrian));
@ -1104,12 +1104,12 @@ void LifeCanvas::OnScroll(wxScrollWinEvent& event)
if (orient == wxHORIZONTAL)
{
m_viewportX += scrollinc;
ScrollWindow( -m_cellsize * scrollinc, 0, (const wxRect *) NULL);
ScrollWindow( -m_cellsize * scrollinc, 0, nullptr);
}
else
{
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 pointSize = 12; // Font size
static const wxChar *index_filename = NULL; // Index filename
static const wxChar *data_filename = NULL; // Data filename
static const wxChar *index_filename = nullptr; // Index filename
static const wxChar *data_filename = nullptr; // Data filename
static wxChar error_buf[300]; // Error message buffer
static bool loaded_ok = false; // Poem 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
// Backing bitmap
wxBitmap *backingBitmap = NULL;
wxBitmap *backingBitmap = nullptr;
void PoetryError(const wxChar *, const wxChar *caption=wxT("wxPoem Error"));
void PoetryNotify(const wxChar *Msg, const wxChar *caption=wxT("wxPoem"));
@ -90,7 +90,7 @@ void FindMax(int *max_thing, int thing);
wxIMPLEMENT_APP(MyApp);
MainWindow *TheMainWindow = NULL;
MainWindow *TheMainWindow = nullptr;
// Create the fonts
void MainWindow::CreateFonts()
@ -110,7 +110,7 @@ MainWindow::MainWindow(wxFrame *frame, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, long 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();
CreateFonts();
@ -510,7 +510,7 @@ bool MyApp::OnInit()
// randomize();
pages[0] = 0;
TheMainWindow = new MainWindow(NULL,
TheMainWindow = new MainWindow(nullptr,
wxID_ANY,
wxT("wxPoem"),
wxPoint(XPos, YPos),
@ -592,7 +592,7 @@ MyCanvas::~MyCanvas()
// Note: this must be done before the main window/canvas are destroyed
// or we get an error (no parent window for menu item button)
delete m_popupMenu;
m_popupMenu = NULL;
m_popupMenu = nullptr;
}
// Define the repainting behaviour
@ -693,13 +693,13 @@ int LoadIndex(const wxChar *file_name)
wxChar buf[100];
if (file_name == NULL)
if (file_name == nullptr)
return 0;
wxSprintf(buf, wxT("%s.idx"), file_name);
index_file = wxFopen(buf, wxT("r"));
if (index_file == NULL)
if (index_file == nullptr)
return 0;
wxFscanf(index_file, wxT("%ld"), &nitems);
@ -769,7 +769,7 @@ bool LoadPoem(const wxChar *file_name, long position)
paging = false;
current_page = 0;
if (file_name == NULL)
if (file_name == nullptr)
{
wxSprintf(error_buf, wxT("Error in Poem loading."));
PoetryError(error_buf);
@ -779,7 +779,7 @@ bool LoadPoem(const wxChar *file_name, long position)
wxSprintf(buf, wxT("%s.dat"), file_name);
data_file = wxFopen(buf, wxT("rb"));
if (data_file == NULL)
if (data_file == nullptr)
{
wxSprintf(error_buf, wxT("Data file %s not found."), buf);
PoetryError(error_buf);

View file

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

View file

@ -73,7 +73,7 @@ DO:
It's also very important to make a consistent use of the ALIASES
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.
- 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
ALIASES += true="<span class='literal'>true</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>"
# 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
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
with standard information adding a custom file to it (just a timestamp) and
allows to view the information gathered using

View file

@ -45,7 +45,7 @@ wxIMPLEMENT_APP(DerivedApp);
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);

View file

@ -73,7 +73,7 @@ auto_ptr<wxZipEntry> entry;
wxFFileInputStream in(wxT("test.zip"));
wxZipInputStream zip(in);
while (entry.reset(zip.GetNextEntry()), entry.get() != NULL)
while (entry.reset(zip.GetNextEntry()), entry.get() != nullptr)
{
// access meta-data
wxString name = entry->GetName();
@ -114,7 +114,7 @@ auto_ptr<wxZipEntry> entry;
outzip.CopyArchiveMetaData(inzip);
// 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 (!outzip.CopyEntry(entry.release(), inzip))
break;
@ -165,9 +165,9 @@ do
{
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...
}
@ -189,7 +189,7 @@ wxFFileInputStream in(wxT("test.zip"));
wxZipInputStream zip(in);
// load the zip catalog
while ((entry = zip.GetNextEntry()) != NULL)
while ((entry = zip.GetNextEntry()) != nullptr)
{
wxZipEntry*& current = cat[entry->GetInternalName()];
// some archive formats can have multiple entries with the same name
@ -296,7 +296,7 @@ if (in->IsOk())
auto_ptr<wxArchiveEntry> entry;
// 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";
}
else
@ -381,7 +381,7 @@ auto_ptr<wxArchiveEntry> entry;
outarc->CopyArchiveMetaData(*arc);
while (entry.reset(arc->GetNextEntry()), entry.get() != NULL)
while (entry.reset(arc->GetNextEntry()), entry.get() != nullptr)
{
if (entry->GetName() == from)
entry->SetName(to);
@ -418,7 +418,7 @@ MyNotifier notifier;
outarc->CopyArchiveMetaData(*arc);
while (entry.reset(arc->GetNextEntry()), entry.get() != NULL)
while (entry.reset(arc->GetNextEntry()), entry.get() != nullptr)
{
entry->SetNotifier(notifier);
if (!outarc->CopyEntry(entry.release(), *arc))

View file

@ -81,7 +81,7 @@ Example of using an assertion macro:
@code
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;
};
@ -89,7 +89,7 @@ void GetTheAnswer(int *p)
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
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
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
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Hello World")
: wxFrame(nullptr, wxID_ANY, "Hello World")
{
wxMenu *menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
@ -272,7 +272,7 @@ bool MyApp::OnInit()
}
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Hello World")
: wxFrame(nullptr, wxID_ANY, "Hello World")
{
wxMenu *menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",

View file

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

View file

@ -270,7 +270,7 @@ A very simple example:
// Using wxChar* array
//
const wxChar* arrayDiet[] =
{ wxT("Herbivore"), wxT("Carnivore"), wxT("Omnivore"), NULL };
{ wxT("Herbivore"), wxT("Carnivore"), wxT("Omnivore"), nullptr };
pg->Append( new wxEnumProperty("Diet",
wxPG_LABEL,
@ -348,7 +348,7 @@ wxFlagsProperty has similar construction:
@code
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
long flags_prop_values[] = { wxICONIZE, wxCAPTION, wxMINIMIZE_BOX,

View file

@ -71,7 +71,7 @@ Example:
// it's a single Unicode code-point encoded as:
// - a UTF16 surrogate pair under Windows
// - 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());
// prints "wxString reports a length of 1 character(s)" on Linux
@ -88,7 +88,7 @@ Example:
// they are 3 Unicode code-points encoded as:
// - 3 UTF16 code units under Windows
// - 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());
// prints "wxString reports a length of 3 character(s)" on Linux
@ -96,7 +96,7 @@ Example:
@endcode
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
@ -303,12 +303,12 @@ for (i = s.begin(); i != s.end(); ++i)
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
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
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
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
case-insensitive string comparison function known either as @c stricmp() or
@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()
{
wxDialog dlg;
if (wxXmlResource::Get()->LoadDialog(&dlg, NULL, "SimpleDialog"))
if (wxXmlResource::Get()->LoadDialog(&dlg, nullptr, "SimpleDialog"))
dlg.ShowModal();
}
@endcode
@ -165,7 +165,7 @@ the XRCCTRL macro to get a pointer to the child. To expand the previous code:
void MyClass::ShowDialog()
{
wxDialog dlg;
if (!wxXmlResource::Get()->LoadDialog(&dlg, NULL, "SimpleDialog"))
if (!wxXmlResource::Get()->LoadDialog(&dlg, nullptr, "SimpleDialog"))
return;
wxTextCtrl* pText = XRCCTRL(dlg, "text", wxTextCtrl);
@ -195,7 +195,7 @@ control to the XRCID macro:
void MyClass::ShowDialog()
{
wxDialog dlg;
if (!wxXmlResource::Get()->LoadDialog(&dlg, NULL, "SimpleDialog"))
if (!wxXmlResource::Get()->LoadDialog(&dlg, nullptr, "SimpleDialog"))
return;
XRCCTRL(dlg, "text", wxTextCtrl)->Bind(wxEVT_TEXT,
@ -367,7 +367,7 @@ protected:
private:
void InitWidgetsFromXRC()
{
wxXmlResource::Get()->LoadObject(this, NULL, "TestWnd", "wxFrame");
wxXmlResource::Get()->LoadObject(this, nullptr, "TestWnd", "wxFrame");
A = XRCCTRL(*this, "A", wxTextCtrl);
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
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.

View file

@ -161,7 +161,7 @@ private:
};
// 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

View file

@ -48,18 +48,18 @@ class WXDLLIMPEXP_CORE wxAcceleratorEntry
{
public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0,
wxMenuItem *item = NULL)
wxMenuItem *item = nullptr)
: m_flags(flags)
, m_keyCode(keyCode)
, m_command(cmd)
, 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
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_keyCode = keyCode;
@ -121,7 +121,7 @@ private:
int m_keyCode; // ASCII or virtual keycode
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;
// for compatibility with old code, use accessors now!

View file

@ -263,13 +263,13 @@ public:
{ return wxACC_NOT_IMPLEMENTED; }
// 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
// not an accessible object.
virtual wxAccStatus GetChild(int WXUNUSED(childId), wxAccessible** WXUNUSED(child))
{ return wxACC_NOT_IMPLEMENTED; }
// Gets the parent, or NULL.
// Gets the parent, or nullptr.
virtual wxAccStatus GetParent(wxAccessible** WXUNUSED(parent))
{ return wxACC_NOT_IMPLEMENTED; }
@ -320,7 +320,7 @@ public:
{ return wxACC_NOT_IMPLEMENTED; }
// 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.
// If this object has the focus, child should be 'this'.
virtual wxAccStatus GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child))

View file

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

View file

@ -92,7 +92,7 @@ public:
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));
*x = dst.m_x;
@ -107,7 +107,7 @@ public:
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
dst = DoTransformDistance(wxPoint2DDouble(*dx, *dy));

View file

@ -44,7 +44,7 @@ union wxAnyValueBuffer
wxAnyValueBuffer()
{
m_ptr = NULL;
m_ptr = nullptr;
}
};
@ -324,7 +324,7 @@ public:
#if wxUSE_EXTENDED_RTTI
virtual const wxTypeInfo* GetTypeInfo() const
{
return wxGetTypeInfo((T*)NULL);
return wxGetTypeInfo((T*)nullptr);
}
#endif
};
@ -389,7 +389,7 @@ public: \
_WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\
virtual const wxTypeInfo* GetTypeInfo() const \
{ \
return wxGetTypeInfo((T*)NULL); \
return wxGetTypeInfo((T*)nullptr); \
} \
};
#else
@ -673,7 +673,7 @@ public:
/*
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
"hidden" in the source file.
*/
@ -965,7 +965,7 @@ public:
const char* and const wchar_t*) has been assigned to wxAny.
*/
template <typename T>
T As(T* = NULL) const
T As(T* = nullptr) const
{
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
// wxANY_VALUE_TYPE_CHECK_TYPE(), just call As() directly.
#define wxANY_AS(any, T) \
(any).As(static_cast<T*>(NULL))
(any).As(static_cast<T*>(nullptr))
template<typename T>

View file

@ -22,7 +22,7 @@
// ----------------------------------------------------------------------------
// 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.
//
// NB: this class is fully inline and so doesn't need to be DLL-exported
@ -30,12 +30,12 @@ class wxAnyStrPtr
{
public:
// 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.
// ctor for invalid pointer
wxAnyStrPtr()
: m_str(NULL)
: m_str(nullptr)
{
}
@ -58,7 +58,7 @@ public:
// e.g. "if ( FuncReturningAnyStrPtr() && ... )" (unfortunately using
// unspecified_bool_type here wouldn't help with ambiguity between all the
// 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
// for !anystr expressions
@ -71,7 +71,7 @@ public:
operator const char *() const
{
if ( !m_str )
return NULL;
return nullptr;
// check if the string is convertible to char at all
//
@ -100,7 +100,7 @@ public:
operator const wchar_t *() const
{
if ( !m_str )
return NULL;
return nullptr;
// no complications with wide strings (as long as we discount
// surrogates as we do for now)
@ -112,8 +112,8 @@ public:
}
// Because the objects of this class are only used as return type for
// functions which can return NULL we can skip providing dereferencing
// operators: the code using this class must test it for NULL first and if
// functions which can return nullptr we can skip providing dereferencing
// 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
// wchar_t* itself, before dereferencing.
//
@ -130,7 +130,7 @@ public:
private:
// 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_iterator m_iter;

View file

@ -226,14 +226,14 @@ public:
// wxTheApp->GetTraits() during startup or termination when the global
// 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
static wxAppTraits *GetTraitsIfExists();
// Return some valid traits object.
//
// 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
// something valid.
static wxAppTraits& GetValidTraits();
@ -241,8 +241,8 @@ public:
// 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
// to the application (except when new event loops are temporarily set-up).
// The returned value maybe NULL. Put initialization code which needs a
// non-NULL main event loop into OnEventLoopEnter().
// The returned value maybe null. Put initialization code which needs a
// non-null main event loop into OnEventLoopEnter().
wxEventLoopBase* GetMainLoop() const
{ return m_mainLoop; }
@ -495,7 +495,7 @@ protected:
// the one and only global application object
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
wxEventLoopBase *CreateMainLoop();
@ -506,11 +506,11 @@ protected:
m_appDisplayName, // app display name ("My Application")
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
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)
wxEventLoopBase *m_mainLoop;
@ -622,11 +622,11 @@ public:
// return the "main" top level window (if it hadn't been set previously
// 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;
// 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();
// control the exit behaviour: by default, the program will exit the
@ -697,7 +697,7 @@ public:
{
return ms_appInstance && ms_appInstance->IsGUI()
? static_cast<wxAppBase*>(ms_appInstance)
: NULL;
: nullptr;
}
protected:
@ -709,7 +709,7 @@ protected:
void DeleteAllTLWs();
// the main top level window (may be NULL)
// the main top level window (may be null)
wxWindow *m_topWindow;
// 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
{
public:
wxAppProgressIndicator(wxWindow* WXUNUSED(parent) = NULL,
wxAppProgressIndicator(wxWindow* WXUNUSED(parent) = nullptr,
int WXUNUSED(maxValue) = 100)
{
}

View file

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

View file

@ -58,11 +58,11 @@ public:
wxArchiveEntry *Clone() const { return DoClone(); }
void SetNotifier(wxArchiveNotifier& notifier);
virtual void UnsetNotifier() { m_notifier = NULL; }
virtual void UnsetNotifier() { m_notifier = nullptr; }
protected:
wxArchiveEntry() : m_notifier(NULL) { }
wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(NULL) { }
wxArchiveEntry() : m_notifier(nullptr) { }
wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(nullptr) { }
virtual void SetOffset(wxFileOffset offset) = 0;
virtual wxArchiveEntry* DoClone() const = 0;
@ -85,7 +85,7 @@ private:
// 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.
//
// 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
{
@ -191,11 +191,11 @@ public:
typedef T* pointer;
typedef T& reference;
wxArchiveIterator() : m_rep(NULL) { }
wxArchiveIterator() : m_rep(nullptr) { }
wxArchiveIterator(Arc& arc) {
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) {
@ -270,7 +270,7 @@ private:
typename Arc::entry_type* entry = m_arc.GetNextEntry();
if (!entry) {
UnRef();
return NULL;
return nullptr;
}
if (m_ref > 1) {
m_ref--;
@ -285,7 +285,7 @@ private:
const T& GetValue() {
if (m_entry) {
_wxSetArchiveIteratorValue(m_value, m_entry, m_entry);
m_entry = NULL;
m_entry = nullptr;
}
return m_value;
}
@ -361,7 +361,7 @@ protected:
virtual wxArchiveInputStream *DoNewStream(wxInputStream *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))
{ return *this; }

View file

@ -287,7 +287,7 @@ public:
friend difference_type operator -(const itor& i1, const itor& i2);
public:
pointer m_ptr;
reverse_iterator() : m_ptr(NULL) { }
reverse_iterator() : m_ptr(nullptr) { }
explicit reverse_iterator(pointer ptr) : m_ptr(ptr) { }
reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
reference operator*() const { return *m_ptr; }
@ -313,7 +313,7 @@ public:
friend difference_type operator -(const itor& i1, const itor& i2);
public:
pointer m_ptr;
const_reverse_iterator() : m_ptr(NULL) { }
const_reverse_iterator() : m_ptr(nullptr) { }
explicit const_reverse_iterator(pointer ptr) : m_ptr(ptr) { }
const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
@ -395,7 +395,7 @@ protected:
private:
// 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
// (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);
// Binary search in the sorted array: return the index of the string if it's
@ -432,7 +432,7 @@ class WXDLLIMPEXP_BASE wxCArrayString
{
public:
wxCArrayString( const wxArrayString& array )
: m_array( array ), m_strings( NULL )
: m_array( array ), m_strings( nullptr )
{ }
~wxCArrayString() { delete[] m_strings; }
@ -450,7 +450,7 @@ public:
wxString* Release()
{
wxString *r = GetStrings();
m_strings = NULL;
m_strings = nullptr;
return r;
}
@ -513,7 +513,7 @@ public:
wxArrayStringsAdapter(const std::vector<wxString>& strings)
: 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

View file

@ -195,12 +195,12 @@ public:
// Gets native size for given 'client' or wxDefaultSize if it doesn't
// have native equivalent. The first version returns the size in logical
// 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);
// Get the size hint of an icon from a specific wxArtClient from the
// 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);
#if WXWIN_COMPATIBILITY_3_0

View file

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

View file

@ -68,7 +68,7 @@ public:
int winId = 0)
: wxBookCtrlEvent(commandType, winId)
{
m_dragSource = NULL;
m_dragSource = nullptr;
}
wxEvent *Clone() const override { return new wxAuiNotebookEvent(*this); }
@ -151,7 +151,7 @@ public:
void SetColour(const wxColour& colour);
void SetActiveColour(const wxColour& colour);
void DoShowHide();
void SetRect(const wxRect& rect, wxWindow* wnd = NULL);
void SetRect(const wxRect& rect, wxWindow* wnd = nullptr);
void RemoveButton(int id);
void AddButton(int id,
@ -344,7 +344,7 @@ public:
//wxBookCtrlBase functions
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 bool SetPageImage(size_t n, int imageId) override;
@ -383,7 +383,7 @@ protected:
virtual wxSize CalculateNewSplitSize();
// 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
virtual int DoModifySelection(size_t n, bool events);
@ -415,7 +415,7 @@ protected:
void OnNavigationKeyNotebook(wxNavigationKeyEvent& 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)
void SetSelectionToWindow(wxWindow *win);
void SetSelectionToPage(const wxAuiNotebookPage& page)

View file

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

View file

@ -48,7 +48,7 @@ public:
virtual void SetSizingInfo(const wxSize& tabCtrlSize,
size_t tabCount,
wxWindow* wnd = NULL) = 0;
wxWindow* wnd = nullptr) = 0;
virtual void SetNormalFont(const wxFont& font) = 0;
virtual void SetSelectedFont(const wxFont& font) = 0;
@ -128,7 +128,7 @@ public:
void SetFlags(unsigned int flags) override;
void SetSizingInfo(const wxSize& tabCtrlSize,
size_t tabCount,
wxWindow* wnd = NULL) override;
wxWindow* wnd = nullptr) override;
void SetNormalFont(const wxFont& font) override;
void SetSelectedFont(const wxFont& font) override;
@ -231,7 +231,7 @@ public:
void SetSizingInfo(const wxSize& tabCtrlSize,
size_t tabCount,
wxWindow* wnd = NULL) override;
wxWindow* wnd = nullptr) override;
void SetNormalFont(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
// 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
WXDLLIMPEXP_BASE size_t
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
// 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
// stopped if it is not NULL
// stopped if it is not null
WXDLLIMPEXP_BASE size_t
wxBase64Decode(void *dst, size_t dstLen,
const char *src, size_t srcLen = wxNO_LEN,
wxBase64DecodeMode mode = wxBase64DecodeMode_Strict,
size_t *posErr = NULL);
size_t *posErr = nullptr);
inline size_t
wxBase64Decode(void *dst, size_t dstLen,
const wxString& src,
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
// strings with embedded NULs
@ -106,12 +106,12 @@ wxBase64Decode(void *dst, size_t dstLen,
WXDLLIMPEXP_BASE wxMemoryBuffer
wxBase64Decode(const char *src, size_t srcLen = wxNO_LEN,
wxBase64DecodeMode mode = wxBase64DecodeMode_Strict,
size_t *posErr = NULL);
size_t *posErr = nullptr);
inline wxMemoryBuffer
wxBase64Decode(const wxString& src,
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
// strings with embedded NULs

View file

@ -135,7 +135,7 @@ public:
{ return false; }
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; }
void SetName(const wxString& name) { m_name = name; }
@ -233,7 +233,7 @@ public:
virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0;
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;
/*

View file

@ -112,7 +112,7 @@ public:
static wxBitmapBundle FromImpl(wxBitmapBundleImpl* impl);
// 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.
void Clear();

View file

@ -94,11 +94,11 @@ public:
// get the panel which represents the given page
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
{
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
@ -162,7 +162,7 @@ public:
virtual bool RemovePage(size_t n)
{
DoInvalidateBestSize();
return DoRemovePage(n) != NULL;
return DoRemovePage(n) != nullptr;
}
// remove all pages and delete them
@ -217,7 +217,7 @@ public:
// hit test: returns which page is hit and, optionally, where (icon, label)
virtual int HitTest(const wxPoint& WXUNUSED(pt),
long * WXUNUSED(flags) = NULL) const
long * WXUNUSED(flags) = nullptr) const
{
return wxNOT_FOUND;
}
@ -279,7 +279,7 @@ protected:
// create a new "page changing" event
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"
// event, usually by just calling SetEventType() on it
@ -292,15 +292,15 @@ protected:
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
// having nodes without any associated page)
virtual bool AllowNullPage() const { return false; }
// 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
// return it if AllowNullPage() is overridden. Note that it can still
// return null if there are no valid pages after this one.
@ -349,7 +349,7 @@ protected:
// event handlers
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;
// Whether to shrink to fit current page

View file

@ -133,7 +133,7 @@ public:
CharType *release() const
{
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_ref == 1, wxT("can't release shared buffer") );
@ -141,7 +141,7 @@ public:
CharType * const p = m_data->Get();
wxScopedCharTypeBuffer *self = const_cast<wxScopedCharTypeBuffer*>(this);
self->m_data->Set(NULL, 0);
self->m_data->Set(nullptr, 0);
self->DecRef();
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()
{
return static_cast<Data *>(wxPrivate::GetUntypedNullData());
@ -252,7 +252,7 @@ protected:
public:
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 )
{
@ -365,7 +365,7 @@ public:
wxCharBuffer(const wxScopedCharTypeBufferBase& buf)
: wxCharTypeBufferBase(buf) {}
wxCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {}
wxCharBuffer(const CharType *str = nullptr) : wxCharTypeBufferBase(str) {}
wxCharBuffer(size_t len) : wxCharTypeBufferBase(len) {}
wxCharBuffer(const wxCStrData& cstr);
@ -382,7 +382,7 @@ public:
wxWCharBuffer(const wxScopedCharTypeBufferBase& buf)
: wxCharTypeBufferBase(buf) {}
wxWCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {}
wxWCharBuffer(const CharType *str = nullptr) : wxCharTypeBufferBase(str) {}
wxWCharBuffer(size_t len) : wxCharTypeBufferBase(len) {}
wxWCharBuffer(const wxCStrData& cstr);
@ -401,7 +401,7 @@ public:
// always return a buffer
// + we should derive this class from wxScopedCharTypeBuffer
// then
wxWritableCharTypeBuffer(const CharType *str = NULL)
wxWritableCharTypeBuffer(const CharType *str = nullptr)
: wxCharTypeBuffer<T>(str) {}
operator CharType*() { return this->data(); }
@ -448,7 +448,7 @@ public:
// everything is private as it can only be used by wxMemoryBuffer
private:
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); }
@ -483,13 +483,13 @@ private:
void *release()
{
if ( m_data == NULL )
return NULL;
if ( m_data == nullptr )
return nullptr;
wxASSERT_MSG( m_ref == 1, "can't release shared buffer" );
void *p = m_data;
m_data = NULL;
m_data = nullptr;
m_len =
m_size = 0;

View file

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

View file

@ -36,12 +36,12 @@ public:
// 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();
// returns the default button size for this platform, and optionally for a
// specific window when the platform supports per-monitor DPI
static wxSize GetDefaultSize(wxWindow* win = NULL);
static wxSize GetDefaultSize(wxWindow* win = nullptr);
protected:
wxDECLARE_NO_COPY_CLASS(wxButtonBase);

View file

@ -204,7 +204,7 @@ public:
}
// 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
virtual bool
GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const
@ -223,8 +223,8 @@ public:
// notice that this is not implemented in all versions
virtual wxCalendarHitTestResult
HitTest(const wxPoint& WXUNUSED(pos),
wxDateTime* WXUNUSED(date) = NULL,
wxDateTime::WeekDay* WXUNUSED(wd) = NULL)
wxDateTime* WXUNUSED(date) = nullptr,
wxDateTime::WeekDay* WXUNUSED(wd) = nullptr)
{
return wxCAL_HITTEST_NOWHERE;
}
@ -253,7 +253,7 @@ public:
virtual void Mark(size_t day, bool mark) = 0;
virtual wxCalendarDateAttr *GetAttr(size_t WXUNUSED(day)) const
{ return NULL; }
{ return nullptr; }
virtual void SetAttr(size_t WXUNUSED(day), wxCalendarDateAttr *attr)
{ delete attr; }
virtual void ResetAttr(size_t WXUNUSED(day)) { }

View file

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

View file

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

View file

@ -54,7 +54,7 @@ public:
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 );
if (it == m_fields.end())
@ -71,7 +71,7 @@ public:
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 );
if (it == m_fields.end())
@ -180,7 +180,7 @@ public:
void *GetClientData() const;
protected:
bool HasClientDataContainer() const { return m_data.get() != NULL; }
bool HasClientDataContainer() const { return m_data.get() != nullptr; }
void CopyClientDataContainer(const wxSharedClientDataContainer& other)
{
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();
// m_data is shared, not deep copied, when cloned. If you make changes to

View file

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

View file

@ -93,7 +93,7 @@ struct wxCmdLineEntryDesc
// the list of wxCmdLineEntryDesc objects should be terminated with this one
#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
@ -141,7 +141,7 @@ public:
typedef std::bidirectional_iterator_tag iterator_category;
#endif // wx_USE_STD_STRING
const_iterator() : m_parser(NULL), m_index(0) {}
const_iterator() : m_parser(nullptr), m_index(0) {}
reference operator *() const;
pointer operator ->() const;
const_iterator &operator ++ ();

View file

@ -90,7 +90,7 @@ public:
const wxList& GetCommands() const { return m_commands; }
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; }
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
WXDLLIMPEXP_CORE wxColour wxGetColourFromUser(wxWindow *parent = NULL,
WXDLLIMPEXP_CORE wxColour wxGetColourFromUser(wxWindow *parent = nullptr,
const wxColour& colInit = wxNullColour,
const wxString& caption = wxEmptyString,
wxColourData *data = NULL);
wxColourData *data = nullptr);
#endif // wxUSE_COLOURDLG

View file

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

View file

@ -181,7 +181,7 @@ public:
bool IsPopupShown() const { return m_popupWinState == Visible; }
// 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 )
{
DoSetPopupControl(popup);
@ -538,7 +538,7 @@ protected:
virtual wxSize DoGetBestSize() 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);
// ensures there is at least the default popup
@ -674,7 +674,7 @@ protected:
wxRect m_tcArea;
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;
// current button state (uses renderer flags)
@ -752,7 +752,7 @@ class WXDLLIMPEXP_CORE wxComboPopup
public:
wxComboPopup()
{
m_combo = NULL;
m_combo = nullptr;
m_iFlags = 0;
}
@ -796,7 +796,7 @@ public:
// implementation. If the found item matched the string, but is
// different, it should be written back to pItem. Default implementation
// 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).
// Default implementation draws value as string.

View file

@ -147,7 +147,7 @@ private:
{
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
// simpler and it doesn't cost us much here.
if ( child )
@ -165,7 +165,7 @@ class wxCompositeWindow : public wxCompositeWindowSettersOnly<W>
public:
virtual void SetFocus() override
{
wxSetFocusToChild(this, NULL);
wxSetFocusToChild(this, nullptr);
}
protected:

View file

@ -104,7 +104,7 @@ public:
// comments near definition wxUSE_CONFIG_NATIVE for details. It returns
// the created object and also sets it as ms_pConfig.
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; }
// ctor & virtual dtor

View file

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

View file

@ -145,9 +145,9 @@ public:
int flags = wxELLIPSIZE_FLAGS_DEFAULT);
// 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,
wxString *labelOnly = NULL);
wxString *labelOnly = nullptr);
// this is a helper for the derived class GetClassDefaultAttributes()
// 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
// differently.
m_conv = NULL;
m_conv = nullptr;
m_bomType = wxBOM_Unknown;
m_ownsConv = false;
m_consumedBOM = false;
@ -139,7 +139,7 @@ private:
// wxFONTENCODING_MAX but not wxFONTENCODING_DEFAULT
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()
wxMBConv *m_conv;

View file

@ -109,7 +109,7 @@
/*
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__
#if defined(__GNUC__) || \
@ -118,7 +118,7 @@
#define __WXFUNCTION__ __FUNCTION__
#else
/* still define __WXFUNCTION__ to avoid #ifdefs elsewhere */
#define __WXFUNCTION__ (NULL)
#define __WXFUNCTION__ (nullptr)
#endif
#endif /* __WXFUNCTION__ already defined */

View file

@ -38,7 +38,7 @@
class WXDLLIMPEXP_CORE wxContextHelp : public wxObject
{
public:
wxContextHelp(wxWindow* win = NULL, bool beginHelp = true);
wxContextHelp(wxWindow* win = nullptr, bool beginHelp = true);
virtual ~wxContextHelp();
bool BeginContextHelp(wxWindow* win);
@ -146,7 +146,7 @@ public:
const wxPoint& pt,
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_helptextOrigin = origin;
@ -229,7 +229,7 @@ class WXDLLIMPEXP_CORE wxHelpControllerHelpProvider : public wxSimpleHelpProvide
public:
// Note that it doesn't own the help controller. The help controller
// should be deleted separately.
wxHelpControllerHelpProvider(wxHelpControllerBase* hc = NULL);
wxHelpControllerHelpProvider(wxHelpControllerBase* hc = nullptr);
// implement wxHelpProvider methods

View file

@ -119,7 +119,7 @@ private:
int AppendItems(const wxArrayStringsAdapter& items)
{
return AppendItems(items, NULL, wxClientData_None);
return AppendItems(items, nullptr, wxClientData_None);
}
int AppendItems(const wxArrayStringsAdapter& items, void **clientData)
@ -162,7 +162,7 @@ private:
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,
@ -316,7 +316,7 @@ public:
// SetClientObject() takes ownership of the pointer, GetClientObject()
// returns it but keeps the ownership while DetachClientObject() expects
// 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);
wxClientData* GetClientObject(unsigned int n) const;
wxClientData* DetachClientObject(unsigned int n);
@ -397,7 +397,7 @@ protected:
wxClientDataType type);
// 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);
// 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.
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
// therefore not be destroyed by the caller.
wxDataObjectSimple *GetObject(const wxDataFormat& format,

View file

@ -108,8 +108,8 @@ WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray);
class WXDLLIMPEXP_CORE wxDataViewModelNotifier
{
public:
wxDataViewModelNotifier() { m_owner = NULL; }
virtual ~wxDataViewModelNotifier() { m_owner = NULL; }
wxDataViewModelNotifier() { m_owner = nullptr; }
virtual ~wxDataViewModelNotifier() { m_owner = nullptr; }
virtual bool ItemAdded( 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;
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; }
// 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;
// Selection: both GetSelection() and GetSelections() can be used for the
@ -754,9 +754,9 @@ public:
virtual bool IsExpanded( const wxDataViewItem & item ) const = 0;
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 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; }
@ -857,7 +857,7 @@ public:
wxDataViewEvent()
: wxNotifyEvent()
{
Init(NULL, NULL, wxDataViewItem());
Init(nullptr, nullptr, wxDataViewItem());
}
// Constructor for the events affecting columns (and possibly also items).
@ -876,7 +876,7 @@ public:
const wxDataViewItem& item)
: wxNotifyEvent(evtType, dvc->GetId())
{
Init(dvc, NULL, item);
Init(dvc, nullptr, item);
}
wxDataViewEvent(const wxDataViewEvent& event)
@ -1241,7 +1241,7 @@ public:
wxDataViewTreeStoreNode( wxDataViewTreeStoreNode *parent,
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
virtual ~wxDataViewTreeStoreNode();
void SetText( const wxString &text )
@ -1284,7 +1284,7 @@ public:
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
virtual ~wxDataViewTreeStoreContainerNode();
const wxDataViewTreeStoreNodes &GetChildren() const
@ -1328,31 +1328,31 @@ public:
wxDataViewItem AppendItem( const wxDataViewItem& parent,
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
wxDataViewItem PrependItem( const wxDataViewItem& parent,
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
wxDataViewItem PrependContainer( const wxDataViewItem& parent,
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
wxDataViewItem AppendContainer( const wxDataViewItem& parent,
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text,
const wxBitmapBundle &icon = wxBitmapBundle(),
const wxBitmapBundle &expanded = wxBitmapBundle(),
wxClientData *data = NULL );
wxClientData *data = nullptr );
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const;
int GetChildCount( const wxDataViewItem& parent ) const;
@ -1429,21 +1429,21 @@ public:
{ return GetStore()->IsContainer(item); }
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,
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,
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,
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL );
wxClientData *data = nullptr );
wxDataViewItem AppendContainer( const wxDataViewItem& parent,
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,
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
{ return GetStore()->GetNthChild(parent, pos); }

View file

@ -927,7 +927,7 @@ public:
// all conversions functions return true to indicate whether parsing
// 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
// parsed)
@ -1021,7 +1021,7 @@ public:
// backwards compatible versions of the parsing functions: they return an
// 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
//
// they're not deprecated because a lot of existing code uses them and
@ -1120,7 +1120,7 @@ public:
inline wxLongLong GetValue() const;
// 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
static struct tm *GetTmNow()

View file

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

View file

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

View file

@ -209,9 +209,9 @@ public:
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const override;
wxCoord *descent = nullptr,
wxCoord *externalLeading = nullptr,
const wxFont *theFont = nullptr) 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
wxPoint* Mirror(int n, const wxPoint*& points) const
{
wxPoint* points_alloc = NULL;
wxPoint* points_alloc = nullptr;
if ( m_mirror )
{
points_alloc = new wxPoint[n];
@ -256,9 +256,9 @@ protected:
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const override
wxCoord *descent = nullptr,
wxCoord *externalLeading = nullptr,
const wxFont *theFont = nullptr) const override
{
// never mirrored
m_dc.DoGetTextExtent(string, x, y, descent, externalLeading, theFont);

View file

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

View file

@ -135,7 +135,7 @@ public:
virtual void SetFont(const wxFont& font) 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);
@ -235,9 +235,9 @@ private:
virtual void DoGetTextExtent(const wxString& string,
wxCoord* x, wxCoord* y,
wxCoord* descent = NULL,
wxCoord* externalLeading = NULL,
const wxFont* theFont = NULL) const override;
wxCoord* descent = nullptr,
wxCoord* externalLeading = nullptr,
const wxFont* theFont = nullptr) const override;
virtual void DoSetDeviceClippingRegion(const wxRegion& region) override;

View file

@ -81,7 +81,7 @@ typedef void (*wxAssertHandler_t)(const wxString& file,
#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
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.
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.
Notice that this function is not MT-safe, so you should call it before
@ -132,15 +132,15 @@ extern void WXDLLIMPEXP_BASE wxSetDefaultAssertHandler();
// defined
inline wxAssertHandler_t wxSetAssertHandler(wxAssertHandler_t /* handler */)
{
return NULL;
return nullptr;
}
inline void wxSetDefaultAssertHandler() { }
#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
// simply a synonym for wxSetAssertHandler(NULL)
inline void wxDisableAsserts() { wxSetAssertHandler(NULL); }
// simply a synonym for wxSetAssertHandler(nullptr)
inline void wxDisableAsserts() { wxSetAssertHandler(nullptr); }
/*
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().
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).
*/
@ -170,7 +170,7 @@ inline void wxDisableAsserts() { wxSetAssertHandler(NULL); }
// 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
// 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
//
// 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,
const char *func,
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
// 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
// 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
// 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__)
#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
#define wxTrap()
@ -357,10 +357,10 @@ extern void WXDLLIMPEXP_BASE wxAbort();
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
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
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
@ -379,10 +379,10 @@ extern void WXDLLIMPEXP_BASE wxAbort();
#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)
#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
#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
//

View file

@ -707,9 +707,7 @@ typedef short int WXTYPE;
wxDEPRECATED(func) { body }
#endif
/* NULL declaration: it must be defined as 0 for C++ programs (in particular, */
/* it must not be defined as "(void *)0" which is standard for C but completely */
/* breaks C++ code) */
/* Get size_t declaration. */
#include <stddef.h>
/* size of statically declared array */
@ -852,29 +850,29 @@ typedef short int WXTYPE;
// everybody gets the assert and other debug macros
#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>
inline void wxDELETE(T*& ptr)
{
typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
if ( ptr != NULL )
if ( ptr != nullptr )
{
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>
inline void wxDELETEA(T*& ptr)
{
typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
if ( ptr != NULL )
if ( ptr != nullptr )
{
delete [] ptr;
ptr = NULL;
ptr = nullptr;
}
}
@ -973,16 +971,10 @@ typedef double wxDouble;
#endif /* wxWCHAR_T_IS_REAL_TYPE/!wxWCHAR_T_IS_REAL_TYPE */
/*
This constant should be used instead of NULL in vararg functions taking
wxChar* arguments: passing NULL (which is the same as 0, unless the compiler
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.
Deprecated constant existing only for compatibility, use nullptr directly in
the new code.
*/
#define wxNullPtr ((void *)NULL)
#define wxNullPtr nullptr
/* Define wxChar16 and wxChar32 */

View file

@ -59,7 +59,7 @@ public:
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
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);
#if wxUSE_PALETTE

View file

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

View file

@ -26,7 +26,7 @@ public:
virtual ~wxWindowDCImpl();
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
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.
*/
wxDfbPtr(T *ptr = NULL) : m_ptr(ptr) {}
wxDfbPtr(T *ptr = nullptr) : m_ptr(ptr) {}
/// Copy ctor
wxDfbPtr(const wxDfbPtr& ptr) { InitFrom(ptr); }
@ -62,13 +62,13 @@ public:
/// Dtor. Releases the interface
~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()
{
if ( 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 Refresh(bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL);
const wxRect *rect = nullptr);
virtual void Update();
virtual bool SetCursor(const wxCursor &cursor);
@ -105,9 +105,9 @@ protected:
// implement the base class pure virtuals
virtual void DoGetTextExtent(const wxString& string,
int *x, int *y,
int *descent = NULL,
int *externalLeading = NULL,
const wxFont *theFont = NULL) const;
int *descent = nullptr,
int *externalLeading = nullptr,
const wxFont *theFont = nullptr) const;
virtual void DoClientToScreen(int *x, int *y) const;
virtual void DoScreenToClient(int *x, int *y) const;
virtual void DoGetPosition(int *x, int *y) const;
@ -178,7 +178,7 @@ private:
// don't access it directly)
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;
friend class wxNonOwnedWindow; // for HandleXXXEvent

View file

@ -126,7 +126,7 @@ protected:
The wrapper provides same API as DirectFB, with a few exceptions:
- methods return true/false instead of error code
- 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
- interface arguments use wxFooPtr type instead of raw DirectFB pointer
- 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
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)
{
@ -255,7 +255,7 @@ struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface>
if ( Check(m_ptr->GetSubSurface(m_ptr, rect, &s)) )
return new wxIDirectFBSurface(s);
else
return NULL;
return nullptr;
}
wxIDirectFBPalettePtr GetPalette()
@ -264,7 +264,7 @@ struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface>
if ( Check(m_ptr->GetPalette(m_ptr, &s)) )
return new wxIDirectFBPalette(s);
else
return NULL;
return nullptr;
}
bool SetPalette(const wxIDirectFBPalettePtr& pal)
@ -336,7 +336,7 @@ struct wxIDirectFBSurface : public wxDfbWrapper<IDirectFBSurface>
: m_surface(surface)
{
if ( !surface->Lock(flags, &ptr, &pitch) )
ptr = NULL;
ptr = nullptr;
}
~Locked()
@ -415,7 +415,7 @@ struct wxIDirectFBWindow : public wxDfbWrapper<IDirectFBWindow>
if ( Check(m_ptr->GetSurface(m_ptr, &s)) )
return new wxIDirectFBSurface(s);
else
return NULL;
return nullptr;
}
bool AttachEventBuffer(const wxIDirectFBEventBufferPtr& buffer)
@ -443,7 +443,7 @@ struct wxIDirectFBDisplayLayer : public wxDfbWrapper<IDirectFBDisplayLayer>
if ( Check(m_ptr->CreateWindow(m_ptr, desc, &w)) )
return new wxIDirectFBWindow(w);
else
return NULL;
return nullptr;
}
bool GetConfiguration(DFBDisplayLayerConfig *config)
@ -466,7 +466,7 @@ struct wxIDirectFBDisplayLayer : public wxDfbWrapper<IDirectFBDisplayLayer>
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
method is cheap.
*/
@ -485,7 +485,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->CreateSurface(m_ptr, desc, &s)) )
return new wxIDirectFBSurface(s);
else
return NULL;
return nullptr;
}
wxIDirectFBEventBufferPtr CreateEventBuffer()
@ -494,7 +494,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->CreateEventBuffer(m_ptr, &b)) )
return new wxIDirectFBEventBuffer(b);
else
return NULL;
return nullptr;
}
wxIDirectFBFontPtr CreateFont(const char *filename,
@ -504,7 +504,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->CreateFont(m_ptr, filename, desc, &f)) )
return new wxIDirectFBFont(f);
else
return NULL;
return nullptr;
}
wxIDirectFBDisplayLayerPtr
@ -514,7 +514,7 @@ struct wxIDirectFB : public wxDfbWrapper<IDirectFB>
if ( Check(m_ptr->GetDisplayLayer(m_ptr, id, &l)) )
return new wxIDirectFBDisplayLayer(l);
else
return NULL;
return nullptr;
}
/// 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
// 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
{
return DoGetParentForDialog(wxDIALOG_MODALITY_APP_MODAL, parent, style);
@ -142,7 +142,7 @@ public:
// 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
// platforms which have hardware buttons replacing OK/Cancel and such)
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
// 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
void AddMainButtonId(wxWindowID id) { m_mainButtonIds.Add((int) id); }
@ -262,7 +262,7 @@ private:
long style) const;
// 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 *parent) const;
@ -349,8 +349,8 @@ public:
#endif // wxUSE_BUTTON
// Reparent the controls to the scrolled window, except those in buttonSizer
virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL);
static void DoReparentControls(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 = nullptr);
// 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).

View file

@ -96,7 +96,7 @@ public:
// -----
// default, use Open()
wxDir() { m_data = NULL; }
wxDir() { m_data = nullptr; }
// opens the directory for enumeration, use IsOpened() to test success
wxDir(const wxString& dir);
@ -162,7 +162,7 @@ public:
#if wxUSE_LONGLONG
// 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

View file

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

View file

@ -73,7 +73,7 @@ public:
// 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
wxRect GetGeometry() const;

View file

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

View file

@ -62,7 +62,7 @@ public:
: m_cursorCopy(cursorCopy),
m_cursorMove(cursorMove),
m_cursorStop(cursorStop)
{ m_data = NULL; }
{ m_data = nullptr; }
virtual ~wxDropSourceBase() { }
// 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
// by wxDropTarget and deleted by it automatically. If you don't give it
// here, you can use SetDataObject() later.
wxDropTargetBase(wxDataObject *dataObject = NULL)
wxDropTargetBase(wxDataObject *dataObject = nullptr)
{ m_dataObject = dataObject; m_defaultAction = wxDragNone; }
// dtor deletes our data object
virtual ~wxDropTargetBase()

View file

@ -67,7 +67,7 @@ typedef wxVector<wxDocTemplate*> wxDocTemplateVector;
class WXDLLIMPEXP_CORE wxDocument : public wxEvtHandler
{
public:
wxDocument(wxDocument *parent = NULL);
wxDocument(wxDocument *parent = nullptr);
virtual ~wxDocument();
// accessors
@ -159,7 +159,7 @@ public:
wxView *GetFirstView() const;
virtual void UpdateAllViews(wxView *sender = NULL, wxObject *hint = NULL);
virtual void UpdateAllViews(wxView *sender = nullptr, wxObject *hint = nullptr);
virtual void NotifyClosing();
// 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
// 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
// it if necessary.
@ -199,7 +199,7 @@ protected:
wxDocTemplate* m_documentTemplate;
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
// independently of its parent and is always closed when its parent is
wxDocument* m_documentParent;
@ -245,7 +245,7 @@ public:
wxView *deactiveView);
virtual void OnDraw(wxDC *dc) = 0;
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 OnChangeFilename();
@ -280,7 +280,7 @@ public:
// destroyed
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; }
protected:
@ -314,8 +314,8 @@ public:
const wxString& ext,
const wxString& docTypeName,
const wxString& viewTypeName,
wxClassInfo *docClassInfo = NULL,
wxClassInfo *viewClassInfo = NULL,
wxClassInfo *docClassInfo = nullptr,
wxClassInfo *viewClassInfo = nullptr,
long flags = wxDEFAULT_TEMPLATE_FLAGS);
virtual ~wxDocTemplate();
@ -446,10 +446,10 @@ public:
void AssociateTemplate(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);
// Find document from file name, may return NULL.
// Find document from file name, may return nullptr.
wxDocument* FindDocumentByPath(const wxString& path) const;
wxDocument *GetCurrentDocument() const;
@ -476,7 +476,7 @@ public:
virtual wxView *GetCurrentView() const { return m_currentView; }
// 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.
wxView *GetAnyUsableView() const;
@ -576,10 +576,10 @@ public:
// default ctor, use Create() after it
wxDocChildFrameAnyBase()
{
m_childDocument = NULL;
m_childView = NULL;
m_win = NULL;
m_lastEvent = NULL;
m_childDocument = nullptr;
m_childView = nullptr;
m_win = nullptr;
m_lastEvent = nullptr;
}
// 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
// (and not via Close() + Destroy())
if ( m_childView )
m_childView->SetDocChildFrame(NULL);
m_childView->SetDocChildFrame(nullptr);
}
wxDocument *GetDocument() const { return m_childDocument; }
@ -808,7 +808,7 @@ public:
wxDocParentFrameAnyBase(wxWindow* frame)
: m_frame(frame)
{
m_docManager = NULL;
m_docManager = nullptr;
}
wxDocManager *GetDocumentManager() const { return m_docManager; }
@ -949,7 +949,7 @@ private:
class WXDLLIMPEXP_CORE wxDocPrintout : public wxPrintout
{
public:
wxDocPrintout(wxView *view = NULL, const wxString& title = wxString());
wxDocPrintout(wxView *view = nullptr, const wxString& title = wxString());
// implement wxPrintout methods
virtual bool OnPrintPage(int page) override;

View file

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

View file

@ -360,7 +360,7 @@ public:
T* const pItem = Traits::Clone(item);
const size_t nOldSize = size();
if ( pItem != NULL )
if ( pItem != nullptr )
base::insert(this->end(), nInsert, pItem);
for ( size_t i = 1; i < nInsert; i++ )
@ -381,7 +381,7 @@ public:
return;
T* const pItem = Traits::Clone(item);
if ( pItem != NULL )
if ( pItem != nullptr )
base::insert(this->begin() + uiIndex, nInsert, pItem);
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
// do need it
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
// Detach() if you use this function
@ -162,7 +162,7 @@ class WXDLLIMPEXP_BASE wxDynamicLibraryDetails
public:
// ctor, normally never used as these objects are only created by
// wxDynamicLibrary::ListLoaded()
wxDynamicLibraryDetails() { m_address = NULL; m_length = 0; }
wxDynamicLibraryDetails() { m_address = nullptr; m_length = 0; }
// get the (base) name
wxString GetName() const { return m_name; }
@ -213,16 +213,16 @@ WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetails,
class WXDLLIMPEXP_BASE wxDynamicLibrary
{
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)
static wxDllType GetProgramHandle();
// return the platform standard DLL extension (with leading dot)
static wxString GetDllExt(wxDynamicLibraryCategory cat = wxDL_LIBRARY);
wxDynamicLibrary() : m_handle(NULL) { }
wxDynamicLibrary() : m_handle(nullptr) { }
wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT)
: m_handle(NULL)
: m_handle(nullptr)
{
Load(libname, flags);
}
@ -232,14 +232,14 @@ public:
~wxDynamicLibrary() { Unload(); }
// 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
bool Load(const wxString& libname, int flags = wxDL_DEFAULT);
// raw function for loading dynamic libs: always behaves as if
// 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);
// attach to an existing handle
@ -248,13 +248,13 @@ public:
// 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
// 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)
static void Unload(wxDllType handle);
// 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.
wxDllType GetLibHandle() const { return m_handle; }
@ -273,14 +273,14 @@ public:
// 'name' is the (possibly mangled) name of the symbol. (use extern "C" to
// 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
// 'success' for a true indication of success or failure to load the
// 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.
void *GetSymbol(const wxString& name, bool *success = NULL) const;
void *GetSymbol(const wxString& name, bool *success = nullptr) const;
// low-level version of GetSymbol()
static void *RawGetSymbol(wxDllType handle, const wxString& name);
@ -334,11 +334,11 @@ public:
static wxString GetPluginsDirectory();
// 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.
static void* GetModuleFromAddress(const void* addr, wxString* path = NULL);
static void* GetModuleFromAddress(const void* addr, wxString* path = nullptr);
#ifdef __WINDOWS__
// return the handle (HMODULE/HINSTANCE) of the DLL with the given name
@ -355,13 +355,13 @@ public:
protected:
// 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
static void ReportError(const wxString& msg,
const wxString& name = wxString());
// the handle to DLL or NULL
// the handle to DLL or nullptr
wxDllType m_handle;
// no copy ctor/assignment operators (or we'd try to unload the library

View file

@ -81,7 +81,7 @@ public:
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
// sufficient number of times.
const wxClassInfo *m_ourFirst; // first class info in this plugin
@ -112,7 +112,7 @@ public:
// Instance methods.
wxPluginManager() : m_entry(NULL) {}
wxPluginManager() : m_entry(nullptr) {}
wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT)
{
Load(libname, flags);
@ -123,22 +123,22 @@ public:
void Unload();
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 );
}
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:
// 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)
{
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.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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