Skip to content

Commit 82e332d

Browse files
committed
avoid clang false positive
1 parent 5aab043 commit 82e332d

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

code/missioneditor/sexp_tree_actions.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,20 +489,19 @@ int SexpTreeActions::insert_operator(int op, void* root_parent_handle)
489489
_model.set_node(node, (SEXPT_OPERATOR | SEXPT_VALID), Operators[op].text.c_str());
490490
_model.tree_nodes[node].flags = node_flags;
491491

492-
void* insert_parent = nullptr;
492+
void* parent_handle = nullptr;
493493
if (parent_node >= 0) {
494-
insert_parent = _model.tree_nodes[parent_node].handle;
494+
parent_handle = _model.tree_nodes[parent_node].handle;
495495
} else {
496496
if (_model._interface && _model._interface->getFlags()[TreeFlags::LabeledRoot]) {
497-
insert_parent = root_parent_handle;
497+
parent_handle = root_parent_handle;
498498
_model._interface->onRootInserted(wrapped_node, node);
499499
} else {
500500
_model.root_item = node;
501501
}
502502
}
503503

504-
_model.tree_nodes[node].handle =
505-
_ui.ui_insert_item(Operators[op].text.c_str(), NodeImage::OPERATOR, insert_parent, wrapped_handle);
504+
_model.tree_nodes[node].handle = _ui.ui_insert_item(Operators[op].text.c_str(), NodeImage::OPERATOR, parent_handle, wrapped_handle);
506505

507506
_ui.ui_move_branch(wrapped_node, node);
508507
_model.item_index = node;

code/missioneditor/sexp_tree_model.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ class ISexpTreeUI {
233233

234234
// Insert a new tree item with the given text/icon under parent_handle, after insert_after.
235235
// Returns the newly created opaque handle.
236-
virtual void* ui_insert_item(const char* text, NodeImage image,
237-
void* parent_handle, void* insert_after) = 0;
236+
virtual void* ui_insert_item(const char* text, NodeImage image, void* parent_handle, void* insert_after) = 0;
238237
// Remove a tree item from the widget
239238
virtual void ui_delete_item(void* handle) = 0;
240239
// Update the displayed text of a tree item

0 commit comments

Comments
 (0)