X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/948123777fd4d4ba34d203d29936888075ea04e1..7bac600c529ba83f8f246a2dcfa9ddd9c0095675:/src/surf/surf_routing.hpp diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index 6096197350..5c59098d20 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -110,8 +110,10 @@ public: struct XBT_PRIVATE NetCardImpl : public NetCard { public: - NetCardImpl(char *name, int id, e_surf_network_element_type_t rcType, As *rcComponent) - : p_rcComponent(rcComponent), p_rcType(rcType), m_id(id), p_name(name) {} + NetCardImpl(const char *name, e_surf_network_element_type_t rcType, As *rcComponent) + : p_rcComponent(rcComponent), + p_rcType(rcType), + p_name(xbt_strdup(name)) {} ~NetCardImpl() { xbt_free(p_name);}; int getId() {return m_id;} @@ -123,7 +125,7 @@ public: private: As *p_rcComponent; e_surf_network_element_type_t p_rcType; - int m_id; + int m_id = -1; char *p_name; };