aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosmin Truta <ctruta@gmail.com>2024-02-15 18:29:26 +0200
committerCosmin Truta <ctruta@gmail.com>2024-02-15 18:29:26 +0200
commit4191872d0dbd06ae7ff59cf06b02a7f9cbb5a790 (patch)
treebb59d1d54a87792fc703086f7e2f063260405d94
parent42c8fcbff90925d47d780dcce23c53f205b42305 (diff)
downloadlibpng-4191872d0dbd06ae7ff59cf06b02a7f9cbb5a790.tar.gz
chore: Update the .editorconfig files and pacify editorconfig-checker
-rw-r--r--.editorconfig23
-rw-r--r--CMakeLists.txt4
-rw-r--r--contrib/.editorconfig8
-rw-r--r--contrib/examples/iccfrompng.c4
-rw-r--r--contrib/gregbook/rpng-x.c2
-rw-r--r--contrib/gregbook/rpng2-x.c2
-rw-r--r--contrib/pngminim/decoder/makefile2
-rw-r--r--contrib/visupng/.editorconfig22
-rw-r--r--loongarch/.editorconfig1
-rw-r--r--mips/.editorconfig8
-rw-r--r--png.c14
-rw-r--r--powerpc/.editorconfig1
-rw-r--r--projects/.editorconfig12
-rw-r--r--scripts/pnglibconf.dfa169
-rwxr-xr-xtests/pngtest-all2
15 files changed, 166 insertions, 108 deletions
diff --git a/.editorconfig b/.editorconfig
index 34a145d4c..324bdf7d5 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -10,29 +10,44 @@ trim_trailing_whitespace = true
# Traditionally, the end-of-line character has been platform-specific.
end_of_line = unset
+[*.txt]
+indent_style = space
+
[*.[chS]]
indent_style = space
+max_doc_length = 80
max_line_length = 81
+# FIXME: max_line_length should be 80
-[*.{awk,cmake,dfa,in,sh}]
+[*.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
-[*.txt]
+[*.{in,sh}]
indent_style = space
-max_line_length = unset
+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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cf62ba83..8bff18ff6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/contrib/.editorconfig b/contrib/.editorconfig
index bd9b590d3..e1b551df7 100644
--- a/contrib/.editorconfig
+++ b/contrib/.editorconfig
@@ -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
diff --git a/contrib/examples/iccfrompng.c b/contrib/examples/iccfrompng.c
index 00056abfd..0f86714a8 100644
--- a/contrib/examples/iccfrompng.c
+++ b/contrib/examples/iccfrompng.c
@@ -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
diff --git a/contrib/gregbook/rpng-x.c b/contrib/gregbook/rpng-x.c
index 92effaa6d..2fc9272c6 100644
--- a/contrib/gregbook/rpng-x.c
+++ b/contrib/gregbook/rpng-x.c
@@ -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)
diff --git a/contrib/gregbook/rpng2-x.c b/contrib/gregbook/rpng2-x.c
index af944c0f2..1375dc9a6 100644
--- a/contrib/gregbook/rpng2-x.c
+++ b/contrib/gregbook/rpng2-x.c
@@ -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 =
diff --git a/contrib/pngminim/decoder/makefile b/contrib/pngminim/decoder/makefile
index 4acf3c177..bbacea4bb 100644
--- a/contrib/pngminim/decoder/makefile
+++ b/contrib/pngminim/decoder/makefile
@@ -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
diff --git a/contrib/visupng/.editorconfig b/contrib/visupng/.editorconfig
new file mode 100644
index 000000000..d946b1446
--- /dev/null
+++ b/contrib/visupng/.editorconfig
@@ -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
diff --git a/loongarch/.editorconfig b/loongarch/.editorconfig
index b142d823b..de2e98ab4 100644
--- a/loongarch/.editorconfig
+++ b/loongarch/.editorconfig
@@ -4,4 +4,5 @@ root = false
# FIXME
[*.[ch]]
+max_doc_length = unset
max_line_length = unset
diff --git a/mips/.editorconfig b/mips/.editorconfig
new file mode 100644
index 000000000..de2e98ab4
--- /dev/null
+++ b/mips/.editorconfig
@@ -0,0 +1,8 @@
+# https://editorconfig.org
+
+root = false
+
+# FIXME
+[*.[ch]]
+max_doc_length = unset
+max_line_length = unset
diff --git a/png.c b/png.c
index 997b8d4dc..802c61e82 100644
--- a/png.c
+++ b/png.c
@@ -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);
diff --git a/powerpc/.editorconfig b/powerpc/.editorconfig
index b142d823b..de2e98ab4 100644
--- a/powerpc/.editorconfig
+++ b/powerpc/.editorconfig
@@ -4,4 +4,5 @@ root = false
# FIXME
[*.[ch]]
+max_doc_length = unset
max_line_length = unset
diff --git a/projects/.editorconfig b/projects/.editorconfig
index bd9b590d3..dc99bd001 100644
--- a/projects/.editorconfig
+++ b/projects/.editorconfig
@@ -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
diff --git a/scripts/pnglibconf.dfa b/scripts/pnglibconf.dfa
index 739805d2d..fe8e48123 100644
--- a/scripts/pnglibconf.dfa
+++ b/scripts/pnglibconf.dfa
@@ -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.
-#
-# 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.
+# 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.
+#
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
diff --git a/tests/pngtest-all b/tests/pngtest-all
index b4280f5ff..668d92e9c 100755
--- a/tests/pngtest-all
+++ b/tests/pngtest-all
@@ -15,7 +15,7 @@ TEST(){
77) test_status="$skip"
skipped=1;;
*) test_status="$fail"
- st="$status";;
+ st="$status";;
esac
echo "===============$test_status $* ===================="
return "$status"