Permalink
Browse files

Silences a bunch of warnings reported with --Wall with gcc 4.8.1 rela…

…ted to set but unused variables. Doesn't silence them all. I left several where I decided the variables are helpful for understanding the code.
  • Loading branch information...
1 parent e0dab07 commit b6822b60279b42f36e5f5123ed6091f6504af209 @nawrockie nawrockie committed Jun 22, 2016
View
@@ -530,7 +530,6 @@ remove_fragments(struct cfg_s *cfg, ESL_MSA *msa, ESL_MSA **ret_filteredmsa, int
int *useme = NULL;
double len = 0.0;
int i;
- int nfrags;
int status;
/* min length is cfg->fragfrac * average length */
@@ -539,7 +538,7 @@ remove_fragments(struct cfg_s *cfg, ESL_MSA *msa, ESL_MSA **ret_filteredmsa, int
len *= cfg->fragfrac / (double) msa->nseq;
ESL_ALLOC(useme, sizeof(int) * msa->nseq);
- for (nfrags = 0, i = 0; i < msa->nseq; i++)
+ for (i = 0; i < msa->nseq; i++)
useme[i] = (esl_abc_dsqrlen(msa->abc, msa->ax[i]) < len) ? 0 : 1;
if ((status = esl_msa_SequenceSubset(msa, useme, ret_filteredmsa)) != eslOK) goto ERROR;
@@ -580,7 +579,6 @@ separate_sets(struct cfg_s *cfg, ESL_MSA *msa, int **ret_i_am_train, int **ret_i
int nc = 0;
int c;
int ctrain; /* index of the cluster that becomes the training alignment */
- int ntrain; /* number of seqs in the training alignment */
int nskip;
int i, i2;
int status;
@@ -591,7 +589,6 @@ separate_sets(struct cfg_s *cfg, ESL_MSA *msa, int **ret_i_am_train, int **ret_i
if ((status = esl_msacluster_SingleLinkage(msa, cfg->idthresh1, &assignment, &nin, &nc)) != eslOK) goto ERROR;
ctrain = esl_vec_IArgMax(nin, nc);
- ntrain = esl_vec_IMax(nin, nc);
for (i = 0; i < msa->nseq; i++) i_am_train[i] = (assignment[i] == ctrain) ? 1 : 0;
if ((status = esl_msa_SequenceSubset(msa, i_am_train, &trainmsa)) != eslOK) goto ERROR;
@@ -53,7 +53,6 @@ static ESL_OPTIONS options[] = {
{ "--betaW", eslARG_REAL, "1E-5", NULL, "x>0.",NULL, NULL, NULL, "set tail probability thresh for W calculation to <x>", 0 },
{ "--beta1", eslARG_REAL, "1E-5", NULL, "x>0.",NULL, NULL, NULL, "set tail probability thresh for dmin1/dmax1 to <x>", 0 },
{ "--beta2", eslARG_REAL, "1E-6", NULL, "x>0.",NULL, NULL, NULL, "set tail probability thresh for dmin2/dmax2 to <x>", 0 },
- { "--verbose", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL, NULL, "show output (default: silently return 0 on success)", 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
};
static char usage[] = "[-options] <cmfile> <Z1> <Z2> where width Z1 < Z2.";
@@ -80,7 +79,6 @@ main(int argc, char **argv)
double gbeta1; /* geometric decay constant, truncation error calc */
double gbeta2; /* geometric decay constant, truncation error calc */
double g; /* log of an estimated gamma[n] */
- int be_verbose;
ESL_ALPHABET *abc = NULL;
char errbuf[eslERRBUFSIZE]; /* for error messages */
CM_QDBINFO *qdbinfo1 = NULL; /* holds dmin1/dmax1 and dmin2/dmax2 for first choice of Z */
@@ -95,7 +93,6 @@ main(int argc, char **argv)
betaW = esl_opt_GetReal (go, "--betaW");
beta1 = esl_opt_GetReal (go, "--beta1");
beta2 = esl_opt_GetReal (go, "--beta2");
- be_verbose = esl_opt_GetBoolean(go, "--verbose");
if (Z1 >= Z2) cm_Fail("Please set a width Z1 < width Z2, else the check won't work right.");
View
@@ -76,7 +76,6 @@ cm_alidisplay_Create(CM_t *cm, char *errbuf, CM_ALNDATA *adata, const ESL_SQ *sq
int pos; /* position in growing ali */
int lc, rc; /* indices for left, right pos in consensus */
int symi, symj;
- int d;
char mode;
int lrf, rrf; /* chars in annotation line; left, right */
int lstr, rstr; /* chars in structure line; left, right */
@@ -416,7 +415,6 @@ cm_alidisplay_Create(CM_t *cm, char *errbuf, CM_ALNDATA *adata, const ESL_SQ *sq
lpost = '.'; /* init to gap, if it corresponds to a residue, we'll reset it below */
rpost = '.'; /* init to gap, if it corresponds to a residue, we'll reset it below */
}
- d = tr->emitr[ti] - tr->emitl[ti] + 1;
mode = tr->mode[ti];
/* Calculate four of the six lines: rfline, csline, model, and aseq.
View
@@ -270,7 +270,7 @@ cm_alignT_hb(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit, int
ESL_STACK *pda; /* stack that tracks bifurc parent of a right start */
int v,j,d,i; /* indices for state, j, subseq len */
int k; /* subseq len for bifurcs */
- int z; /* state index */
+ /*int z;*/ /* state index */
int y, yoffset; /* child state y, it's offset */
int bifparent; /* B_st parent */
int b; /* local begin state */
@@ -340,7 +340,7 @@ cm_alignT_hb(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit, int
if (cm->sttype[v] == B_st) {
k = shmx->kshadow[v][jp_v][dp_v]; /* k = offset len of right fragment */
- z = cm->cnum[v];
+ /*z = cm->cnum[v];*/
/* Store info about the right fragment that we'll retrieve later:
*/
@@ -2201,7 +2201,6 @@ cm_OptAccAlign(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit, CM
int sdr; /* StateRightDelta(cm->sttype[v] */
int j_sdr; /* j - sdr */
int d_sd; /* d - sd */
- float tsc; /* a transition score */
int have_el; /* TRUE if CM has local ends on, otherwise FALSE */
/* the DP matrices */
@@ -2244,7 +2243,6 @@ cm_OptAccAlign(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit, CM
/* Main recursion */
for (v = cm->M-1; v >= 0; v--) {
- float const *tsc_v = cm->tsc[v]; /* transition scores for state v */
sd = StateDelta(cm->sttype[v]);
sdr = StateRightDelta(cm->sttype[v]);
@@ -2321,7 +2319,6 @@ cm_OptAccAlign(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit, CM
*/
for (y = cm->cfirst[v]; y < (cm->cfirst[v] + cm->cnum[v]); y++) {
yoffset = y - cm->cfirst[v];
- tsc = tsc_v[yoffset];
j_sdr = 0;
for (j = sdr; j <= L; j++, j_sdr++) {
d_sd = 0;
@@ -3001,7 +2998,6 @@ cm_CYKOutsideAlign(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit
float **esc_vAA; /* ptr to cm->oesc, optimized emission scores */
float escore; /* an emission score, tmp variable */
int voffset; /* index of v in t_v(y) transition scores */
- int emitmode; /* EMITLEFT, EMITRIGHT, EMITPAIR, EMITNONE, for state y */
int sd; /* StateDelta(cm->sttype[y]) */
int sdr; /* StateRightDelta(cm->sttype[y] */
@@ -3111,7 +3107,6 @@ cm_CYKOutsideAlign(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit
if ((cm->flags & CMH_LOCAL_END) && NOT_IMPOSSIBLE(cm->endsc[v])) {
sdr = StateRightDelta(cm->sttype[v]); /* note sdr is for state v */
sd = StateDelta(cm->sttype[v]); /* note sd is for state v */
- emitmode = Emitmode(cm->sttype[v]); /* note emitmode is for state v */
for (j = 0; j <= L; j++) {
for (d = 0; d <= j; d++) {
@@ -4023,7 +4018,6 @@ cm_OutsideAlign(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit, i
float **esc_vAA; /* ptr to cm->oesc, optimized emission scores */
float escore; /* an emission score, tmp variable */
int voffset; /* index of v in t_v(y) transition scores */
- int emitmode; /* EMITLEFT, EMITRIGHT, EMITPAIR, EMITNONE, for state y */
int sd; /* StateDelta(cm->sttype[y]) */
int sdr; /* StateRightDelta(cm->sttype[y] */
@@ -4128,7 +4122,6 @@ cm_OutsideAlign(CM_t *cm, char *errbuf, ESL_DSQ *dsq, int L, float size_limit, i
if ((cm->flags & CMH_LOCAL_END) && NOT_IMPOSSIBLE(cm->endsc[v])) {
sdr = StateRightDelta(cm->sttype[v]); /* note sdr is for state v */
sd = StateDelta(cm->sttype[v]); /* note sd is for state v */
- emitmode = Emitmode(cm->sttype[v]); /* note emitmode is for state v */
for (j = 0; j <= L; j++) {
for (d = 0; d <= j; d++) {
@@ -5196,7 +5189,6 @@ cm_EmitterPosteriorHB(CM_t *cm, char *errbuf, int L, float size_limit, CM_HB_MX
int status;
int v, j, d; /* state, position, subseq length */
int i; /* sequence position */
- int sd; /* StateDelta(v) */
int ip_v; /* offset i in banded matrix */
int ip_v2; /* another offset i in banded matrix */
int jp_v; /* offset j in banded matrix */
@@ -5225,7 +5217,6 @@ cm_EmitterPosteriorHB(CM_t *cm, char *errbuf, int L, float size_limit, CM_HB_MX
* leftwise (l_pp) or rightwise (r_pp).
*/
for(v = 0; v < cm->M; v++) {
- sd = StateDelta(cm->sttype[v]);
if(cm->sttype[v] == MP_st || cm->sttype[v] == ML_st || cm->sttype[v] == IL_st) {
for(j = jmin[v]; j <= jmax[v]; j++) {
jp_v = j - jmin[v];
@@ -5450,7 +5441,7 @@ int
cm_PostCode(CM_t *cm, char *errbuf, int L, CM_EMIT_MX *emit_mx, Parsetree_t *tr, char **ret_ppstr, float *ret_avgp)
{
int status;
- int x, v, i, j, d, r; /* counters */
+ int x, v, i, j, r; /* counters */
char *ppstr; /* the PP string, created here */
float p; /* a probability */
float sum_logp; /* log of summed probability of all residues emitted thus far */
@@ -5464,7 +5455,6 @@ cm_PostCode(CM_t *cm, char *errbuf, int L, CM_EMIT_MX *emit_mx, Parsetree_t *tr,
v = tr->state[x];
i = tr->emitl[x];
j = tr->emitr[x];
- d = j-i+1;
/* Only P, L, R, and EL states have emissions. */
if(cm->sttype[v] == EL_st) { /* EL state, we have to handle this guy special */
@@ -5510,7 +5500,7 @@ int
cm_PostCodeHB(CM_t *cm, char *errbuf, int L, CM_HB_EMIT_MX *emit_mx, Parsetree_t *tr, char **ret_ppstr, float *ret_avgp)
{
int status;
- int x, v, i, j, d, r; /* counters */
+ int x, v, i, j, r; /* counters */
char *ppstr; /* the PP string, created here */
float p; /* a probability */
float sum_logp; /* log of summed probability of all residues emitted thus far */
@@ -5533,7 +5523,6 @@ cm_PostCodeHB(CM_t *cm, char *errbuf, int L, CM_HB_EMIT_MX *emit_mx, Parsetree_t
v = tr->state[x];
i = tr->emitl[x];
j = tr->emitr[x];
- d = j-i+1;
/* Only P, L, R, and EL states have emissions. */
if(cm->sttype[v] == EL_st) { /* EL state, we have to handle this guy special */
View
@@ -9217,7 +9217,6 @@ cm_TrEmitterPosteriorHB(CM_t *cm, char *errbuf, int L, float size_limit, char pr
int status;
int v, j, d; /* state, position, subseq length */
int i; /* sequence position */
- int sd; /* StateDelta(v) */
int fill_L, fill_R; /* do we need to fill Ll_pp/Rr_pp matrices? */
int jp_v; /* j-jmin[v] for current j, and current v */
int jp_v2; /* another offset j in banded matrix */
@@ -9253,7 +9252,6 @@ cm_TrEmitterPosteriorHB(CM_t *cm, char *errbuf, int L, float size_limit, char pr
* leftwise (*l_pp) or rightwise (*r_pp).
*/
for(v = 0; v < cm->M; v++) {
- sd = StateDelta(cm->sttype[v]);
if(cm->sttype[v] == MP_st || cm->sttype[v] == ML_st || cm->sttype[v] == IL_st) {
if(cm->cp9b->Jvalid[v]) {
for(j = jmin[v]; j <= jmax[v]; j++) {
@@ -9588,7 +9586,7 @@ int
cm_TrPostCode(CM_t *cm, char *errbuf, int L, CM_TR_EMIT_MX *emit_mx, Parsetree_t *tr, char **ret_ppstr, float *ret_avgp)
{
int status;
- int x, v, i, j, d, r; /* counters */
+ int x, v, i, j, r; /* counters */
char *ppstr; /* the PP string, created here */
float p; /* a probability */
float sum_logp; /* log of summed probability of all residues emitted thus far */
@@ -9606,7 +9604,6 @@ cm_TrPostCode(CM_t *cm, char *errbuf, int L, CM_TR_EMIT_MX *emit_mx, Parsetree_t
v = tr->state[x];
i = tr->emitl[x];
j = tr->emitr[x];
- d = j-i+1;
mode = tr->mode[x];
/* Only P, L, R, and EL states have emissions. */
@@ -9694,7 +9691,7 @@ int
cm_TrPostCodeHB(CM_t *cm, char *errbuf, int L, CM_TR_HB_EMIT_MX *emit_mx, Parsetree_t *tr, char **ret_ppstr, float *ret_avgp)
{
int status;
- int x, v, i, j, d, r; /* counters */
+ int x, v, i, j, r; /* counters */
char *ppstr; /* the PP string, created here */
float p; /* a probability */
float sum_logp; /* log of summed probability of all residues emitted thus far */
@@ -9721,7 +9718,6 @@ cm_TrPostCodeHB(CM_t *cm, char *errbuf, int L, CM_TR_HB_EMIT_MX *emit_mx, Parset
v = tr->state[x];
i = tr->emitl[x];
j = tr->emitr[x];
- d = j-i+1;
mode = tr->mode[x];
/* Only P, L, R, and EL states have emissions. */
View
@@ -745,7 +745,6 @@ RefCYKScan(CM_t *cm, char *errbuf, CM_SCAN_MX *smx, int qdbidx, ESL_DSQ *dsq, in
int dn_w, dx_w; /* minimum/maximum valid d for state w */
int *dmin; /* [0..v..cm->M-1] minimum d allowed for this state */
int *dmax; /* [0..v..cm->M-1] maximum d allowed for this state */
- int cnum; /* number of children for current state */
int *jp_wA; /* rolling pointer index for B states, gets precalc'ed */
float **init_scAA; /* [0..v..cm->M-1][0..d..W] initial score for each v, d for all j */
double **act; /* [0..j..W-1][0..a..abc->K-1], alphabet count, count of residue a in dsq from 1..jp where j = jp%(W+1) */
@@ -869,7 +868,6 @@ RefCYKScan(CM_t *cm, char *errbuf, CM_SCAN_MX *smx, int qdbidx, ESL_DSQ *dsq, in
jp_v = (cm->stid[v] == BEGL_S) ? (j % (W+1)) : cur;
jp_y = (StateRightDelta(cm->sttype[v]) > 0) ? prv : cur;
sd = StateDelta(cm->sttype[v]);
- cnum = cm->cnum[v];
dn = dnA[v];
dx = dxA[v];
/* if we emit right, precalc score of emitting res j from state v */
@@ -2388,7 +2386,6 @@ RefIInsideScan(CM_t *cm, char *errbuf, CM_SCAN_MX *smx, int qdbidx, ESL_DSQ *dsq
int dn_w, dx_w; /* minimum/maximum valid d for state w */
int *dmin; /* [0..v..cm->M-1] minimum d allowed for this state */
int *dmax; /* [0..v..cm->M-1] maximum d allowed for this state */
- int cnum; /* number of children for current state */
int *jp_wA; /* rolling pointer index for B states, gets precalc'ed */
int **init_scAA; /* [0..v..cm->M-1][0..d..W] initial score for each v, d for all j */
double **act; /* [0..j..W-1][0..a..abc->K-1], alphabet count, count of residue a in dsq from 1..jp where j = jp%(W+1) */
@@ -2512,7 +2509,6 @@ RefIInsideScan(CM_t *cm, char *errbuf, CM_SCAN_MX *smx, int qdbidx, ESL_DSQ *dsq
jp_v = (cm->stid[v] == BEGL_S) ? (j % (W+1)) : cur;
jp_y = (StateRightDelta(cm->sttype[v]) > 0) ? prv : cur;
sd = StateDelta(cm->sttype[v]);
- cnum = cm->cnum[v];
dn = dnA[v];
dx = dxA[v];
/* if we emit right, precalc score of emitting res j from state v */
@@ -2768,7 +2764,6 @@ RefFInsideScan(CM_t *cm, char *errbuf, CM_SCAN_MX *smx, int qdbidx, ESL_DSQ *dsq
int dn_w, dx_w; /* minimum/maximum valid d for state w */
int *dmin; /* [0..v..cm->M-1] minimum d allowed for this state */
int *dmax; /* [0..v..cm->M-1] maximum d allowed for this state */
- int cnum; /* number of children for current state */
int *jp_wA; /* rolling pointer index for B states, gets precalc'ed */
float **init_scAA; /* [0..v..cm->M-1][0..d..W] initial score for each v, d for all j */
double **act; /* [0..j..W-1][0..a..abc->K-1], alphabet count, count of residue a in dsq from 1..jp where j = jp%(W+1) */
@@ -2891,7 +2886,6 @@ RefFInsideScan(CM_t *cm, char *errbuf, CM_SCAN_MX *smx, int qdbidx, ESL_DSQ *dsq
jp_v = (cm->stid[v] == BEGL_S) ? (j % (W+1)) : cur;
jp_y = (StateRightDelta(cm->sttype[v]) > 0) ? prv : cur;
sd = StateDelta(cm->sttype[v]);
- cnum = cm->cnum[v];
dn = dnA[v];
dx = dxA[v];
/* if we emit right, precalc score of emitting res j from state v */
View
@@ -111,7 +111,6 @@ RefTrCYKScan(CM_t *cm, char *errbuf, CM_TR_SCAN_MX *trsmx, int qdbidx, int pass_
int dx_w; /* maximum valid d for state w */
int kn, kx; /* minimum/maximum valid k for current d in B_st recursion */
int *dmax; /* [0..v..cm->M-1] maximum d allowed for this state */
- int cnum; /* number of children for current state */
int *jp_wA; /* rolling pointer index for B states, gets precalc'ed */
float **init_scAA; /* [0..v..cm->M-1][0..d..W] initial score for each v, d for all j */
double **act; /* [0..j..W-1][0..a..abc->K-1], alphabet count, count of residue a in dsq from 1..jp where j = jp%(W+1) */
@@ -260,7 +259,6 @@ RefTrCYKScan(CM_t *cm, char *errbuf, CM_TR_SCAN_MX *trsmx, int qdbidx, int pass_
jp_y = (StateRightDelta(cm->sttype[v]) > 0) ? prv : cur;
jq_y = (StateRightDelta(cm->sttype[v]) > 0) ? cur : prv;
sd = StateDelta(cm->sttype[v]);
- cnum = cm->cnum[v];
/* if we emit right, precalc score of emitting res j from state v */
float esc_j = IMPOSSIBLE;
float rmesc_j = IMPOSSIBLE;
@@ -768,7 +766,6 @@ RefITrInsideScan(CM_t *cm, char *errbuf, CM_TR_SCAN_MX *trsmx, int qdbidx, int p
int dx_y; /* maximum valid d for state y */
int dx_w; /* maximum valid d for state w */
int *dmax; /* [0..v..cm->M-1] maximum d allowed for this state */
- int cnum; /* number of children for current state */
int *jp_wA; /* rolling pointer index for B states, gets precalc'ed */
int **init_scAA; /* [0..v..cm->M-1][0..d..W] initial score for each v, d for all j */
double **act; /* [0..j..W-1][0..a..abc->K-1], alphabet count, count of residue a in dsq from 1..jp where j = jp%(W+1) */
@@ -917,7 +914,6 @@ RefITrInsideScan(CM_t *cm, char *errbuf, CM_TR_SCAN_MX *trsmx, int qdbidx, int p
jp_y = (StateRightDelta(cm->sttype[v]) > 0) ? prv : cur;
jq_y = (StateRightDelta(cm->sttype[v]) > 0) ? cur : prv;
sd = StateDelta(cm->sttype[v]);
- cnum = cm->cnum[v];
/* if we emit right, precalc score of emitting res j from state v */
int esc_j = -INFTY;
int rmesc_j = -INFTY;
View
@@ -1831,7 +1831,7 @@ cm_check_before_detaching(CM_t *cm, int insert1, int insert2)
int ret_val;
int i, yoffset;
int to_detach;
- int to_keep;
+ /*int to_keep;*/
float diff;
ret_val = FALSE;
@@ -1843,15 +1843,15 @@ cm_check_before_detaching(CM_t *cm, int insert1, int insert2)
{
ret_val = TRUE;
to_detach = insert1;
- to_keep = insert2;
+ /*to_keep = insert2;*/
}
if(cm->sttype[insert2+1] == E_st)
{
if(ret_val)
cm_Fail("ERROR: in cm_check_before_detaching() insert1: %d and insert2: %d both map to END_E-1 states.\n", insert1, insert2);
ret_val = TRUE;
to_detach = insert2;
- to_keep = insert1;
+ /*to_keep = insert1;*/
}
/* check to make sure we have 0.0 counts in to_detach */
Oops, something went wrong.

0 comments on commit b6822b6

Please sign in to comment.