aboutsummaryrefslogtreecommitdiff
path: root/src/pq/pq_common.h
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-10-10 13:34:47 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-10-10 13:34:47 +0200
commit713db415a9bf47ffb665ee16892121829e067168 (patch)
tree38bd1e3a9ae84e7b96c128aae8cd64c92254cf1c /src/pq/pq_common.h
parentcbc2beb113c7209ffc629fe683dab7b531f0f1b1 (diff)
downloadexchange-713db415a9bf47ffb665ee16892121829e067168.tar.xz
[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
Diffstat (limited to 'src/pq/pq_common.h')
-rw-r--r--src/pq/pq_common.h21
1 files changed, 5 insertions, 16 deletions
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));