From 88ee1f91965ac9fc4521ba94089418f99248d3c9 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 18 Jul 2016 18:15:03 +0200 Subject: [PATCH] com_option.c, com_option(), cleanup, rename variables --- src/frontend/com_option.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/frontend/com_option.c b/src/frontend/com_option.c index a2c225537..a7f6ce420 100644 --- a/src/frontend/com_option.c +++ b/src/frontend/com_option.c @@ -14,7 +14,7 @@ void com_option(wordlist *wl) { - struct variable *vars, *varsfree; + struct variable *vars, *v; CKTcircuit *circuit = NULL; @@ -87,35 +87,35 @@ com_option(wordlist *wl) return; } - varsfree = vars = cp_setparse(wl); + vars = cp_setparse(wl); /* This is sort of a hassle... */ - while (vars) { + for (v = vars; v; v = v->va_next) { void *s; - switch (vars->va_type) { + switch (v->va_type) { case CP_BOOL: - s = &vars->va_bool; + s = &v->va_bool; break; case CP_NUM: - s = &vars->va_num; + s = &v->va_num; break; case CP_REAL: - s = &vars->va_real; + s = &v->va_real; break; case CP_STRING: - s = vars->va_string; + s = v->va_string; break; case CP_LIST: - s = vars->va_vlist; + s = v->va_vlist; break; default: s = NULL; } /* qui deve settare le opzioni di simulazione */ - cp_vset(vars->va_name, vars->va_type, s); - vars = vars->va_next; + cp_vset(v->va_name, v->va_type, s); } - free_struct_variable(varsfree); + + free_struct_variable(vars); }