diff options
Diffstat (limited to 'extern/mantaflow/helper/util')
-rw-r--r-- | extern/mantaflow/helper/util/randomstream.h | 2 | ||||
-rw-r--r-- | extern/mantaflow/helper/util/rcmatrix.h | 14 | ||||
-rw-r--r-- | extern/mantaflow/helper/util/simpleimage.cpp | 10 | ||||
-rw-r--r-- | extern/mantaflow/helper/util/simpleimage.h | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/extern/mantaflow/helper/util/randomstream.h b/extern/mantaflow/helper/util/randomstream.h index 5b477326f6f..95e007fa943 100644 --- a/extern/mantaflow/helper/util/randomstream.h +++ b/extern/mantaflow/helper/util/randomstream.h @@ -270,7 +270,7 @@ inline void MTRand::seed() } // Was not successful, so use time() and clock() instead - seed(hash(time(NULL), clock())); + seed(hash(time(nullptr), clock())); } inline void MTRand::initialize(const uint32 intseed) diff --git a/extern/mantaflow/helper/util/rcmatrix.h b/extern/mantaflow/helper/util/rcmatrix.h index 3a466952ac2..f1f0efe6416 100644 --- a/extern/mantaflow/helper/util/rcmatrix.h +++ b/extern/mantaflow/helper/util/rcmatrix.h @@ -157,18 +157,18 @@ template<class N, class T> struct RCMatrix { { for (N i = 0; i < n; i++) { dealloc_row(i); - matrix[i] = NULL; + matrix[i] = nullptr; if (offsets.size()) offsets[i] = 0; } }; bool empty(N i) const { - return matrix[i] == NULL; + return matrix[i] == nullptr; } N row_nonzero_size(N i) const { - return matrix[i] == NULL ? 0 : matrix[i]->index.size(); + return matrix[i] == nullptr ? 0 : matrix[i]->index.size(); } void resize(N size, N expected_none_zeros = 0) { @@ -185,7 +185,7 @@ template<class N, class T> struct RCMatrix { // Expanding matrix.resize(size); for (N i = n; i < size; i++) { - matrix[i] = NULL; + matrix[i] = nullptr; if (offsets.size()) offsets[i] = 0; } @@ -209,7 +209,7 @@ template<class N, class T> struct RCMatrix { if (matrix[i]) { if (offsets.empty() || !offsets[i]) delete matrix[i]; - matrix[i] = NULL; + matrix[i] = nullptr; if (offsets.size()) offsets[i] = 0; } @@ -426,7 +426,7 @@ template<class N, class T> struct RCMatrix { } operator bool() const { - return rowEntry != NULL && k < (N)rowEntry->index.size(); + return rowEntry != nullptr && k < (N)rowEntry->index.size(); } Iterator &operator++() { @@ -447,7 +447,7 @@ template<class N, class T> struct RCMatrix { } N size() const { - return rowEntry == NULL ? 0 : rowEntry->index.size(); + return rowEntry == nullptr ? 0 : rowEntry->index.size(); } protected: diff --git a/extern/mantaflow/helper/util/simpleimage.cpp b/extern/mantaflow/helper/util/simpleimage.cpp index 9846fa5bd96..5f062bf0150 100644 --- a/extern/mantaflow/helper/util/simpleimage.cpp +++ b/extern/mantaflow/helper/util/simpleimage.cpp @@ -35,7 +35,7 @@ bool SimpleImage::writePpm( } FILE *fp = fopen(filename.c_str(), "wb"); - if (fp == NULL) { + if (fp == nullptr) { errMsg("SimpleImage::WritePPM Unable to open '" << filename << "' for writing"); return false; } @@ -96,7 +96,7 @@ bool SimpleImage::initFromPpm(std::string filename) } // 1st line: PPM or PGM - if (fgets(line, MAXLINE, fp) == NULL) { + if (fgets(line, MAXLINE, fp) == nullptr) { if (mAbortOnError) debMsg("SimpleImage::initFromPpm fgets failed", 1); return 0; @@ -114,7 +114,7 @@ bool SimpleImage::initFromPpm(std::string filename) // Read in width and height, & allocate space // 2nd line: width height - if (fgets(line, MAXLINE, fp) == NULL) { + if (fgets(line, MAXLINE, fp) == nullptr) { if (mAbortOnError) errMsg("SimpleImage::initFromPpm fgets failed"); return 0; @@ -156,14 +156,14 @@ bool SimpleImage::initFromPpm(std::string filename) // Read in maximum value (ignore) , could be scanned with sscanf as well, but this should be // 255... 3rd line - if (fgets(line, MAXLINE, fp) == NULL) { + if (fgets(line, MAXLINE, fp) == nullptr) { if (mAbortOnError) errMsg("SimpleImage::initFromPpm fgets failed"); return 0; } // Read in the pixel array row-by-row: 1st row = top scanline */ - unsigned char *ptr = NULL; + unsigned char *ptr = nullptr; ptr = &pic[(windH - 1) * rowsize]; for (int i = windH; i > 0; i--) { assertMsg(fread((void *)ptr, 1, rowsize, fp) == rowsize, diff --git a/extern/mantaflow/helper/util/simpleimage.h b/extern/mantaflow/helper/util/simpleimage.h index d7e88b83f74..865e64ab86e 100644 --- a/extern/mantaflow/helper/util/simpleimage.h +++ b/extern/mantaflow/helper/util/simpleimage.h @@ -29,7 +29,7 @@ namespace Manta { class SimpleImage { public: // cons/des - SimpleImage() : mSize(-1), mpData(NULL), mAbortOnError(true){}; + SimpleImage() : mSize(-1), mpData(nullptr), mAbortOnError(true){}; virtual ~SimpleImage() { if (mpData) |