From: suter Date: Tue, 11 Jun 2013 13:21:42 +0000 (+0200) Subject: size_t instead of unsigned long for storage size and used_size X-Git-Tag: v3_9_90~276^2~17 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6da3f48c9f8d12591ad10f3473afd2bfbce1b15e size_t instead of unsigned long for storage size and used_size --- diff --git a/src/surf/storage.c b/src/surf/storage.c index dbca4f2466..dfc0359b2b 100644 --- a/src/surf/storage.c +++ b/src/surf/storage.c @@ -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 -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); @@ -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; - unsigned long size = 0; + size_t size = 0; 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)); } -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)) @@ -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]; - unsigned long size; + size_t size; while ((read = xbt_getline(&line, &len, file)) != -1) { diff --git a/src/surf/storage_private.h b/src/surf/storage_private.h index 534b1d025a..1d896f5bac 100644 --- a/src/surf/storage_private.h +++ b/src/surf/storage_private.h @@ -12,7 +12,7 @@ typedef struct s_storage_type { 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 { @@ -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 */ - unsigned long size; - unsigned long used_size; + size_t size; + size_t used_size; xbt_dynar_t write_actions; } s_storage_t, *storage_t;