From 713db415a9bf47ffb665ee16892121829e067168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Tue, 10 Oct 2023 13:34:47 +0200 Subject: [pq] cleanup of amount tuple type handling - add counter for tuple elements to struct - use GNUNET_memcpy instead of casting also, fix format string in test for age_restriction --- src/pq/pq_common.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/pq/pq_common.h') diff --git a/src/pq/pq_common.h b/src/pq/pq_common.h index dff5e4c89..6172c0bfb 100644 --- a/src/pq/pq_common.h +++ b/src/pq/pq_common.h @@ -58,6 +58,7 @@ enum TALER_PQ_ArrayType */ struct TALER_PQ_AmountP { + uint32_t cnt; /* # elements in the tuple (== 2) */ uint32_t oid_v; /* oid of .v */ uint32_t sz_v; /* size of .v */ uint64_t v; /* value */ @@ -74,28 +75,16 @@ struct TALER_PQ_AmountP */ struct TALER_PQ_AmountCurrencyP { - uint32_t cnt; /* number of OIDs in tuple */ + uint32_t cnt; /* # elements in the tuple (== 3) */ uint32_t oid_v; /* oid of .v */ uint32_t sz_v; /* size of .v */ uint64_t v; /* value */ uint32_t oid_f; /* oid of .f */ uint32_t sz_f; /* size of .f */ uint32_t f; /* fraction */ - - /** - * oid of .c - */ - uint32_t oid_c; - - /** - * size of .c - */ - uint32_t sz_c; - - /** - * currency - */ - uint8_t c[TALER_CURRENCY_LEN]; + uint32_t oid_c; /* oid of .c */ + uint32_t sz_c; /* size of .c */ + uint8_t c[TALER_CURRENCY_LEN]; /* currency */ } __attribute__((packed)); -- cgit v1.2.3