diff -ru therion-0.3.9-orig/thexpmodel.cxx therion-0.3.9/thexpmodel.cxx
--- therion-0.3.9-orig/thexpmodel.cxx	2005-05-12 21:03:46.000000000 +0100
+++ therion-0.3.9/thexpmodel.cxx	2005-12-14 08:48:58.800754176 +0000
@@ -1362,7 +1362,7 @@
       sptr = (thsurvey*)(*obi);
       if (sptr->num1 > 0) {
         sptr->num1 = survnum++;
-        fprintf(pltf,"S %d %d %s\n", sptr->num1, (sptr->fsptr != NULL) ? sptr->fsptr->num1 : -1, sptr->name);
+        fprintf(pltf,"S %ld %ld %s\n", sptr->num1, (sptr->fsptr != NULL) ? sptr->fsptr->num1 : -1, sptr->name);
         if (strlen(sptr->title)) {
           fprintf(pltf,"C %s\n", sptr->title);
         }
@@ -1379,7 +1379,7 @@
     if (stnum[i] > 0) {
       stnum[i] = survnum;
       pst = &(dbp->db1d.station_vec[i]);
-      fprintf(pltf,"T %d %d %s %.3f %.3f %.3f G%s%s%s\n", survnum, pst->survey->num1, pst->name, pst->x, pst->y, pst->z, (pst->flags & TT_STATIONFLAG_ENTRANCE) != 0 ? "E" : "", (pst->flags & TT_STATIONFLAG_FIXED) != 0 ? "F" : "", (pst->flags & TT_STATIONFLAG_CONT) != 0 ? "C" : "");
+      fprintf(pltf,"T %ld %ld %s %.3f %.3f %.3f G%s%s%s\n", survnum, pst->survey->num1, pst->name, pst->x, pst->y, pst->z, (pst->flags & TT_STATIONFLAG_ENTRANCE) != 0 ? "E" : "", (pst->flags & TT_STATIONFLAG_FIXED) != 0 ? "F" : "", (pst->flags & TT_STATIONFLAG_CONT) != 0 ? "C" : "");
       if (pst->comment != NULL) {
         fprintf(pltf,"C %s\n", pst->comment);
       }
@@ -1392,7 +1392,7 @@
   tlegs = dbp->db1d.get_tree_legs();
   for(i = 0; i < nlegs; i++, tlegs++) {
     if ((*tlegs)->survey->is_selected()) {
-      fprintf(pltf,"H %d %d %d G%s%s\n", 
+      fprintf(pltf,"H %ld %ld %ld G%s%s\n", 
           stnum[(*tlegs)->leg->from.id - 1],
           stnum[(*tlegs)->leg->to.id - 1],
           (*tlegs)->survey->num1,
@@ -1416,7 +1416,7 @@
         case TT_SURFACE_CMD:
           tmp3d = ((thsurface*)(*obi))->get_3d();
           if ((tmp3d != NULL) && (tmp3d->nfaces > 0)) {
-            fprintf(pltf,"X 1 %d\n", ((thsurface*)(*obi))->fsptr->num1);
+            fprintf(pltf,"X 1 %ld\n", ((thsurface*)(*obi))->fsptr->num1);
             tmp3d->exp_shift_x = 0.0;
             tmp3d->exp_shift_y = 0.0;
             tmp3d->exp_shift_z = 0.0;
@@ -1447,7 +1447,7 @@
             d3d->exp_shift_x = 0.0;
             d3d->exp_shift_y = 0.0;
             d3d->exp_shift_z = 0.0;
-            fprintf(pltf,"X 0 %d\n", cs->fsptr->num1);
+            fprintf(pltf,"X 0 %ld\n", cs->fsptr->num1);
             d3d->export_tlx(pltf);
           }
         }
diff -ru therion-0.3.9-orig/thtexfonts.cxx therion-0.3.9/thtexfonts.cxx
--- therion-0.3.9-orig/thtexfonts.cxx	2005-05-05 12:20:53.000000000 +0100
+++ therion-0.3.9/thtexfonts.cxx	2005-12-14 08:49:29.025159368 +0000
@@ -147,7 +147,7 @@
 }
 
 string replace_all(string s, string f, string r) {
-  unsigned int found = s.find(f);
+  size_t found = s.find(f);
   while(found != string::npos) {
     s.replace(found, f.length(), r);
     found = s.find(f);
