1
0
mirror of https://github.com/glennrp/libpng.git synced 2026-10-24 08:39:18 +03:00

21 Commits

Author SHA1 Message Date
THE-Spellchecker
0094fdbf37 Fix typographical errors
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2026-02-13 18:30:34 +02:00
Cosmin Truta
d9e9c6d3a0 refactor: Replace deprecated pointer typedefs (part 2)
Following up on commit 7c67f70da1:

Replace 22 deprecated pointer typedefs with their underlying types.
The typedefs replaced are:

1. Core structure types:
   - png_structp, png_structrp, png_structpp and const variants
   - png_infop, png_inforp, png_infopp and const variants

2. Utility structure types:
   - png_row_infop, png_row_infopp
   - png_imagep, png_imagepp
   - png_controlp

3. Color structure types:
   - png_colorp, png_colorpp and const variants
   - png_color_8p, png_color_8pp and const variants
   - png_color_16p, png_color_16pp and const variants

4. Text and time structure types:
   - png_textp, png_textpp and const variants
   - png_timep, png_timepp and const variants

5. Chunk structure types:
   - png_unknown_chunkp, png_unknown_chunkpp and const variants
   - png_sPLT_tp, png_sPLT_tpp and const variants
   - png_sPLT_entryp, png_sPLT_entrypp and const variants

6. Internal types:
   - png_compression_bufferp
   - png_dsortp, png_dsortpp

Remove all remaining uses of spurious PNG_RESTRICT qualifiers.
Non-aliasing has already been guaranteed by the type-based aliasing
rules combined with the libpng usage pattern of a single pointer per
type.

Update the user manual accordingly.

This completes the systematic replacement of deprecated pointer
typedefs across the entire libpng codebase. The typedef declarations
remain in png.h for backward compatibility, marked as deprecated.

Reviewed-by: Chris Blume <ProgramMax@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-11-03 10:30:49 +02:00
Cosmin Truta
7c67f70da1 refactor: Replace deprecated pointer typedefs (part 1)
Following up on commit ddce3ff853:

1. Replace 28 deprecated pointer typedefs with their underlying types.
   The typedefs replaced are:
   - Basic: png_voidp, png_charp and const variants
   - Byte: png_bytep, png_const_bytep, png_bytepp
   - Numeric:
     - Integer: 16/32-bit integer pointer variants
     - Fixed-point: png_fixed_point_p and variants
     - Floating-point: png_doublep and variants

2. Remove a spurious PNG_RESTRICT qualifier. Non-aliasing has already
   been guaranteed by the type-based aliasing rules.

3. Update the user manual accordingly.

Reviewed-by: Chris Blume <ProgramMax@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-10-29 09:20:20 +02:00
Cosmin Truta
caa0c733f3 chore: Tidy up whitespace in declarations and definitions
Prepare a clean and consistent baseline for the upcoming refactoring.
2025-10-24 22:21:39 +03:00
John Bowler
ed689982c2 Update the support for target-specific code
The change removes the need for build configuration of target specific
code such as SIMD enhancements.

The extensible framework is based on checks in the new file named
pngtarget.h and allows per target description of requirements and
capabilities using macros with the prefix PNG_TARGET_.  These macros are
interpreted by the core libpng code in a target independent way.

The PNG_TARGET_ prefixed macros describe the target specific
implementation and document how to include it.  The actual inclusion of
the code is done, at present, by a single target independent core file
named pngsimd.c.

This approach ensures that no special configuration in the build system
is required on any system.  It is not required on a system which is
compiling for the build host where we can reasonably assume that the
compiler is correctly set up.  Neither is it required for cross builds
so long as the toolchain is correctly set up.  In this case the
toolchain means the cross build system and any ancilliary programs it
requires.

More details of the implementation are included in the source files
named pngtarget.h and pngsimd.c.  These files document in C comments how
additional target specific code might be added.

The changes consist primarily of movement of target specific code from
the core libpng source files to the existing target specific
subdirectories such as the ones named intel and arm.  This isolates the
code into the corresponding subdirectory and eliminates the requirement
for changes across the libpng structure.

As part of this the ARM processor NEON instruction set specific palette
to RGB code has been generalised to allow implementation in other
architectures.  The resultant updated version of the original (ARM Ltd)
implementation has been moved to the subdirectory named arm.

In addition some selected changes have been included to allow testing
with higher warning levels than the typical compiler defaults.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-10-10 21:28:34 +03:00
Cosmin Truta
77c3a39299 Clean up comments and whitespace characters in source files
Remove all remaining "last changed" version info from source comments.
(The version control system maintains this information automatically.)

Delete the trailing whitespace characters.
2022-11-20 21:23:33 +02:00
Cosmin Truta
94429a335b Remove the "last changed" version information from source comments 2018-09-04 00:58:55 -04:00
Samuel Williams
d3d1baadb4 Prefer memcpy to manual pointer arithmetic. 2018-08-19 01:16:22 -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
df7e9dae0c [libpng16] Imported from libpng-1.6.32.tar 2017-08-24 16:39:02 -05:00
Glenn Randers-Pehrson
b73c891891 [libpng16] Bump version to 1.6.32beta01 2017-07-27 14:18:21 -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
aa6e0482fa [libpng16] Quieted "declaration after statement" warnings in intel/filter_sse2.c. 2017-07-09 11:51:42 -05:00
Glenn Randers-Pehrson
5cc23552a7 [libpng16]Change "int" to "png_uint_32" in intel/filter_sse2.c to prevent
possible integer overflow (Bug report by John Bowler).
2017-07-09 08:26:54 -05:00
Glenn Randers-Pehrson
a315efe3b2 [libpng16] Mention CVE-2016-5737 in CHANGES, update intel "last changed" date 2017-05-24 09:58:09 -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
bef76802de [libpng16] Moved SSE2 optimization code into the main libpng source directory.
Configure libpng with "configure --enable-intel-sse" or compile
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.  This patch was
previously applied to libpng-1.6.28rc03 but withdrawn to allow time for QA.
2017-01-05 18:09:33 -06:00
Glenn Randers-Pehrson
93b3476358 [libpng16] Imported from libpng-1.6.28rc03.tar 2017-01-03 22:25:10 -06:00
Glenn Randers-Pehrson
edef058e18 [libpng16] Moved SSE2 optimization code into the main libpng source directory.
Configure libpng with "configure --enable-intel-see" or compile
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
2017-01-03 19:15:15 -06:00