On Wed 02 Jan 2019 12:09:05 PM CET, Leonid Bloch wrote: > +print_sizes() { > + local p=10 > + while [ ${p} -lt 64 ] > + do > + local pad=' ' > + local n=$((p % 10)) > + n=$((1 << n)) > + [ $((n / 100)) -eq 0 ] && pad=' ' > + [ $((n / 10)) -eq 0 ] && pad=' ' > + local suff=$((p / 10)) > + printf "#define S_%u%s%s%20u\n" ${n} "$(size_suffix ${suff})" \ > + "${pad}" $((1 << p)) > + p=$((p + 1)) > + done > +}
I have to say that I'm not very convinced of the benefits of replacing a set of trivial numeric macros with a longer and harder to read shell script accompanied by changes to the build system. Berto