diff --git a/lib/ldpc/dec.c b/lib/ldpc/dec.c index 86e97ae72..d87f962f4 100755 --- a/lib/ldpc/dec.c +++ b/lib/ldpc/dec.c @@ -36,7 +36,7 @@ decoding_method dec_method; /* Decoding method to use */ -int table; /* Trace option, 2 for a table of decoding details */ +int ldpc_table; /* Trace option, 2 for a table of decoding details */ int block_no; /* Number of current block, from zero */ int max_iter; /* Maximum number of iteratons of decoding to do */ @@ -73,7 +73,7 @@ void enum_decode_setup(void) exit(1); } - if (table==2) + if (ldpc_table==2) { printf(" block decoding likelihood\n"); } } @@ -190,7 +190,7 @@ unsigned enum_decode /* Output data to trace file. */ - if (table==2) + if (ldpc_table==2) { printf("%7d %10x %10.4e\n",block_no,d,lk); } } @@ -242,7 +242,7 @@ unsigned enum_decode void prprp_decode_setup (void) { - if (table==2) + if (ldpc_table==2) { printf( " block iter changed perrs loglik Eperrs Eloglik entropy\n"); } @@ -271,7 +271,7 @@ unsigned prprp_decode { c = check(H,dblk,pchk); - if (table==2) + if (ldpc_table==2) { printf("%7d %5d %8.1f %6d %+9.2f %8.1f %+9.2f %7.1f\n", block_no, n, changed(lratio,dblk,N), c, loglikelihood(lratio,dblk,N), expected_parity_errors(H,bprb), expected_loglikelihood(lratio,bprb,N), diff --git a/lib/ldpc/dec.h b/lib/ldpc/dec.h index 6623937c5..d2dc32a33 100755 --- a/lib/ldpc/dec.h +++ b/lib/ldpc/dec.h @@ -23,7 +23,7 @@ typedef enum extern decoding_method dec_method; /* Decoding method to use */ -extern int table; /* Trace option, 2 for a table of decoding details */ +extern int ldpc_table; /* Trace option, 2 for a table of decoding details */ extern int block_no; /* Number of current block, from zero */ extern int max_iter; /* Maximum number of iteratons of decoding to do */ diff --git a/lib/ldpc/decode.c b/lib/ldpc/decode.c index a82e5c9cc..ec04f2e44 100755 --- a/lib/ldpc/decode.c +++ b/lib/ldpc/decode.c @@ -64,18 +64,18 @@ int main /* Look at initial flag arguments. */ - table = 0; + ldpc_table = 0; blockio_flush = 0; while (argc>1) { if (strcmp(argv[1],"-t")==0) - { if (table!=0) usage(); - table = 1; + { if (ldpc_table!=0) usage(); + ldpc_table = 1; } else if (strcmp(argv[1],"-T")==0) - { if (table!=0) usage(); - table = 2; + { if (ldpc_table!=0) usage(); + ldpc_table = 2; } else if (strcmp(argv[1],"-f")==0) { if (blockio_flush!=0) usage(); @@ -141,7 +141,7 @@ int main { fprintf(stderr,"Can't read more than one stream from standard input\n"); exit(1); } - if ((table>0) + if ((ldpc_table>0) + (strcmp(dfile,"-")==0) + (pfile!=0 && strcmp(pfile,"-")==0) > 1) { fprintf(stderr,"Can't send more than one stream to standard output\n"); @@ -209,7 +209,7 @@ int main /* Print header for summary table. */ - if (table==1) + if (ldpc_table==1) { printf(" block iterations valid changed\n"); } @@ -319,7 +319,7 @@ int main /* Print summary table entry. */ - if (table==1) + if (ldpc_table==1) { printf ("%7d %10f %d %8.1f\n", block_no, (double)iters, valid, (double)chngd); /* iters is printed as a double to avoid problems if it's >= 2^31 */