chore: Update the .editorconfig files and pacify editorconfig-checker

libpng16
Cosmin Truta 2024-02-15 18:29:26 +02:00
parent 42c8fcbff9
commit 4191872d0d
15 changed files with 171 additions and 113 deletions

View File

@ -10,29 +10,44 @@ trim_trailing_whitespace = true
# Traditionally, the end-of-line character has been platform-specific.
end_of_line = unset
[*.[chS]]
indent_style = space
max_line_length = 81
[*.{awk,cmake,dfa,in,sh}]
indent_style = space
max_line_length = 100
[*.txt]
indent_style = space
max_line_length = unset
[*.[chS]]
indent_style = space
max_doc_length = 80
max_line_length = 81
# FIXME: max_line_length should be 80
[*.dfa]
indent_style = space
max_doc_length = 80
max_line_length = 80
[*.{awk,cmake}]
indent_style = space
max_doc_length = 80
max_line_length = 100
[*.{in,sh}]
indent_style = space
max_doc_length = 100
max_line_length = 100
[{Makefile.in,ltmain.sh}]
indent_style = unset
insert_final_newline = unset
max_doc_length = unset
max_line_length = unset
trim_trailing_whitespace = unset
[*~]
end_of_line = unset
indent_style = unset
insert_final_newline = unset
max_line_length = unset
trim_trailing_whitespace = unset
[COMMIT_EDITMSG]
indent_style = space
max_doc_length = unset
max_line_length = 72

View File

@ -265,7 +265,7 @@ if(TARGET_ARCH MATCHES "^(loongarch)")
if(COMPILER_SUPPORTS_LSX)
set(libpng_loongarch_sources
loongarch/loongarch_lsx_init.c
loongarch/filter_lsx_intrinsics.c)
loongarch/filter_lsx_intrinsics.c)
set_source_files_properties(${libpng_loongarch_sources}
PROPERTIES
COMPILE_FLAGS "-mlsx")
@ -302,7 +302,7 @@ endif()
# Set definitions and sources for LoongArch.
if(TARGET_ARCH MATCHES "^(loongarch)")
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
endif()
endif(PNG_HARDWARE_OPTIMIZATIONS)

View File

@ -2,12 +2,6 @@
root = false
[*]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
insert_final_newline = unset
[*.[ch]]
max_doc_length = unset
max_line_length = unset
trim_trailing_whitespace = unset

View File

@ -80,7 +80,7 @@ extract(FILE *fp, png_uint_32 *proflen)
}
else
result = no_profile;
result = no_profile;
}
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
@ -155,7 +155,7 @@ extract_one_file(const char *filename)
}
else if (verbose && profile == no_profile)
printf("%s has no profile\n", filename);
printf("%s has no profile\n", filename);
}
else

View File

@ -21,7 +21,7 @@
- 1.10: added support for non-default visuals; fixed X pixel-conversion
- 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed
command-line parsing bug
- 1.12: fixed some small X memory leaks (thanks to François Petitjean)
- 1.12: fixed some small X memory leaks (thanks to François Petitjean)
- 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche)
- 1.14: added support for X resources (thanks to Gerhard Niklasch)
- 2.00: dual-licensed (added GNU GPL)

View File

@ -27,7 +27,7 @@
- 1.11: added -usleep option for demos; fixed command-line parsing bug
- 1.12: added -pause option for demos and testing
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
- 1.21: fixed some small X memory leaks (thanks to François Petitjean)
- 1.21: fixed some small X memory leaks (thanks to François Petitjean)
- 1.22: fixed XFreeGC() crash bug (thanks to Patrick Welche)
- 1.23: added -bgpat 0 mode (std white/gray checkerboard, 8x8 squares)
- 1.30: added -loop option for -bgpat (ifdef FEATURE_LOOP); fixed bpp =

View File

@ -54,7 +54,7 @@ ZOBJS = adler32$(O) crc32$(O) \
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
pngset$(C) pngtrans$(C)
# Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h

