Skip to content

Commit be62db0

Browse files
authored
Fixing unreferenced parameter warnings as errors in Playground-Composition and elsewhere (#14678)
## Description Resolved all warnings which caused build errors in Playground-Composition and RNTesterApp-Fabric. ### Type of Change - Bug fix (non-breaking change which fixes an issue) ### Why Fix build errors in CI and blocking PRs. Resolves #14677 ### What Commented out unreferenced variable names. Also re-ran package.json evaluation. ## Screenshots N/A ## Testing Verified projects built without warnings in latest VS. ## Changelog Should this change be included in the release notes: _no_
1 parent ea3bf9e commit be62db0

File tree

4 files changed

+15
-22
lines changed

4 files changed

+15
-22
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Fixing unreferenced parameter warnings as errors in Playground-Composition and elsewhere",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ winrt::Microsoft::ReactNative::ReactNativeHost CreateReactNativeHost(
9494
#endif
9595

9696
host.InstanceSettings().InstanceLoaded(
97-
[](auto sender, const winrt::Microsoft::ReactNative::InstanceLoadedEventArgs &args) {
97+
[](auto /*sender*/, const winrt::Microsoft::ReactNative::InstanceLoadedEventArgs &args) {
9898
global_reactContext = args.Context();
9999
});
100100

@@ -168,7 +168,7 @@ WinMain(HINSTANCE /* instance */, HINSTANCE, PSTR /* commandLine */, int /* show
168168
// Before we shutdown the application - unload the ReactNativeHost to give the javascript a chance to save any
169169
// state
170170
auto async = host.UnloadInstance();
171-
async.Completed([host](auto asyncInfo, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
171+
async.Completed([host](auto /*asyncInfo*/, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
172172
asyncStatus;
173173
assert(asyncStatus == winrt::Windows::Foundation::AsyncStatus::Completed);
174174
host.InstanceSettings().UIDispatcher().Post([]() { PostQuitMessage(0); });
@@ -331,7 +331,7 @@ void InsertExpandCollapseStateValueIfNotDefault(
331331
}
332332
}
333333

334-
winrt::Windows::Data::Json::JsonObject ListErrors(winrt::Windows::Data::Json::JsonValue payload) {
334+
winrt::Windows::Data::Json::JsonObject ListErrors(winrt::Windows::Data::Json::JsonValue /*payload*/) {
335335
winrt::Windows::Data::Json::JsonObject result;
336336
winrt::Windows::Data::Json::JsonArray jsonErrors;
337337
winrt::Windows::Data::Json::JsonArray jsonWarnings;

packages/playground/windows/playground-composition/Playground-Composition.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void RegisterCustomComponent(winrt::Microsoft::ReactNative::IReactPackageBuilder
5353
*/
5454
struct EllipseImageHandler
5555
: winrt::implements<EllipseImageHandler, winrt::Microsoft::ReactNative::Composition::IUriImageProvider> {
56-
bool CanLoadImageUri(winrt::Microsoft::ReactNative::IReactContext context, winrt::Windows::Foundation::Uri uri) {
56+
bool CanLoadImageUri(winrt::Microsoft::ReactNative::IReactContext /*context*/, winrt::Windows::Foundation::Uri uri) {
5757
return uri.SchemeName() == L"ellipse";
5858
}
5959

@@ -114,7 +114,6 @@ winrt::Windows::UI::Composition::Compositor g_compositor{nullptr};
114114
constexpr auto WindowDataProperty = L"WindowData";
115115

116116
int RunPlayground(int showCmd, bool useWebDebugger);
117-
winrt::Microsoft::ReactNative::IReactPackageProvider CreateStubDeviceInfoPackageProvider() noexcept;
118117

119118
struct WindowData {
120119
static HINSTANCE s_instance;
@@ -239,12 +238,12 @@ struct WindowData {
239238
::SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SIZEBOX);
240239
m_compRootView.SizeChanged(
241240
[hwnd, props = InstanceSettings().Properties()](
242-
auto sender, const winrt::Microsoft::ReactNative::RootViewSizeChangedEventArgs &args) {
241+
auto /*sender*/, const winrt::Microsoft::ReactNative::RootViewSizeChangedEventArgs &args) {
243242
auto compositor =
244243
winrt::Microsoft::ReactNative::Composition::CompositionUIService::GetCompositor(props);
245244
auto async = compositor.RequestCommitAsync();
246245
async.Completed([hwnd, size = args.Size()](
247-
auto asyncInfo, winrt::Windows::Foundation::AsyncStatus /*asyncStatus*/) {
246+
auto /*asyncInfo*/, winrt::Windows::Foundation::AsyncStatus /*asyncStatus*/) {
248247
RECT rcClient, rcWindow;
249248
GetClientRect(hwnd, &rcClient);
250249
GetWindowRect(hwnd, &rcWindow);
@@ -340,7 +339,7 @@ struct WindowData {
340339
case IDM_UNLOAD: {
341340
auto async = Host().UnloadInstance();
342341
async.Completed([&, uidispatch = InstanceSettings().UIDispatcher()](
343-
auto asyncInfo, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
342+
auto /*asyncInfo*/, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
344343
asyncStatus;
345344
OutputDebugStringA("Instance Unload completed\n");
346345

@@ -583,7 +582,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
583582
L"ReactNative.Composition", L"CompositionContext"});
584583

585584
auto async = data->m_host.UnloadInstance();
586-
async.Completed([host = data->m_host](auto asyncInfo, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
585+
async.Completed([host = data->m_host](auto /*asyncInfo*/, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
587586
asyncStatus;
588587
assert(asyncStatus == winrt::Windows::Foundation::AsyncStatus::Completed);
589588
host.InstanceSettings().UIDispatcher().Post([]() { PostQuitMessage(0); });

vnext/fmt/packages.lock.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)