mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 22:30:07 -05:00
use CM_NULLPTR
This commit is contained in:
committed by
Brad King
parent
b4b73f56a2
commit
1d6909a287
@@ -24,29 +24,30 @@
|
||||
#include <form.h>
|
||||
|
||||
static const char* cmDocumentationName[][2] = {
|
||||
{ 0, " ccmake - Curses Interface for CMake." },
|
||||
{ 0, 0 }
|
||||
{ CM_NULLPTR, " ccmake - Curses Interface for CMake." },
|
||||
{ CM_NULLPTR, CM_NULLPTR }
|
||||
};
|
||||
|
||||
static const char* cmDocumentationUsage[][2] = {
|
||||
{ 0, " ccmake <path-to-source>\n"
|
||||
" ccmake <path-to-existing-build>" },
|
||||
{ 0, "Specify a source directory to (re-)generate a build system for "
|
||||
"it in the current working directory. Specify an existing build "
|
||||
"directory to re-generate its build system." },
|
||||
{ 0, 0 }
|
||||
{ CM_NULLPTR, " ccmake <path-to-source>\n"
|
||||
" ccmake <path-to-existing-build>" },
|
||||
{ CM_NULLPTR,
|
||||
"Specify a source directory to (re-)generate a build system for "
|
||||
"it in the current working directory. Specify an existing build "
|
||||
"directory to re-generate its build system." },
|
||||
{ CM_NULLPTR, CM_NULLPTR }
|
||||
};
|
||||
|
||||
static const char* cmDocumentationUsageNote[][2] = {
|
||||
{ 0, "Run 'ccmake --help' for more information." },
|
||||
{ 0, 0 }
|
||||
{ CM_NULLPTR, "Run 'ccmake --help' for more information." },
|
||||
{ CM_NULLPTR, CM_NULLPTR }
|
||||
};
|
||||
|
||||
static const char* cmDocumentationOptions[]
|
||||
[2] = { CMAKE_STANDARD_OPTIONS_TABLE,
|
||||
{ 0, 0 } };
|
||||
{ CM_NULLPTR, CM_NULLPTR } };
|
||||
|
||||
cmCursesForm* cmCursesForm::CurrentForm = 0;
|
||||
cmCursesForm* cmCursesForm::CurrentForm = CM_NULLPTR;
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -176,7 +177,7 @@ int main(int argc, char const* const* argv)
|
||||
touchwin(stdscr);
|
||||
endwin();
|
||||
delete cmCursesForm::CurrentForm;
|
||||
cmCursesForm::CurrentForm = 0;
|
||||
cmCursesForm::CurrentForm = CM_NULLPTR;
|
||||
|
||||
std::cout << std::endl << std::endl;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
|
||||
{
|
||||
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
|
||||
this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
|
||||
this->Entry = 0;
|
||||
this->Entry = CM_NULLPTR;
|
||||
this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
|
||||
this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
|
||||
}
|
||||
|
||||
this->Entry = 0;
|
||||
this->Entry = CM_NULLPTR;
|
||||
const char* value = cm->GetState()->GetCacheEntryValue(key);
|
||||
assert(value);
|
||||
switch (cm->GetState()->GetCacheEntryType(key)) {
|
||||
@@ -111,6 +111,6 @@ const char* cmCursesCacheEntryComposite::GetValue()
|
||||
if (this->Label) {
|
||||
return this->Label->GetValue();
|
||||
} else {
|
||||
return 0;
|
||||
return CM_NULLPTR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ bool cmCursesForm::Debug = false;
|
||||
|
||||
cmCursesForm::cmCursesForm()
|
||||
{
|
||||
this->Form = 0;
|
||||
this->Form = CM_NULLPTR;
|
||||
}
|
||||
|
||||
cmCursesForm::~cmCursesForm()
|
||||
@@ -24,7 +24,7 @@ cmCursesForm::~cmCursesForm()
|
||||
if (this->Form) {
|
||||
unpost_form(this->Form);
|
||||
free_form(this->Form);
|
||||
this->Form = 0;
|
||||
this->Form = CM_NULLPTR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ cmCursesLongMessageForm::cmCursesLongMessageForm(
|
||||
this->Messages += "\n\n";
|
||||
}
|
||||
this->Title = title;
|
||||
this->Fields[0] = 0;
|
||||
this->Fields[1] = 0;
|
||||
this->Fields[0] = CM_NULLPTR;
|
||||
this->Fields[1] = CM_NULLPTR;
|
||||
}
|
||||
|
||||
cmCursesLongMessageForm::~cmCursesLongMessageForm()
|
||||
@@ -110,7 +110,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int)
|
||||
if (this->Form) {
|
||||
unpost_form(this->Form);
|
||||
free_form(this->Form);
|
||||
this->Form = 0;
|
||||
this->Form = CM_NULLPTR;
|
||||
}
|
||||
|
||||
const char* msg = this->Messages.c_str();
|
||||
@@ -119,7 +119,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int)
|
||||
|
||||
if (this->Fields[0]) {
|
||||
free_field(this->Fields[0]);
|
||||
this->Fields[0] = 0;
|
||||
this->Fields[0] = CM_NULLPTR;
|
||||
}
|
||||
|
||||
this->Fields[0] = new_field(y - 6, x - 2, 1, 1, 0, 0);
|
||||
|
||||
@@ -36,8 +36,8 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
|
||||
, InitialWidth(initWidth)
|
||||
{
|
||||
this->NumberOfPages = 0;
|
||||
this->Fields = 0;
|
||||
this->Entries = 0;
|
||||
this->Fields = CM_NULLPTR;
|
||||
this->Entries = CM_NULLPTR;
|
||||
this->AdvancedMode = false;
|
||||
this->NumberOfVisibleEntries = 0;
|
||||
this->OkToGenerate = false;
|
||||
@@ -64,7 +64,7 @@ cmCursesMainForm::~cmCursesMainForm()
|
||||
if (this->Form) {
|
||||
unpost_form(this->Form);
|
||||
free_form(this->Form);
|
||||
this->Form = 0;
|
||||
this->Form = CM_NULLPTR;
|
||||
}
|
||||
delete[] this->Fields;
|
||||
|
||||
@@ -75,7 +75,7 @@ cmCursesMainForm::~cmCursesMainForm()
|
||||
delete this->Entries;
|
||||
if (this->CMakeInstance) {
|
||||
delete this->CMakeInstance;
|
||||
this->CMakeInstance = 0;
|
||||
this->CMakeInstance = CM_NULLPTR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ void cmCursesMainForm::RePost()
|
||||
if (this->Form) {
|
||||
unpost_form(this->Form);
|
||||
free_form(this->Form);
|
||||
this->Form = 0;
|
||||
this->Form = CM_NULLPTR;
|
||||
}
|
||||
delete[] this->Fields;
|
||||
if (this->AdvancedMode) {
|
||||
@@ -215,7 +215,7 @@ void cmCursesMainForm::RePost()
|
||||
this->Fields = new FIELD*[3 * this->NumberOfVisibleEntries + 1];
|
||||
size_t cc;
|
||||
for (cc = 0; cc < 3 * this->NumberOfVisibleEntries + 1; cc++) {
|
||||
this->Fields[cc] = 0;
|
||||
this->Fields[cc] = CM_NULLPTR;
|
||||
}
|
||||
|
||||
// Assign fields
|
||||
@@ -244,7 +244,7 @@ void cmCursesMainForm::RePost()
|
||||
this->NumberOfVisibleEntries = 1;
|
||||
}
|
||||
// Has to be null terminated.
|
||||
this->Fields[3 * this->NumberOfVisibleEntries] = 0;
|
||||
this->Fields[3 * this->NumberOfVisibleEntries] = CM_NULLPTR;
|
||||
}
|
||||
|
||||
void cmCursesMainForm::Render(int left, int top, int width, int height)
|
||||
@@ -263,7 +263,7 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
|
||||
// Delete the previous form
|
||||
unpost_form(this->Form);
|
||||
free_form(this->Form);
|
||||
this->Form = 0;
|
||||
this->Form = CM_NULLPTR;
|
||||
}
|
||||
|
||||
// Wrong window size
|
||||
@@ -345,7 +345,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
|
||||
}
|
||||
|
||||
// Give the current widget (if it exists), a chance to print keys
|
||||
cmCursesWidget* cw = 0;
|
||||
cmCursesWidget* cw = CM_NULLPTR;
|
||||
if (this->Form) {
|
||||
FIELD* currentField = current_field(this->Form);
|
||||
cw = reinterpret_cast<cmCursesWidget*>(field_userptr(currentField));
|
||||
@@ -434,7 +434,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
|
||||
// Get the key of the current entry
|
||||
FIELD* cur = current_field(this->Form);
|
||||
int findex = field_index(cur);
|
||||
cmCursesWidget* lbl = 0;
|
||||
cmCursesWidget* lbl = CM_NULLPTR;
|
||||
if (findex >= 0) {
|
||||
lbl = reinterpret_cast<cmCursesWidget*>(
|
||||
field_userptr(this->Fields[findex - 2]));
|
||||
@@ -566,7 +566,7 @@ int cmCursesMainForm::Configure(int noconfigure)
|
||||
this->FillCacheManagerFromUI();
|
||||
this->CMakeInstance->SaveCache(
|
||||
this->CMakeInstance->GetHomeOutputDirectory());
|
||||
this->LoadCache(0);
|
||||
this->LoadCache(CM_NULLPTR);
|
||||
|
||||
// Get rid of previous errors
|
||||
this->Errors = std::vector<std::string>();
|
||||
@@ -583,7 +583,7 @@ int cmCursesMainForm::Configure(int noconfigure)
|
||||
} else {
|
||||
retVal = this->CMakeInstance->Configure();
|
||||
}
|
||||
this->CMakeInstance->SetProgressCallback(0, 0);
|
||||
this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
|
||||
|
||||
keypad(stdscr, TRUE); /* Use key symbols as
|
||||
KEY_DOWN*/
|
||||
@@ -638,7 +638,7 @@ int cmCursesMainForm::Generate()
|
||||
// run the generate process
|
||||
int retVal = this->CMakeInstance->Generate();
|
||||
|
||||
this->CMakeInstance->SetProgressCallback(0, 0);
|
||||
this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
|
||||
keypad(stdscr, TRUE); /* Use key symbols as
|
||||
KEY_DOWN*/
|
||||
|
||||
@@ -888,7 +888,7 @@ void cmCursesMainForm::HandleInput()
|
||||
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(
|
||||
field_userptr(this->Fields[findex - 2]));
|
||||
const char* curField = lbl->GetValue();
|
||||
const char* helpString = 0;
|
||||
const char* helpString = CM_NULLPTR;
|
||||
|
||||
const char* existingValue =
|
||||
this->CMakeInstance->GetState()->GetCacheEntryValue(curField);
|
||||
@@ -973,7 +973,7 @@ void cmCursesMainForm::HandleInput()
|
||||
// (findex always corresponds to the value field)
|
||||
FIELD* nextCur;
|
||||
if (findex == 2) {
|
||||
nextCur = 0;
|
||||
nextCur = CM_NULLPTR;
|
||||
} else if (findex == 3 * this->NumberOfVisibleEntries - 1) {
|
||||
nextCur = this->Fields[findex - 5];
|
||||
} else {
|
||||
@@ -1003,7 +1003,7 @@ void cmCursesMainForm::HandleInput()
|
||||
|
||||
if (nextCur) {
|
||||
// make the next or prev. current field after deletion
|
||||
nextCur = 0;
|
||||
nextCur = CM_NULLPTR;
|
||||
std::vector<cmCursesCacheEntryComposite*>::iterator it;
|
||||
for (it = this->Entries->begin(); it != this->Entries->end();
|
||||
++it) {
|
||||
@@ -1052,7 +1052,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr)
|
||||
int findex = start_index;
|
||||
for (;;) {
|
||||
if (!str.empty()) {
|
||||
cmCursesWidget* lbl = 0;
|
||||
cmCursesWidget* lbl = CM_NULLPTR;
|
||||
if (findex >= 0) {
|
||||
lbl = reinterpret_cast<cmCursesWidget*>(
|
||||
field_userptr(this->Fields[findex - 2]));
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
* exception is during a resize. The optional argument specifies the
|
||||
* string to be displayed in the status bar.
|
||||
*/
|
||||
void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(0); }
|
||||
void UpdateStatusBar() CM_OVERRIDE { this->UpdateStatusBar(CM_NULLPTR); }
|
||||
virtual void UpdateStatusBar(const char* message);
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
|
||||
return false;
|
||||
}
|
||||
|
||||
this->OriginalString = 0;
|
||||
this->OriginalString = CM_NULLPTR;
|
||||
this->Done = false;
|
||||
|
||||
char debugMessage[128];
|
||||
|
||||
@@ -23,7 +23,7 @@ cmCursesWidget::~cmCursesWidget()
|
||||
{
|
||||
if (this->Field) {
|
||||
free_field(this->Field);
|
||||
this->Field = 0;
|
||||
this->Field = CM_NULLPTR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user