]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/qapi: use ARRAY_SIZE macro
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 18 Jul 2017 06:10:05 +0000 (03:10 -0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Sat, 10 Feb 2018 07:45:14 +0000 (10:45 +0300)
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
tests/test-string-output-visitor.c

index fa4b4ca28896f548a3113f9b333c1288ec2dee2c..02766c0f659561b6ca4547a3f2e1a644a6b7f696 100644 (file)
@@ -95,7 +95,7 @@ static void test_visitor_out_intList(TestOutputVisitorData *data,
     Error *err = NULL;
     char *str;
 
-    for (i = 0; i < sizeof(value) / sizeof(value[0]); i++) {
+    for (i = 0; i < ARRAY_SIZE(value); i++) {
         *tmp = g_malloc0(sizeof(**tmp));
         (*tmp)->value = value[i];
         tmp = &(*tmp)->next;