chore: Split lines in scripts/*.awk to pacify the editorconfig checker

This commit is contained in:
Cosmin Truta 2024-01-31 15:02:42 +02:00
parent f0c578748b
commit 3bd304e5f4
2 changed files with 23 additions and 11 deletions

View File

@ -106,11 +106,13 @@ NF==2 && $2 ~ /^@[1-9][0-9]*$/ { # exported symbol
# At the end check for symbols marked as both duplicated and removed # At the end check for symbols marked as both duplicated and removed
END{ END{
if (symbolo > lasto) { if (symbolo > lasto) {
print "highest symbol ordinal in png.h,", symbolo ", exceeds last ordinal from png.h", lasto print "highest symbol ordinal in png.h,",
symbolo ", exceeds last ordinal from png.h", lasto
err = 1 err = 1
} }
if (mastero > lasto) { if (mastero > lasto) {
print "highest symbol ordinal in", master ",", mastero ", exceeds last ordinal from png.h", lasto print "highest symbol ordinal in", master ",",
mastero ", exceeds last ordinal from png.h", lasto
err = 1 err = 1
} }
unexported=0 unexported=0
@ -149,17 +151,21 @@ END{
unexported = 0 unexported = 0
} }
if (symbol[o] != "" && removed[o] != "") { if (symbol[o] != "" && removed[o] != "") {
print "png.h: symbol", o, "both exported as '" symbol[o] "' and removed as '" removed[o] "'" print "png.h: symbol", o,
"both exported as '" symbol[o] "' and removed as '" removed[o] "'"
err = 1 err = 1
} else if (symbol[o] != official[o]) { } else if (symbol[o] != official[o]) {
# either the symbol is missing somewhere or it changed # either the symbol is missing somewhere or it changed
err = 1 err = 1
if (symbol[o] == "") if (symbol[o] == "")
print "png.h: symbol", o, "is exported as '" official[o] "' in", master print "png.h: symbol", o,
"is exported as '" official[o] "' in", master
else if (official[o] == "") else if (official[o] == "")
print "png.h: exported symbol", o, "'" symbol[o] "' not present in", master print "png.h: exported symbol", o,
"'" symbol[o] "' not present in", master
else else
print "png.h: exported symbol", o, "'" symbol[o] "' exists as '" official[o] "' in", master print "png.h: exported symbol", o,
"'" symbol[o] "' exists as '" official[o] "' in", master
} }
# Finally generate symbols.new # Finally generate symbols.new

View File

@ -401,8 +401,10 @@ pre != 0 && $1 == "chunk" && NF >= 2{
if (i > NF) { if (i > NF) {
# Output new 'option' lines to the intermediate file (out) # Output new 'option' lines to the intermediate file (out)
print "option READ_" opt, "requires READ_ANCILLARY_CHUNKS" reqread, "enables", opt enables , onoff >out print "option READ_" opt, "requires READ_ANCILLARY_CHUNKS" reqread,
print "option WRITE_" opt, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, "enables", opt enables, onoff >out "enables", opt enables , onoff >out
print "option WRITE_" opt, "requires WRITE_ANCILLARY_CHUNKS" reqwrite,
"enables", opt enables, onoff >out
next next
} }
# Else hit the error handler below - bad line format! # Else hit the error handler below - bad line format!
@ -731,7 +733,9 @@ END{
# 'have_ifs' here means that everything = "off" still allows an 'if' on # 'have_ifs' here means that everything = "off" still allows an 'if' on
# an otherwise enabled option to turn it on; otherwise the 'if' # an otherwise enabled option to turn it on; otherwise the 'if'
# handling is effectively disabled by 'everything = off' # handling is effectively disabled by 'everything = off'
if (option[i] == "off" || option[i] == "disabled" && everything != "on" || option[i] == "enabled" && everything == "off" && !have_ifs) { if ((option[i] == "off") ||
(option[i] == "disabled" && everything != "on") ||
(option[i] == "enabled" && everything == "off" && !have_ifs)) {
print "# undef PNG_on /*default off*/" >out print "# undef PNG_on /*default off*/" >out
} else { } else {
print "# ifdef PNG_NO_" i >out print "# ifdef PNG_NO_" i >out
@ -752,7 +756,8 @@ END{
# pnglibconf.h # pnglibconf.h
print "# ifdef PNG_on" >out print "# ifdef PNG_on" >out
if (i ~ /^fail_/) { if (i ~ /^fail_/) {
print error, i, "is on: enabled by:" iffs[i] enabledby[i] ", requires" requires[i] end >out print error, i, "is on:",
"enabled by:" iffs[i] enabledby[i] ", requires" requires[i] end >out
} else if (i !~ /^ok_/) { } else if (i !~ /^ok_/) {
print def i sup >out print def i sup >out
# Supported option, set required settings # Supported option, set required settings
@ -779,7 +784,8 @@ END{
print und i une >out print und i une >out
} }
if (i ~ /^ok_/) { if (i ~ /^ok_/) {
print error, i, "not enabled: requires:" requires[i] ", enabled by:" iffs[i] enabledby[i] end >out print error, i, "not enabled: ",
"requires:" requires[i] ", enabled by:" iffs[i] enabledby[i] end >out
} }
print "#endif" >out print "#endif" >out
} }