From 904c3205c0a7c205da3ccf5ca6fae3860858c80d Mon Sep 17 00:00:00 2001 From: Heng Li Date: Sat, 23 Feb 2013 13:26:50 -0500 Subject: [PATCH] removed a few unused variables These variables have been assigned but never actually used. Reported by gcc-4.7. Lower version cannot give such warnings. --- QSufSort.c | 3 --- bwamem.c | 10 +++++----- bwase.c | 8 ++++---- bwtsw2_aux.c | 4 ++-- stdaln.c | 6 ++---- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/QSufSort.c b/QSufSort.c index e437ac38..36c5a519 100644 --- a/QSufSort.c +++ b/QSufSort.c @@ -59,12 +59,9 @@ void QSufSortSuffixSort(qsint_t* __restrict V, qsint_t* __restrict I, const qsin qsint_t i, j; qsint_t s, negatedSortedGroupLength; qsint_t numSymbolAggregated; - qsint_t maxNumInputSymbol; qsint_t numSortedPos = 1; qsint_t newAlphabetSize; - maxNumInputSymbol = largestInputSymbol - smallestInputSymbol + 1; - if (!skipTransform) { /* bucketing possible*/ newAlphabetSize = QSufSortTransform(V, I, numChar, largestInputSymbol, smallestInputSymbol, diff --git a/bwamem.c b/bwamem.c index b52d20b1..5bd495c3 100644 --- a/bwamem.c +++ b/bwamem.c @@ -418,7 +418,7 @@ static inline int cal_max_gap(const mem_opt_t *opt, int qlen) void mem_chain2aln(const mem_opt_t *opt, int64_t l_pac, const uint8_t *pac, int l_query, const uint8_t *query, const mem_chain_t *c, mem_alnreg_v *av) { // FIXME: in general, we SHOULD check funny seed patterns such as contained seeds. When that happens, we should use a SW or extend more seeds int i, k; - int64_t rlen, rmax[2], tmp, max = 0, max_i = 0; + int64_t rlen, rmax[2], tmp, max = 0; const mem_seed_t *s; uint8_t *rseq = 0; @@ -432,7 +432,7 @@ void mem_chain2aln(const mem_opt_t *opt, int64_t l_pac, const uint8_t *pac, int e = t->rbeg + t->len + ((l_query - t->qbeg - t->len) + cal_max_gap(opt, l_query - t->qbeg - t->len)); rmax[0] = rmax[0] < b? rmax[0] : b; rmax[1] = rmax[1] > e? rmax[1] : e; - if (t->len > max) max = t->len, max_i = i; + if (t->len > max) max = t->len; } // retrieve the reference sequence rseq = bns_get_seq(l_pac, pac, rmax[0], rmax[1], &rlen); @@ -523,7 +523,7 @@ uint32_t *bwa_gen_cigar(const int8_t mat[25], int q, int r, int w_, int64_t l_pa void bwa_hit2sam(kstring_t *str, const int8_t mat[25], int q, int r, int w, const bntseq_t *bns, const uint8_t *pac, bseq1_t *s, const bwahit_t *p_, int is_hard, const bwahit_t *m) { #define is_mapped(x) ((x)->rb >= 0 && (x)->rb < (x)->re && (x)->re <= bns->l_pac<<1) - int score, n_cigar, is_rev = 0, nn, rid, mid, copy_mate = 0; + int score, n_cigar, is_rev = 0, rid, mid, copy_mate = 0; uint32_t *cigar = 0; int64_t pos; bwahit_t ptmp, *p = &ptmp; @@ -548,7 +548,7 @@ void bwa_hit2sam(kstring_t *str, const int8_t mat[25], int q, int r, int w, cons p->flag |= n_cigar == 0? 4 : 0; // FIXME: check why this may happen (this has already happened) } else n_cigar = 0, cigar = 0; pos = bns_depos(bns, p->rb < bns->l_pac? p->rb : p->re - 1, &is_rev); - nn = bns_cnt_ambi(bns, pos, p->re - p->rb, &rid); + bns_cnt_ambi(bns, pos, p->re - p->rb, &rid); kputw(p->flag, str); kputc('\t', str); kputs(bns->anns[rid].name, str); kputc('\t', str); kputuw(pos - bns->anns[rid].offset + 1, str); kputc('\t', str); kputw(p->qual, str); kputc('\t', str); @@ -569,7 +569,7 @@ void bwa_hit2sam(kstring_t *str, const int8_t mat[25], int q, int r, int w, cons } if (m && is_mapped(m)) { // then print mate pos and isize pos = bns_depos(bns, m->rb < bns->l_pac? m->rb : m->re - 1, &is_rev); - nn = bns_cnt_ambi(bns, pos, m->re - m->rb, &mid); + bns_cnt_ambi(bns, pos, m->re - m->rb, &mid); kputc('\t', str); if (mid == rid) kputc('=', str); else kputs(bns->anns[mid].name, str); diff --git a/bwase.c b/bwase.c index 1f36aaab..017322bc 100644 --- a/bwase.c +++ b/bwase.c @@ -71,8 +71,8 @@ void bwa_aln2seq_core(int n_aln, const bwt_aln1_t *aln, bwa_seq_t *s, int set_ma } rest -= q->l - q->k + 1; } else { // Random sampling (http://code.activestate.com/recipes/272884/). In fact, we never come here. - int j, i, k; - for (j = rest, i = q->l - q->k + 1, k = 0; j > 0; --j) { + int j, i; + for (j = rest, i = q->l - q->k + 1; j > 0; --j) { double p = 1.0, x = drand48(); while (x < p) p -= p * j / (i--); s->multi[z].pos = q->l - i; @@ -412,11 +412,11 @@ void bwa_print_sam1(const bntseq_t *bns, bwa_seq_t *p, const bwa_seq_t *mate, in // print mate coordinate if (mate && mate->type != BWA_TYPE_NO_MATCH) { - int m_seqid, m_is_N; + int m_seqid; long long isize; am = mate->seQ < p->seQ? mate->seQ : p->seQ; // smaller single-end mapping quality // redundant calculation here, but should not matter too much - m_is_N = bns_cnt_ambi(bns, mate->pos, mate->len, &m_seqid); + bns_cnt_ambi(bns, mate->pos, mate->len, &m_seqid); err_printf("\t%s\t", (seqid == m_seqid)? "=" : bns->anns[m_seqid].name); isize = (seqid == m_seqid)? pos_5(mate) - pos_5(p) : 0; if (p->type == BWA_TYPE_NO_MATCH) isize = 0; diff --git a/bwtsw2_aux.c b/bwtsw2_aux.c index 55c7c642..c727984c 100644 --- a/bwtsw2_aux.c +++ b/bwtsw2_aux.c @@ -186,14 +186,14 @@ static void gen_cigar(const bsw2opt_t *opt, int lq, uint8_t *seq[2], const uint8 bsw2aux_t *q = b->aux + i; uint8_t *query; bwtint_t k; - int score, path_len, beg, end; + int path_len, beg, end; if (p->l) continue; beg = (p->flag & 0x10)? lq - p->end : p->beg; end = (p->flag & 0x10)? lq - p->beg : p->end; query = seq[(p->flag & 0x10)? 1 : 0] + beg; for (k = p->k; k < p->k + p->len; ++k) // in principle, no out-of-boundary here target[k - p->k] = pac[k>>2] >> (~k&3)*2 & 0x3; - score = aln_global_core(target, p->len, query, end - beg, &par, path, &path_len); + aln_global_core(target, p->len, query, end - beg, &par, path, &path_len); q->cigar = aln_path2cigar32(path, path_len, &q->n_cigar); #if 0 if (name && score != p->G) { // debugging only diff --git a/stdaln.c b/stdaln.c index eb418824..cd064cf9 100644 --- a/stdaln.c +++ b/stdaln.c @@ -542,13 +542,12 @@ int aln_local_core(unsigned char *seq1, int len1, unsigned char *seq2, int len2, int start, end, max_score; int thres, *suba, *ss; - int gap_open, gap_ext, b; + int gap_open, gap_ext; int *score_matrix, N_MATRIX_ROW; /* initialize some align-related parameters. just for compatibility */ gap_open = ap->gap_open; gap_ext = ap->gap_ext; - b = ap->band_width; score_matrix = ap->matrix; N_MATRIX_ROW = ap->row; thres = _thres > 0? _thres : -_thres; @@ -862,7 +861,7 @@ uint16_t *aln_path2cigar(const path_t *path, int path_len, int *n_cigar) int aln_extend_core(unsigned char *seq1, int len1, unsigned char *seq2, int len2, const AlnParam *ap, path_t *path, int *path_len, int G0, uint8_t *_mem) { - int q, r, qr, tmp_len; + int q, r, qr; int32_t **s_array, *score_array; int is_overflow, of_base; uint32_t *eh; @@ -889,7 +888,6 @@ int aln_extend_core(unsigned char *seq1, int len1, unsigned char *seq2, int len2 s_array[i] = (int32_t*)_p, _p += 4 * len1; /* initialization */ aln_init_score_array(seq1, len1, N_MATRIX_ROW, score_matrix, s_array); - tmp_len = len1 + 1; start = 1; end = 2; end_i = end_j = 0; score = 0;