Skip to content

Commit

Permalink
warnings on unused variables, initialisation of structures
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentnoe committed Nov 30, 2014
1 parent edba5ec commit 7dad282
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
22 changes: 11 additions & 11 deletions genome_map.c
Expand Up @@ -236,7 +236,7 @@ static inline ScoreType genome_map__get_sorted_score(GenomeMapType* genome_map,
}

static inline void genome_map__radix_sort_reads(GenomeMapType* genome_map) {
int i = 0;
unsigned int i = 0;
#define BITS_IN_DIGIT 4
#define BUCKETS (1 << (BITS_IN_DIGIT))
#define DIGITS ((sizeof(ScoreType) * 8) / BITS_IN_DIGIT)
Expand Down Expand Up @@ -290,7 +290,7 @@ static inline void genome_map__radix_sort_reads(GenomeMapType* genome_map) {
* then the reference code is returned.
* Otherwise, the first code with the highest number of appearances is returned.
*/
inline int genome_map__get_direct_consensus_code(const GenomeMapType* genome_map, const int ref_id, const int ref_pos, const int offset, const int reference_code, const ScoreType match, const ScoreType mismatch) {
inline int genome_map__get_direct_consensus_code(const GenomeMapType* genome_map, const int ref_id, const int ref_pos, const int offset, const int reference_code) {

/* no read mapped : set to the "reference" code */
if (genome_map->g_maps[ref_id][ref_pos] == NULL) {
Expand Down Expand Up @@ -333,15 +333,15 @@ inline int genome_map__get_direct_consensus_code(const GenomeMapType* genome_map

CODE_TYPE crt_checksum = CODE_IDENTITY;

inline int genome_map__get_consensus_color(const GenomeMapType* genome_map, const int ref_id, const int ref_pos, const int offset, const int reference_color, const ScoreType match, const ScoreType mismatch) {
inline int genome_map__get_consensus_color(const GenomeMapType* genome_map, const int ref_id, const int ref_pos, const int offset, const int reference_color) {

int best_color = reference_color;
CODE_TYPE checksum = crt_checksum;

int window = 0;
int fwd_i = ref_pos, fwd_j = offset;

best_color = genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, offset, reference_color, match, mismatch);
best_color = genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, offset, reference_color);

if (best_color != reference_color) {

Expand All @@ -360,7 +360,7 @@ inline int genome_map__get_consensus_color(const GenomeMapType* genome_map, cons
while (window < FORWARD_WINDOW_SIZE) {
++fwd_j;
if (fwd_j >= genome_map->hitmap->indel_count ||
genome_map__get_direct_consensus_code(genome_map, ref_id, fwd_i, fwd_j, GENOME_MAP_NO_CODE, match, mismatch) == GENOME_MAP_NO_CODE) {
genome_map__get_direct_consensus_code(genome_map, ref_id, fwd_i, fwd_j, GENOME_MAP_NO_CODE) == GENOME_MAP_NO_CODE) {
fwd_j = -1;
++fwd_i;
}
Expand All @@ -374,11 +374,11 @@ inline int genome_map__get_consensus_color(const GenomeMapType* genome_map, cons
COMPOSE_SAFE(
NTH_CODE(genome_map->ref_dbs[ref_id].sequence, fwd_i),
genome_map__get_direct_consensus_code(
genome_map, ref_id, fwd_i, -1, NTH_CODE(genome_map->ref_dbs[ref_id].sequence, fwd_i), match, mismatch)));
genome_map, ref_id, fwd_i, -1, NTH_CODE(genome_map->ref_dbs[ref_id].sequence, fwd_i))));
} else {
checksum = COMPOSE_SAFE(
checksum,
genome_map__get_direct_consensus_code(genome_map, ref_id, fwd_i, fwd_j, GENOME_MAP_NO_CODE, match, mismatch));
genome_map__get_direct_consensus_code(genome_map, ref_id, fwd_i, fwd_j, GENOME_MAP_NO_CODE));
}
if(checksum == CODE_IDENTITY) {
break;
Expand Down Expand Up @@ -455,14 +455,14 @@ ScoreType genome_map__compute_adjusted_score(GenomeMapType* genome_map, int read
{
CODE_TYPE ref_code = NTH_CODE(genome_map->ref_dbs[ref_id].sequence, ref_pos);
score += (ref_code ==
genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, -1, ref_code, match, mismatch)) ? match : mismatch;
genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, -1, ref_code)) ? match : mismatch;
++ref_pos;
indel = 0;
}
break;

case TRACEBACK_PAIR_READ_DELETION :
score += (genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, -1, GENOME_MAP_NO_CODE, match, mismatch)
score += (genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, -1, GENOME_MAP_NO_CODE)
== GENOME_MAP_NO_CODE) ? match : mismatch;
++ref_pos;
indel = 0;
Expand All @@ -475,7 +475,7 @@ ScoreType genome_map__compute_adjusted_score(GenomeMapType* genome_map, int read
{
CODE_TYPE read_code = (traceback_cell & TRACEBACK_CODE_MASK);
score += (read_code ==
genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, -1, read_code, match, mismatch)) ? match : mismatch;
genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, -1, read_code)) ? match : mismatch;
++ref_pos;
indel = 0;
}
Expand All @@ -485,7 +485,7 @@ ScoreType genome_map__compute_adjusted_score(GenomeMapType* genome_map, int read
{
CODE_TYPE read_code = (traceback_cell & TRACEBACK_CODE_MASK);
score += (read_code ==
genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, indel, read_code, match, mismatch)) ? match : mismatch;
genome_map__get_direct_consensus_code(genome_map, ref_id, ref_pos, indel, read_code)) ? match : mismatch;
++indel;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion index.c
Expand Up @@ -240,7 +240,7 @@ inline int index__get_extern_next_hit(const IndexType *index, const int key, int
#endif /* ndef DISABLE_CONTIG_INDEX */
}

