diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 13:27:46 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 15:31:31 +0300 |
commit | 21d77a417e17ac92bfc10dbd742c867d4019ce69 (patch) | |
tree | ec664b5c6ca7882bcc5a1e1ce09cad67b842af9d /source/blender/blendthumb | |
parent | d35a10134cfdbd3e24a56218ef3f05aac2a2fc7e (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Some changes missed from f68cfd6bb078482c4a779a6e26a56e2734edb5b8.
Diffstat (limited to 'source/blender/blendthumb')
-rw-r--r-- | source/blender/blendthumb/src/blendthumb_png.cc | 4 | ||||
-rw-r--r-- | source/blender/blendthumb/src/blendthumb_win32.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blendthumb/src/blendthumb_png.cc b/source/blender/blendthumb/src/blendthumb_png.cc index e3e3e929e63..17c0492af42 100644 --- a/source/blender/blendthumb/src/blendthumb_png.cc +++ b/source/blender/blendthumb/src/blendthumb_png.cc @@ -110,7 +110,7 @@ std::optional<blender::Vector<uint8_t>> blendthumb_create_png_data_from_thumb( 0x00, /* Filter method. */ 0x00, /* Interlace method. */ }); - BLI_assert((size_t)ihdr_data.size() == ihdr_data_final_size); + BLI_assert(size_t(ihdr_data.size()) == ihdr_data_final_size); } /* Join it all together to create a PNG image. */ @@ -135,7 +135,7 @@ std::optional<blender::Vector<uint8_t>> blendthumb_create_png_data_from_thumb( png_chunk_create(png_buf, MAKE_ID('I', 'D', 'A', 'T'), image_data); png_chunk_create(png_buf, MAKE_ID('I', 'E', 'N', 'D'), {}); - BLI_assert((size_t)png_buf.size() == png_buf_final_size); + BLI_assert(size_t(png_buf.size()) == png_buf_final_size); } return png_buf; diff --git a/source/blender/blendthumb/src/blendthumb_win32.cc b/source/blender/blendthumb/src/blendthumb_win32.cc index 2acc8f20a12..4ba91955bd3 100644 --- a/source/blender/blendthumb/src/blendthumb_win32.cc +++ b/source/blender/blendthumb/src/blendthumb_win32.cc @@ -110,7 +110,7 @@ static ssize_t stream_read(FileReader *reader, void *buffer, size_t size) stream->_pStream->Read(buffer, size, &readsize); stream->reader.offset += readsize; - return (ssize_t)readsize; + return ssize_t(readsize); } static off64_t stream_seek(FileReader *reader, off64_t offset, int whence) @@ -173,7 +173,7 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE /* Scale up the thumbnail if required. */ if ((unsigned)thumb.width < cx && (unsigned)thumb.height < cx) { - float scale = 1.0f / (std::max(thumb.width, thumb.height) / (float)cx); + float scale = 1.0f / (std::max(thumb.width, thumb.height) / float(cx)); LONG NewWidth = (LONG)(thumb.width * scale); LONG NewHeight = (LONG)(thumb.height * scale); |