Fixed a bug that was triggering a seg fault.
This commit is contained in:
parent
d8c9c07659
commit
8a690c2058
3 changed files with 18 additions and 12 deletions
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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 <sys/types.h>
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue