Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple of unused value warnings when built with NDEBUG #1688

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cram/cram_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,13 @@ int cram_index_build(cram_fd *fd, const char *fn_base, const char *fn_idx) {
return -1;
}

cpos = htell(fd->fp);
assert(cpos == hpos + c->length);
off_t next_cpos = htell(fd->fp);
if (next_cpos != hpos + c->length) {
hts_log_error("Length %"PRId32" in container header at offset %lld does not match block lengths (%lld)",
c->length, (long long) cpos, (long long) next_cpos - hpos);
return -1;
}
cpos = next_cpos;

cram_free_container(c);
}
Expand Down
3 changes: 2 additions & 1 deletion cram/cram_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ void cram_stats_dump(cram_stats *st) {
* Returns the best codec to use.
*/
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 nvals, i, max_val = 0, min_val = INT_MAX;
int *vals = NULL, *freqs = NULL, vals_alloc = 0;
int ntot HTS_UNUSED = 0;

#if DEBUG_CRAM_STATS
cram_stats_dump(st);
Expand Down