Commit c1109649 authored by Mikaël Salson's avatar Mikaël Salson

algo: Remove compilation warnings due to signed/unsigned comparisons

parent b469295a
......@@ -117,7 +117,7 @@ int main(int argc, char* argv[])
reads = fa.getAll();
list<string> labels;
for (int i=0; i < reads.size(); i++) {
for (size_t i=0; i < reads.size(); i++) {
labels.push_back(fa.label(i));
}
......
......@@ -39,7 +39,7 @@ unsigned long long filesize(const char* filename)
return in.tellg();
}
void Fasta::init(int extract_field, string extract_separator, int mark_pos)
void Fasta::init(int extract_field, string extract_separator, size_t mark_pos)
{
this -> extract_field = extract_field ;
this -> extract_separator = extract_separator ;
......@@ -108,7 +108,7 @@ void Fasta::add(Sequence seq) {
}
int Fasta::size() const{ return (int)reads.size(); }
int Fasta::totalSize() const { return total_size ; }
size_t Fasta::totalSize() const { return total_size ; }
list<Sequence> Fasta::getAll() const {
list<Sequence> reads;
......@@ -235,7 +235,7 @@ void OnlineFasta::addLineToCurrentSequence(string line)
current.sequence += c;
if (mark_pos) {
if (current.sequence.length() + current_gaps == mark_pos)
if ((int) current.sequence.length() + current_gaps == mark_pos)
current.marked_pos = current.sequence.length();
}
}
......
......@@ -17,7 +17,7 @@ typedef struct read_t
string sequence; // Sequence: original string representation
string quality;
int* seq; // Sequence: seq representation
int marked_pos; // Some marked position in the sequence
size_t marked_pos; // Some marked position in the sequence
} Sequence;
typedef enum {
......@@ -32,9 +32,9 @@ unsigned long long filesize(const char* filename);
class Fasta
{
void init(int extract_field, string extract_separator, int mark_pos=0);
void init(int extract_field, string extract_separator, size_t mark_pos=0);
int total_size;
size_t total_size;
int extract_field;
int mark_pos;
string extract_separator;
......@@ -59,7 +59,7 @@ public:
string name;
string basename;
int size() const;
int totalSize() const;
size_t totalSize() const;
/**
* Get all the sequences from the FASTA file
......
......@@ -44,7 +44,7 @@ protected:
int s; // span of the seed (s >= k)
string seed ;
size_t nb_kmers_inserted;
int max_size_indexing;
size_t max_size_indexing;
public:
......
......@@ -103,7 +103,7 @@ string AlignBox::refToString(int from, int to) {
if (i == start)
s << color;
if (j > 0 && j <= ref.size())
if (j > 0 && (size_t)j <= ref.size())
s << ref[j-1] ;
else
s << ".";
......@@ -684,7 +684,7 @@ string check_and_resolve_overlap(string seq, int seq_begin, int seq_end,
int trim_l[overlap+1];
int trim_r[overlap+1];
for(int i=0; i<=overlap; i++) {
for(size_t i=0; i<=(size_t)overlap; i++) {
score_l[i] = i < seq_left.size() ? dp_l.best_score_on_i(seq_left.size() - i, trim_l + i) : MINUS_INF ;
score_r[i] = i < seq_right.size() ? dp_r.best_score_on_i(seq_right.size() - i, trim_r + i) : MINUS_INF ;
}
......
......@@ -139,7 +139,7 @@ int dna_to_int(const string &word, int size) {
string nuc_to_aa(const string &word) {
string aa;
int index_word = 0;
int i = 0;
size_t i = 0;
for (; i < word.length() ; i++) {
index_word = (index_word << 2) | nuc_to_int(word[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment