From Murai Takashi <tmurai01@xxxxxxxxx>:
Murai Takashi has uploaded this change for review. (
https://review.haiku-os.org/c/haiku/+/3271 ;)
Change subject: cortex: Remove dead code
......................................................................
cortex: Remove dead code
Pointed out by clang static analyzer.
Change-Id: Ic647109e5e7d2e304be6f8c542ea9bfca551c3a3
---
M src/apps/cortex/DormantNodeView/DormantNodeWindow.cpp
M src/apps/cortex/MediaRoutingView/MediaJack.cpp
M src/apps/cortex/MediaRoutingView/MediaNodePanel.cpp
M src/apps/cortex/MediaRoutingView/MediaWire.cpp
4 files changed, 6 insertions(+), 10 deletions(-)
git pull ssh://git.haiku-os.org:22/haiku refs/changes/71/3271/1
diff --git a/src/apps/cortex/DormantNodeView/DormantNodeWindow.cpp
b/src/apps/cortex/DormantNodeView/DormantNodeWindow.cpp
index 52f3aed..fab7632 100644
--- a/src/apps/cortex/DormantNodeView/DormantNodeWindow.cpp
+++ b/src/apps/cortex/DormantNodeView/DormantNodeWindow.cpp
@@ -86,8 +86,7 @@
r.left = r.right + 1.0;
r.right = r.left + B_V_SCROLL_BAR_WIDTH;
r.InsetBy(0.0, -1.0);
- BScrollBar *scrollBar;
- AddChild(scrollBar = new BScrollBar(r, "", m_listView, 0.0, 0.0,
B_VERTICAL));
+ AddChild(new BScrollBar(r, "", m_listView, 0.0, 0.0, B_VERTICAL));
// Add the ListView
AddChild(m_listView);
diff --git a/src/apps/cortex/MediaRoutingView/MediaJack.cpp
b/src/apps/cortex/MediaRoutingView/MediaJack.cpp
index 664f2c7..395e742 100644
--- a/src/apps/cortex/MediaRoutingView/MediaJack.cpp
+++ b/src/apps/cortex/MediaRoutingView/MediaJack.cpp
@@ -739,7 +739,6 @@
BPopUpMenu *menu = new BPopUpMenu("MediaJack PopUp", false, false,
B_ITEMS_IN_COLUMN);
menu->SetFont(be_plain_font);
- BMenuItem *item;
// add the "Get Info" item
if (isInput())
@@ -749,7 +748,7 @@
BMessage *message = new
BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
message->AddData("input", B_RAW_TYPE,
reinterpret_cast<const void
*>(&input), sizeof(input));
- menu->AddItem(item = new BMenuItem("Get info", message));
+ menu->AddItem(new BMenuItem("Get info", message));
}
else if (isOutput())
{
@@ -758,7 +757,7 @@
BMessage *message = new
BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
message->AddData("output", B_RAW_TYPE,
reinterpret_cast<const void
*>(&output), sizeof(output));
- menu->AddItem(item = new BMenuItem("Get info", message));
+ menu->AddItem(new BMenuItem("Get info", message));
}
menu->SetTargetForItems(view());
diff --git a/src/apps/cortex/MediaRoutingView/MediaNodePanel.cpp
b/src/apps/cortex/MediaRoutingView/MediaNodePanel.cpp
index 5f41912..2c3c082 100644
--- a/src/apps/cortex/MediaRoutingView/MediaNodePanel.cpp
+++ b/src/apps/cortex/MediaRoutingView/MediaNodePanel.cpp
@@ -341,8 +341,7 @@
ref->getFreeInputs(freeInputs);
for (uint32 i = 0; i < freeInputs.size(); i++)
{
- MediaJack *jack;
- AddItem(jack = new MediaJack(freeInputs[i]));
+ AddItem(new MediaJack(freeInputs[i]));
}
}
@@ -353,8 +352,7 @@
ref->getFreeOutputs(freeOutputs);
for (uint32 i = 0; i < freeOutputs.size(); i++)
{
- MediaJack *jack;
- AddItem(jack = new MediaJack(freeOutputs[i]));
+ AddItem(new MediaJack(freeOutputs[i]));
}
}
diff --git a/src/apps/cortex/MediaRoutingView/MediaWire.cpp
b/src/apps/cortex/MediaRoutingView/MediaWire.cpp
index 8f40f36..2f35426 100644
--- a/src/apps/cortex/MediaRoutingView/MediaWire.cpp
+++ b/src/apps/cortex/MediaRoutingView/MediaWire.cpp
@@ -322,7 +322,7 @@
BMessage *message = new
BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
message->AddData("connection", B_RAW_TYPE,
reinterpret_cast<const void
*>(&output), sizeof(output));
- menu->AddItem(item = new BMenuItem("Get info", message, 'I'));
+ menu->AddItem(new BMenuItem("Get info", message, 'I'));
// add the "Disconnect" item
menu->AddItem(item = new BMenuItem("Disconnect", new
BMessage(MediaRoutingView::M_DELETE_SELECTION), 'T'));
--
To view, visit https://review.haiku-os.org/c/haiku/+/3271
To unsubscribe, or for help writing mail filters, visit
https://review.haiku-os.org/settings
Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Ic647109e5e7d2e304be6f8c542ea9bfca551c3a3
Gerrit-Change-Number: 3271
Gerrit-PatchSet: 1
Gerrit-Owner: Murai Takashi <tmurai01@xxxxxxxxx>
Gerrit-MessageType: newchange