View File

@ -0,0 +1,22 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = unset
indent_style = unset
insert_final_newline = true
max_doc_length = 80
max_line_length = 100
trim_trailing_whitespace = true
[*.rc]
end_of_line = crlf
trim_trailing_whitespace = unset
[*.ds[pw]]
end_of_line = crlf
max_doc_length = unset
max_line_length = unset
trim_trailing_whitespace = unset

View File

@ -4,4 +4,5 @@ root = false
# FIXME
[*.[ch]]
max_doc_length = unset
max_line_length = unset

8
mips/.editorconfig Normal file
View File

@ -0,0 +1,8 @@
# https://editorconfig.org
root = false
# FIXME
[*.[ch]]
max_doc_length = unset
max_line_length = unset

14
png.c
View File

@ -1821,14 +1821,14 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace,
}
# ifdef PNG_WARNINGS_SUPPORTED
else
{
char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
{
char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
pos = png_safecat(message, (sizeof message), pos,
png_format_number(number, number+(sizeof number),
PNG_NUMBER_FORMAT_x, value));
pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
}
pos = png_safecat(message, (sizeof message), pos,
png_format_number(number, number+(sizeof number),
PNG_NUMBER_FORMAT_x, value));
pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
}
# endif
/* The 'reason' is an arbitrary message, allow +79 maximum 195 */
pos = png_safecat(message, (sizeof message), pos, reason);

View File

@ -4,4 +4,5 @@ root = false
# FIXME
[*.[ch]]
max_doc_length = unset
max_line_length = unset

View File

@ -1,13 +1,3 @@
# https://editorconfig.org
root = false
[*]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
insert_final_newline = unset
max_doc_length = unset
max_line_length = unset
trim_trailing_whitespace = unset
root = true

View File

