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

@ -17,14 +17,14 @@ TRI_COORD<T>::TRI_COORD(INDEX row, INDEX col, T val, bool add_to)
//-----------------------------------------------------------------------------
template<typename T>
SparseMatrix<T>::SparseMatrix(INDEX rows, INDEX cols)
: _val(NULL), _ia(NULL), _ja(NULL), _size(0), _nRowsCRS(0), hasTemplate_(false),
: _val(nullptr), _ia(nullptr), _ja(nullptr), _size(0), _nRowsCRS(0), hasTemplate_(false),
_nRows(rows),_nCols(cols) {}
//-----------------------------------------------------------------------------
// copy constructor
//-----------------------------------------------------------------------------
template<typename T>
SparseMatrix<T>::SparseMatrix(const SparseMatrix<T>& C)
: Matrix<T>(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
: Matrix<T>(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false)
{
_copy(C);
}
@ -33,7 +33,7 @@ SparseMatrix<T>::SparseMatrix(const SparseMatrix<T>& C)
//-----------------------------------------------------------------------------
template<typename T>
SparseMatrix<T>::SparseMatrix(const DenseMatrix<T>& C)
: Matrix<T>(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
: Matrix<T>(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false)
{
reset(C);
}
@ -67,9 +67,9 @@ void SparseMatrix<T>::_create(INDEX size, INDEX nrows)
// assign memory to hold matrix
try
{
_val = (_size && nrows) ? new T [_size] : NULL;
_ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : NULL;
_ja = (_size && nrows) ? new INDEX [_size] : NULL;
_val = (_size && nrows) ? new T [_size] : nullptr;
_ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : nullptr;
_ja = (_size && nrows) ? new INDEX [_size] : nullptr;
}
catch (std::exception &e)
{
@ -94,8 +94,8 @@ void SparseMatrix<T>::_delete()
if (_ia) delete [] _ia;
if (_ja) delete [] _ja;
_size = _nRowsCRS = 0;
_val = NULL;
_ia = _ja = NULL;
_val = nullptr;
_ia = _ja = nullptr;
}
//-----------------------------------------------------------------------------
// full memory copy of C into this