Skip to content

Commit

Permalink
CxxReact: Silence 'unused lambda capture' warnings in open-source (#2…
Browse files Browse the repository at this point in the history
…2240)

Summary:
This pull request silences build warnings like this in open-source:

```
{snip}/ReactCommon/cxxreact/CxxNativeModule.cpp:134:85: warning: lambda capture 'callId' is not used [-Wunused-lambda-capture]
  messageQueueThread_->runOnQueue([method, params=std::move(params), first, second, callId] () {
```

These are variables used by "fbsystrace", which is not open-sourced.

An  unused statement has been added to the affected files in the `#else` for the `#ifdef WITH_FBSYSTRACE` conditionals
Pull Request resolved: #22240

Differential Revision: D13031358

Pulled By: shergin

fbshipit-source-id: 8ccfc226b65e32abda6abb573f77a6589bd19dcd
  • Loading branch information
empyrical authored and kelset committed Nov 26, 2018
1 parent ec1bbfd commit 87c9d92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ReactCommon/cxxreact/CxxNativeModule.cpp
Expand Up @@ -136,6 +136,8 @@ void CxxNativeModule::invoke(unsigned int reactMethodId, folly::dynamic&& params
if (callId != -1) {
fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, "native", callId);
}
#else
(void)(callId);
#endif
SystraceSection s(method.name.c_str());
try {
Expand Down
4 changes: 4 additions & 0 deletions ReactCommon/cxxreact/NativeToJsBridge.cpp
Expand Up @@ -161,6 +161,8 @@ void NativeToJsBridge::callFunction(
"JSCall",
systraceCookie);
SystraceSection s("NativeToJsBridge::callFunction", "module", module, "method", method);
#else
(void)(systraceCookie);
#endif
// This is safe because we are running on the executor's thread: it won't
// destruct until after it's been unregistered (which we check above) and
Expand Down Expand Up @@ -191,6 +193,8 @@ void NativeToJsBridge::invokeCallback(double callbackId, folly::dynamic&& argume
"<callback>",
systraceCookie);
SystraceSection s("NativeToJsBridge::invokeCallback");
#else
(void)(systraceCookie);
#endif
executor->invokeCallback(callbackId, arguments);
});
Expand Down

0 comments on commit 87c9d92

Please sign in to comment.