Skip to content
Permalink
Browse files

Appeasement of new gcc6 --Wmisleading-indentation warning.

  • Loading branch information...
cryptogenomicon committed Jun 1, 2017
1 parent 69e3299 commit ee0d671bcb09c8a2130c4788e1681ef8303f6720
Showing with 64 additions and 47 deletions.
  1. +6 −3 esl_buffer.c
  2. +10 −8 esl_huffman.c
  3. +8 −4 esl_msafile_clustal.c
  4. +8 −4 esl_msafile_psiblast.c
  5. +32 −28 esl_sq.c
@@ -3077,9 +3077,12 @@ example_read_fasta(ESL_BUFFER *bf, char **ret_name, char **ret_desc, char **ret_
return eslOK;

ERROR:
if (seqname) free(seqname); *ret_name = NULL;
if (seqdesc) free(seqdesc); *ret_desc = NULL;
if (seq) free(seq); *ret_seq = NULL;
if (seqname) free(seqname);
if (seqdesc) free(seqdesc);
if (seq) free(seq);
*ret_name = NULL;
*ret_desc = NULL;
*ret_seq = NULL;
*ret_seqlen = 0;
return status;
}
@@ -346,14 +346,16 @@ esl_huffman_Dump(FILE *fp, ESL_HUFFMAN *hc)

/* Decoding table (if set) */
if (hc->dt_len)
fprintf(fp, "Decoding table:\n");
for (d = 0; d < hc->D; d++)
{
L = hc->dt_len[d];
fprintf(fp, "L=%2d r=%3d (%3d) ", L, hc->dt_rank[d], hc->sorted_at[hc->dt_rank[d]]);
dump_uint32(fp, hc->dt_lcode[d], eslHUFFMAN_MAXCODE);
fputc('\n', fp);
}
{
fprintf(fp, "Decoding table:\n");
for (d = 0; d < hc->D; d++)
{
L = hc->dt_len[d];
fprintf(fp, "L=%2d r=%3d (%3d) ", L, hc->dt_rank[d], hc->sorted_at[hc->dt_rank[d]]);
dump_uint32(fp, hc->dt_lcode[d], eslHUFFMAN_MAXCODE);
fputc('\n', fp);
}
}

return eslOK;
}
@@ -230,11 +230,15 @@ esl_msafile_clustal_Read(ESL_MSAFILE *afp, ESL_MSA **ret_msa)
do { /* afp->line, afp->n is now the first line of a block... */
idx = 0;
do {
for (pos = 0; pos < n; pos++) if (! isspace(p[pos])) break; name_start = pos;
for (pos = pos+1; pos < n; pos++) if ( isspace(p[pos])) break; name_len = pos - name_start;
for (pos = pos+1; pos < n; pos++) if (! isspace(p[pos])) break; seq_start = pos;
for (pos = 0; pos < n; pos++) if (! isspace(p[pos])) break;
name_start = pos;
for (pos = pos+1; pos < n; pos++) if ( isspace(p[pos])) break;
name_len = pos - name_start;
for (pos = pos+1; pos < n; pos++) if (! isspace(p[pos])) break;
seq_start = pos;
if (pos >= n) ESL_XFAIL(eslEFORMAT, afp->errmsg, "invalid alignment line");
for (pos = pos+1; pos < n; pos++) if ( isspace(p[pos])) break; seq_len = pos - seq_start; /* expect one block; ignore trailing stuff, inc. optional coords */
for (pos = pos+1; pos < n; pos++) if ( isspace(p[pos])) break;
seq_len = pos - seq_start; /* expect one block; ignore trailing stuff, inc. optional coords */

if (idx == 0) {
block_seq_start = seq_start;
@@ -211,11 +211,15 @@ esl_msafile_psiblast_Read(ESL_MSAFILE *afp, ESL_MSA **ret_msa)
do { /* while in the file... */
idx = 0;
do { /* while in a block... */
for (pos = 0; pos < afp->n; pos++) if (! isspace(afp->line[pos])) break; name_start = pos;
for (pos = pos+1; pos < afp->n; pos++) if ( isspace(afp->line[pos])) break; name_len = pos - name_start;
for (pos = pos+1; pos < afp->n; pos++) if (! isspace(afp->line[pos])) break; seq_start = pos;
for (pos = 0; pos < afp->n; pos++) if (! isspace(afp->line[pos])) break;
name_start = pos;
for (pos = pos+1; pos < afp->n; pos++) if ( isspace(afp->line[pos])) break;
name_len = pos - name_start;
for (pos = pos+1; pos < afp->n; pos++) if (! isspace(afp->line[pos])) break;
seq_start = pos;
if (pos >= afp->n) ESL_XFAIL(eslEFORMAT, afp->errmsg, "invalid alignment line");
for (pos = afp->n-1; pos > 0; pos--) if (! isspace(afp->line[pos])) break; seq_len = pos - seq_start + 1;
for (pos = afp->n-1; pos > 0; pos--) if (! isspace(afp->line[pos])) break;
seq_len = pos - seq_start + 1;

if (idx == 0) {
block_seq_start = seq_start;
@@ -1898,12 +1898,17 @@ esl_sq_FetchFromMSA(const ESL_MSA *msa, int which, ESL_SQ **ret_sq)
ESL_ALLOC(sq->xr, sizeof(char *) * sq->nxr); for (x = 0; x < sq->nxr; x ++) sq->xr[x] = NULL;
for (x = 0; x < sq->nxr; x ++) {
if (xr[x] != NULL) {
if (sq->xr[x] == NULL) {
ESL_ALLOC(sq->xr[x], sizeof(char) * (sq->n+2));
sq->xr[x][0] = '\0';
strcpy(sq->xr[x]+1, xr[x]);
}
else strcpy(sq->xr[x]+1, xr[x]); sq->xr[x][0] = '\0';
if (sq->xr[x] == NULL)
{
ESL_ALLOC(sq->xr[x], sizeof(char) * (sq->n+2));
sq->xr[x][0] = '\0';
strcpy(sq->xr[x]+1, xr[x]);
}
else
{
strcpy(sq->xr[x]+1, xr[x]);
sq->xr[x][0] = '\0';
}
esl_abc_CDealign(sq->abc, sq->xr[x]+1, sq->dsq, NULL);
}
if (xr_tag[x] != NULL) {
@@ -1931,7 +1936,8 @@ esl_sq_FetchFromMSA(const ESL_MSA *msa, int which, ESL_SQ **ret_sq)

ERROR:
if (msa->ngr > 0) {
if (xr_tag != NULL) free(xr_tag); if (xr != NULL) free(xr);
if (xr_tag) free(xr_tag);
if (xr) free(xr);
}
esl_sq_Destroy(sq);
*ret_sq = NULL;
@@ -2481,11 +2487,10 @@ utest_ExtraResMarkups()
esl_msafile_Open(&abc, tmpfile, NULL, eslMSAFILE_STOCKHOLM, NULL, &afp1);
esl_msafile_stockholm_Read(afp1, &msa1);

sq = esl_sq_CreateDigital(abc);
if (esl_sq_GetFromMSA(msa1, 0, sq) != eslOK) esl_fatal(msg); esl_sq_Reuse(sq);
if (esl_sq_GetFromMSA(msa1, 1, sq) != eslOK) esl_fatal(msg); esl_sq_Reuse(sq);
if (esl_sq_GetFromMSA(msa1, 2, sq) != eslOK) esl_fatal(msg); esl_sq_Reuse(sq);
if (esl_sq_GetFromMSA(msa1, 5, sq) != eslOK) esl_fatal(msg);
sq = esl_sq_CreateDigital(abc); if (esl_sq_GetFromMSA(msa1, 0, sq) != eslOK) esl_fatal(msg);
esl_sq_Reuse(sq); if (esl_sq_GetFromMSA(msa1, 1, sq) != eslOK) esl_fatal(msg);
esl_sq_Reuse(sq); if (esl_sq_GetFromMSA(msa1, 2, sq) != eslOK) esl_fatal(msg);
esl_sq_Reuse(sq); if (esl_sq_GetFromMSA(msa1, 5, sq) != eslOK) esl_fatal(msg);

/* test of sq_Copy */
sq1 = esl_sq_Create();
@@ -2494,28 +2499,27 @@ utest_ExtraResMarkups()
esl_sq_Copy(sq, sq2);
esl_sq_Destroy(sq1);
esl_sq_Destroy(sq2);

esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa1, 0, &sq) != eslOK) esl_fatal(msg);
esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa1, 1, &sq) != eslOK) esl_fatal(msg);
esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa1, 2, &sq) != eslOK) esl_fatal(msg);
esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa1, 5, &sq) != eslOK) esl_fatal(msg);
esl_sq_Destroy(sq);

