Skip to content

Commit

Permalink
Fix lambda captures
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Jul 12, 2024
1 parent 7c9cf09 commit 6a2a74d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions samples/fleet_provisioning/fleet_provisioning/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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());
Expand All @@ -356,7 +356,7 @@ void registerThing(
}
};

auto onRegisterRejected = [&](ErrorResponse *error, int ioErr) {
auto onRegisterRejected = [](ErrorResponse *error, int ioErr) {
if (ioErr == AWS_OP_SUCCESS)
{
fprintf(
Expand All @@ -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));
Expand Down
14 changes: 7 additions & 7 deletions samples/fleet_provisioning/mqtt5_fleet_provisioning/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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());
Expand All @@ -348,7 +348,7 @@ void registerThing(
}
};

auto onRegisterRejected = [&](ErrorResponse *error, int ioErr) {
auto onRegisterRejected = [](ErrorResponse *error, int ioErr) {
if (ioErr == AWS_OP_SUCCESS)
{
fprintf(
Expand All @@ -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));
Expand Down

0 comments on commit 6a2a74d

Please sign in to comment.