[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 15/17] tests/hbitmap: use ARRAY_SIZE macro
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 15/17] tests/hbitmap: use ARRAY_SIZE macro |
Date: |
Sat, 10 Feb 2018 10:55:10 +0300 |
From: Philippe Mathieu-Daudé <address@hidden>
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: John Snow <address@hidden>
---
tests/test-hbitmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c
index 9091c639b3..f29631f939 100644
--- a/tests/test-hbitmap.c
+++ b/tests/test-hbitmap.c
@@ -813,7 +813,7 @@ static void test_hbitmap_serialize_basic(TestHBitmapData
*data,
size_t buf_size;
uint8_t *buf;
uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 };
- int num_positions = sizeof(positions) / sizeof(positions[0]);
+ int num_positions = ARRAY_SIZE(positions);
hbitmap_test_init(data, L3, 0);
g_assert(hbitmap_is_serializable(data->hb));
@@ -838,7 +838,7 @@ static void test_hbitmap_serialize_part(TestHBitmapData
*data,
size_t buf_size;
uint8_t *buf;
uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 };
- int num_positions = sizeof(positions) / sizeof(positions[0]);
+ int num_positions = ARRAY_SIZE(positions);
hbitmap_test_init(data, L3, 0);
buf_size = L2;
@@ -880,7 +880,7 @@ static void test_hbitmap_serialize_zeroes(TestHBitmapData
*data,
int64_t next;
uint64_t min_l1 = MAX(L1, 64);
uint64_t positions[] = { 0, min_l1, L2, L3 - min_l1};
- int num_positions = sizeof(positions) / sizeof(positions[0]);
+ int num_positions = ARRAY_SIZE(positions);
hbitmap_test_init(data, L3, 0);
--
2.11.0
- [Qemu-trivial] [PULL 00/17] Trivial patches for 2018-02-10, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 02/17] scripts/argparse.py: spelling (independant), Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 01/17] qapi-schema.json: spelling (independant comparation), Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 05/17] mailmap: set preferred spelling for Daniel Berrangé, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 03/17] machine: Polish -machine xxx,help, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 06/17] qemu-options.hx: Remove confusing spaces in parameter listings, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 15/17] tests/hbitmap: use ARRAY_SIZE macro,
Michael Tokarev <=
- [Qemu-trivial] [PULL 17/17] tests/qapi: use ARRAY_SIZE macro, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 16/17] tests/qapi: use QEMU_IS_ALIGNED macro, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 10/17] maint: Mention web site maintenance in README, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 13/17] qga: use ARRAY_SIZE macro, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 11/17] oslib-posix: check for posix_memalign in configure script, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 12/17] MAINTAINERS: Add qemu-binfmt-conf.sh script, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 09/17] build: fix typo in error message, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 14/17] async: use ARRAY_SIZE macro, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 08/17] configure: Allow capstone=git only if git update is not disabled, Michael Tokarev, 2018/02/10
- [Qemu-trivial] [PULL 07/17] scripts/make-release: Don't archive .git files, Michael Tokarev, 2018/02/10