T2345: Replace instances of NULL with nullptr

The following changes have been applied to src and lib folders:
regex replace: ([^"_])NULL ⇒ \1nullptr (8968 chgs in src, 1153 in lib)
Manually find/change: (void \*) nullptr ⇒ nullptr (1 case)
regex find: ".*?nullptr.*?"
  Manually ~14 cases back to "NULL" in src, ~2 in lib
  regex finds a few false positive where nullptr appears between two
  strings in a function call
This commit is contained in:
Anne Gunn
2020-09-11 07:39:46 -06:00
parent 101d39142e
commit f1ef7d85a8
1217 changed files with 8531 additions and 8531 deletions

View File

@ -48,8 +48,8 @@ OutputManager::OutputManager(string outputPrefix, set<int> & otypes)
firstStep_(true),
firstGlobalsWrite_(true),
writeGlobalsHeader_(true),
coordinates_(NULL),
connectivities_(NULL),
coordinates_(nullptr),
connectivities_(nullptr),
dataType_(POINT),
outputPrefix_(outputPrefix),
ensightOutput_(otypes.count(ENSIGHT)),
@ -68,8 +68,8 @@ OutputManager::OutputManager()
firstStep_(true),
firstGlobalsWrite_(true),
writeGlobalsHeader_(true),
coordinates_(NULL),
connectivities_(NULL),
coordinates_(nullptr),
connectivities_(nullptr),
dataType_(POINT),
outputPrefix_("NULL"),
ensightOutput_(true),
@ -132,7 +132,7 @@ void OutputManager::print_custom_names() {
// Dump text-based fields to disk for later restart
void OutputManager::write_restart_file(string fileName, RESTART_LIST *data)
{
FILE * fp=NULL;
FILE * fp=nullptr;
fp=fopen(fileName.c_str(),"wb"); // open
RESTART_LIST::iterator iter;
for (iter = data->begin(); iter != data->end(); iter++) {
@ -153,7 +153,7 @@ void OutputManager::write_restart_file(string fileName, RESTART_LIST *data)
void OutputManager::read_restart_file(string fileName, RESTART_LIST *data)
{
FILE * fp=NULL;
FILE * fp=nullptr;
fp=fopen(fileName.c_str(),"rb"); // open
RESTART_LIST::iterator iter;
for (iter = data->begin(); iter != data->end(); iter++) {
@ -230,7 +230,7 @@ void OutputManager::write_geometry_ensight(void)
string geom_file_name = outputPrefix_ + ".geo";
// open file
FILE * fp=NULL;
FILE * fp=nullptr;
char buffer[80];
if ( ! initialized_ ) {
fp=fopen(geom_file_name.c_str(),"wb"); // open
@ -240,7 +240,7 @@ void OutputManager::write_geometry_ensight(void)
else {
fp=fopen(geom_file_name.c_str(),"ab"); // append
}
if (fp == NULL) {
if (fp == nullptr) {
throw ATC_Error("can not create Ensight geometry file");
}
@ -491,14 +491,14 @@ void OutputManager::write_data_ensight(string field_name, const MATRIX *field_da
// open or append data file
string data_file_name = filenames[ifile];
FILE * fp=NULL;
FILE * fp=nullptr;
if ( outputTimes_.size() == 1 ) {
fp=fopen(data_file_name.c_str(),"wb"); // open
}
else {
fp=fopen(data_file_name.c_str(),"ab"); // append
}
if (fp == NULL) {
if (fp == nullptr) {
throw ATC_Error("can not create Ensight data file: "+data_file_name);
}
@ -799,8 +799,8 @@ void OutputManager::write_dictionary(double /* time */, OUTPUT_LIST *data)
string geom_file_name = outputPrefix_ + ".geo";
// open file
FILE * fp=NULL;
if ((fp=fopen(dict_file_name.c_str(),"w")) == NULL)
FILE * fp=nullptr;
if ((fp=fopen(dict_file_name.c_str(),"w")) == nullptr)
{
throw ATC_Error("can not create Ensight case file");
}