From 08a8ba5b7ccd6f4aa2393fd6c8e32267121314f1 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 18 Jan 2018 10:21:13 +0100 Subject: [PATCH 1/1] Disable unused copy constructors (and please cppcheck). --- examples/s4u/dht-kademlia/node.hpp | 4 +++- examples/s4u/dht-kademlia/routing_table.hpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/s4u/dht-kademlia/node.hpp b/examples/s4u/dht-kademlia/node.hpp index 10625d03ae..178f380a88 100644 --- a/examples/s4u/dht-kademlia/node.hpp +++ b/examples/s4u/dht-kademlia/node.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2014-2017. The SimGrid Team. +/* Copyright (c) 2012, 2014-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -22,6 +22,8 @@ public: unsigned int find_node_success = 0; // Number of find_node which have succeeded. unsigned int find_node_failed = 0; // Number of find_node which have failed. explicit Node(unsigned int node_id) : id_(node_id), table(new RoutingTable(node_id)), receive_comm(nullptr) {} + Node(const Node&) = delete; + Node& operator=(const Node&) = delete; ~Node() { delete table; } unsigned int getId() { return id_; } diff --git a/examples/s4u/dht-kademlia/routing_table.hpp b/examples/s4u/dht-kademlia/routing_table.hpp index 60354ce0f4..bbe7128dc2 100644 --- a/examples/s4u/dht-kademlia/routing_table.hpp +++ b/examples/s4u/dht-kademlia/routing_table.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2014, 2017. The SimGrid Team. +/* Copyright (c) 2012, 2014, 2017-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ class RoutingTable { public: Bucket** buckets; // Node bucket list - 160 sized. explicit RoutingTable(unsigned int node_id); + RoutingTable(const RoutingTable&) = delete; + RoutingTable& operator=(const RoutingTable&) = delete; ~RoutingTable(); void print(); Bucket* findBucket(unsigned int id); -- 2.20.1