diff --git a/simulator/port_tree.cpp b/simulator/port_tree.cpp index 84d5bf4..24eebca 100644 --- a/simulator/port_tree.cpp +++ b/simulator/port_tree.cpp @@ -132,21 +132,21 @@ void port_tree::set_priority (uint32_t priority) uint32_t port_tree::internal_port_path_cost() const { - return STP_GetInternalPortPathCost(_port->bridge()->stp_bridge(), _port->port_index(), _tree_index); + return STP_GetInternalPortPathCost(_port->bridge()->stp_bridge(), (unsigned int)_port->port_index(), (unsigned int)_tree_index); } uint32_t port_tree::admin_internal_port_path_cost() const { - return STP_GetAdminInternalPortPathCost(_port->bridge()->stp_bridge(), _port->port_index(), _tree_index); + return STP_GetAdminInternalPortPathCost(_port->bridge()->stp_bridge(), (unsigned int)_port->port_index(), (unsigned int)_tree_index); } void port_tree::set_admin_internal_port_path_cost (uint32_t value) { - if (STP_GetAdminInternalPortPathCost (_port->bridge()->stp_bridge(), _port->port_index(), _tree_index) != value) + if (STP_GetAdminInternalPortPathCost (_port->bridge()->stp_bridge(), (unsigned int)_port->port_index(), (unsigned int)_tree_index) != value) { this->on_property_changing (&admin_internal_port_path_cost_property); this->on_property_changing (&internal_port_path_cost_property); - STP_SetAdminInternalPortPathCost (_port->bridge()->stp_bridge(), _port->port_index(), _tree_index, value, ::GetMessageTime()); + STP_SetAdminInternalPortPathCost (_port->bridge()->stp_bridge(), (unsigned int)_port->port_index(), (unsigned int)_tree_index, value, ::GetMessageTime()); this->on_property_changed (&internal_port_path_cost_property); this->on_property_changed (&admin_internal_port_path_cost_property); } diff --git a/tests/test_helpers.cpp b/tests/test_helpers.cpp index c4610dd..60f4c75 100644 --- a/tests/test_helpers.cpp +++ b/tests/test_helpers.cpp @@ -95,14 +95,14 @@ bool exchange_bpdus (test_bridge& one, size_t one_port, test_bridge& other, size { auto bpdu = std::move(one.tx_queues[one_port].back()); one.tx_queues[one_port].pop(); - STP_OnBpduReceived (other, other_port, bpdu.data(), (unsigned int) bpdu.size(), 0); + STP_OnBpduReceived (other, (unsigned int)other_port, bpdu.data(), (unsigned int) bpdu.size(), 0); exchanged = true; } else if (!other.tx_queues[other_port].empty()) { auto bpdu = std::move(other.tx_queues[other_port].back()); other.tx_queues[other_port].pop(); - STP_OnBpduReceived (one, one_port, bpdu.data(), (unsigned int) bpdu.size(), 0); + STP_OnBpduReceived (one, (unsigned int)one_port, bpdu.data(), (unsigned int) bpdu.size(), 0); exchanged = true; } else