From 1e44e2d0f43f0d2d4e7f5554f433faf6cf95cd86 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 18 Jul 2015 12:52:10 +0200 Subject: [PATCH] cosmetics: make semantic more clear --- src/simgrid/sg_config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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."); } -- 2.20.1