From 6a2a74deeba1c6f785f32ca72363307ec3f424d5 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Fri, 12 Jul 2024 10:04:01 -0700 Subject: [PATCH] Fix lambda captures --- .../fleet_provisioning/fleet_provisioning/main.cpp | 14 +++++++------- .../mqtt5_fleet_provisioning/main.cpp | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/samples/fleet_provisioning/fleet_provisioning/main.cpp b/samples/fleet_provisioning/fleet_provisioning/main.cpp index 105577ecf..02b307f7e 100644 --- a/samples/fleet_provisioning/fleet_provisioning/main.cpp +++ b/samples/fleet_provisioning/fleet_provisioning/main.cpp @@ -190,7 +190,7 @@ void createKeysAndCertificate(IotIdentityClient &identityClient, CreateCertifica } }; - auto onKeysRejected = [&](ErrorResponse *error, int ioErr) { + auto onKeysRejected = [](ErrorResponse *error, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf( @@ -276,7 +276,7 @@ void createCertificateFromCsr(IotIdentityClient &identityClient, CreateCertifica } }; - auto onCsrRejected = [&](ErrorResponse *error, int ioErr) { + auto onCsrRejected = [](ErrorResponse *error, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf( @@ -325,7 +325,7 @@ void registerThing( const Utils::cmdData &cmdData, const String &token) { - auto onRegisterAcceptedSubAck = [&](int ioErr) { + auto onRegisterAcceptedSubAck = [&ctx](int ioErr) { if (ioErr != AWS_OP_SUCCESS) { fprintf(stderr, "Error subscribing to RegisterThing accepted: %s\n", ErrorDebugString(ioErr)); @@ -334,7 +334,7 @@ void registerThing( ctx.acceptedSubAckPromise.set_value(); }; - auto onRegisterRejectedSubAck = [&](int ioErr) { + auto onRegisterRejectedSubAck = [&ctx](int ioErr) { if (ioErr != AWS_OP_SUCCESS) { fprintf(stderr, "Error subscribing to RegisterThing rejected: %s\n", ErrorDebugString(ioErr)); @@ -343,7 +343,7 @@ void registerThing( ctx.rejectedSubAckPromise.set_value(); }; - auto onRegisterAccepted = [&](RegisterThingResponse *response, int ioErr) { + auto onRegisterAccepted = [&ctx](RegisterThingResponse *response, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf(stdout, "RegisterThingResponse ThingName: %s.\n", response->ThingName->c_str()); @@ -356,7 +356,7 @@ void registerThing( } }; - auto onRegisterRejected = [&](ErrorResponse *error, int ioErr) { + auto onRegisterRejected = [](ErrorResponse *error, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf( @@ -373,7 +373,7 @@ void registerThing( } }; - auto onRegisterPublishPubAck = [&](int ioErr) { + auto onRegisterPublishPubAck = [&ctx](int ioErr) { if (ioErr != AWS_OP_SUCCESS) { fprintf(stderr, "Error publishing to RegisterThing: %s\n", ErrorDebugString(ioErr)); diff --git a/samples/fleet_provisioning/mqtt5_fleet_provisioning/main.cpp b/samples/fleet_provisioning/mqtt5_fleet_provisioning/main.cpp index 0670619c2..3ea7ef274 100644 --- a/samples/fleet_provisioning/mqtt5_fleet_provisioning/main.cpp +++ b/samples/fleet_provisioning/mqtt5_fleet_provisioning/main.cpp @@ -182,7 +182,7 @@ void createKeysAndCertificate(IotIdentityClient &identityClient, CreateCertifica } }; - auto onKeysRejected = [&](ErrorResponse *error, int ioErr) { + auto onKeysRejected = [](ErrorResponse *error, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf( @@ -268,7 +268,7 @@ void createCertificateFromCsr(IotIdentityClient &identityClient, CreateCertifica } }; - auto onCsrRejected = [&](ErrorResponse *error, int ioErr) { + auto onCsrRejected = [](ErrorResponse *error, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf( @@ -317,7 +317,7 @@ void registerThing( const Utils::cmdData &cmdData, const String &token) { - auto onRegisterAcceptedSubAck = [&](int ioErr) { + auto onRegisterAcceptedSubAck = [&ctx](int ioErr) { if (ioErr != AWS_OP_SUCCESS) { fprintf(stderr, "Error subscribing to RegisterThing accepted: %s\n", ErrorDebugString(ioErr)); @@ -326,7 +326,7 @@ void registerThing( ctx.acceptedSubAckPromise.set_value(); }; - auto onRegisterRejectedSubAck = [&](int ioErr) { + auto onRegisterRejectedSubAck = [&ctx](int ioErr) { if (ioErr != AWS_OP_SUCCESS) { fprintf(stderr, "Error subscribing to RegisterThing rejected: %s\n", ErrorDebugString(ioErr)); @@ -335,7 +335,7 @@ void registerThing( ctx.rejectedSubAckPromise.set_value(); }; - auto onRegisterAccepted = [&](RegisterThingResponse *response, int ioErr) { + auto onRegisterAccepted = [&ctx](RegisterThingResponse *response, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf(stdout, "RegisterThingResponse ThingName: %s.\n", response->ThingName->c_str()); @@ -348,7 +348,7 @@ void registerThing( } }; - auto onRegisterRejected = [&](ErrorResponse *error, int ioErr) { + auto onRegisterRejected = [](ErrorResponse *error, int ioErr) { if (ioErr == AWS_OP_SUCCESS) { fprintf( @@ -365,7 +365,7 @@ void registerThing( } }; - auto onRegisterPublishPubAck = [&](int ioErr) { + auto onRegisterPublishPubAck = [&ctx](int ioErr) { if (ioErr != AWS_OP_SUCCESS) { fprintf(stderr, "Error publishing to RegisterThing: %s\n", ErrorDebugString(ioErr));