From 3bd304e5f456324a3fa884af6c0e6605c49630fc Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Wed, 31 Jan 2024 15:02:42 +0200 Subject: [PATCH] chore: Split lines in scripts/*.awk to pacify the editorconfig checker --- scripts/checksym.awk | 18 ++++++++++++------ scripts/options.awk | 16 +++++++++++----- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/scripts/checksym.awk b/scripts/checksym.awk index 48e55e60e..2ab52ecb3 100755 --- a/scripts/checksym.awk +++ b/scripts/checksym.awk @@ -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 END{ 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 } 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 } unexported=0 @@ -149,17 +151,21 @@ END{ unexported = 0 } 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 } else if (symbol[o] != official[o]) { # either the symbol is missing somewhere or it changed err = 1 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] == "") - 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 - 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 diff --git a/scripts/options.awk b/scripts/options.awk index 284811967..b74223ab7 100755 --- a/scripts/options.awk +++ b/scripts/options.awk @@ -401,8 +401,10 @@ pre != 0 && $1 == "chunk" && NF >= 2{ if (i > NF) { # 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 WRITE_" opt, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, "enables", opt enables, onoff >out + print "option READ_" opt, "requires READ_ANCILLARY_CHUNKS" reqread, + "enables", opt enables , onoff >out + print "option WRITE_" opt, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, + "enables", opt enables, onoff >out next } # 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 # an otherwise enabled option to turn it on; otherwise the 'if' # 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 } else { print "# ifdef PNG_NO_" i >out @@ -752,7 +756,8 @@ END{ # pnglibconf.h print "# ifdef PNG_on" >out 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_/) { print def i sup >out # Supported option, set required settings @@ -779,7 +784,8 @@ END{ print und i une >out } 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 }