Replace common pattern by new LIMIT_TO()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2013-01-14 22:34:05 +01:00
parent aa870f5d91
commit 726b9380d1
11 changed files with 73 additions and 162 deletions

View file

@ -378,10 +378,7 @@ parse_args(int argc, char *argv[])
sp = atoi(argv[4]);
else
sp = DEFAULT_SPIKE;
if (sp < 0)
sp = 0;
if (sp > 100)
sp = 100;
sp = LIMIT_TO(sp, 0, 100);
if (argc > 5)
pm = atoi(argv[5]);