commit 510bcb911ce9aea189663690711da71fcc34b328
parent d0aa19952bfc26a8cd9923a1a2799160191faa70
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 11 Jul 2026 11:08:34 +0200
note on closure polymorphism
Diffstat:
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/testing/testing_api_cmd_get_orders.c b/src/testing/testing_api_cmd_get_orders.c
@@ -74,6 +74,12 @@ struct GetOrdersState
* @param cls closure for this function
* @param ogr response
*/
+/* FIXME_POLYMORPHISM: TALER_MERCHANT_GetPrivateOrdersCallback is used in this
+ compilation unit with two different closure types (struct GetOrdersState here,
+ struct MerchantPollOrdersStartState in merchant_poll_orders_cb below), so a single
+ TALER_MERCHANT_GET_PRIVATE_ORDERS_RESULT_CLOSURE override cannot type both. Left as
+ void *cls; adopting the RESULT_CLOSURE pattern needs a manual refactor (e.g. split
+ the two commands into separate translation units). */
static void
get_orders_cb (void *cls,
const struct TALER_MERCHANT_GetPrivateOrdersResponse *ogr)
@@ -404,6 +410,9 @@ conclude_task (void *cls)
* @param cls closure
* @param ogr response details
*/
+/* FIXME_POLYMORPHISM: see get_orders_cb above — same GetPrivateOrdersCallback typedef
+ is reused here with a different closure type, so this compilation unit cannot adopt
+ a single TALER_MERCHANT_GET_PRIVATE_ORDERS_RESULT_CLOSURE override. Left as void *cls. */
static void
merchant_poll_orders_cb (
void *cls,
diff --git a/src/testing/testing_api_cmd_merchant_get_order.c b/src/testing/testing_api_cmd_merchant_get_order.c
@@ -154,6 +154,11 @@ apply_forget (void *cls,
* @param cls closure
* @param osr order status response details
*/
+/* FIXME_POLYMORPHISM: TALER_MERCHANT_GetPrivateOrderCallback is used in this
+ compilation unit with two different closure types (struct MerchantGetOrderState here,
+ struct MerchantPollOrderStartState in merchant_poll_order_cb below), so a single
+ TALER_MERCHANT_GET_PRIVATE_ORDER_RESULT_CLOSURE override cannot type both. Left as
+ void *cls; adopting the RESULT_CLOSURE pattern needs a manual refactor. */
static void
merchant_get_order_cb (
void *cls,
@@ -950,6 +955,10 @@ conclude_task (void *cls)
* @param cls closure
* @param osr order status response details
*/
+/* FIXME_POLYMORPHISM: see merchant_get_order_cb above — same GetPrivateOrderCallback
+ typedef is reused here with a different closure type, so this compilation unit cannot
+ adopt a single TALER_MERCHANT_GET_PRIVATE_ORDER_RESULT_CLOSURE override. Left as
+ void *cls. */
static void
merchant_poll_order_cb (
void *cls,
diff --git a/src/testing/testing_api_cmd_wallet_get_order.c b/src/testing/testing_api_cmd_wallet_get_order.c
@@ -94,6 +94,11 @@ struct WalletGetOrderState
* @param cls closure
* @param owgr response details
*/
+/* FIXME_POLYMORPHISM: TALER_MERCHANT_GetOrdersCallback is used in this compilation
+ unit with two different closure types (struct WalletGetOrderState here, struct
+ WalletPollOrderStartState in wallet_poll_order_cb below), so a single
+ TALER_MERCHANT_GET_ORDERS_RESULT_CLOSURE override cannot type both. Left as void *cls;
+ adopting the RESULT_CLOSURE pattern needs a manual refactor. */
static void
wallet_get_order_cb (
void *cls,
@@ -605,6 +610,9 @@ conclude_task (void *cls)
* @param cls a `struct WalletPollOrderStartState *`
* @param owgr response details
*/
+/* FIXME_POLYMORPHISM: see wallet_get_order_cb above — same GetOrdersCallback typedef is
+ reused here with a different closure type, so this compilation unit cannot adopt a
+ single TALER_MERCHANT_GET_ORDERS_RESULT_CLOSURE override. Left as void *cls. */
static void
wallet_poll_order_cb (
void *cls,