From: Renaud Barate Date: Fri, 4 Apr 2014 09:09:49 +0000 (+0200) Subject: Add initializer for struct resourceParams to avoid uninitialized values X-Git-Tag: V7_4_0b1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=83f25b8c498e912edd74a1720a824486f450f46c;p=modules%2Fkernel.git Add initializer for struct resourceParams to avoid uninitialized values --- diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index fbc71d554..7874bfd90 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -44,14 +44,6 @@ Launcher::Job::Job() _result_directory = ""; _maximum_duration = ""; _maximum_duration_in_second = -1; - _resource_required_params.name = ""; - _resource_required_params.hostname = ""; - _resource_required_params.OS = ""; - _resource_required_params.nb_proc = -1; - _resource_required_params.nb_node = -1; - _resource_required_params.nb_proc_per_node = -1; - _resource_required_params.cpu_clock = -1; - _resource_required_params.mem_mb = -1; _queue = ""; _job_type = ""; _exclusive = false; diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index d22dc7c5b..1aed4d065 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -50,6 +50,18 @@ const string ResourcesManager_cpp::DEFAULT_RESOURCE_NAME = "localhost"; static LoadRateManagerFirst first; static LoadRateManagerCycl cycl; static LoadRateManagerAltCycl altcycl; + +resourceParams::resourceParams() +: can_launch_batch_jobs(false), + can_run_containers(false), + nb_proc(-1), + nb_node(-1), + nb_proc_per_node(-1), + cpu_clock(-1), + mem_mb(-1) +{ +} + //============================================================================= /*! * just for test diff --git a/src/ResourcesManager/ResourcesManager.hxx b/src/ResourcesManager/ResourcesManager.hxx index 50a651786..500f957c2 100644 --- a/src/ResourcesManager/ResourcesManager.hxx +++ b/src/ResourcesManager/ResourcesManager.hxx @@ -50,6 +50,8 @@ // session. struct resourceParams { + resourceParams(); + std::string name; std::string hostname; bool can_launch_batch_jobs;