Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-11-06 19:49:09 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-11-06 20:08:25 +0300
commit16732def37c5a66f3ea28dbe247b09cc6bca6677 (patch)
tree5d14f5c920a1411e336bd80b12becbb3f73de19a /source/blender/gpu/intern/gpu_texture.cc
parent88926375a0e4e45f72c87b9e487c060ddd3c9216 (diff)
Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code. No functional changes.
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.cc')
-rw-r--r--source/blender/gpu/intern/gpu_texture.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc
index 99d286c3abd..d134d718cbe 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -49,14 +49,14 @@ Texture::Texture(const char *name)
}
for (int i = 0; i < ARRAY_SIZE(fb_); i++) {
- fb_[i] = NULL;
+ fb_[i] = nullptr;
}
}
Texture::~Texture()
{
for (int i = 0; i < ARRAY_SIZE(fb_); i++) {
- if (fb_[i] != NULL) {
+ if (fb_[i] != nullptr) {
fb_[i]->attachment_remove(fb_attachment_[i]);
}
}
@@ -142,7 +142,7 @@ bool Texture::init_buffer(GPUVertBuf *vbo, eGPUTextureFormat format)
void Texture::attach_to(FrameBuffer *fb, GPUAttachmentType type)
{
for (int i = 0; i < ARRAY_SIZE(fb_); i++) {
- if (fb_[i] == NULL) {
+ if (fb_[i] == nullptr) {
fb_attachment_[i] = type;
fb_[i] = fb;
return;
@@ -156,7 +156,7 @@ void Texture::detach_from(FrameBuffer *fb)
for (int i = 0; i < ARRAY_SIZE(fb_); i++) {
if (fb_[i] == fb) {
fb_[i]->attachment_remove(fb_attachment_[i]);
- fb_[i] = NULL;
+ fb_[i] = nullptr;
return;
}
}
@@ -226,7 +226,7 @@ static inline GPUTexture *gpu_texture_create(const char *name,
if (!success) {
delete tex;
- return NULL;
+ return nullptr;
}
if (pixels) {
tex->update(data_format, pixels);
@@ -295,7 +295,7 @@ GPUTexture *GPU_texture_create_compressed_2d(
if (!success) {
delete tex;
- return NULL;
+ return nullptr;
}
if (data) {
size_t ofs = 0;
@@ -320,7 +320,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(const char *name, GPUVertBuf *vert)
bool success = tex->init_buffer(vert, tex_format);
if (!success) {
delete tex;
- return NULL;
+ return nullptr;
}
return reinterpret_cast<GPUTexture *>(tex);
}
@@ -383,7 +383,7 @@ void *GPU_texture_read(GPUTexture *tex_, eGPUDataFormat data_format, int miplvl)
*/
void GPU_texture_clear(GPUTexture *tex, eGPUDataFormat data_format, const void *data)
{
- BLI_assert(data != NULL); /* Do not accept NULL as parameter. */
+ BLI_assert(data != nullptr); /* Do not accept NULL as parameter. */
reinterpret_cast<Texture *>(tex)->clear(data_format, data);
}