if (esl_sq_FetchFromMSA(msa1, 0, &sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);
if (esl_sq_FetchFromMSA(msa1, 1, &sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);
if (esl_sq_FetchFromMSA(msa1, 2, &sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);
if (esl_sq_FetchFromMSA(msa1, 5, &sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);


/* Text msa to text sq */
esl_msafile_Open(NULL, tmpfile, NULL, eslMSAFILE_STOCKHOLM, NULL, &afp2);
esl_msafile_stockholm_Read(afp2, &msa2);

sq = esl_sq_Create();
if (esl_sq_GetFromMSA(msa2, 0, sq) != eslOK) esl_fatal(msg); esl_sq_Reuse(sq);
if (esl_sq_GetFromMSA(msa2, 1, sq) != eslOK) esl_fatal(msg); esl_sq_Reuse(sq);
if (esl_sq_GetFromMSA(msa2, 2, sq) != eslOK) esl_fatal(msg); esl_sq_Reuse(sq);
if (esl_sq_GetFromMSA(msa2, 5, sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);

if (esl_sq_FetchFromMSA(msa2, 0, &sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);
if (esl_sq_FetchFromMSA(msa2, 1, &sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);
if (esl_sq_FetchFromMSA(msa2, 2, &sq) != eslOK) esl_fatal(msg); esl_sq_Destroy(sq);
if (esl_sq_FetchFromMSA(msa2, 5, &sq) != eslOK) esl_fatal(msg);
sq = esl_sq_Create(); if (esl_sq_GetFromMSA(msa2, 0, sq) != eslOK) esl_fatal(msg);
esl_sq_Reuse(sq); if (esl_sq_GetFromMSA(msa2, 1, sq) != eslOK) esl_fatal(msg);
esl_sq_Reuse(sq); if (esl_sq_GetFromMSA(msa2, 2, sq) != eslOK) esl_fatal(msg);
esl_sq_Reuse(sq); if (esl_sq_GetFromMSA(msa2, 5, sq) != eslOK) esl_fatal(msg);

esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa2, 0, &sq) != eslOK) esl_fatal(msg);
esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa2, 1, &sq) != eslOK) esl_fatal(msg);
esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa2, 2, &sq) != eslOK) esl_fatal(msg);
esl_sq_Destroy(sq); if (esl_sq_FetchFromMSA(msa2, 5, &sq) != eslOK) esl_fatal(msg);

/* test of sq_Copy */
sq1 = esl_sq_Create();
sq2 = esl_sq_CreateDigital(abc);

0 comments on commit ee0d671

Please sign in to comment.
You can’t perform that action at this time.