Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Initialize ramsize, and simply use an assignment to copy struct.
[simgrid.git] / src / surf / workstation_interface.cpp
index d43fd4a..5f8d501 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2013-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include "workstation_interface.hpp"
 #include "vm_workstation_interface.hpp"
 #include "cpu_cas01.hpp"
@@ -96,6 +102,7 @@ Workstation::Workstation(ModelPtr model, const char *name, xbt_dict_t props,
  : Resource(model, name, props)
  , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
 {
+  p_params.ramsize = 0;
   surf_callback_emit(workstationCreatedCallbacks, this);
 }
 
@@ -104,6 +111,7 @@ Workstation::Workstation(ModelPtr model, const char *name, xbt_dict_t props, lmm
  : Resource(model, name, props, constraint)
  , p_storage(storage), p_netElm(netElm), p_cpu(cpu)
 {
+  p_params.ramsize = 0;
   surf_callback_emit(workstationCreatedCallbacks, this);
 }
 
@@ -324,13 +332,13 @@ xbt_dynar_t Workstation::getVms()
 
 void Workstation::getParams(ws_params_t params)
 {
-  memcpy(params, &p_params, sizeof(s_ws_params_t));
+  *params = p_params;
 }
 
 void Workstation::setParams(ws_params_t params)
 {
   /* may check something here. */
-  memcpy(&p_params, params, sizeof(s_ws_params_t));
+  p_params = *params;
 }
 
 /**********