From 192edc5eaf5d8185aed2501aa0a0454d5b2c2cd4 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 19 Sep 1998 18:01:21 +0000 Subject: [PATCH] Support for changes to libDEM.a --- DemInfo/Makefile.am | 4 ++++ DemInfo/deminfo.cxx | 18 ++++++++++-------- FixNode/Makefile.am | 4 ++++ FixNode/main.cxx | 34 ++++++++++++++++++---------------- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/DemInfo/Makefile.am b/DemInfo/Makefile.am index 0ec8323d0..aa73af873 100644 --- a/DemInfo/Makefile.am +++ b/DemInfo/Makefile.am @@ -32,6 +32,7 @@ deminfo_SOURCES = \ deminfo_LDADD = \ $(top_builddir)/Lib/DEM/libDEM.a \ $(top_builddir)/Lib/Bucket/libBucket.a \ + $(top_builddir)/Lib/Misc/libMisc.a \ $(top_builddir)/Lib/zlib/libz.a INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib @@ -44,6 +45,9 @@ CXXFLAGS = -g #--------------------------------------------------------------------------- # $Log$ +# Revision 1.3 1998/09/19 18:01:21 curt +# Support for changes to libDEM.a +# # Revision 1.2 1998/07/30 23:49:24 curt # Removed libtool support. # diff --git a/DemInfo/deminfo.cxx b/DemInfo/deminfo.cxx index 9af81a9dd..27f1f4357 100644 --- a/DemInfo/deminfo.cxx +++ b/DemInfo/deminfo.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -37,8 +38,7 @@ int main(int argc, char **argv) { // DEM data fgDEM dem; - char fg_root[256]; - char filename[256]; + string filename; double error; int i, j; @@ -48,17 +48,16 @@ int main(int argc, char **argv) { } // set input dem file name - strcpy(filename, argv[1]); + filename = argv[1]; dem.open(filename); if ( dem.read_a_record() ) { - printf("Results = %s %.1f %.1f\n", - filename, - dem.info_originx() / 3600.0, - dem.info_originy() / 3600.0 ) ; + cout << "Results = " << filename << " " + << dem.info_originx() / 3600.0 << " " + << dem.info_originy() / 3600.0 << "\n"; } else { - printf("Error parsing DEM file.\n"); + cout << "Error parsing DEM file.\n"; } dem.close(); @@ -68,6 +67,9 @@ int main(int argc, char **argv) { // $Log$ +// Revision 1.2 1998/09/19 18:01:22 curt +// Support for changes to libDEM.a +// // Revision 1.1 1998/06/04 19:18:05 curt // Initial revision. // diff --git a/FixNode/Makefile.am b/FixNode/Makefile.am index b44b9b6d7..f9224f1a3 100644 --- a/FixNode/Makefile.am +++ b/FixNode/Makefile.am @@ -34,6 +34,7 @@ fixnode_SOURCES = \ fixnode_LDADD = \ $(top_builddir)/Lib/DEM/libDEM.a \ $(top_builddir)/Lib/Bucket/libBucket.a \ + $(top_builddir)/Lib/Misc/libMisc.a \ $(top_builddir)/Lib/zlib/libz.a INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib @@ -46,6 +47,9 @@ CXXFLAGS = -g #--------------------------------------------------------------------------- # $Log$ +# Revision 1.5 1998/09/19 18:01:26 curt +# Support for changes to libDEM.a +# # Revision 1.4 1998/07/30 23:49:24 curt # Removed libtool support. # diff --git a/FixNode/main.cxx b/FixNode/main.cxx index 92441ec8e..4adaa97d0 100644 --- a/FixNode/main.cxx +++ b/FixNode/main.cxx @@ -1,5 +1,5 @@ -// main.c -- read in a .node file and fix the z values of the interpolated -// points +// main.cxx -- read in a .node file and fix the z values of the interpolated +// points // // Written by Curtis Olson, started November 1997. // @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef HAVE_STDLIB_H # include @@ -47,15 +48,15 @@ static double nodes[MAX_NODES][3]; // find all the matching files in the specified directory and fix them -void process_files(char *root_path) { +void process_files(const string& root_path) { DIR *d; struct dirent *de; - char file_path[256]; + string file_path; char *ptr; int len; - if ( (d = opendir(root_path)) == NULL ) { - printf("cannot open directory '%s'.", root_path); + if ( (d = opendir( root_path.c_str() )) == NULL ) { + cout << "cannot open directory " + root_path + "\n"; exit(-1); } @@ -67,15 +68,13 @@ void process_files(char *root_path) { // printf("--> %s \n", ptr); if ( strcmp(ptr, ".1.node") == 0 ) { - strcpy(file_path, root_path); - strcat(file_path, "/"); - strcat(file_path, de->d_name); - printf("File = %s\n", file_path); + file_path = root_path + "/" + de->d_name; + cout << "File = " + file_path + "\n"; // load the input data files - triload(file_path, nodes); + triload(file_path.c_str(), nodes); - fixnodes(file_path, &dem, nodes); + fixnodes(file_path.c_str(), &dem, nodes); } } } @@ -84,17 +83,17 @@ void process_files(char *root_path) { // main int main(int argc, char **argv) { - char demfile[256], root_path[256]; + string demfile, root_path; if ( argc != 3 ) { printf("Usage %s demfile root_path\n", argv[0]); exit(-1); } - printf("Starting fixnode\n"); + cout << "Starting fixnode\n"; - strcpy(demfile, argv[1]); - strcpy(root_path, argv[2]); + demfile = argv[1]; + root_path = argv[2]; // load the corresponding dem file so we can interpolate elev values dem.open(demfile); @@ -109,6 +108,9 @@ int main(int argc, char **argv) { // $Log$ +// Revision 1.6 1998/09/19 18:01:27 curt +// Support for changes to libDEM.a +// // Revision 1.5 1998/07/22 21:46:41 curt // Fixed a bug that was triggering a seg fault. //