Commit Graph

388 Commits

Author SHA1 Message Date
Cosmin Truta
ceb327789b Remove top-level const from function-scope variables
As per the const correctness rules, top-level const-ness of data
in automatic scopes does not propagate outside of these scopes
(unlike const-ness at lower levels, such as pointers to const data).

Previously, const was used liberally, but inconsistently across the
libpng codebase. Using const wherever applicable is not incorrect.
However, _consistent_ use of const is difficult to maintain in such
conditions.

In conclusion, we shall continue to use const only where doing so is
strictly necessary:

1. If a function guarantees that it will not modify an argument
   passed by pointer, the corresponding function parameter should be
   a pointer-to-const (const T *).

2. Static data should not be modified, therefore it should be const.

Reference:
Google C++ Style Guide
https://google.github.io/styleguide/cppguide.html#Use_of_const
2018-08-18 22:47:16 -04:00
Cosmin Truta
a873893279 Remove the "last changed" version information from source comments
This information is maintained by the version control system.
2018-07-28 18:47:21 -04:00
Cosmin Truta
46aedd8961 Release libpng version 1.6.35 2018-07-15 23:58:00 -04:00
Cosmin Truta
a74aa9a002 [libpng16] Replace the remaining uses of png_size_t with size_t
In v1.6.0, size_t became a required type. It should be used
consistently. To maintain backwards compatibility, png_size_t
is still maintained in deprecated form.
2018-06-17 22:37:44 -04:00
Glenn Randers-Pehrson
0c440812db [libpng16] Imported from libpng-1.6.26.tar 2016-10-19 19:11:38 -05:00
Glenn Randers-Pehrson
761d833372 [libpng16] Quieted all remaining -Wconversion compiler warnings 2016-10-02 18:46:35 -05:00
Glenn Randers-Pehrson
b50d5cea2b [libpng16] Imported from libpng-1.6.24.tar 2016-08-03 21:32:26 -05:00
Glenn Randers-Pehrson
dd70604cec [libpng16] Fixed more indentation 2016-07-15 11:20:46 -05:00
Glenn Randers-Pehrson
4d8de33979 [libpng16] Update copyright uears in source files. 2015-12-13 22:41:17 -06:00
Glenn Randers-Pehrson
e6172809bd [libpng16] Imported from libpng-1.6.18.tar 2015-07-22 22:40:52 -05:00
John Bowler
b780eba4e4 [libpng16] Fixed cexcept.h in which GCC 5 now reports that one of the auto
variables in the Try macro needs to be volatile to prevent value
being lost over the setjmp.
2015-06-03 14:46:34 -05:00
Glenn Randers-Pehrson
c861dc8923 [libpng16] Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
(Bug report by Viktor Szaka'ts).
2015-04-01 12:06:01 -05:00
Glenn Randers-Pehrson
c98f7fb4e3 [libpng16] Imported from libpng-1.6.17.tar 2015-03-26 08:11:12 -05:00
Glenn Randers-Pehrson
c5370ede95 [libpng16] Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
the Coverity scan without them.
2015-03-21 11:54:32 -05:00
Glenn Randers-Pehrson
4029db9aac [libpng16] Imported from libpng-1.6.17beta06.tar 2015-02-27 19:01:02 -06:00
Glenn Randers-Pehrson
7011a8cec3 [libpng16] Added "& 0xff" to things being typecast to "png_byte". 2015-02-27 18:53:44 -06:00
Glenn Randers-Pehrson
e8ef689cb9 [libpng16] Imported from libpng-1.6.15.tar 2014-11-20 10:22:57 -06:00
Glenn Randers-Pehrson
cda68df8c1 [libpng16] Changed "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */" 2014-11-06 22:11:39 -06:00
Glenn Randers-Pehrson
70cb8f9a7e [libpng16] Removed #ifdef PNG_16BIT_SUPPORTED/#endif around png_product2(); it is
needed by png_reciprocal2().
Added #ifdef PNG_16BIT_SUPPORTED/#endif around png_log16bit() and
    png_do_swap().
2014-11-06 20:58:33 -06:00
Glenn Randers-Pehrson
f2d4167fee [libpng16] Added a pair of parentheses suggested by clang 2014-10-31 21:17:11 -05:00
Glenn Randers-Pehrson
5d713fe123 [libpng16] Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to
"if (x !== 0)"
2014-10-31 20:58:40 -05:00
Glenn Randers-Pehrson
3e753eb8b2 [libpng16] Imported from libpng-1.6.9.tar 2014-02-05 22:33:56 -06:00
Glenn Randers-Pehrson
95a197397f [libpng16] Updated copyright year in recently-changed files. 2013-12-31 21:10:13 -06:00
Glenn Randers-Pehrson
38f49403bd [libpng16] Update "last changed" dates in recently-patched files. 2013-12-22 15:04:00 -06:00
John Bowler
8f1150eb75 [libpng16] Made transform implementation functions static. This makes the
internal functions called by png_do_{read|write}_transformations static. On an
x86-64 DLL build (Gentoo Linux) this reduces the size of the text
segment of the DLL by 1208 bytes, about 0.6%. It also simplifies
maintenance by removing the declarations from pngpriv.h and allowing
easier changes to the internal interfaces.
2013-12-19 15:33:49 -06:00
John Bowler
c10930a4fc [libpng16] Bookkeeping: Moved functions around (no changes). Moved transform
function definitions before the place where they are called so that
they can be masde static. Move the intrapixel functions and the
grayscale palette builder out of the png?tran.c files. The latter
isn't a transform function and is no longer used internally, and the
former MNG specific functions are better placed in pngread/pngwrite.c
2013-12-19 15:24:06 -06:00
Glenn Randers-Pehrson
871b1d0fab [libpng16] Bump version to 1.6.1beta05 2013-03-02 15:03:15 -06:00
Glenn Randers-Pehrson
f3af706c2a [libpng16] Imported from libpng-1.6.0beta05.tar 2013-03-01 21:38:03 -06:00
Glenn Randers-Pehrson
c53778ff53 [libpng16] Imported from libpng-1.6.0.tar 2013-02-13 22:53:57 -06:00
Glenn Randers-Pehrson
9477ecdfa6 [libpng16] Updated copyright year to 2013 in newly-changed files 2013-01-01 07:45:42 -06:00
John Bowler
8fb6c6a9b3 [libpng16] Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
compiler issues slightly different warnings from those issued by the
current vesions of GCC. This eliminates those warnings by
adding/removing casts and small code rewrites.
2012-01-25 07:47:44 -06:00
Glenn Randers-Pehrson
1531bd61a0 [libpng16] Updated copyright year to 2012 2012-01-01 14:45:04 -06:00
John Bowler
5d56786eff [libpng16] Implemented 'restrict' for png_info and png_struct.
Added new "png_structrp" typedef. Because of the
way libpng works both png_info and png_struct are always accessed via a
single pointer.  This means adding C99 'restrict' to the pointer gives
the compiler some opportunity to optimize the code.  This change allows that.
2011-12-24 09:12:00 -06:00
Glenn Randers-Pehrson
55e85c24b4 [libpng15] Imported from libpng-1.5.7beta01.tar 2011-11-04 13:47:49 -05:00
Glenn Randers-Pehrson
2b7d730e27 [libpng15] Bump version to libpng-1.5.7beta01 2011-11-02 23:14:13 -05:00
Glenn Randers-Pehrson
bc6726bc04 [libpng15] Imported from libpng-1.5.6.tar 2011-11-02 22:48:36 -05:00
Glenn Randers-Pehrson
bb5cb1476b [libpng15] Bump version to libpng-1.5.6beta02 2011-09-22 12:48:19 -05:00
Glenn Randers-Pehrson
d404b6d488 [devel] Imported from libpng-1.5.4.tar 2011-07-07 06:26:30 -05:00
John Bowler
550bab03fb [devel] Removed the ACCURATE and LEGACY options (they are no longer useable)
Fixed some compiliation problems with scaling options.
2011-06-14 06:17:26 -05:00
John Bowler
4a12f4a22a [devel] Cleanup of conditional compilation code and of background/gamma
handling. Internal changes only except for a new option to avoid compiling
in the png_build_grayscale_palette API (which is not used at all internally.)
The main change is to move the transform tests (READ_TRANSFORMS,
WRITE_TRANSFORMS) up one level to the caller of the APIs.
2011-04-17 18:34:22 -05:00
Glenn Randers-Pehrson
cb1aee2506 [devel] Fixed bug with stripping the filler or alpha channel when writing,
that was introduced in libpng-1.5.2beta01.
2011-04-16 19:27:34 -05:00
Glenn Randers-Pehrson
dcc3505c7b [devel] Imported from libpng-1.5.2.tar 2011-03-31 11:29:05 -05:00
Glenn Randers-Pehrson
cad6798a8c [devel] Imported from libpng-1.5.2beta01.tar 2011-02-13 06:13:39 -06:00
John Bowler
9b872f4cf9 [devel] Clean up ALPHA flags and transformations 2011-02-12 09:00:16 -06:00
Glenn Randers-Pehrson
f5ea1b7095 [devel] Imported from libpng-1.5.0.tar 2011-01-06 06:45:07 -06:00
Glenn Randers-Pehrson
64b863cd2a [devel] Update copyright year and bump to version libpng-1.5.0rc07 2011-01-04 09:58:33 -06:00
Glenn Randers-Pehrson
b3edc73afa [devel] Changes to remove gcc warnings (John Bowler)
Certain optional gcc warning flags resulted in warnings in libpng code.
With these changes only -Wconversion and -Wcast-qual cannot be turned on.
Changes are trivial rearrangements of code.  -Wconversion is not possible
for pngrutil.c (because of the widespread use of += et al on variables
smaller than (int) or (unsigned int)) and -Wcast-qual is not possible
with pngwio.c and pngwutil.c because the 'write' callback and zlib
compression both fail to declare their input buffers with 'const'.
2010-11-21 14:06:41 -06:00
Glenn Randers-Pehrson
ccadcae40b [devel] Added whitespace in pngrutil.c, pngwtran.c, and pngwutil.c 2010-10-23 17:29:13 -05:00
Glenn Randers-Pehrson
f0eda4e8d7 [devel] Imported from libpng-1.5.0beta51.tar 2010-10-15 15:08:42 -05:00
Glenn Randers-Pehrson
7e1fabe2f7 [devel] Imported from libpng-1.5.0beta50.tar 2010-10-14 07:35:45 -05:00