From 7db98a18fe8513bc13c825bce0a13ac220d04fa2 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 1 Mar 2017 07:09:05 -0600 Subject: [PATCH] [libpng16] Suppress clang warnings about implicit sign changes in png.c --- ANNOUNCE | 1 + CHANGES | 1 + png.c | 12 ++++++------ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 0d302812b..398520eb5 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -43,6 +43,7 @@ Version 1.6.29beta03 [March 1, 2017] Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer). Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1. + Suppress clang warnings about implicit sign changes in png.c Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 8b9980cd2..987a8a558 100644 --- a/CHANGES +++ b/CHANGES @@ -5812,6 +5812,7 @@ Version 1.6.29beta03 [March 1, 2017] Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer). Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1. + Suppress clang warnings about implicit sign changes in png.c Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/png.c b/png.c index 5750467a4..eba0646e2 100644 --- a/png.c +++ b/png.c @@ -1,7 +1,7 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.6.28 [January 5, 2017%] + * Last changed in libpng 1.6.29 [(PENDING RELEASE)] * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -776,14 +776,14 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.29beta03 - February 22, 2017" PNG_STRING_NEWLINE \ + "libpng version 1.6.29beta03 - March 1, 2017" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \ PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.6.29beta03 - February 22, 2017\ + return "libpng version 1.6.29beta03 - March 1, 2017\ Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -4260,13 +4260,13 @@ png_set_option(png_structrp png_ptr, int option, int onoff) if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT && (option & 1) == 0) { - png_uint_32 mask = 3 << option; - png_uint_32 setting = (2 + (onoff != 0)) << option; + png_uint_32 mask = 3U << option; + png_uint_32 setting = (2U + (onoff != 0)) << option; png_uint_32 current = png_ptr->options; png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff); - return (current & mask) >> option; + return (int)(current & mask) >> option; } return PNG_OPTION_INVALID; -- GitLab