[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: |
Marc-André Lureau |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH 26/29] tests/tcg: use ARRAY_SIZE macro |
Date: |
Tue, 18 Jul 2017 03:56:47 -0700 |
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 ;)
> 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
>
>
--
Marc-André Lureau
- [Qemu-trivial] [PATCH 22/29] vmsvga: use ARRAY_SIZE macro, (continued)
- [Qemu-trivial] [PATCH 22/29] vmsvga: use ARRAY_SIZE macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 23/29] async: use ARRAY_SIZE macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 24/29] tests/acpi: use ARRAY_SIZE macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 25/29] libqos: use ARRAY_SIZE macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 26/29] tests/tcg: use ARRAY_SIZE macro, Philippe Mathieu-Daudé, 2017/07/18
[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