Commit 4c5a51d8 authored by Mikaël Salson's avatar Mikaël Salson

Algo: Use unsigned loop variables when needed

That solves signed/unsigned compilation warnings.
This had no effect in practice but that makes the compiler happy.
parent d0ccbacd
......@@ -74,9 +74,9 @@ void comp_matrix::load(string file){
char* tampon=(char*)malloc(windows.size()*sizeof(char));
ifstream in_comp(file.c_str());
for(int i=0; i<windows.size();i++){
for(unsigned int i=0; i<windows.size();i++){
in_comp.read(tampon, windows.size()*sizeof(char));
for(int j=0;j<windows.size(); j++){
for(unsigned int j=0;j<windows.size(); j++){
m[i][j]=tampon[j];
}
}
......@@ -90,7 +90,7 @@ void comp_matrix::save(string file){
ofstream out_comp(file.c_str());
for(int i=0; i<windows.size();i++){
for(unsigned int i=0; i<windows.size();i++){
out_comp.write((char *)m[i],windows.size()*sizeof(char));
}
......@@ -99,7 +99,7 @@ void comp_matrix::save(string file){
void comp_matrix::del(){
for (int i=0;i<windows.size();i++){
for (unsigned int i=0;i<windows.size();i++){
free(m[i]);
}
free(m);
......
......@@ -343,11 +343,11 @@ void DynProg::backtrack()
linkgap = new int[x.size()+1];
gap2 = new int[y.size()+1];
for (int i = 0; i <=x.size(); i++) {
for (unsigned int i = 0; i <=x.size(); i++) {
gap1[i] = 0;
linkgap[i] = 0;
}
for (int i = 0; i <= y.size(); i++) {
for (unsigned int i = 0; i <= y.size(); i++) {
gap2[i] = 0;
}
......
......@@ -197,7 +197,7 @@ void OnlineFasta::next() {
// Compute seq
current.seq = new int[current.sequence.length()];
for (int i=0; i< current.sequence.length(); i++)
for (unsigned int i=0; i< current.sequence.length(); i++)
{
current.seq[i] = nuc_to_int(current.sequence[i]) ;
}
......
......@@ -52,7 +52,7 @@ void LazyMsa::alignOne(string *align, int one){
ostringstream stream;
for (int i=0; i<ref.size(); i++){
for (unsigned int i=0; i<ref.size(); i++){
for (int j=0; j<gapRef[one][i] ; j++){
stream <<"-";
}
......@@ -66,7 +66,7 @@ void LazyMsa::alignOne(string *align, int one){
ostringstream stream2;
for (int i=0; i<sequences[one].size(); i++){
for (unsigned int i=0; i<sequences[one].size(); i++){
for (int j=0; j<gapSeq[one][i] ; j++){
stream2 <<"-";
}
......@@ -84,19 +84,19 @@ void LazyMsa::align(string *align){
int *maxGap= new int [ref.size()+1];
for (int i = 0; i< ref.size()+1; i++){
for (unsigned int i = 0; i< ref.size()+1; i++){
maxGap[i]=0;
}
for (int i=0; i<sizeUsed+1; i++){
for (int j=0; j<ref.size()+1; j++){
for (unsigned int j=0; j<ref.size()+1; j++){
if ( gapRef[i][j] > maxGap[j] ) maxGap[j]=gapRef[i][j];
}
}
ostringstream stream;
for (int i=0; i<ref.size(); i++){
for (unsigned int i=0; i<ref.size(); i++){
for (int j=0; j<maxGap[i] ; j++){
stream <<"-";
}
......@@ -111,11 +111,11 @@ void LazyMsa::align(string *align){
for (int i=0; i<sizeUsed+1; i++){
ostringstream stream2;
for (int j = 0; j< ref.size()+1; j++){
for (unsigned int j = 0; j< ref.size()+1; j++){
gapSeq[i][link[i][j]]+=maxGap[j]-gapRef[i][j];
}
for (int j=0; j<sequences[i].size(); j++){
for (unsigned int j=0; j<sequences[i].size(); j++){
for (int k=0; k<gapSeq[i][j] ; k++){
stream2 <<"-";
}
......
......@@ -29,7 +29,7 @@ vector<int> WindowsStorage::getStatus(junction window) {
JsonList WindowsStorage::statusToJson(junction window) {
JsonList result;
for (int i=0; i<status_by_window[window].size(); i++){
for (unsigned int i=0; i<status_by_window[window].size(); i++){
if (status_by_window[window][i] !=0){
ostringstream oss;
oss << 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