From: Martin Quinson Date: Sat, 18 Jul 2015 10:52:10 +0000 (+0200) Subject: cosmetics: make semantic more clear X-Git-Tag: v3_12~493 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1e44e2d0f43f0d2d4e7f5554f433faf6cf95cd86 cosmetics: make semantic more clear --- diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 8ab8535a10..6bfc5c7da3 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -461,14 +461,16 @@ static void _sg_cfg_cb_contexts_parallel_mode(const char *name, int pos) static void _sg_cfg_cb__surf_network_coordinates(const char *name, int pos) { + static int already_set = 0; int val = xbt_cfg_get_boolean(_sg_cfg_set, name); if (val) { - if (!COORD_HOST_LEVEL) { + if (!already_set) { COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp); COORD_ASR_LEVEL = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp); } + already_set = 1; } else - if (COORD_HOST_LEVEL) + if (already_set) xbt_die("Setting of whether to use coordinate cannot be disabled once set."); }