A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid using memset to initialize structs.
[simgrid.git]
/
src
/
surf
/
xml
/
surfxml_sax_cb.cpp
diff --git
a/src/surf/xml/surfxml_sax_cb.cpp
b/src/surf/xml/surfxml_sax_cb.cpp
index
6730a35
..
e370d13
100644
(file)
--- a/
src/surf/xml/surfxml_sax_cb.cpp
+++ b/
src/surf/xml/surfxml_sax_cb.cpp
@@
-426,8
+426,7
@@
void STag_surfxml_prop()
}
void ETag_surfxml_host() {
}
void ETag_surfxml_host() {
- s_sg_platf_host_cbarg_t host;
- memset(&host,0,sizeof(host));
+ s_sg_platf_host_cbarg_t host{};
host.properties = current_property_set;
current_property_set = nullptr;
host.properties = current_property_set;
current_property_set = nullptr;
@@
-693,8
+692,7
@@
void STag_surfxml_bypassZoneRoute(){
}
void ETag_surfxml_route(){
}
void ETag_surfxml_route(){
- s_sg_platf_route_cbarg_t route;
- memset(&route,0,sizeof(route));
+ s_sg_platf_route_cbarg_t route{};
route.src = sg_netpoint_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
route.dst = sg_netpoint_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
route.src = sg_netpoint_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
route.dst = sg_netpoint_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
@@
-722,8
+720,7
@@
void ETag_surfxml_ASroute()
}
void ETag_surfxml_zoneRoute()
{
}
void ETag_surfxml_zoneRoute()
{
- s_sg_platf_route_cbarg_t ASroute;
- memset(&ASroute,0,sizeof(ASroute));
+ s_sg_platf_route_cbarg_t ASroute{};
ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_src); // tested to not be nullptr in start tag
ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_dst); // tested to not be nullptr in start tag
ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_src); // tested to not be nullptr in start tag
ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_dst); // tested to not be nullptr in start tag
@@
-754,8
+751,7
@@
void ETag_surfxml_zoneRoute()
}
void ETag_surfxml_bypassRoute(){
}
void ETag_surfxml_bypassRoute(){
- s_sg_platf_route_cbarg_t route;
- memset(&route,0,sizeof(route));
+ s_sg_platf_route_cbarg_t route{};
route.src = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
route.dst = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
route.src = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
route.dst = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
@@
-782,8
+778,7
@@
void ETag_surfxml_bypassASroute()
}
void ETag_surfxml_bypassZoneRoute()
{
}
void ETag_surfxml_bypassZoneRoute()
{
- s_sg_platf_route_cbarg_t ASroute;
- memset(&ASroute,0,sizeof(ASroute));
+ s_sg_platf_route_cbarg_t ASroute{};
ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_src);
ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_dst);
ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_src);
ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_dst);
@@
-929,8
+924,7
@@
void ETag_surfxml_process()
void ETag_surfxml_actor()
{
void ETag_surfxml_actor()
{
- s_sg_platf_process_cbarg_t actor;
- memset(&actor,0,sizeof(actor));
+ s_sg_platf_process_cbarg_t actor{};
actor.properties = current_property_set;
current_property_set = nullptr;
actor.properties = current_property_set;
current_property_set = nullptr;