Commit Graph

25 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
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
2239961279 [libpng16] Fix "last changed" dates in powerpc/*.c 2017-03-21 19:37:27 -05:00
Glenn Randers-Pehrson
03a6f3f9c9 [libpng16] Bump version to 1.6.30beta01 2017-03-16 10:40:01 -05:00
Glenn Randers-Pehrson
d42e88d5b3 [libpng16] Imported from libpng-1.6.29.tar 2017-03-16 07:26:33 -05:00
Glenn Randers-Pehrson
b475d0593c [libpng16] Update credits and copyright information about powerpc-vsx code 2017-02-22 15:14:22 -06:00
Vadim Barkov
a343882c74 Made VSX code pedantic strict C90 compliant
Fixed signed/unsigned comparations, png_byte and summations. Also
fixed combound literals which are permited by C90.
2017-02-11 21:33:32 +00:00
Vadim Barkov
483bcad21d Changed minimum supported PowerPC CPU comment
Changed it from POWER8 to POWER7 due to the last one
supports VSX too.
2017-02-10 07:33:06 +00:00
Vadim Barkov
310dee21f7 Refactoring
Now all defines in filter VSX file are prefixed with VSX
and have more clear names
2017-02-10 07:20:59 +00:00
Vadim Barkov
d1c12e85c1 Added support for ppc64 big endian for filter_paeth VSX 2017-02-09 19:11:31 +00:00
Vadim Barkov
99d7285f20 Fixed filter_paeth for PowerPC VSX
Now all tests are fine for ppc64le
2017-02-09 18:57:53 +00:00
Vadim Barkov
d4bdca45b3 Fixed multiple bugs in VSX filter functions
Now up,sub and avg filter VSX functions pass tests
2017-02-08 14:02:44 +00:00
Vadim Barkov
58e9d5d59d Refactoring 2017-02-02 22:37:36 +00:00
Vadim Barkov
ae15e839d9 Small bugfix 2017-02-02 04:51:56 +00:00
Vadim Barkov
9bd58f9387 Removed PNG_ALIGN check in VSX code since it is not used 2017-01-31 12:15:45 +00:00
Vadim Barkov
bea573d370 Added auxv-based VSX detection method for PowerPC and enabled it by default 2017-01-31 11:59:11 +00:00
Vadim Barkov
acb155d893 Implemented filter_paeth PowerPC VSX variant 2017-01-31 04:05:19 +03:00
Vadim Barkov
c43aaa8b20 Implemented filter_avg for PowerPC VXS 2017-01-29 18:44:54 +03:00
Vadim Barkov
6ddcd33daa Fixed potential align errors for PowerPC VSX filter functions
The problem is that row and prev_row may not be aligned to the same
byte count. This situation leaded to undefined behaviour.
2017-01-29 18:37:53 +03:00
Vadim Barkov
adbf1d6d1c Fixed missing defines for VSX filter_sub 2017-01-19 18:12:13 +03:00
Vadim Barkov
9b0311a4d8 Implemented filter_sub optimisation for PowerPC VSX 2017-01-19 02:11:34 +03:00
Vadim Barkov
b455622aa8 Fixed potential bug on align calculation for VSX filter_up 2017-01-19 01:29:24 +03:00
Vadim Barkov
ccef5edbfe Fixed bug with unaligned input on VSX filter_up 2017-01-16 19:45:17 +03:00
Vadim Barkov
91acd4baf8 Implemented png_read_filter_up_vsx 2017-01-15 20:20:29 +03:00
Vadim Barkov
2b6e59d968 Added initial code for PowerPC VSX optimisation 2017-01-14 16:05:33 +03:00