Skip to content

Commit 5c76ecd

Browse files
committed
Resolve compiler warnings (C4456, C4189, C4100)
- MainWindow.McpRoutes.cpp:191 rename inner 'first' -> 'firstField' (shadowed outer 'first' from properties loop). - MainWindow.McpRoutes.cpp:1039 remove unused 'slashPos' (path parsing fell back to stoi-on-stripped without the slash split). - MainWindow.xaml.cpp click handler: drop unused 'imgDipX'/'imgDipY' locals (only normX/normY used downstream). - MainWindow.xaml.cpp OnPreviewPointerPressed: drop unused 'isPixelTraceTab' local. - MainWindow.xaml.cpp OnPreviewPointerMoved: mark unused 'sender' parameter.
1 parent 8d10fa9 commit 5c76ecd

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

MainWindow.McpRoutes.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,11 @@ static std::string NodeToJson(const ::ShaderLab::Graph::EffectNode& node)
188188
!node.analysisOutput.fields.empty())
189189
{
190190
json += ",\"analysisResults\":[";
191-
bool first = true;
191+
bool firstField = true;
192192
for (const auto& fv : node.analysisOutput.fields)
193193
{
194-
if (!first) json += ",";
194+
if (!firstField) json += ",";
195+
firstField = false;
195196
json += "{\"name\":\"" + ToUtf8(fv.name) + "\"";
196197
if (!::ShaderLab::Graph::AnalysisFieldIsArray(fv.type))
197198
{
@@ -1036,7 +1037,6 @@ namespace winrt::ShaderLab::implementation
10361037
// Parse nodeId and optional /logs suffix from path.
10371038
// Expected: /node/{id}/logs or /node/{id}/logs?since={seq}
10381039
auto stripped = path.substr(6); // remove "/node/"
1039-
auto slashPos = stripped.find(L'/');
10401040
uint32_t nodeId = 0;
10411041
try { nodeId = static_cast<uint32_t>(std::stoi(stripped)); } catch (...) {
10421042
return { 400, R"({"error":"Invalid node ID"})" };

MainWindow.xaml.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,8 +2273,6 @@ namespace winrt::ShaderLab::implementation
22732273

22742274
auto imgBounds = GetPreviewImageBounds();
22752275
float dpiScale = (std::max)(1.0f, PreviewPanel().CompositionScaleX());
2276-
float imgDipX = (m_traceClickDipX - m_previewPanX) / m_previewZoom;
2277-
float imgDipY = (m_traceClickDipY - m_previewPanY) / m_previewZoom;
22782276
float iW = imgBounds.right - imgBounds.left;
22792277
float iH = imgBounds.bottom - imgBounds.top;
22802278
if (iW <= 0 || iW > 100000.0f) { auto vp = PreviewViewportDips(); iW = vp.width; }
@@ -2375,9 +2373,8 @@ namespace winrt::ShaderLab::implementation
23752373
winrt::Microsoft::UI::Xaml::Input::PointerRoutedEventArgs const& args)
23762374
{
23772375
auto point = args.GetCurrentPoint(PreviewPanel());
2378-
bool isPixelTraceTab = (BottomTabView().SelectedIndex() == 1);
23792376

2380-
// Left or middle button → start pan (click without drag triggers pixel trace on release).
2377+
// Left or middle button → start pan
23812378
if (point.Properties().IsMiddleButtonPressed() || point.Properties().IsLeftButtonPressed())
23822379
{
23832380
m_isPreviewPanning = true;
@@ -2694,7 +2691,7 @@ namespace winrt::ShaderLab::implementation
26942691
// -----------------------------------------------------------------------
26952692

26962693
void MainWindow::OnPreviewPointerMoved(
2697-
winrt::Windows::Foundation::IInspectable const& sender,
2694+
winrt::Windows::Foundation::IInspectable const& /*sender*/,
26982695
winrt::Microsoft::UI::Xaml::Input::PointerRoutedEventArgs const& args)
26992696
{
27002697
if (!m_renderEngine.IsInitialized()) return;

0 commit comments

Comments
 (0)