You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Replace NULL with nullptr
This commit is contained in:
@@ -52,7 +52,7 @@ static Vector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_quali
|
||||
Vector<uint8_t> data = img->get_data();
|
||||
const uint8_t *r = data.ptr();
|
||||
|
||||
uint8_t *dst_buff = NULL;
|
||||
uint8_t *dst_buff = nullptr;
|
||||
size_t dst_size = 0;
|
||||
if (img->get_format() == Image::FORMAT_RGB8) {
|
||||
|
||||
@@ -101,9 +101,9 @@ static Ref<Image> _webp_lossy_unpack(const Vector<uint8_t> &p_buffer) {
|
||||
|
||||
bool errdec = false;
|
||||
if (features.has_alpha) {
|
||||
errdec = WebPDecodeRGBAInto(&r[4], size, dst_w, datasize, 4 * features.width) == NULL;
|
||||
errdec = WebPDecodeRGBAInto(&r[4], size, dst_w, datasize, 4 * features.width) == nullptr;
|
||||
} else {
|
||||
errdec = WebPDecodeRGBInto(&r[4], size, dst_w, datasize, 3 * features.width) == NULL;
|
||||
errdec = WebPDecodeRGBInto(&r[4], size, dst_w, datasize, 3 * features.width) == nullptr;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_V_MSG(errdec, Ref<Image>(), "Failed decoding WebP image.");
|
||||
@@ -128,9 +128,9 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p
|
||||
|
||||
bool errdec = false;
|
||||
if (features.has_alpha) {
|
||||
errdec = WebPDecodeRGBAInto(p_buffer, p_buffer_len, dst_w, datasize, 4 * features.width) == NULL;
|
||||
errdec = WebPDecodeRGBAInto(p_buffer, p_buffer_len, dst_w, datasize, 4 * features.width) == nullptr;
|
||||
} else {
|
||||
errdec = WebPDecodeRGBInto(p_buffer, p_buffer_len, dst_w, datasize, 3 * features.width) == NULL;
|
||||
errdec = WebPDecodeRGBInto(p_buffer, p_buffer_len, dst_w, datasize, 3 * features.width) == nullptr;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_V_MSG(errdec, ERR_FILE_CORRUPT, "Failed decoding WebP image.");
|
||||
|
||||
Reference in New Issue
Block a user