Commit Graph

557 Commits

Author SHA1 Message Date
Cosmin Truta
1ceaa83a84 Fix the build with MSVC ARM64 2018-09-04 00:53:38 -04:00
Cosmin Truta
b66ed71131 Restore the ANSI C compliance after adding the ARM optimization
Also apply style and formatting fixes
2018-09-04 00:15:30 -04:00
Richard Townsend
7734cda20c Optimize png_do_expand_palette for ARM
ARM-specific optimization processes 8 or 4 pixels at once.
Improves performance by around 10-22% on a recent ARM Chromebook.
2018-09-04 00:04:58 -04:00
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
1ef8882814 Replace the remaining uses of PNG_CONST with const
In v1.6.0, compiler support for const became a requirement.
It should be used consistently. To maintain backwards compatibility,
PNG_CONST is still maintained in deprecated form.
2018-08-18 21:01:02 -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
0e06b5948c [libpng16] Imported from libpng-1.6.35beta01.tar 2018-03-06 14:06:24 -06:00
luz.paz
eb91c0e4ed More misc. typos
found via `codespell-q 3`
please review
2018-02-09 06:57:29 -05:00
Glenn Randers-Pehrson
3403a6e387 Merge branch 'typos' of git://github.com/luzpaz/libpng into libpng16 2017-11-03 10:57:27 -05:00
Glenn Randers-Pehrson
b196bd6566 [Libpng16] Add typecast to NULL argument to png_do_expand() 2017-11-03 10:50:38 -05:00
Unknown
f23b41d7b1 Misc. typos
Some are user facing. Some are in actual code. Most are in source comments. Also, please double check the changes in contrib/tools/pngfix.c
2017-11-03 00:52:06 -04:00
Glenn Randers-Pehrson
4b52ef8e76 [libpng16] Removed some unnecessary brackets in pngrtran.c 2017-10-31 20:57:23 -05:00
Glenn Randers-Pehrson
2ee8cb0559 [libpng16] Imported from libpng-1.6.33.tar 2017-09-28 13:58:30 -05:00
Glenn Randers-Pehrson
051d6cc19b [libpng16] Fixed incorrect typecast of some arguments to png_malloc() and
png_calloc() that were png_uint_32 instead of png_alloc_size_t
(Bug report by "irwir" in Github libpng issue #175).
2017-09-03 15:19:59 -05:00
Glenn Randers-Pehrson
9fcb846402 [libpng16] Imported from libpng-1.6.31.tar 2017-07-27 05:27:17 -05:00
John Bowler
72d07d3202 [libpng16] Removed one of the GCC-7.1.0 'strict-overflow' warnings that
result when integers appear on both sides of a compare.  Worked around the
  others by forcing the strict-overflow setting in the relevant functions to
  a level where they are not reported.
Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
  the space.
Worked around some C-style casts from (void*) because g++ 5.4.0 objects
  to them.
Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
  overflow' check that is on by default with -Wall -Wextra.
2017-07-11 08:47:05 -05:00
Glenn Randers-Pehrson
9f7134c3fc [libpng16] Update some "last changed" dates 2017-06-29 17:52:18 -05:00
Viktor Szakats
b3ffdc5991 URL updates 2017-03-31 23:25:57 +00:00
Glenn Randers-Pehrson
e744ee1338 [libpng16] Update CHANGES, ANNOUNCE, and "last changed" dates. 2017-03-30 12:24:55 -05:00
Viktor Szakats
8c50acb9d2 silence clang -Wcomma warnings 2017-03-29 23:54:40 +00:00
Glenn Randers-Pehrson
d42e88d5b3 [libpng16] Imported from libpng-1.6.29.tar 2017-03-16 07:26:33 -05:00
Glenn Randers-Pehrson
4f31b7f242 [libpng16= Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer). 2017-02-27 20:17:56 -06: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
ac43a87820 [libpng16] Imported from libpng-1.6.22.tar 2016-05-26 07:25:14 -05:00
Glenn Randers-Pehrson
1a3fa1e091 [libpng16] Imported from libpng-1.6.22beta03.tar 2016-03-09 12:04:40 -06:00
Glenn Randers-Pehrson
05591abeb1 [libpng16] Updated CHANGES, ANNOUNCE, change date in pngrtran.c 2016-01-30 10:08:47 -06:00
John Bowler
f1eafe8b01 Relax limit checks on gamma values.
As suggested in the comments gamma values outside the range currently permitted
by png_set_alpha_mode are useful for HDR data encoding.  These values are
already permitted by png_set_gamma so it is reasonable caution to extend the
png_set_alpha_mode range as HDR imaging systems are starting to emerge.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-29 18:09:49 -08:00
Glenn Randers-Pehrson
4d8de33979 [libpng16] Update copyright uears in source files. 2015-12-13 22:41:17 -06:00
Glenn Randers-Pehrson
415d26805a [libpng16] Imported from libpng-1.6.19.tar 2015-11-12 07:13:31 -06:00
Glenn Randers-Pehrson
b00d986d54 [libpng16] Imported from libpng-1.6.19rc02.tar 2015-10-31 09:04:18 -05:00
John Bowler
896c3cfb76 rowbytes check correction
The old code incorrectly calculated the output rowbytes when the
application decreased either the number of channels or the bit depth (or
both) in a user transform.  This was safe; libpng overallocated buffer
space (potentially by quite a lot; up to 4 times the amount required)
but, from 1.5.4 on, resulted in a png_error.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-10-29 18:16:48 -07:00
Glenn Randers-Pehrson
01a0e8062d [libpng16] Reverted addition of png_set_filler_16 and png_set_add_alpha_16()
functions. They unnecessarily duplicate png_set_filler() and png_set_add_alpha()
which now work properly with 16-bit images.
2015-09-24 22:39:53 -05:00
Glenn Randers-Pehrson
efe4e5d10d [libpng16] Reverted the fix of byte order in png_do_read_filler() with 16-bit
input that was made in version 1.6.17beta01, to preserve legacy
behavior even though it was incorrect.  Instead, added new API
png_set_filter_16() and png_set_add_alpha_16() that set a flag to
make png_do_read_filter() interpret the filler bytes properly.
2015-09-23 22:08:04 -05:00
Glenn Randers-Pehrson
a8242fe6fb [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnUL 2015-08-17 20:46:27 -05:00
Glenn Randers-Pehrson
b9ba8d6a57 [libpng16] Mention in manual that 16-bit platform support has been dropped. 2015-08-16 23:32:04 -05:00
Glenn Randers-Pehrson
8ba4b13c55 [libpng16] Changed 0xnnnn constants to 0xnnnnUL. 2015-08-16 22:49:58 -05:00
Glenn Randers-Pehrson
8b83ff3704 [libpng16] Change "n bit" to "n-bit" in comments. 2015-08-13 20:57:18 -05:00
Victor Szakats
4e1d299e6b [libpng16] Removed unreachable "break" statements in png.c, pngread.c, and
pngrtran.c to suppress clang warnings (Bug report by Viktor Szakats).
2015-08-07 14:31:11 -05:00
Glenn Randers-Pehrson
e6172809bd [libpng16] Imported from libpng-1.6.18.tar 2015-07-22 22:40:52 -05:00
Glenn Randers-Pehrson
a390897ba4 [libpng16] Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin).
Removed some useless typecasts from contrib/tools/png-fix-itxt.c
2015-07-01 14:06:39 -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
f17e6c3046 [libpng16] Imported from libpng-1.6.17rc06.tar 2015-03-22 19:43:23 -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
bbe2be3f54 [libpng16] Spelling fixes: less then N -> less than N (Lauri Nurmi) 2015-03-07 13:13:11 -06:00
Glenn Randers-Pehrson
7011a8cec3 [libpng16] Added "& 0xff" to things being typecast to "png_byte". 2015-02-27 18:53:44 -06:00