Skip to content

Commit 0c05409

Browse files
empyricalfacebook-github-bot
authored andcommittedNov 16, 2018
CxxReact: Silence 'unused lambda capture' warnings in open-source (#22240)
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
1 parent 9ea1295 commit 0c05409

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎ReactCommon/cxxreact/CxxNativeModule.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ void CxxNativeModule::invoke(unsigned int reactMethodId, folly::dynamic&& params
136136
if (callId != -1) {
137137
fbsystrace_end_async_flow(TRACE_TAG_REACT_APPS, "native", callId);
138138
}
139+
#else
140+
(void)(callId);
139141
#endif
140142
SystraceSection s(method.name.c_str());
141143
try {

‎ReactCommon/cxxreact/NativeToJsBridge.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ void NativeToJsBridge::callFunction(
161161
"JSCall",
162162
systraceCookie);
163163
SystraceSection s("NativeToJsBridge::callFunction", "module", module, "method", method);
164+
#else
165+
(void)(systraceCookie);
164166
#endif
165167
// This is safe because we are running on the executor's thread: it won't
166168
// destruct until after it's been unregistered (which we check above) and
@@ -191,6 +193,8 @@ void NativeToJsBridge::invokeCallback(double callbackId, folly::dynamic&& argume
191193
"<callback>",
192194
systraceCookie);
193195
SystraceSection s("NativeToJsBridge::invokeCallback");
196+
#else
197+
(void)(systraceCookie);
194198
#endif
195199
executor->invokeCallback(callbackId, arguments);
196200
});

0 commit comments

Comments
 (0)
Failed to load comments.