From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX09E-0006XQ-0A for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX097-0008ML-R1 for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX097-0008M9-J3 for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:53 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s373MrBx031304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Apr 2014 23:22:53 -0400 From: Juan Quintela Date: Mon, 7 Apr 2014 05:20:57 +0200 Message-Id: <1396840915-10384-40-git-send-email-quintela@redhat.com> In-Reply-To: <1396840915-10384-1-git-send-email-quintela@redhat.com> References: <1396840915-10384-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PATCH 39/97] vmstate: Test for VMSTATE_FLOAT64_ARRAY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Remove unused VMSTATE_FLOAT64_ARRAY_V. Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 35c7bef..f925cc6 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -636,6 +636,9 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_INT64_ARRAY(_f, _s, _n) \ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int64, int64_t) +#define VMSTATE_FLOAT64_ARRAY(_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_float64, float64) + #define VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t) @@ -660,12 +663,6 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT32_SUB_ARRAY(_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_FLOAT64_ARRAY_V(_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_float64, float64) - -#define VMSTATE_FLOAT64_ARRAY(_f, _s, _n) \ - VMSTATE_FLOAT64_ARRAY_V(_f, _s, _n, 0) - #define VMSTATE_BUFFER_V(_f, _s, _v) \ VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, 0, sizeof(typeof_field(_s, _f))) diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index d33fa77..e64706f 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -551,6 +551,7 @@ typedef struct TestArray { int32_t i32_1[VMSTATE_ARRAY_SIZE]; int32_t i32_2[VMSTATE_ARRAY_SIZE]; int64_t i64_1[VMSTATE_ARRAY_SIZE]; + float64 f64_1[VMSTATE_ARRAY_SIZE]; } TestArray; TestArray obj_array = { @@ -568,6 +569,8 @@ TestArray obj_array = { .i32_1 = {51, 52, 53, 54, 55}, .i32_2 = {55, 54, 53, 52, 51}, .i64_1 = {61, 62, 63, 64, 65}, + .f64_1 = {float64_zero, float64_one, float64_ln2, float64_pi, + float64_infinity}, }; static const VMStateDescription vmstate_array_primitive = { @@ -585,6 +588,7 @@ static const VMStateDescription vmstate_array_primitive = { VMSTATE_INT16_ARRAY(i16_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_INT32_ARRAY(i32_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_INT64_ARRAY(i64_1, TestArray, VMSTATE_ARRAY_SIZE), + VMSTATE_FLOAT64_ARRAY(f64_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_END_OF_LIST() } }; @@ -611,6 +615,11 @@ uint8_t wire_array_primitive[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, + /* f64_1 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xe6, 0x2e, 0x42, 0xfe, 0xfa, 0x39, 0xef, + 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18, + 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ }; @@ -673,6 +682,7 @@ static void test_array_primitive(void) ELEM_ASSERT(i16_1, i); ELEM_ASSERT(i32_1, i); ELEM_ASSERT(i64_1, i); + ELEM_ASSERT(f64_1, i); } /* We save the file again. We want the EOF this time */ -- 1.9.0