|
| From: | Alberto Garcia |
| Subject: | Re: [Qemu-devel] [PATCH 1/1] include: Auto-generate the sizes lookup table |
| Date: | Thu, 03 Jan 2019 10:19:26 +0100 |
| User-agent: | Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
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
| [Prev in Thread] | Current Thread | [Next in Thread] |