From: Arnaud Giersch Date: Wed, 8 Nov 2017 17:44:59 +0000 (+0100) Subject: Fix Werror=missing-field-initializers with older compilers. X-Git-Tag: v3.18~242^2~67 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a73e3b31f63b6da6b5f520f258f96d8aeca337be Fix Werror=missing-field-initializers with older compilers. --- diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 2fbc75ea1c..e7c33708a4 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -140,7 +140,7 @@ int console_add_host___link(lua_State *L) { } int console_add_host(lua_State *L) { - s_sg_platf_host_cbarg_t host{}; + s_sg_platf_host_cbarg_t host; int type; // we get values from the table passed as argument @@ -302,7 +302,7 @@ int console_add_router(lua_State* L) { int console_add_route(lua_State *L) { XBT_DEBUG("Adding route"); - s_sg_platf_route_cbarg_t 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"); @@ -373,7 +373,7 @@ int console_add_route(lua_State *L) { } int console_add_ASroute(lua_State *L) { - s_sg_platf_route_cbarg_t ASroute{}; + s_sg_platf_route_cbarg_t ASroute; lua_pushstring(L, "src"); lua_gettable(L, -2); diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 1bccf4a4fb..08b74dfc9e 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -315,7 +315,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst, /* OUT */ std::vector& links, double* latency) { - s_sg_platf_route_cbarg_t route{}; + s_sg_platf_route_cbarg_t route; XBT_DEBUG("Resolve route from '%s' to '%s'", src->getCname(), dst->getCname()); diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index 1d6175c820..1a5a9ad539 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -113,12 +113,15 @@ msg_vm_t MSG_vm_create(msg_host_t pm, const char* name, int coreAmount, int rams /* 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{}; - params.ramsize = static_cast(ramsize) * 1024 * 1024; - params.devsize = 0; - params.skip_stage2 = 0; + s_vm_params_t params; + params.ncpus = 0; + params.ramsize = static_cast(ramsize) * 1024 * 1024; + params.overcommit = 0; + params.devsize = 0; + params.skip_stage1 = 0; + params.skip_stage2 = 0; params.max_downtime = 0.03; - params.mig_speed = static_cast(mig_netspeed) * 1024 * 1024; // mig_speed + params.mig_speed = static_cast(mig_netspeed) * 1024 * 1024; // mig_speed params.dp_intensity = static_cast(dp_intensity) / 100; params.dp_cap = params.ramsize * 0.9; // assume working set memory is 90% of ramsize diff --git a/src/simix/smx_deployment.cpp b/src/simix/smx_deployment.cpp index eecc1c70e0..f380ffe0c9 100644 --- a/src/simix/smx_deployment.cpp +++ b/src/simix/smx_deployment.cpp @@ -117,7 +117,7 @@ simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name) 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{}; + s_sg_platf_process_cbarg_t process; sg_host_t host = sg_host_by_name(process_host); if (not host) diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index a853c3d89f..b22b8b89a7 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -194,7 +194,7 @@ void sg_platf_new_cluster(ClusterCreationArgs* cluster) XBT_DEBUG("", host_id.c_str(), cluster->speeds.front()); - s_sg_platf_host_cbarg_t 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; @@ -314,7 +314,7 @@ void sg_platf_new_cabinet(CabinetCreationArgs* cabinet) { for (int const& radical : *cabinet->radicals) { std::string hostname = cabinet->prefix + std::to_string(radical) + cabinet->suffix; - s_sg_platf_host_cbarg_t host{}; + s_sg_platf_host_cbarg_t host; host.pstate = 0; host.core_amount = 1; host.id = hostname.c_str(); diff --git a/src/surf/xml/platf_private.hpp b/src/surf/xml/platf_private.hpp index 9523a09677..82def2f21a 100644 --- a/src/surf/xml/platf_private.hpp +++ b/src/surf/xml/platf_private.hpp @@ -42,14 +42,14 @@ enum e_surf_cluster_topology_t { */ struct s_sg_platf_host_cbarg_t { - const char* id; + const char* id = nullptr; std::vector speed_per_pstate; - int pstate; - int core_amount; - tmgr_trace_t speed_trace; - tmgr_trace_t state_trace; - const char* coord; - std::map* properties; + int pstate = 0; + int core_amount = 0; + tmgr_trace_t speed_trace = nullptr; + tmgr_trace_t state_trace = nullptr; + const char* coord = nullptr; + std::map* properties = nullptr; }; typedef s_sg_platf_host_cbarg_t* sg_platf_host_cbarg_t; @@ -174,14 +174,14 @@ public: }; struct s_sg_platf_process_cbarg_t { - const char **argv; - int argc; - std::map* properties; - const char *host; - const char *function; - double start_time; - double kill_time; - e_surf_process_on_failure_t on_failure; + const char** argv = nullptr; + int argc = 0; + std::map* properties = nullptr; + const char* host = nullptr; + const char* function = nullptr; + double start_time = 0.0; + double kill_time = 0.0; + e_surf_process_on_failure_t on_failure = {}; }; typedef s_sg_platf_process_cbarg_t* sg_platf_process_cbarg_t; diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 5f34526866..67f14a4432 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -426,7 +426,7 @@ void STag_surfxml_prop() } void ETag_surfxml_host() { - s_sg_platf_host_cbarg_t host{}; + s_sg_platf_host_cbarg_t host; host.properties = current_property_set; current_property_set = nullptr; @@ -692,7 +692,7 @@ void STag_surfxml_bypassZoneRoute(){ } void ETag_surfxml_route(){ - s_sg_platf_route_cbarg_t 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 @@ -716,7 +716,7 @@ void ETag_surfxml_ASroute() } void ETag_surfxml_zoneRoute() { - s_sg_platf_route_cbarg_t 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 @@ -742,7 +742,7 @@ void ETag_surfxml_zoneRoute() } void ETag_surfxml_bypassRoute(){ - s_sg_platf_route_cbarg_t 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 @@ -765,7 +765,7 @@ void ETag_surfxml_bypassASroute() } void ETag_surfxml_bypassZoneRoute() { - s_sg_platf_route_cbarg_t 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); @@ -907,7 +907,7 @@ void ETag_surfxml_process() void ETag_surfxml_actor() { - s_sg_platf_process_cbarg_t actor{}; + s_sg_platf_process_cbarg_t actor; actor.properties = current_property_set; current_property_set = nullptr;