Cleanup: Clang-Tidy modernize-use-nullptr

Replace `NULL` with `nullptr` in C++ code.

No functional changes.
This commit is contained in:
2020-11-06 17:49:09 +01:00
parent 88926375a0
commit 16732def37
426 changed files with 7145 additions and 7146 deletions

View File

@@ -62,11 +62,11 @@ GLVaoCache::~GLVaoCache()
void GLVaoCache::init()
{
context_ = NULL;
interface_ = NULL;
context_ = nullptr;
interface_ = nullptr;
is_dynamic_vao_count = false;
for (int i = 0; i < GPU_VAO_STATIC_LEN; i++) {
static_vaos.interfaces[i] = NULL;
static_vaos.interfaces[i] = nullptr;
static_vaos.vao_ids[i] = 0;
}
vao_base_instance_ = 0;
@@ -93,7 +93,7 @@ void GLVaoCache::insert(const GLShaderInterface *interface, GLuint vao)
else {
/* Erase previous entries, they will be added back if drawn again. */
for (int i = 0; i < GPU_VAO_STATIC_LEN; i++) {
if (static_vaos.interfaces[i] != NULL) {
if (static_vaos.interfaces[i] != nullptr) {
const_cast<GLShaderInterface *>(static_vaos.interfaces[i])->ref_remove(this);
context_->vao_free(static_vaos.vao_ids[i]);
}
@@ -143,7 +143,7 @@ void GLVaoCache::remove(const GLShaderInterface *interface)
if (interfaces[i] == interface) {
context_->vao_free(vaos[i]);
vaos[i] = 0;
interfaces[i] = NULL;
interfaces[i] = nullptr;
break; /* cannot have duplicates */
}
}
@@ -157,7 +157,7 @@ void GLVaoCache::clear()
const GLShaderInterface **interfaces = (is_dynamic_vao_count) ? dynamic_vaos.interfaces :
static_vaos.interfaces;
/* Early out, nothing to free. */
if (context_ == NULL) {
if (context_ == nullptr) {
return;
}
@@ -174,7 +174,7 @@ void GLVaoCache::clear()
}
for (int i = 0; i < count; i++) {
if (interfaces[i] != NULL) {
if (interfaces[i] != nullptr) {
const_cast<GLShaderInterface *>(interfaces[i])->ref_remove(this);
}
}
@@ -213,7 +213,7 @@ void GLVaoCache::context_check()
BLI_assert(ctx);
if (context_ != ctx) {
if (context_ != NULL) {
if (context_ != nullptr) {
/* IMPORTANT: Trying to draw a batch in multiple different context will trash the VAO cache.
* This has major performance impact and should be avoided in most cases. */
context_->vao_cache_unregister(this);
@@ -307,7 +307,7 @@ void GLBatch::bind(int i_first)
#if GPU_TRACK_INDEX_RANGE
/* Can be removed if GL 4.3 is required. */
if (!GLContext::fixed_restart_index_support && (elem != NULL)) {
if (!GLContext::fixed_restart_index_support && (elem != nullptr)) {
glPrimitiveRestartIndex(this->elem_()->restart_index());
}
#endif