From 95355fe21420ed2722bbcd61840ba2de2851abc9 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Mar 2022 02:44:07 -0800 Subject: [PATCH] clang-tidy: remove C casts Signed-off-by: Rosen Penev --- src/jpgimage.cpp | 2 +- src/pngimage.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp index 1aa076d1..ed3c4692 100644 --- a/src/jpgimage.cpp +++ b/src/jpgimage.cpp @@ -1058,7 +1058,7 @@ namespace Exiv2 { uint8_t pad[2]; pad[0] = static_cast(chunk + 1); pad[1] = static_cast(chunks); - outIo.write((const byte*)iccId_, 12); + outIo.write(reinterpret_cast(iccId_), 12); outIo.write((const byte*)pad, 2); if (outIo.write(iccProfile_.c_data(chunk * chunk_size), bytes) != bytes) throw Error(kerImageWriteFailed); diff --git a/src/pngimage.cpp b/src/pngimage.cpp index b82e6bee..39946f0f 100644 --- a/src/pngimage.cpp +++ b/src/pngimage.cpp @@ -39,8 +39,8 @@ const unsigned char pngBlank[] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00, namespace { - const auto nullComp = (const Exiv2::byte*)"\0\0"; - const auto typeICCP = (const Exiv2::byte*)"iCCP"; + const auto nullComp = reinterpret_cast("\0\0"); + const auto typeICCP = reinterpret_cast("iCCP"); inline bool compare(const char* str, const Exiv2::DataBuf& buf, size_t length) { assert(strlen(str) <= length); @@ -641,7 +641,7 @@ namespace Exiv2 { // calculate CRC uLong tmp = crc32(0L, Z_NULL, 0); tmp = crc32(tmp, typeICCP, 4); - tmp = crc32(tmp, (const Bytef*)profileName_.data(), nameLength); + tmp = crc32(tmp, reinterpret_cast(profileName_.data()), nameLength); tmp = crc32(tmp, nullComp, 2); tmp = crc32(tmp, compressed.c_data(), static_cast(compressed.size())); byte crc[4];