diff -u ../terra.orig/Array.h ./Array.h
--- ../terra.orig/Array.h	1995-12-19 11:24:31.000000000 -0800
+++ ./Array.h	2014-03-18 15:04:25.000000000 -0700
@@ -1,6 +1,9 @@
 #ifndef ARRAY_INCLUDED // -*- C++ -*-
 #define ARRAY_INCLUDED
 
+#include <memory.h>
+
+
 //
 // Array classes
 //
diff -u ../terra.orig/GreedyInsert.cc ./GreedyInsert.cc
--- ../terra.orig/GreedyInsert.cc	1996-01-19 09:07:18.000000000 -0800
+++ ./GreedyInsert.cc	2014-03-18 15:17:36.000000000 -0700
@@ -1,9 +1,11 @@
-#include <iostream.h>
+#include <iostream>
 #include "GreedyInsert.h"
-
+#include <assert.h>
 #include "Mask.h"
 extern ImportMask *MASK;
 
+using namespace std;
+
 void TrackedTriangle::update(Subdivision& s)
 {
     GreedySubdivision& gs = (GreedySubdivision&)s;
@@ -209,7 +211,11 @@
 
     is_used(sx,sy) = DATA_POINT_USED;
     count++;
+#if 0
     return insert(Vec2(sx,sy), t);
+#endif
+    Vec2 vec(sx,sy);
+    return insert(vec, t);
 }
 
 
Only in .: GreedyInsert.o
diff -u ../terra.orig/Heap.cc ./Heap.cc
--- ../terra.orig/Heap.cc	1996-01-09 13:19:08.000000000 -0800
+++ ./Heap.cc	2014-03-18 15:04:25.000000000 -0700
@@ -1,7 +1,9 @@
 #include <assert.h>
-#include <iostream.h>
+#include <iostream>
 #include "Heap.h"
 
