From: gakamath Date: Mon, 28 Nov 2022 14:26:23 +0000 (+0530) Subject: Remove line continuations in et_c.awk X-Git-Tag: krb5-1.21-beta1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f368c75dd867965cd621d011a6770e940af4047d;p=thirdparty%2Fkrb5.git Remove line continuations in et_c.awk Line continuations cause issues for the awk in MinGW, so just have long lines instead. [ghudson@mit.edu: rewrote commit message; factored out some string constructions for readability] --- diff --git a/src/util/et/et_c.awk b/src/util/et/et_c.awk index 35d924aa35..8a86bab403 100644 --- a/src/util/et/et_c.awk +++ b/src/util/et/et_c.awk @@ -82,8 +82,7 @@ c2n["_"]=63 # figure out: table_number_base=table_number*256 tab_base_low = tab_base_low * 256 - tab_base_high = (tab_base_high * 256) + \ - int(tab_base_low / mod_base) + tab_base_high = (tab_base_high * 256) + int(tab_base_low / mod_base) tab_base_low = tab_base_low % mod_base if (table_number > 128*256*256) { @@ -203,14 +202,12 @@ END { print "#include " > outfile print "" > outfile if (tab_base_high == 0) { - print "const struct error_table et_" table_name "_error_table = { text, " \ - sprintf("%dL, %d };", tab_base_sign*tab_base_low, \ - table_item_count) > outfile + base = sprintf("%dL", tab_base_sign * tab_base_low) } else { - print "const struct error_table et_" table_name "_error_table = { text, " \ - sprintf("%d%06dL, %d };", tab_base_sign*tab_base_high, \ - tab_base_low, table_item_count) > outfile + base = sprintf("%d%06dL", tab_base_sign * tab_base_high, tab_base_low) } + ints = sprintf("%s, %d", base, table_item_count) + print "const struct error_table et_" table_name "_error_table = { text, " ints " };" > outfile print "" > outfile print "#if !defined(_WIN32)" > outfile print "void initialize_" table_name "_error_table (void)" > outfile diff --git a/src/util/et/et_h.awk b/src/util/et/et_h.awk index 65c6c453ff..95940d1b3b 100644 --- a/src/util/et/et_h.awk +++ b/src/util/et/et_h.awk @@ -81,8 +81,7 @@ c2n["_"]=63 # figure out: table_number_base=table_number*256 tab_base_low = tab_base_low * 256 - tab_base_high = (tab_base_high * 256) + \ - int(tab_base_low / mod_base) + tab_base_high = (tab_base_high * 256) + int(tab_base_low / mod_base) tab_base_low = tab_base_low % mod_base if (table_number > 128*256*256) { @@ -119,11 +118,9 @@ c2n["_"]=63 /^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,/ { tag=substr($2,1,length($2)-1) if (curr_high == 0) { - printf "#define %-40s (%dL)\n", tag, \ - curr_sign*curr_low > outfile + printf "#define %-40s (%dL)\n", tag, curr_sign*curr_low > outfile } else { - printf "#define %-40s (%d%06dL)\n", tag, curr_high*curr_sign, \ - curr_low > outfile + printf "#define %-40s (%d%06dL)\n", tag, curr_high*curr_sign, curr_low > outfile } curr_low += curr_sign; if (curr_low >= mod_base) { @@ -142,14 +139,11 @@ END { exit 1 } if (tab_base_high == 0) { - print "#define ERROR_TABLE_BASE_" table_name " (" \ - sprintf("%d", tab_base_sign*tab_base_low) \ - "L)" > outfile + base = sprintf("%dL", tab_base_sign * tab_base_low) } else { - print "#define ERROR_TABLE_BASE_" table_name " (" \ - sprintf("%d%06d", tab_base_sign*tab_base_high, \ - tab_base_low) "L)" > outfile + base = sprintf("%d%06dL", tab_base_sign * tab_base_high, tab_base_low) } + print "#define ERROR_TABLE_BASE_" table_name " (" base ")" > outfile print "" > outfile print "extern const struct error_table et_" table_name "_error_table;" > outfile print "" > outfile