[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH 26/29] tests/tcg: use ARRAY_SIZE
From: |
Alex Bennée |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH 26/29] tests/tcg: use ARRAY_SIZE macro |
Date: |
Tue, 18 Jul 2017 12:16:25 +0100 |
User-agent: |
mu4e 0.9.19; emacs 25.2.50.3 |
Marc-André Lureau <address@hidden> writes:
> Hi
>
> On Mon, Jul 17, 2017 at 11:10 PM, Philippe Mathieu-Daudé
> <address@hidden> wrote:
>> Applied using the Coccinelle semantic patch
>> scripts/coccinelle/use_osdep.cocci
>>
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> tests/tcg/alpha/test-cond.c | 2 +-
>> tests/tcg/alpha/test-ovf.c | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>
> I think those do not include osdep.h
>
> (sigh, tests/tcg would need some love ;)
Pranith has had a couple of revs at this:
Subject: [PATCH v5 00/19] Cleanup of TCG tests
Date: Thu, 1 Dec 2016 00:14:14 -0500
Message-Id: <address@hidden>
We have the cross-compilers available as a fallback via docker although
not every one can seamlessly use it for building stuff. Is getting a
working cross-compiler setup too much of a hurdle fore those that want
to build cross-arch tests?
>
>> diff --git a/tests/tcg/alpha/test-cond.c b/tests/tcg/alpha/test-cond.c
>> index 74adffaa69..e5596f10b8 100644
>> --- a/tests/tcg/alpha/test-cond.c
>> +++ b/tests/tcg/alpha/test-cond.c
>> @@ -77,7 +77,7 @@ int main (void)
>> {
>> int i;
>>
>> - for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++)
>> + for (i = 0; i < ARRAY_SIZE(vectors); i++)
>> if ((*vectors[i].func)(vectors[i].v) != vectors[i].r) {
>> write(1, "Failed\n", 7);
>> return 1;
>> diff --git a/tests/tcg/alpha/test-ovf.c b/tests/tcg/alpha/test-ovf.c
>> index 01c80e7525..43fc6ebb2e 100644
>> --- a/tests/tcg/alpha/test-ovf.c
>> +++ b/tests/tcg/alpha/test-ovf.c
>> @@ -20,7 +20,7 @@ int main (void)
>> {
>> int i;
>>
>> - for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++)
>> + for (i = 0; i < ARRAY_SIZE(vectors); i++)
>> if ((*vectors[i].func)(vectors[i].a, vectors[i].b) != vectors[i].r) {
>> write(1, "Failed\n", 7);
>> }
>> --
>> 2.13.2
>>
>>
--
Alex Bennée
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 22/29] vmsvga: use ARRAY_SIZE macro, (continued)
[Qemu-trivial] [PATCH 27/29] tests/hbitmap: use ARRAY_SIZE macro, Philippe Mathieu-Daudé, 2017/07/18
[Qemu-trivial] [PATCH 28/29] tests/qapi: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
[Qemu-trivial] [PATCH 29/29] tests/qapi: use ARRAY_SIZE macro, Philippe Mathieu-Daudé, 2017/07/18