From f23d4aa31ac4cc1281c8cd496f8fb7a6a2ad53f3 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 23 Sep 2008 12:32:35 +0200 Subject: [PATCH] source/sol.c: don't print any messages when silent option is specified The old code would test for non-zero verbose, but the silent option sets verbose to -1, resulting in some messages getting printed when they should not. Reported by Sven De Smet --- source/sol.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/sol.c b/source/sol.c index 5c9133d..584c387 100644 --- a/source/sol.c +++ b/source/sol.c @@ -641,7 +641,7 @@ PipNewparm * sol_newparm_edit(int *i, int Bg, int Urs_p, int flags) else newparm_first = newparm; newparm_now = newparm ; - if (verbose) + if (verbose > 0) { fprintf(dump,"\n(newparm ") ; fprintf(dump,FORMAT,newparm->rank) ; fprintf(dump," (div ") ; @@ -693,7 +693,7 @@ PipList * sol_list_edit(int *i, int nb_elements, int Bg, int Urs_p, int flags) list->vector = sol_vector_edit(i, Bg, Urs_p, flags); list_now = list ; - if (verbose) + if (verbose > 0) { fprintf(dump,"\n(list ") ; pip_vector_print(dump,list->vector) ; } @@ -709,14 +709,14 @@ PipList * sol_list_edit(int *i, int nb_elements, int Bg, int Urs_p, int flags) list_new->vector = sol_vector_edit(i, Bg, Urs_p, flags); list_new->next = NULL ; - if (verbose) + if (verbose > 0) { fprintf(dump,"\n") ; pip_vector_print(dump,list_new->vector) ; } list_now->next = list_new ; list_now = list_now->next ; } - if (verbose) + if (verbose > 0) fprintf(dump,"\n)") ; return(list) ; @@ -794,22 +794,22 @@ PipQuast *sol_quast_edit(int *i, PipQuast *father, int Bg, int Urs_p, int flags) if (flags & SOL_DUAL) solution->next_then = sol_quast_edit(i, solution, Bg, Urs_p, 0); break ; - case Nil : if (verbose) + case Nil : if (verbose > 0) fprintf(dump,"\n()") ; break ; case If : solution->condition = sol_vector_edit(i, Bg, Urs_p, flags & SOL_REMOVE); - if (verbose) + if (verbose > 0) { fprintf(dump,"\n(if ") ; pip_vector_print(dump,solution->condition) ; } solution->next_then = sol_quast_edit(i, solution, Bg, Urs_p, flags); solution->next_else = sol_quast_edit(i, solution, Bg, Urs_p, flags); - if (verbose) + if (verbose > 0) fprintf(dump,"\n)") ; break ; default : fprintf(stderr,"\nAie !!! Flag %d inattendu.\n",p->flags) ; - if (verbose) + if (verbose > 0) fprintf(dump,"\nAie !!! Flag %d inattendu.\n",p->flags) ; exit(1) ; } -- 2.11.4.GIT