From 8a690c205815a1e6913ac563cfb9bda6ff66e76d Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 22 Jul 1998 21:46:40 +0000 Subject: [PATCH] Fixed a bug that was triggering a seg fault. --- FixNode/fixnode.cxx | 13 +++++++------ FixNode/fixnode.hxx | 7 ++++--- FixNode/main.cxx | 10 +++++++--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/FixNode/fixnode.cxx b/FixNode/fixnode.cxx index b4408fbe6..86e6ac8cd 100644 --- a/FixNode/fixnode.cxx +++ b/FixNode/fixnode.cxx @@ -33,9 +33,7 @@ /* load the node information */ -void fixnodes( char *filename, fgDEM dem, - float dem_data[DEM_SIZE_1][DEM_SIZE_1], - double nodes[MAX_NODES][3] ) +void fixnodes( char *filename, fgDEM *dem, double nodes[MAX_NODES][3] ) { char toname[256]; FILE *fd; @@ -53,7 +51,7 @@ void fixnodes( char *filename, fgDEM dem, nodes[i][1], nodes[i][2]); */ nodes[i][2] = - dem.interpolate_altitude(nodes[i][0], nodes[i][1]); + dem->interpolate_altitude(nodes[i][0], nodes[i][1]); /* printf("Fixed: %d %.2f %.2f %.2f\n", i, nodes[i][0], nodes[i][1], nodes[i][2]); */ @@ -80,9 +78,12 @@ void fixnodes( char *filename, fgDEM dem, /* $Log$ -/* Revision 1.2 1998/04/14 02:26:03 curt -/* Code reorganizations. Added a Lib/ directory for more general libraries. +/* Revision 1.3 1998/07/22 21:46:40 curt +/* Fixed a bug that was triggering a seg fault. /* + * Revision 1.2 1998/04/14 02:26:03 curt + * Code reorganizations. Added a Lib/ directory for more general libraries. + * * Revision 1.1 1998/04/08 23:05:56 curt * Adopted Gnu automake/autoconf system. * diff --git a/FixNode/fixnode.hxx b/FixNode/fixnode.hxx index 370e136a5..236875fab 100644 --- a/FixNode/fixnode.hxx +++ b/FixNode/fixnode.hxx @@ -37,15 +37,16 @@ // load the node information -void fixnodes( char *basename, fgDEM dem, - float dem_data[DEM_SIZE_1][DEM_SIZE_1], - double nodes[MAX_NODES][3] ); +void fixnodes( char *basename, fgDEM *dem, double nodes[MAX_NODES][3] ); #endif // _FIXNODE_H // $Log$ +// Revision 1.2 1998/07/22 21:46:41 curt +// Fixed a bug that was triggering a seg fault. +// // Revision 1.1 1998/04/08 23:05:56 curt // Adopted Gnu automake/autoconf system. // diff --git a/FixNode/main.cxx b/FixNode/main.cxx index 9a3d3b32d..92441ec8e 100644 --- a/FixNode/main.cxx +++ b/FixNode/main.cxx @@ -40,8 +40,7 @@ // Storage for the original DEM data which is used to interpolate z values -static fgDEM dem; -static float dem_data[DEM_SIZE_1][DEM_SIZE_1]; +fgDEM dem; // Node list static double nodes[MAX_NODES][3]; @@ -76,7 +75,7 @@ void process_files(char *root_path) { // load the input data files triload(file_path, nodes); - fixnodes(file_path, dem, dem_data, nodes); + fixnodes(file_path, &dem, nodes); } } } @@ -92,6 +91,8 @@ int main(int argc, char **argv) { exit(-1); } + printf("Starting fixnode\n"); + strcpy(demfile, argv[1]); strcpy(root_path, argv[2]); @@ -108,6 +109,9 @@ int main(int argc, char **argv) { // $Log$ +// Revision 1.5 1998/07/22 21:46:41 curt +// Fixed a bug that was triggering a seg fault. +// // Revision 1.4 1998/06/27 16:55:24 curt // Changed include order for // -- 2.39.5