From 276a1a7952ea867811b5e22166577aa04b5f4c34 Mon Sep 17 00:00:00 2001 From: Rangi Date: Wed, 8 Jul 2026 16:42:53 -0400 Subject: [PATCH] Use `const_cast` more precisely to remove `const` without changing type --- src/gfx/reverse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gfx/reverse.cpp b/src/gfx/reverse.cpp index af95aa73..2054e6e1 100644 --- a/src/gfx/reverse.cpp +++ b/src/gfx/reverse.cpp @@ -420,7 +420,7 @@ void reverse() { } png_structp png = png_create_write_struct( PNG_LIBPNG_VER_STRING, - const_cast(static_cast(pngFile.c_str(options.input))), + const_cast(pngFile.c_str(options.input)), pngError, pngWarning ); @@ -572,7 +572,7 @@ void reverse() { // signature. // (AIUI, casting away const-ness is okay as long as you don't actually modify the // pointed-to data) - png_write_rows(png, const_cast(rowPtrs), 8); + png_write_rows(png, const_cast(rowPtrs), 8); } // Finalize the write