From: Morten Kjeldgaard <mok@bioxray.au.dk>
Subject: modification to source code


--- a/src/Mol.cpp
+++ b/src/Mol.cpp
@@ -16,7 +16,7 @@
 #include "Mol.h"
 #include "HardSettings.h"
 
-#include "Progress.h"
+#include "progress.h"
 #include "AtomColor.h"
 
 #include "MyCanvas.h"
@@ -112,12 +112,12 @@
     
 
   // assign texture positions
-  for (int i=0; i<atom.size(); i++) {
+  for (int i=0; i < (int)atom.size(); i++) {
     if (!atom[i].AssignNextTextPos( textsize )) return false;
   }
 
   if (sticks)
-  for (int i=0; i<bond.size(); i++) {
+    for (int i=0; i < (int)bond.size(); i++) {
     if (!bond[i].AssignNextTextPos( textsize )) return false;
   }
     
@@ -217,8 +217,8 @@
   
   dir=(a-b).Normalize();
   
-  float rada= _a.covalentr;
-  float radb= _b.covalentr;
+  //float rada= _a.covalentr;
+  //float radb= _b.covalentr;
   
   /*a-=dir*(rada*0.60);
   b+=dir*(radb*0.60);*/
@@ -266,21 +266,21 @@
 
   bool showprogress=atom.size()>2000;
   
-  if (showprogress) StartProgress("Locating Bonds",atom.size() );
+  if (showprogress) StartProgress((char *)"Locating Bonds",atom.size() );
   
   // Sort atoms per x coordinate
   std::sort( atom.begin(), atom.end() );
   
   
   int st=0; // start interval
-  for (int i=0; i<atom.size(); i++) {
+  for (int i=0; i < (int)atom.size(); i++) {
     if (showprogress) if (i%100) if (!UpdateProgress(i)) {
       bond.clear();
       //SetSpaceFill();
       return;
     };
     float px=atom[i].px;
-    for (int j=st; j<atom.size(); j++) {
+    for (int j=st; j < (int)atom.size(); j++) {
       if (atom[j].px < px-MAXD) st=j; // move interval forward
       else if (atom[j].px > px ) break; // no more atoms
       else {
@@ -300,7 +300,7 @@
     
   
   if (showprogress) EndProgress();
-  printf("%d bonds detected!\n",bond.size() );
+  printf("%d bonds detected!\n", (int)bond.size() );
 }
 
 void Mol::SetSpaceFill(){
@@ -309,7 +309,7 @@
 
   ReassignTextureAutosize();
   
-  for (int i=0; i<atom.size(); i++)  atom[i].r=atom[i].spacefillr;
+  for (int i=0; i < (int)atom.size(); i++)  atom[i].r=atom[i].spacefillr;
 }
 
 void Mol::SetBallAndSticks(float radius){
@@ -323,7 +323,7 @@
     
   ReassignTextureAutosize();
   
-  for (int i=0; i<atom.size(); i++) {
+  for (int i=0; i < (int)atom.size(); i++) {
     atom[i].r=atom[i].covalentr;
     if (atom[i].r<radius)  atom[i].r=radius;
   }
@@ -341,7 +341,7 @@
 
   ReassignTextureAutosize();
     
-  for (int i=0; i<atom.size(); i++)  atom[i].r=radius;
+  for (int i=0; i < (int)atom.size(); i++)  atom[i].r=radius;
   stick_radius=radius;
 }
 
@@ -352,7 +352,7 @@
     tx1=atom[0].trp[0]+atom[0].r;
     ty0=atom[0].trp[1]-atom[0].r;
     ty1=atom[0].trp[1]+atom[0].r;
-    for (int i=1; i<atom.size(); i++) {
+    for (int i=1; i < (int)atom.size(); i++) {
       atom[i].Transform(ax,ay,az);
       // update bounding box
       if (atom[i].trp[0]-atom[i].r<tx0) tx0=atom[i].trp[0]-atom[i].r;
@@ -364,7 +364,7 @@
 } 
 
 void Mol::DuplicateTexels(vector<Byte> &t, int texsize){
-    for (int i=0; i<atom.size(); i++) {
+  for (int i=0; i < (int)atom.size(); i++) {
       atom[i].s.DuplicateTexels(t, texsize, atom[i].tx, atom[i].ty);
     }
 }
@@ -397,7 +397,7 @@
   int startAtom=atoi( st.substr(6,5).c_str());
 	// assert(startAtom >0 && (startAtom-1)<atom.size());  // this assert cannot be used anymore from a static method
 	int i=1;
-	while(st.size()>6+i*5+4 && isdigit(st[6+i*5+4]))
+	while((int)st.size() > 6+i*5+4 && isdigit(st[6+i*5+4]))
 	{
 	 //	printf("'%s' -> '%s' (%c)\n",st.substr(6,5).c_str(),st.substr(6+i*5,5).c_str(),st[6+i*5+4]);
 	 int secondAtom=atoi( st.substr(6+i*5,5).c_str());
@@ -427,7 +427,7 @@
     if (fseek(f, 0, SEEK_END)==0) size=ftell (f);
     fseek (f, 0, SEEK_SET);
     bool showprogress=(size==0) || (size>1000000);
-    if (showprogress) StartProgress("Reading file", size);
+    if (showprogress) StartProgress((char *)"Reading file", size);
     
     char buf[82];
     buf[81]=0;
@@ -464,7 +464,7 @@
     //printf("Found %d atoms!\n", atom.size() );
     
     nhetatm=0;  natm=0;
-    for (int i=0; i<atom.size(); i++){
+    for (int i=0; i < (int)atom.size(); i++){
       if (atom[i].hetatomFlag)  nhetatm++; else natm++;
     }
    
@@ -472,7 +472,7 @@
 
     UpdateColors();
      
-    for (int i=0; i<tmpBondVec.size(); i+=2) {
+    for (int i=0; i < (int)tmpBondVec.size(); i+=2) {
       AddBond(tmpBondVec[i],tmpBondVec[i+1]);
     }
 
@@ -525,11 +525,12 @@
 void Mol::ComputeSize(){
     // bounding box!
     float x0,y0,z0,x1,y1,z1;
-    if (atom.size()>0)
+    if (atom.size() < 1)
+      return;
     x0=x1=atom[0].px;
     y0=y1=atom[0].py;
     z0=z1=atom[0].pz;
-    for (int i=1; i<atom.size(); i++) {
+    for (int i=1; i < (int)atom.size(); i++) {
       if (x1>atom[i].px) x1=atom[i].px;
       if (y1>atom[i].py) y1=atom[i].py;
       if (z1>atom[i].pz) z1=atom[i].pz;
@@ -591,12 +592,12 @@
 }
 
 void Mol::UpdateColors(){
-  for (int i=0; i<atom.size(); i++){
+  for (int i=0;  i < (int)atom.size(); i++){
     atom[i].UpdateColors(colMode);
   }
   
   if (sticks)
-  for (int i=0; i<bond.size(); i++) {
+    for (int i=0; i < (int)bond.size(); i++) {
     bond[i].UpdateColors();
   } 
 }
