/* This is useful to build named structs, like option or property sets. */
-/* Copyright (c) 2004-2013. The SimGrid Team.
+/* Copyright (c) 2004-2014. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
printf(" %s: %s\n", name, variable->desc);
printf(" Type: %s; ", xbt_cfgelm_type_name[variable->type]);
if (variable->min != 1 || variable->max != 1) {
- if (variable->min == 0 && variable->max == 0)
- printf("Arity: no bound; ");
+ printf("Arity: min:%d to max:", variable->min);
+ if (variable->max == 0)
+ printf("(no bound); ");
else
- printf("Arity: min:%d to max:%d; ", variable->min, variable->max);
+ printf("%d; ", variable->max);
}
size = xbt_dynar_length(variable->content);
printf("Current value%s: ", (size <= 1 ? "" : "s"));
size);
}
+ if (variable->isdefault && size > variable->min) {
+ xbt_dict_cursor_free(&cursor);
+ THROWF(mismatch_error, 0,
+ "Config elem %s theoretically accepts %d %s, but has a default of %d values.",
+ name, variable->min, xbt_cfgelm_type_name[variable->type], size);
+ }
+
if (variable->max > 0 && variable->max < size) {
xbt_dict_cursor_free(&cursor);
THROWF(mismatch_error, 0,
}
else
XBT_DEBUG
- ("Do not override configuration variable '%s' with value '%lf' because it was already set.",
+ ("Do not override configuration variable '%s' with value '%f' because it was already set.",
name, val);
}