From 16732def37c5a66f3ea28dbe247b09cc6bca6677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 6 Nov 2020 17:49:09 +0100 Subject: Cleanup: Clang-Tidy modernize-use-nullptr Replace `NULL` with `nullptr` in C++ code. No functional changes. --- source/blender/gpu/opengl/gl_batch.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender/gpu/opengl/gl_batch.cc') diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc index b81c2d69122..89486b73b05 100644 --- a/source/blender/gpu/opengl/gl_batch.cc +++ b/source/blender/gpu/opengl/gl_batch.cc @@ -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(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(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 -- cgit v1.2.3