beautify code: indentations etc.

This commit is contained in:
h_vogt 2011-11-13 11:11:09 +00:00
parent 43b14e4d35
commit 9dbb7654eb
2 changed files with 601 additions and 604 deletions

View File

@ -1,3 +1,6 @@
2011-11-13 Holger Vogt
* inp.c: code beautify, indentations etc.
2011-11-04 Holger Vogt 2011-11-04 Holger Vogt
* INSTALL: give more precise instructions * INSTALL: give more precise instructions

View File

@ -66,8 +66,7 @@ com_listing(wordlist *wl)
s = wl->wl_word; s = wl->wl_word;
if ( strcmp( s, "param" ) == 0 ) { if ( strcmp( s, "param" ) == 0 ) {
do_param_listing = TRUE; do_param_listing = TRUE;
} } else {
else {
switch (*s) { switch (*s) {
case 'l': case 'l':
case 'L': case 'L':
@ -95,8 +94,7 @@ com_listing(wordlist *wl)
} }
if ( do_param_listing ) { if ( do_param_listing ) {
nupa_list_params(cp_out); nupa_list_params(cp_out);
} } else {
else {
if (type != LS_DECK) if (type != LS_DECK)
fprintf(cp_out, "\t%s\n\n", ft_curckt->ci_name); fprintf(cp_out, "\t%s\n\n", ft_curckt->ci_name);
inp_list(cp_out, expand ? ft_curckt->ci_deck : inp_list(cp_out, expand ? ft_curckt->ci_deck :
@ -289,7 +287,8 @@ top2:
* SJB - 22nd May 2001 * SJB - 22nd May 2001
*/ */
void void
line_free_x(struct line * deck, bool recurse) { line_free_x(struct line * deck, bool recurse)
{
if(!deck) if(!deck)
return; return;
tfree(deck->li_line); tfree(deck->li_line);
@ -382,11 +381,9 @@ inp_spsource(FILE *fp, bool comfile, char *filename)
if (dd->li_line[0] == '*') if (dd->li_line[0] == '*')
cp_evloop(dd->li_line + 2); cp_evloop(dd->li_line + 2);
/* option line stored but not processed */ /* option line stored but not processed */
else if (ciprefix("option", dd->li_line)) else if (ciprefix("option", dd->li_line)) {
{
com_options = inp_getoptsc(dd->li_line, com_options); com_options = inp_getoptsc(dd->li_line, com_options);
} } else
else
cp_evloop(dd->li_line); cp_evloop(dd->li_line);
} }
} }
@ -495,8 +492,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename)
|| eq(s, ".save") || eq(s, ".save")
|| eq(s, ".op") || eq(s, ".op")
|| ciprefix(".meas", s) || ciprefix(".meas", s)
|| eq(s, ".tf")) || eq(s, ".tf")) {
{
if (end) { if (end) {
end->wl_next = alloc(struct wordlist); end->wl_next = alloc(struct wordlist);
end->wl_next->wl_prev = end; end->wl_next->wl_prev = end;
@ -626,8 +622,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename)
if ( curr_meas == NULL ) { if ( curr_meas == NULL ) {
curr_meas = ft_curckt->ci_meas = dd; curr_meas = ft_curckt->ci_meas = dd;
} } else {
else {
curr_meas->li_next = dd; curr_meas->li_next = dd;
curr_meas = dd; curr_meas = dd;
} }
@ -709,10 +704,12 @@ inp_dodeck(
FALSE if called from inp_spsource() */ FALSE if called from inp_spsource() */
struct line *options, /*in: all .option lines from deck */ struct line *options, /*in: all .option lines from deck */
char *filename /*in: input file of deck */ char *filename /*in: input file of deck */
) { )
{
struct circ *ct; struct circ *ct;
struct line *dd; struct line *dd;
CKTcircuit *ckt; char *s; CKTcircuit *ckt;
char *s;
INPtables *tab = NULL; INPtables *tab = NULL;
struct variable *eev = NULL; struct variable *eev = NULL;
wordlist *wl; wordlist *wl;
@ -783,8 +780,7 @@ inp_dodeck(
break; break;
case CP_STRING: case CP_STRING:
break; break;
default: default: {
{
fprintf(stderr, "ERROR: enumeration value `CP_LIST' not handled in inp_dodeck\nAborting...\n" ); fprintf(stderr, "ERROR: enumeration value `CP_LIST' not handled in inp_dodeck\nAborting...\n" );
controlled_exit(EXIT_FAILURE); controlled_exit(EXIT_FAILURE);
} }
@ -935,8 +931,7 @@ inp_dodeck(
if_option(ct->ci_ckt, eev->va_name, if_option(ct->ci_ckt, eev->va_name,
eev->va_type, eev->va_string); eev->va_type, eev->va_string);
break; break;
default: default: {
{
fprintf(stderr, "ERROR: enumeration value `CP_LIST' not handled in inp_dodeck\nAborting...\n" ); fprintf(stderr, "ERROR: enumeration value `CP_LIST' not handled in inp_dodeck\nAborting...\n" );
controlled_exit(EXIT_FAILURE); controlled_exit(EXIT_FAILURE);
} }
@ -1103,8 +1098,7 @@ com_source(wordlist *wl)
/* Don't print the title if this is a spice initialisation file. */ /* Don't print the title if this is a spice initialisation file. */
if (ft_nutmeg || substring(INITSTR, owl->wl_word) || substring(ALT_INITSTR, owl->wl_word)) { if (ft_nutmeg || substring(INITSTR, owl->wl_word) || substring(ALT_INITSTR, owl->wl_word)) {
inp_spsource(fp, TRUE, tempfile ? NULL : wl->wl_word); inp_spsource(fp, TRUE, tempfile ? NULL : wl->wl_word);
} } else {
else {
inp_spsource(fp, FALSE, tempfile ? NULL : wl->wl_word); inp_spsource(fp, FALSE, tempfile ? NULL : wl->wl_word);
} }
cp_interactive = inter; cp_interactive = inter;