inline int index__get_extern_current_hit (const IndexType *index, const int key, const int *hit_pointer) {
inline int index__get_extern_current_hit (const IndexType *index, const int *hit_pointer) {
#ifdef DISABLE_CONTIG_INDEX
return *hit_pointer ;
#else
Expand Down
2 changes: 1 addition & 1 deletion index.h
Expand Up @@ -71,7 +71,7 @@ int index__get_extern_next_hit(const IndexType *index, const int key, int* hit_p
* @return The position -- in the reference database -- of the subsequence
* corresponding to the key
*/
int index__get_extern_current_hit (const IndexType *index, const int key, const int *hit_pointer);
int index__get_extern_current_hit (const IndexType *index, const int *hit_pointer);

/**
* Destroy an indexed
Expand Down
2 changes: 1 addition & 1 deletion main.c
Expand Up @@ -438,7 +438,7 @@ int main (int argc, char* argv[]) {
if (quality) {
VERB_FILTER(VERBOSITY_MODERATE, MESSAGE__("%s\n", quality););
}
single_alignment(read, reference, reference_masked, quality, match, mismatch, gap_open, gap_extend, allowed_indels, simd_allowed_diags, output);
single_alignment(read, reference, reference_masked, quality, match, mismatch, gap_open, gap_extend, allowed_indels, output);
} else if (reads_file) {
if (genome_file) {
VERB_FILTER(VERBOSITY_MODERATE, MESSAGE__("\n\nAligning reads against reference.\nInput files: %s, %s, %s.\n\n", genome_file, reads_file, qual_file?qual_file:"(null)"););
Expand Down
10 changes: 7 additions & 3 deletions run.c
Expand Up @@ -244,7 +244,7 @@ int PRINT_ALL_READS = 0;
* @param output The output file descriptor
*/
int single_alignment(const char* read_str, const char* ref_str, const char* ref_masked_str, const char* qual_str,
const ScoreType match, const ScoreType mismatch, const ScoreType gap_open, const ScoreType gap_extend, const int allowed_indels, const int simd_allowed_diags,
const ScoreType match, const ScoreType mismatch, const ScoreType gap_open, const ScoreType gap_extend, const int allowed_indels,
FILE* output) {
CODE_TYPE* read = string_to_code(read_str);
CODE_TYPE* ref = string_to_code(ref_str);
Expand Down Expand Up @@ -356,7 +356,7 @@ int single_alignment(const char* read_str, const char* ref_str, const char* ref_
} \
}

#define ALIGNMENT__RESET_READ(read, quality) { \
#define ALIGNMENT__RESET_READ(read, quality) { \
alignment__reset_with_compressed_read(&alignment[_ogtn], read, quality); \
}

Expand All @@ -381,7 +381,11 @@ int single_alignment(const char* read_str, const char* ref_str, const char* ref_
#else

/* Heap/Key/Hit Structures for each process */
#define HEAP_KEY_HIT_REVSEQ__DECLARE HitType * heap = NULL; int ** key = NULL; int ** hit_pointer = NULL; ReadDataType tmp_sequence = {0};
#ifndef NUCLEOTIDES
#define HEAP_KEY_HIT_REVSEQ__DECLARE HitType * heap = NULL; int ** key = NULL; int ** hit_pointer = NULL; ReadDataType tmp_sequence = {.info = NULL, .first_base = 0, .first_qual = 0, .quality = NULL, .sequence = NULL, .tag = 0};
#else
#define HEAP_KEY_HIT_REVSEQ__DECLARE HitType * heap = NULL; int ** key = NULL; int ** hit_pointer = NULL; ReadDataType tmp_sequence = {.info = NULL, .quality = NULL, .sequence = NULL, .tag = 0};
#endif

#define HEAP_KEY_HIT_REVSEQ__ALLOC(__heap_size__,__nb_seeds__,__read_len__) { \
SAFE_FAILURE__ALLOC(heap, __heap_size__, HitType); \
Expand Down
2 changes: 1 addition & 1 deletion run.h
Expand Up @@ -8,7 +8,7 @@
#include "genome_map.h"

int single_alignment(const char* read_str, const char* ref_str, const char* ref_masked_str, const char* qual_str,
const ScoreType match, const ScoreType mismatch, const ScoreType gap_open, const ScoreType gap_extend, const int allowed_indels, const int simd_allowed_diags,
const ScoreType match, const ScoreType mismatch, const ScoreType gap_open, const ScoreType gap_extend, const int allowed_indels,
FILE* output);

int reads_against_references(const char* reads_filename, const char* qual_filename, const char* ref_filename,
Expand Down

0 comments on commit 7dad282

Please sign in to comment.