[med-svn] [htslib] 08/10: Replaced commented-out debugging code with #ifdef equivalent.

Andreas Tille tille at debian.org
Wed Jul 19 19:54:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository htslib.

commit fc05969e438b03e786d2492a064bd6627d2198f6
Author: Anders Kaplan <anders.kaplan at magasin1.se>
Date:   Mon Jul 3 23:08:28 2017 +0200

    Replaced commented-out debugging code with #ifdef equivalent.
---
 bcf_sr_sort.c     | 20 +++++++++++++++++---
 cram/cram_stats.c |  6 +++++-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/bcf_sr_sort.c b/bcf_sr_sort.c
index 5ab46ce..6c3943c 100644
--- a/bcf_sr_sort.c
+++ b/bcf_sr_sort.c
@@ -267,6 +267,8 @@ static int cmpstringp(const void *p1, const void *p2)
 {
     return strcmp(* (char * const *) p1, * (char * const *) p2);
 }
+
+#if DEBUG_VSETS
 void debug_vsets(sr_sort_t *srt)
 {
     int i,j,k;
@@ -285,6 +287,9 @@ void debug_vsets(sr_sort_t *srt)
         fprintf(stderr,"\n");
     }
 }
+#endif
+
+#if DEBUG_VBUF
 void debug_vbuf(sr_sort_t *srt)
 {
     int i, j;
@@ -299,6 +304,8 @@ void debug_vbuf(sr_sort_t *srt)
         fprintf(stderr,"\n");
     }
 }
+#endif
+
 char *grp_create_key(sr_sort_t *srt)
 {
     if ( !srt->str.l ) return strdup("");
@@ -485,7 +492,9 @@ static void bcf_sr_sort_set(bcf_srs_t *readers, sr_sort_t *srt, const char *chr,
         }
         var->type = type;
     }
-    // debug_vsets(srt);
+#if DEBUG_VSETS
+    debug_vsets(srt);
+#endif
 
     // initialize the pairing matrix
     hts_expand(int, srt->ngrp*srt->nvset, srt->mpmat, srt->pmat);
@@ -501,7 +510,10 @@ static void bcf_sr_sort_set(bcf_srs_t *readers, sr_sort_t *srt, const char *chr,
     // pair the lines
     while ( srt->nvset )
     {
-        // fprintf(stderr,"\n"); debug_vsets(srt);
+#if DEBUG_VSETS
+	fprintf(stderr,"\n");
+	debug_vsets(srt);
+#endif
 
         int imax = 0;
         for (ivset=1; ivset<srt->nvset; ivset++)
@@ -567,7 +579,9 @@ int bcf_sr_sort_next(bcf_srs_t *readers, sr_sort_t *srt, const char *chr, int mi
 
     if ( !srt->vcf_buf[0].nrec ) return 0;
 
-    // debug_vbuf(srt);
+#if DEBUG_VBUF
+    debug_vbuf(srt);
+#endif
 
     int nret = 0;
     for (i=0; i<srt->sr->nreaders; i++)
diff --git a/cram/cram_stats.c b/cram/cram_stats.c
index 0e56593..5fb63d4 100644
--- a/cram/cram_stats.c
+++ b/cram/cram_stats.c
@@ -96,6 +96,7 @@ void cram_stats_del(cram_stats *st, int32_t val) {
     }
 }
 
+#if DEBUG_CRAM_STATS
 void cram_stats_dump(cram_stats *st) {
     int i;
     fprintf(stderr, "cram_stats:\n");
@@ -114,6 +115,7 @@ void cram_stats_dump(cram_stats *st) {
 	}
     }
 }
+#endif
 
 /*
  * Computes entropy from integer frequencies for various encoding methods and
@@ -128,7 +130,9 @@ enum cram_encoding cram_stats_encoding(cram_fd *fd, cram_stats *st) {
     int nvals, i, ntot = 0, max_val = 0, min_val = INT_MAX;
     int *vals = NULL, *freqs = NULL, vals_alloc = 0;
 
-    //cram_stats_dump(st);
+#if DEBUG_CRAM_STATS
+    cram_stats_dump(st);
+#endif
 
     /* Count number of unique symbols */
     for (nvals = i = 0; i < MAX_STAT_VAL; i++) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/htslib.git



More information about the debian-med-commit mailing list