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/blenloader/intern/undofile.cc | |
parent | d35a10134cfdbd3e24a56218ef3f05aac2a2fc7e (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Some changes missed from f68cfd6bb078482c4a779a6e26a56e2734edb5b8.
Diffstat (limited to 'source/blender/blenloader/intern/undofile.cc')
-rw-r--r-- | source/blender/blenloader/intern/undofile.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/undofile.cc b/source/blender/blenloader/intern/undofile.cc index 4c417c41297..99d1ca336fe 100644 --- a/source/blender/blenloader/intern/undofile.cc +++ b/source/blender/blenloader/intern/undofile.cc @@ -233,9 +233,9 @@ bool BLO_memfile_write_file(struct MemFile *memfile, const char *filepath) for (chunk = static_cast<MemFileChunk *>(memfile->chunks.first); chunk; chunk = static_cast<MemFileChunk *>(chunk->next)) { #ifdef _WIN32 - if ((size_t)write(file, chunk->buf, uint(chunk->size)) != chunk->size) + if (size_t(write(file, chunk->buf, uint(chunk->size))) != chunk->size) #else - if ((size_t)write(file, chunk->buf, chunk->size) != chunk->size) + if (size_t(write(file, chunk->buf, chunk->size)) != chunk->size) #endif { break; @@ -269,19 +269,19 @@ static ssize_t undo_read(FileReader *reader, void *buffer, size_t size) return 0; } - if (seek != (size_t)undo->reader.offset) { + if (seek != size_t(undo->reader.offset)) { chunk = static_cast<MemFileChunk *>(undo->memfile->chunks.first); seek = 0; while (chunk) { - if (seek + chunk->size > (size_t)undo->reader.offset) { + if (seek + chunk->size > size_t(undo->reader.offset)) { break; } seek += chunk->size; chunk = static_cast<MemFileChunk *>(chunk->next); } offset = seek; - seek = (size_t)undo->reader.offset; + seek = size_t(undo->reader.offset); } if (chunk) { @@ -323,7 +323,7 @@ static ssize_t undo_read(FileReader *reader, void *buffer, size_t size) chunk->is_identical_future; } while (totread < size); - return (ssize_t)totread; + return ssize_t(totread); } return 0; |