Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
size_t instead of unsigned long for storage size and used_size
authorsuter <frederic.suter@cc.in2p3.fr>
Tue, 11 Jun 2013 13:21:42 +0000 (15:21 +0200)
committersuter <frederic.suter@cc.in2p3.fr>
Tue, 11 Jun 2013 13:21:42 +0000 (15:21 +0200)
src/surf/storage.c
src/surf/storage_private.h

index dbca4f2..dfc0359 100644 (file)
@@ -34,7 +34,7 @@ static xbt_dynar_t storage_list;
 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
 
 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
 
-static xbt_dict_t parse_storage_content(char *filename, unsigned long *used_size);
+static xbt_dict_t parse_storage_content(char *filename, size_t *used_size);
 static int storage_action_unref(surf_action_t action);
 static void storage_action_state_set(surf_action_t action, e_surf_action_state_t state);
 static surf_action_t storage_action_execute (void *storage, double size, e_surf_action_storage_type_t type);
 static int storage_action_unref(surf_action_t action);
 static void storage_action_state_set(surf_action_t action, e_surf_action_state_t state);
 static surf_action_t storage_action_execute (void *storage, double size, e_surf_action_storage_type_t type);
@@ -46,7 +46,7 @@ static surf_action_t storage_action_ls(void *storage, const char* path)
   xbt_dict_t ls_dict = xbt_dict_new();
 
   char* key;
   xbt_dict_t ls_dict = xbt_dict_new();
 
   char* key;
-  unsigned long size = 0;
+  size_t size = 0;
   xbt_dict_cursor_t cursor = NULL;
 
   xbt_dynar_t dyn = NULL;
   xbt_dict_cursor_t cursor = NULL;
 
   xbt_dynar_t dyn = NULL;
@@ -517,7 +517,7 @@ static void storage_parse_storage(sg_platf_storage_cbarg_t storage)
       (void *) xbt_strdup(storage->type_id));
 }
 
       (void *) xbt_strdup(storage->type_id));
 }
 
-static xbt_dict_t parse_storage_content(char *filename, unsigned long *used_size)
+static xbt_dict_t parse_storage_content(char *filename, size_t *used_size)
 {
   *used_size = 0;
   if ((!filename) || (strcmp(filename, "") == 0))
 {
   *used_size = 0;
   if ((!filename) || (strcmp(filename, "") == 0))
@@ -534,7 +534,7 @@ static xbt_dict_t parse_storage_content(char *filename, unsigned long *used_size
   size_t len = 0;
   ssize_t read;
   char path[1024];
   size_t len = 0;
   ssize_t read;
   char path[1024];
-  unsigned long size;
+  size_t size;
 
 
   while ((read = xbt_getline(&line, &len, file)) != -1) {
 
 
   while ((read = xbt_getline(&line, &len, file)) != -1) {
index 534b1d0..1d896f5 100644 (file)
@@ -12,7 +12,7 @@ typedef struct s_storage_type {
   char *content;
   char *type_id;
   xbt_dict_t properties;
   char *content;
   char *type_id;
   xbt_dict_t properties;
-  unsigned long size;
+  size_t size;
 } s_storage_type_t, *storage_type_t;
 
 typedef struct s_mount {
 } s_storage_type_t, *storage_type_t;
 
 typedef struct s_mount {
@@ -33,8 +33,8 @@ typedef struct storage {
   lmm_constraint_t constraint_write;    /* Constraint for maximum write bandwidth*/
   lmm_constraint_t constraint_read;     /* Constraint for maximum write bandwidth*/
   xbt_dict_t content; /* char * -> s_surf_file_t */
   lmm_constraint_t constraint_write;    /* Constraint for maximum write bandwidth*/
   lmm_constraint_t constraint_read;     /* Constraint for maximum write bandwidth*/
   xbt_dict_t content; /* char * -> s_surf_file_t */
-  unsigned long size;
-  unsigned long used_size;
+  size_t size;
+  size_t used_size;
   xbt_dynar_t write_actions;
 } s_storage_t, *storage_t;
 
   xbt_dynar_t write_actions;
 } s_storage_t, *storage_t;