From: Leonid Bloch <lbloch@janustech.com>
To: Alberto Garcia <berto@igalia.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"Stefan Weil" <sw@weilnetz.de>, "Max Reitz" <mreitz@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] include: Auto-generate the sizes lookup table
Date: Thu, 3 Jan 2019 20:57:45 +0000 [thread overview]
Message-ID: <9df1a9a8-284b-573b-98aa-fd77edb0cd65@janustech.com> (raw)
In-Reply-To: <w51h8eqdroh.fsf@maestria.local.igalia.com>
Hi Berto,
On 1/3/19 12:19 PM, Alberto Garcia wrote:
> 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.
I think that the benefit is that the script is easily verifiable,
whereas if someone would like to verify the table, they will need to
generate it themselves. Also, this table is automatically generated
anyway, so it only makes sense to generate it during the build.
Leonid.
>
> Berto
>
next prev parent reply other threads:[~2019-01-03 20:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 11:08 [Qemu-devel] [PATCH 0/1] include: Auto-generate the sizes lookup table Leonid Bloch
2019-01-02 11:09 ` [Qemu-devel] [PATCH 1/1] " Leonid Bloch
2019-01-03 9:19 ` Alberto Garcia
2019-01-03 20:57 ` Leonid Bloch [this message]
2019-01-03 21:04 ` Eric Blake
2019-01-03 21:21 ` Leonid Bloch
2019-01-03 21:42 ` Eric Blake
2019-01-04 9:31 ` Alberto Garcia
2019-01-04 21:23 ` Leonid Bloch
2019-01-03 9:33 ` Philippe Mathieu-Daudé
2019-01-03 21:06 ` Leonid Bloch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9df1a9a8-284b-573b-98aa-fd77edb0cd65@janustech.com \
--to=lbloch@janustech.com \
--cc=armbru@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).