1
0
mirror of https://github.com/glennrp/libpng.git synced 2026-10-22 20:29:09 +03:00

fix(build): Resolve MSVC warning for unary minus on unsigned type

Redo the refactor from commit 9929ba276e
(version 1.6.56) in a manner that placates MSVC warning C4146.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Mike Williams
2026-06-04 14:19:20 +01:00
committed by Cosmin Truta
parent d76d5106f0
commit cf92470738
3 changed files with 3 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ Authors, for copyright and licensing purposes.
* Mans Rullgard
* Matt Sarett
* Mike Klein
* Mike Williams
* Mohammad Seet
* Pascal Massimino
* Paul Schmidt

View File

@@ -4113,7 +4113,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
row_stride = (png_int_32)/*SAFE*/png_row_stride;
if (row_stride < 0)
check = -(png_uint_32)row_stride;
check = 0U - (png_uint_32)row_stride;
else
check = (png_uint_32)row_stride;

View File

@@ -2030,7 +2030,7 @@ png_image_write_main(png_voidp argument)
display->row_stride = (png_int_32)/*SAFE*/png_row_stride;
if (display->row_stride < 0)
check = -(png_uint_32)display->row_stride;
check = 0U - (png_uint_32)display->row_stride;
else
check = (png_uint_32)display->row_stride;