]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Stop using designated initializer for array in C++ demo
authorMatt Corallo <git@bluematt.me>
Thu, 25 Jan 2024 21:42:33 +0000 (21:42 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 25 Jan 2024 21:42:33 +0000 (21:42 +0000)
This seems to be no issue on recent-ish compilers, but my Android
compiler seems to complain about it.

lightning-c-bindings/demo.cpp

index 9cc3dc5f34991706c934f491a550fdca43f1dba0..f9284ee3cb9f377ba1240258d31490218b0a5d77 100644 (file)
@@ -1112,7 +1112,8 @@ int main() {
        LDK::RecipientOnionFields invoice2_recipient(std::move(pay_params->contents.result->b));
        LDK::RouteParameters invoice2_params(std::move(pay_params->contents.result->c));
        assert(pay_params->result_ok);
-       LDKThirtyTwoBytes payment_id { .data = 0 };
+       LDKThirtyTwoBytes payment_id;
+       memset(&payment_id, 0, 32);
        LDK::CResult_NoneRetryableSendFailureZ invoice_pay_res = ChannelManager_send_payment(
                &cm1, std::move(pay_params->contents.result->a), std::move(invoice2_recipient),
                std::move(payment_id), std::move(invoice2_params), Retry_attempts(0)