From 96f6da0bb376f8e45654a506df3639c8a8fdf48b Mon Sep 17 00:00:00 2001 From: ponchio Date: Wed, 1 Dec 2004 03:25:58 +0000 Subject: [PATCH] Windows port. --- apps/nexus/vchain.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/nexus/vchain.cpp b/apps/nexus/vchain.cpp index f04f849d..776e179e 100644 --- a/apps/nexus/vchain.cpp +++ b/apps/nexus/vchain.cpp @@ -15,7 +15,7 @@ bool VChain::Save(const string &file) { unsigned int nlevels = size(); fwrite(&nlevels, sizeof(unsigned int), 1, fp); - for(int i = 0; i < nlevels; i++) { + for(unsigned int i = 0; i < nlevels; i++) { VPartition &level = operator[](i); unsigned int npoints = level.size(); fwrite(&npoints, sizeof(unsigned int), 1, fp); @@ -26,24 +26,24 @@ bool VChain::Save(const string &file) { unsigned int nfrag = newfragments.size(); fwrite(&nfrag, sizeof(unsigned int), 1, fp); - std::map >::iterator i; - for(i = newfragments.begin(); i != newfragments.end(); i++) { - unsigned int n = (*i).second.size(); - fwrite(&((*i).first), sizeof(unsigned int), 1, fp); + std::map >::iterator j; + for(j = newfragments.begin(); j != newfragments.end(); j++) { + unsigned int n = (*j).second.size(); + fwrite(&((*j).first), sizeof(unsigned int), 1, fp); fwrite(&n, sizeof(unsigned int), 1, fp); set::iterator k; - for(k = (*i).second.begin(); k != (*i).second.end(); k++) + for(k = (*j).second.begin(); k != (*j).second.end(); k++) fwrite(&*k, sizeof(unsigned int), 1, fp); } nfrag = oldfragments.size(); fwrite(&nfrag, sizeof(unsigned int), 1, fp); - for(i = oldfragments.begin(); i != oldfragments.end(); i++) { - unsigned int n = (*i).second.size(); - fwrite(&((*i).first), sizeof(unsigned int), 1, fp); + for(j = oldfragments.begin(); j != oldfragments.end(); j++) { + unsigned int n = (*j).second.size(); + fwrite(&((*j).first), sizeof(unsigned int), 1, fp); fwrite(&n, sizeof(unsigned int), 1, fp); set::iterator k; - for(k = (*i).second.begin(); k != (*i).second.end(); k++) + for(k = (*j).second.begin(); k != (*j).second.end(); k++) fwrite(&*k, sizeof(unsigned int), 1, fp); } fclose(fp); @@ -58,7 +58,7 @@ bool VChain::Load(const string &file) { } unsigned int nlevels; fread(&nlevels, sizeof(unsigned int), 1, fp); - for(int i = 0; i < nlevels; i++) { + for(unsigned int i = 0; i < nlevels; i++) { push_back(VPartition()); VPartition &level = back();