Skip to content

Commit

Permalink
Merge pull request #168 from jb-gcx/gcx/fixup-future
Browse files Browse the repository at this point in the history
Fix compiler warnings in Future implementation
  • Loading branch information
li-feng-sc authored May 17, 2024
2 parents ecffe7e + 3f40e5a commit 47e3ddd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion support-lib/cpp/Future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <condition_variable>
#include <mutex>
#include <cassert>
#include <exception>

#ifdef __cpp_coroutines
#if __has_include(<coroutine>)
Expand Down Expand Up @@ -414,7 +415,7 @@ Future<void> combine(U&& futures, size_t c) {
return future;
}
for (auto& f: futures) {
f.then([context] (auto f) {
f.then([context] (auto) {
if (--(context->counter) == 0) {
context->promise.setValue();
}
Expand Down
4 changes: 2 additions & 2 deletions support-lib/objc/Future_objc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class FutureAdaptor<Void>

__block auto p = std::make_unique<NativePromiseType>();
auto f = p->getFuture();
[o then: ^id(DJFuture* res) {
[o then: ^id(DJFuture*) {
@try {
p->setValue();
} @catch (NSException* e) {
Expand All @@ -98,7 +98,7 @@ class FutureAdaptor<Void>
DJPromise<NSNull*>* promise = [[DJPromise alloc] init];
DJFuture<NSNull*>* future = [promise getFuture];

c.then([promise] (Future<void> res) {
c.then([promise] (Future<void>) {
try {
[promise setValue:[NSNull null]];
} catch (const std::exception& e) {
Expand Down

0 comments on commit 47e3ddd

Please sign in to comment.