mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 09:23:35 +08:00
Issue #100 remove auto_ptr and c++03 support.
Problem: auto_ptr is deprecated. Solution: use unique_ptr which is only available in c++11 and newer. Also fix how unit tests are run as part of the build to keep them from being deleted when they fail. Testing: Unit tests on linux run.
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
*/
|
||||
|
||||
#if __GNUC__
|
||||
// We need auto_ptr for compatibility reasons
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||
#endif
|
||||
|
||||
@@ -27,7 +25,7 @@ static void publishNodeStatus(PairableCanDriver& can, uavcan::NodeID node_id,
|
||||
|
||||
struct NodeInfoListener : public uavcan::INodeInfoListener
|
||||
{
|
||||
std::auto_ptr<uavcan::protocol::GetNodeInfo::Response> last_node_info;
|
||||
std::unique_ptr<uavcan::protocol::GetNodeInfo::Response> last_node_info;
|
||||
uavcan::NodeID last_node_id;
|
||||
unsigned status_message_cnt;
|
||||
unsigned status_change_cnt;
|
||||
@@ -82,7 +80,7 @@ TEST(NodeInfoRetriever, Basic)
|
||||
std::cout << "sizeof(uavcan::ServiceClient<uavcan::protocol::GetNodeInfo>): "
|
||||
<< sizeof(uavcan::ServiceClient<uavcan::protocol::GetNodeInfo>) << std::endl;
|
||||
|
||||
std::auto_ptr<uavcan::NodeStatusProvider> provider(new uavcan::NodeStatusProvider(nodes.b));
|
||||
std::unique_ptr<uavcan::NodeStatusProvider> provider(new uavcan::NodeStatusProvider(nodes.b));
|
||||
|
||||
NodeInfoListener listener;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user