+using namespace std;
+
 
 void Heap::swap(int i,int j)
 {
Only in .: Heap.o
diff -u ../terra.orig/Makefile ./Makefile
--- ../terra.orig/Makefile	1996-01-30 08:35:20.000000000 -0800
+++ ./Makefile	2014-03-18 16:52:05.000000000 -0700
@@ -4,23 +4,24 @@
 # You should change these to fit your system.
 #
 
-CC = cc
-C++ = CC
+CC = gcc
+C++ = g++
 
 # For compiling on SGI's with the pre-5.3 (ie. cfront-based) compiler:
 # add '-ptr/tmp/terra_ptrepository' to OPTFLAGS
 # add '-pte.cc' to LFLAGS
 
-OPTFLAGS = -g -mips2 
+# OPTFLAGS = -g -mips2 
 # OPTFLAGS = -O2 -mips2
+OPTFLAGS = -g -Wall
 
 GUI_LIBS = -lglut -lGLU -lGL -lXmu -lX11
-LIBS = -lmalloc -lmx
+LIBS = # -lmalloc -lmx
 
 #
 # This defines the location of the GLUT libraries
 #
-ANIM = /afs/cs/project/anim/garland
+ANIM = /opt/local
 GLUT_FLAGS = 
 GLUT_INCDIR = $(ANIM)/include
 GLUT_LIBDIR = $(ANIM)/lib
@@ -34,7 +35,7 @@
 #
 # These are the flags for compilation (CFLAGS) and linking (LFLAGS) 
 #
-CFLAGS = $(INCDIR) $(OPTFLAGS) -DSAFETY
+CFLAGS = $(INCDIR) $(OPTFLAGS) -DIOSTREAMH # -DSAFETY
 LFLAGS = $(LIBDIR) $(OPTFLAGS)
 
 
@@ -81,7 +82,7 @@
 
 depend :
 	touch Makefile.depend
-	makedepend -fMakefile.depend $(INCDIR) -I/usr/include/CC $(BASE_SRCS) $(GUI_SRCS)
+	makedepend -fMakefile.depend $(INCDIR) $(BASE_SRCS) $(GUI_SRCS)
 	/bin/rm -f Makefile.depend.bak
 
 sinclude Makefile.depend
diff -u ../terra.orig/Map.h ./Map.h
--- ../terra.orig/Map.h	1996-01-30 08:35:21.000000000 -0800
+++ ./Map.h	2014-03-18 15:09:08.000000000 -0700
@@ -2,10 +2,13 @@
 #define MAP_INCLUDED
 
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 
 #include "Geom.h"
 
+using namespace std;
+
+
 class Map
 {
 public:
Only in .: Map.o
diff -u ../terra.orig/Mask.cc ./Mask.cc
--- ../terra.orig/Mask.cc	1996-01-17 08:03:13.000000000 -0800
+++ ./Mask.cc	2014-03-18 15:04:25.000000000 -0700
@@ -1,10 +1,12 @@
 #include <math.h>
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 
 #include "Geom.h"
 #include "Mask.h"
 
+using namespace std;
+
 
 RealMask *readMask(istream& in)
 {
diff -u ../terra.orig/Mask.h ./Mask.h
--- ../terra.orig/Mask.h	1996-01-17 08:03:14.000000000 -0800
+++ ./Mask.h	2014-03-18 15:16:16.000000000 -0700
@@ -1,6 +1,11 @@
 #ifndef MASK_INCLUDED // -*- C++ -*-
 #define MASK_INCLUDED
 
+#include <istream>
+
+using namespace std;
+
+
 class ImportMask
 {
 
Only in .: Mask.o
diff -u ../terra.orig/Quadedge.cc ./Quadedge.cc
--- ../terra.orig/Quadedge.cc	1995-12-19 14:05:48.000000000 -0800
+++ ./Quadedge.cc	2014-03-18 15:04:25.000000000 -0700
@@ -1,8 +1,10 @@
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 
 #include "Quadedge.h"
 
+using namespace std;
+
 Edge::Edge(const Edge&)
 {
     cerr << "Edge: Edge assignments are forbidden." << endl;
Only in .: Quadedge.o
diff -u ../terra.orig/Subdivision.cc ./Subdivision.cc
--- ../terra.orig/Subdivision.cc	1996-01-30 08:35:22.000000000 -0800
+++ ./Subdivision.cc	2014-04-01 17:12:59.000000000 -0700
@@ -1,9 +1,10 @@
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 #include <assert.h>
 
 #include "Subdivision.h"
 
+using namespace std;
 
 
 Edge *Subdivision::makeEdge(Vec2& org, Vec2& dest)
@@ -105,7 +106,7 @@
 
 static void overEdge(Edge *e, edge_callback fn, void *closure)
 {
-    if( e->token != timestamp )
+    if( static_cast<typeof(timestamp)>(e->token) != timestamp )
     {
 	e->token = timestamp;
 	e->Sym()->token = timestamp;
@@ -214,7 +215,7 @@
         real td = triArea(x, ed->Dest(), ed->Org());
 
         if (td>0)                       // x is below ed
-            if (to>0 || to==0 && t==0) {// x is interior, or origin endpoint
+            if (to>0 || (to==0 && t==0)) {// x is interior, or origin endpoint
                 startingEdge = e;
                 return e;
             }
@@ -259,10 +260,12 @@
 
     if ( (x == e->Org()) || (x == e->Dest()) ) {
         // point is already in the mesh
+#if 0
 	//
         cerr << "WARNING: Tried to reinsert point: " << x << endl;
 	cerr << "         org: " << e->Org() << endl;
 	cerr << "        dest: " << e->Dest() << endl;
+#endif
         return NULL;
     }
 
@@ -338,7 +341,9 @@
     do {
 
 	Edge *e = spoke->Lnext();
+#if 0
 	Edge *t = e->Oprev();
+#endif
 
 	if( isInterior(e) && shouldSwap(x, e) )
 	    swap(e);
Only in .: Subdivision.o
diff -u ../terra.orig/Vec2.h ./Vec2.h
--- ../terra.orig/Vec2.h	1996-01-30 08:35:24.000000000 -0800
+++ ./Vec2.h	2014-03-18 16:55:04.000000000 -0700
@@ -1,6 +1,11 @@
 #ifndef VEC2_INCLUDED // -*- C++ -*-
 #define VEC2_INCLUDED
 
+#include <iostream>
+
+using namespace std;
+
+
 class Vec2 {
 protected:
     real elt[2];
@@ -163,7 +168,13 @@
 
 inline istream& operator>>(istream& in, Vec2& v)
 {
+#if 0
     return in >> "[" >> v[0] >> v[1] >> "]";
+#endif
+    in.ignore(1, '[');
+    in >> v[0] >> v[1];
+    in.ignore(1, ']');
+    return in;
 }
 #endif
 
diff -u ../terra.orig/Vec3.h ./Vec3.h
--- ../terra.orig/Vec3.h	1995-12-19 11:24:37.000000000 -0800
+++ ./Vec3.h	2014-03-18 16:54:02.000000000 -0700
@@ -1,6 +1,11 @@
 #ifndef VEC3_INCLUDED // -*- C++ -*-
 #define VEC3_INCLUDED
 
+#include <iostream>
+
+using namespace std;
+
+
 class Vec3 {
 protected:
     real elt[3];
@@ -173,7 +178,13 @@
 
 inline istream& operator>>(istream& in, Vec3& v)
 {
+#if 0
     return in >> "[" >> v[0] >> v[1] >> v[2] >> "]";
+#endif
+    in.ignore(1, '[');
+    in >> v[0] >> v[1];
+    in.ignore(1, ']');
+    return in;
 }
 #endif
 
Only in .: altadena-lake.osm
Only in .: altadena.osm
diff -u ../terra.orig/cmdline.cc ./cmdline.cc
--- ../terra.orig/cmdline.cc	1996-01-19 10:34:14.000000000 -0800
+++ ./cmdline.cc	2014-04-01 17:11:47.000000000 -0700
@@ -1,7 +1,9 @@
 #include <stdlib.h>
-#include <fstream.h>
+#include <fstream>
 #include <string.h>
 #include "terra.h"
+#include <getopt.h>
+
 
 GreedySubdivision *mesh;
 Map *DEM;
@@ -18,9 +20,9 @@
 char *mask_filename   = NULL;
 char *script_filename = NULL;
 
-static char *options = "e:p:h:o:m:s:";
+static const char *options = "e:p:h:o:m:s:";
 
-static char *usage_string =
+static const char *usage_string =
 "-e <thresh>      Sets the tolerable error threshold\n"
 "-p <count>       Sets the maximum number of allowable points\n"
 "-h <factor>      Sets the height scaling factor.  For example,\n"
@@ -31,7 +33,7 @@
 "-s <file>        Execute preinsertion script from <file>\n"
 "\n";
 
-static void usage_error(char *msg = NULL)
+static void usage_error(const char *msg = NULL)
 {
     if( msg )
 	cerr << msg << endl;
Only in .: cmdline.o
diff -u ../terra.orig/glHacks.h ./glHacks.h
--- ../terra.orig/glHacks.h	1996-01-30 08:35:27.000000000 -0800
+++ ./glHacks.h	2014-03-18 16:55:18.000000000 -0700
@@ -4,6 +4,9 @@
 #include <GL/glx.h>
 #include <GL/gl.h>
 #include <GL/glu.h>
+#include <iostream>
+
+using namespace std;
 
 
 /*************************************************************************
Only in .: glHacks.o
diff -u ../terra.orig/greedy.cc ./greedy.cc
--- ../terra.orig/greedy.cc	1996-01-19 10:34:15.000000000 -0800
+++ ./greedy.cc	2014-04-01 17:14:20.000000000 -0700
@@ -1,4 +1,6 @@
 #include "terra.h"
+#include <fstream>
+
 
 void scripted_preinsertion(istream& script)
 {
@@ -64,7 +66,7 @@
 inline int goal_not_met()
 {
     return mesh->maxError() > error_threshold &&
-	   mesh->pointCount() < point_limit;
+      static_cast<typeof(point_limit)>(mesh->pointCount()) < point_limit;
 }
 
 static void announce_goal()
diff -u ../terra.orig/output.cc ./output.cc
--- ../terra.orig/output.cc	1996-01-30 08:35:30.000000000 -0800
+++ ./output.cc	2014-04-01 17:08:47.000000000 -0700
@@ -1,8 +1,8 @@
 #include "terra.h"
-#include <fstream.h>
+#include <fstream>
 
 
-void generate_output(char *filename, FileFormat format)
+void generate_output(const char *filename, FileFormat format)
 {
     if( !filename )
 	filename = output_filename;
Only in .: output.o
Only in .: terra
diff -u ../terra.orig/terra.cc ./terra.cc
--- ../terra.orig/terra.cc	1996-01-10 13:22:59.000000000 -0800
+++ ./terra.cc	2014-03-18 15:09:42.000000000 -0700
@@ -1,10 +1,12 @@
 #include "terra.h"
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
     process_cmdline(argc, argv);
 
     greedy_insertion();
 
     generate_output();
+
+    return 0;
 }
diff -u ../terra.orig/terra.h ./terra.h
--- ../terra.orig/terra.h	1996-01-19 10:34:17.000000000 -0800
+++ ./terra.h	2014-04-01 17:08:42.000000000 -0700
@@ -24,7 +24,7 @@
 extern void scripted_preinsertion(istream&);
 extern void subsample_insertion(int target_width);
 
-extern void generate_output(char *filename=NULL,
+extern void generate_output(const char *filename=NULL,
 			    FileFormat format=NULLfile);
 extern void output_tin(ostream&);
 extern void output_eps(ostream&);
Only in .: terra.o
Only in .: xterra
diff -u ../terra.orig/xterra.cc ./xterra.cc
--- ../terra.orig/xterra.cc	1995-12-15 11:26:34.000000000 -0800
+++ ./xterra.cc	2014-04-01 17:09:39.000000000 -0700
@@ -5,7 +5,7 @@
 
 
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
     glutInit(&argc, argv);
     process_cmdline(argc, argv);
@@ -15,4 +15,6 @@
 
 
     gui_interact();
+
+    return 0;
 }
Only in .: xterra.o