@ -204,26 +204,33 @@ option SET_OPTION disabled
# These options are specific to the ARM NEON hardware optimizations. At present
# these optimizations depend on GCC specific pre-processing of an assembler (.S)
# file so they probably won't work with other compilers.
# file, so they probably won't work with other compilers.
#
# ARM_NEON_OPT:
# unset: check at compile time
# (__ARM_NEON__ must be predefined by the compiler, as a result of
# passing "-mfpu=neon" to the compiler options)
# 0: disable (even if the CPU has a NEON FPU)
# 1: check at run time (via ARM_NEON_{API,CHECK})
# 2: switch on unconditionally
# (inadvisable - instead, pass "-mfpu=neon" to the compiler)
# NOTE:
# When building libpng, avoid using any setting other than '0';
# '1' is set automatically when either 'API' or 'CHECK' are configured in;
# '2' should not be necessary, as "-mfpu=neon" will achieve the same effect
# as well as applying the NEON optimizations to the rest of libpng.
# NOTE:
# Any setting other than '0' requires ALIGNED_MEMORY.
#
# ARM_NEON_API:
# (PNG_ARM_NEON == 1)
# Allow the optimization to be switched on with png_set_option.
#
# ARM_NEON_CHECK:
# (PNG_ARM_NEON == 1)
# Compile a run-time check to see if Neon extensions are supported.
# This is poorly supported and deprecated - use the png_set_option API.
#
# ARM_NEON_OPT: unset: check at compile time (__ARM_NEON__ must be defined by
# the compiler, typically as a result of specifying
# CC="gcc -mfpu=neon".)
# 0: disable (even if the CPU has a NEON FPU.)
# 1: check at run time (via ARM_NEON_{API,CHECK})
# 2: switch on unconditionally (inadvisable - instead pass
# -mfpu=neon to GCC in CC)
# When building libpng avoid using any setting other than '0'; '1' is
# set automatically when either 'API' or 'CHECK' are configured in,
# '2' should not be necessary as -mfpu=neon will achieve the same
# effect as well as applying NEON optimizations to the rest of the
# libpng code.
# NOTE: any setting other than '0' requires ALIGNED_MEMORY
# ARM_NEON_API: (PNG_ARM_NEON == 1) allow the optimization to be switched on
# with png_set_option
# ARM_NEON_CHECK: (PNG_ARM_NEON == 1) compile a run-time check to see if Neon
# extensions are supported. This is poorly supported and
# deprecated - use the png_set_option API.
setting ARM_NEON_OPT
option ARM_NEON_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
sets ARM_NEON_OPT 1
@ -232,24 +239,29 @@ option ARM_NEON_CHECK disabled requires ALIGNED_MEMORY,
# These options are specific to the PowerPC VSX hardware optimizations.
#
# POWERPC_VSX_OPT: unset: check at compile time (__PPC64__,__ALTIVEC__,__VSX__
# must be defined by the compiler, typically as a result
# of specifying
# "-mvsx -maltivec" compiler flags)
# 0: disable (even if the CPU supports VSX.)
# 1: check at run time (via POWERPC_VSX_{API,CHECK})
# 2: switch on unconditionally (inadvisable - instead pass
# -mvsx -maltivec to compiler options)
# When building libpng avoid using any setting other than '0'; '1' is
# set automatically when either 'API' or 'CHECK' are configured in,
# '2' should not be necessary as "-mvsx -maltivec" will achieve the same
# effect as well as applying VSX optimizations to the rest of the
# libpng code.
# POWERPC_VSX_API: (PNG_POWERPC_VSX == 1) allow the optimization to be switched on
# with png_set_option
# POWERPC_VSX_CHECK: (PNG_POWERPC_VSX == 1) compile a run-time check to see if VSX
# extensions are supported. This is supported not for all OSes
# (see contrib/powerpc/README)
# POWERPC_VSX_OPT:
# unset: check at compile time
# (__PPC64__,__ALTIVEC__,__VSX__ must be predefined by the compiler,
# as a result of passing "-mvsx -maltivec" to the compiler options)
# 0: disable (even if the CPU supports VSX)
# 1: check at run time (via POWERPC_VSX_{API,CHECK})
# 2: switch on unconditionally
# (inadvisable - instead, pass "-mvsx -maltivec" to the compiler)
# NOTE:
# When building libpng, avoid using any setting other than '0';
# '1' is set automatically when either 'API' or 'CHECK' are configured in;
# '2' should not be necessary, as "-mvsx -maltivec" will achieve the same
# effect as well as applying the VSX optimizations to the rest of libpng.
#
# POWERPC_VSX_API:
# (PNG_POWERPC_VSX == 1)
# Allow the optimization to be switched on with png_set_option.
#
# POWERPC_VSX_CHECK:
# (PNG_POWERPC_VSX == 1)
# Compile a run-time check to see if VSX extensions are supported.
# This is not supported on all systems. See contrib/powerpc-vsx/README.
#
setting POWERPC_VSX_OPT
option POWERPC_VSX_API disabled enables SET_OPTION,
sets POWERPC_VSX_OPT 1
@ -258,23 +270,30 @@ option POWERPC_VSX_CHECK disabled,
# These options are specific to the MIPS MSA hardware optimizations.
#
# MIPS_MSA_OPT: unset: check at compile time (__mips_msa must be defined by
# the compiler, typically as a result of specifying
# "-mmsa -mfp64" compiler flags)
# 0: disable (even if the CPU supports MSA.)
# 1: check at run time (via MIPS_MSA_{API,CHECK})
# 2: switch on unconditionally (inadvisable - instead pass
# -mmsa -mfp64 to compiler options)
# When building libpng avoid using any setting other than '0'; '1' is
# set automatically when either 'API' or 'CHECK' are configured in,
# '2' should not be necessary as "-mmsa -mfp64" will achieve the same
# effect as well as applying MSA optimizations to the rest of the
# libpng code.
# NOTE: any setting other than '0' requires ALIGNED_MEMORY
# MIPS_MSA_API: (PNG_MIPS_MSA == 1) allow the optimization to be switched on
# with png_set_option.
# MIPS_MSA_CHECK: (PNG_MIPS_MSA == 1) compile a run-time check to see if MSA
# extensions are supported.
# MIPS_MSA_OPT:
# unset: check at compile time
# (__mips_msa must be predefined by the compiler, as a result of
# passing "-mmsa -mfp64" to the compiler options)
# 0: disable (even if the CPU supports MSA)
# 1: check at run time (via MIPS_MSA_{API,CHECK})
# 2: switch on unconditionally
# (inadvisable - instead, pass "-mmsa -mfp64" to the compiler)
# NOTE:
# When building libpng, avoid using any setting other than '0';
# '1' is set automatically when either 'API' or 'CHECK' are configured in;
# '2' should not be necessary, as "-mmsa -mfp64" will achieve the same
# effect as well as applying the MSA optimizations to the rest of libpng.
# NOTE:
# Any setting other than '0' requires ALIGNED_MEMORY.
#
# MIPS_MSA_API:
# (PNG_MIPS_MSA == 1)
# Allow the optimization to be switched on with png_set_option.
#
# MIPS_MSA_CHECK:
# (PNG_MIPS_MSA == 1)
# Compile a run-time check to see if MSA extensions are supported.
#
setting MIPS_MSA_OPT
option MIPS_MSA_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
sets MIPS_MSA_OPT 1
@ -283,22 +302,30 @@ option MIPS_MSA_CHECK disabled requires ALIGNED_MEMORY,
# These options are specific to the MIPS MMI hardware optimizations.
#
# MIPS_MMI_OPT: unset: check at compile time (__mips_loongson_mmi must be defined by
# the compiler, typically as a result of specifying
# "-mloongson-mmi -march=loongson3a" compiler flags)
# 0: disable (even if the CPU supports MMI.)
# 1: check at run time (via MIPS_MMI_{API,CHECK})
# 2: switch on unconditionally (inadvisable - instead pass
# -mloongson-mmi -march=loongson3a to compiler options)
# When building libpng avoid using any setting other than '0'; '1' is
# set automatically when either 'API' or 'CHECK' are configured in,
# '2' should not be necessary as "-mloongson-mmi -march=loongson3a" will achieve the same
# effect as well as applying MMI optimizations to the rest of the
# libpng code.
# MIPS_MMI_API: (PNG_MIPS_MMI == 1) allow the optimization to be switched on
# with png_set_option
# MIPS_MMI_CHECK: (PNG_MIPS_MMI == 1) compile a run-time check to see if MMI
# extensions are supported.
# MIPS_MMI_OPT:
# unset: check at compile time
# (__mips_loongson_mmi must be defined by the compiler, as a result of
# passing "-mloongson-mmi -march=loongson3a" to the compiler options)
# 0: disable (even if the CPU supports MMI)
# 1: check at run time (via MIPS_MMI_{API,CHECK})
# 2: switch on unconditionally
# (inadvisable - instead, pass "-mloongson-mmi -march=loongson3a" to the
# compiler)
# NOTE:
# When building libpng, avoid using any setting other than '0';
# '1' is set automatically when either 'API' or 'CHECK' are configured in;
# '2' should not be necessary, as "-mloongson-mmi -march=loongson3a" will
# achieve the same effect as well as applying the MMI optimizations to the
# rest of libpng.
#
# MIPS_MMI_API:
# (PNG_MIPS_MMI == 1)
# Allow the optimization to be switched on with png_set_option.
#
# MIPS_MMI_CHECK:
# (PNG_MIPS_MMI == 1)
# Compile a run-time check to see if MMI extensions are supported.
#
setting MIPS_MMI_OPT
option MIPS_MMI_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
sets MIPS_MMI_OPT 1

View File

@ -15,7 +15,7 @@ TEST(){
77) test_status="$skip"
skipped=1;;
*) test_status="$fail"
st="$status";;
st="$status";;
esac
echo "===============$test_status $* ===================="
return "$status"