}
int console_add_host(lua_State *L) {
- s_sg_platf_host_cbarg_t host;
- memset(&host,0,sizeof(host));
+ s_sg_platf_host_cbarg_t host{};
int type;
// we get values from the table passed as argument
int console_add_route(lua_State *L) {
XBT_DEBUG("Adding route");
- s_sg_platf_route_cbarg_t route;
- memset(&route,0,sizeof(route));
+ s_sg_platf_route_cbarg_t route{};
int type;
lua_ensure(lua_istable(L, -1), "Bad Arguments to add a route. Should be a table with named arguments");
}
int console_add_ASroute(lua_State *L) {
- s_sg_platf_route_cbarg_t ASroute;
- memset(&ASroute,0,sizeof(ASroute));
+ s_sg_platf_route_cbarg_t ASroute{};
lua_pushstring(L, "src");
lua_gettable(L, -2);
void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
/* OUT */ std::vector<surf::LinkImpl*>* links, double* latency)
{
- s_sg_platf_route_cbarg_t route;
- memset(&route, 0, sizeof(route));
+ s_sg_platf_route_cbarg_t route{};
XBT_DEBUG("Resolve route from '%s' to '%s'", src->getCname(), dst->getCname());
/* For the moment, intensity_rate is the percentage against the migration bandwidth */
msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount);
- s_vm_params_t params;
- memset(¶ms, 0, sizeof(params));
+ s_vm_params_t params{};
params.ramsize = static_cast<sg_size_t>(ramsize) * 1024 * 1024;
params.devsize = 0;
params.skip_stage2 = 0;
void SIMIX_process_set_function(const char* process_host, const char* process_function, xbt_dynar_t arguments,
double process_start_time, double process_kill_time)
{
- s_sg_platf_process_cbarg_t process;
- memset(&process,0,sizeof(process));
+ s_sg_platf_process_cbarg_t process{};
sg_host_t host = sg_host_by_name(process_host);
if (not host)
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id.c_str(), cluster->speeds.front());
- s_sg_platf_host_cbarg_t host;
- memset(&host, 0, sizeof(host));
+ s_sg_platf_host_cbarg_t host{};
host.id = host_id.c_str();
if ((cluster->properties != nullptr) && (not cluster->properties->empty())) {
host.properties = new std::map<std::string, std::string>;
{
for (int const& radical : *cabinet->radicals) {
std::string hostname = cabinet->prefix + std::to_string(radical) + cabinet->suffix;
- s_sg_platf_host_cbarg_t host;
- memset(&host, 0, sizeof(host));
+ s_sg_platf_host_cbarg_t host{};
host.pstate = 0;
host.core_amount = 1;
host.id = hostname.c_str();
}
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;
}
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
}
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
}
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
}
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);
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;