From: schnorr Date: Mon, 7 Feb 2011 13:36:38 +0000 (+0000) Subject: [trace] only one id generator for tracing system X-Git-Tag: v3.6_beta2~345 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/59518475423ac3b2dfa8981463c1ca3fdddd5341?hp=ac1f230c7d64fba88e0938ce18d0772b4721fda6 [trace] only one id generator for tracing system git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9584 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/instr/instr_paje.c b/src/instr/instr_paje.c index 566f5d3400..ef88e61775 100644 --- a/src/instr/instr_paje.c +++ b/src/instr/instr_paje.c @@ -24,6 +24,12 @@ void instr_paje_init (container_t root) rootContainer = root; } +static long long int new_type_id (void) +{ + static long long int type_id = 0; + return type_id++; +} + static val_t newValue (const char *valuename, const char *color, type_t father) { val_t ret = xbt_new0(s_val_t, 1); @@ -31,9 +37,8 @@ static val_t newValue (const char *valuename, const char *color, type_t father) ret->father = father; ret->color = xbt_strdup (color); - static long long int type_id = 0; char str_id[INSTR_DEFAULT_STR_SIZE]; - snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "v%lld", type_id++); + snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", new_type_id()); ret->id = xbt_strdup (str_id); xbt_dict_set (father->values, valuename, ret, NULL); @@ -69,9 +74,8 @@ static type_t newType (const char *typename, const char *key, const char *color, ret->values = xbt_dict_new (); ret->color = xbt_strdup (color); - static long long int type_id = 0; char str_id[INSTR_DEFAULT_STR_SIZE]; - snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", type_id++); + snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", new_type_id()); ret->id = xbt_strdup (str_id); if (father != NULL){