Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move collective algorithms to separate folders
[simgrid.git] / src / surf / storage_n11.cpp
index 88b7996..b89e195 100644 (file)
@@ -28,12 +28,6 @@ static inline void routing_storage_type_free(void *r)
   free(stype);
 }
 
-static inline void routing_storage_host_free(void *r)
-{
-  xbt_dynar_t dyn = (xbt_dynar_t) r;
-  xbt_dynar_free(&dyn);
-}
-
 static void check_disk_attachment()
 {
   xbt_lib_cursor_t cursor;
@@ -56,7 +50,6 @@ void storage_register_callbacks()
   instr_routing_define_callbacks();
 
   ROUTING_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, xbt_free_f);
-  ROUTING_STORAGE_HOST_LEVEL = xbt_lib_add_level(storage_lib, routing_storage_host_free);
   ROUTING_STORAGE_TYPE_LEVEL = xbt_lib_add_level(storage_type_lib, routing_storage_type_free);
   SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, [](void *self) {
     delete static_cast<simgrid::surf::Storage*>(self);
@@ -192,8 +185,8 @@ StorageAction *StorageN11::open(const char* mount, const char* path)
 {
   XBT_DEBUG("\tOpen file '%s'",path);
 
-  sg_size_t size, *psize;
-  psize = (sg_size_t*) xbt_dict_get_or_null(content_, path);
+  sg_size_t size;
+  sg_size_t* psize = (sg_size_t*)xbt_dict_get_or_null(content_, path);
   // if file does not exist create an empty file
   if(psize)
     size = *psize;
@@ -297,6 +290,8 @@ StorageN11Action::StorageN11Action(Model *model, double cost, bool failed, Stora
     //    storage->p_writeActions->push_back(action);
     //    ref();
     break;
+  default:
+    THROW_UNIMPLEMENTED;
   }
   XBT_OUT();
 }