From 5bbd08091c35c094f00968d5d8404042c2206d9f Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 28 Apr 1998 01:22:16 +0000 Subject: [PATCH] Type-ified fgTIME and fgVIEW. --- Time/fg_time.cxx | 9 ++++++--- Time/fg_time.hxx | 13 ++++++++----- Time/fg_timer.cxx | 15 +++++++++++---- Time/light.cxx | 7 +++++-- Time/sunpos.cxx | 7 +++++-- 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/Time/fg_time.cxx b/Time/fg_time.cxx index cb3eca091..c281f5b79 100644 --- a/Time/fg_time.cxx +++ b/Time/fg_time.cxx @@ -54,12 +54,12 @@ #define RADHR(x) DEGHR(x*RAD_TO_DEG) -struct fgTIME cur_time_params; +fgTIME cur_time_params; // Initialize the time dependent variables -void fgTimeInit(struct fgTIME *t) { +void fgTimeInit(fgTIME *t) { fgOPTIONS *o; o = ¤t_options; @@ -312,7 +312,7 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) { // Update time variables such as gmt, julian date, and sidereal time -void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) { +void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) { double gst_precise, gst_course; fgPrintf( FG_EVENT, FG_BULK, "Updating time\n"); @@ -375,6 +375,9 @@ void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) { // $Log$ +// Revision 1.4 1998/04/28 01:22:16 curt +// Type-ified fgTIME and fgVIEW. +// // Revision 1.3 1998/04/25 22:06:33 curt // Edited cvs log messages in source files ... bad bad bad! // diff --git a/Time/fg_time.hxx b/Time/fg_time.hxx index b0a31c3c7..8e5c01913 100644 --- a/Time/fg_time.hxx +++ b/Time/fg_time.hxx @@ -48,7 +48,7 @@ // Define a structure containing global time parameters -struct fgTIME { +typedef struct { // the date/time in various forms // Unix "calendar" time in seconds time_t cur_time; @@ -80,9 +80,9 @@ struct fgTIME { // How much to change the value of warp each iteration. Allows us // to make time progress faster than normal. long int warp_delta; -}; +} fgTIME; -extern struct fgTIME cur_time_params; +extern fgTIME cur_time_params; typedef struct fg_timestamp_t { @@ -104,17 +104,20 @@ void timesum(fg_timestamp *res, fg_timestamp *start, long millis); // Update time variables such as gmt, julian date, and sidereal time -void fgTimeInit(struct fgTIME *t); +void fgTimeInit(fgTIME *t); // Update the time dependent variables -void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t); +void fgTimeUpdate(fgFLIGHT *f, fgTIME *t); #endif // _FG_TIME_HXX // $Log$ +// Revision 1.4 1998/04/28 01:22:17 curt +// Type-ified fgTIME and fgVIEW. +// // Revision 1.3 1998/04/25 22:06:34 curt // Edited cvs log messages in source files ... bad bad bad! // diff --git a/Time/fg_timer.cxx b/Time/fg_timer.cxx index ebd397cbf..bb1fc3f13 100644 --- a/Time/fg_timer.cxx +++ b/Time/fg_timer.cxx @@ -31,6 +31,10 @@ #include /* for timer routines */ #include /* for printf() */ +#ifdef HAVE_STDLIB_H +# include +#endif + #ifdef HAVE_SYS_TIME_H # include /* for get/setitimer, gettimeofday, struct timeval */ #endif @@ -117,11 +121,14 @@ int fgGetTimeInterval( void ) { /* $Log$ -/* Revision 1.2 1998/04/25 20:24:03 curt -/* Cleaned up initialization sequence to eliminate interdependencies -/* between sun position, lighting, and view position. This creates a -/* valid single pass initialization path. +/* Revision 1.3 1998/04/28 01:22:18 curt +/* Type-ified fgTIME and fgVIEW. /* + * Revision 1.2 1998/04/25 20:24:03 curt + * Cleaned up initialization sequence to eliminate interdependencies + * between sun position, lighting, and view position. This creates a + * valid single pass initialization path. + * * Revision 1.1 1998/04/24 00:52:29 curt * Wrapped "#include " in "#ifdef HAVE_CONFIG_H" * Fog color fixes. diff --git a/Time/light.cxx b/Time/light.cxx index 5177645ea..4d67b4d0f 100644 --- a/Time/light.cxx +++ b/Time/light.cxx @@ -95,8 +95,8 @@ void fgLightInit( void ) { // update lighting parameters based on current sun position void fgLightUpdate( void ) { fgLIGHT *l; - struct fgTIME *t; - struct fgVIEW *v; + fgTIME *t; + fgVIEW *v; /* if the 4th field is 0.0, this specifies a direction ... */ GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 }; /* base sky color */ @@ -158,6 +158,9 @@ void fgLightUpdate( void ) { // $Log$ +// Revision 1.4 1998/04/28 01:22:18 curt +// Type-ified fgTIME and fgVIEW. +// // Revision 1.3 1998/04/26 05:10:04 curt // "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd. // diff --git a/Time/sunpos.cxx b/Time/sunpos.cxx index 996764224..2c0c22ef0 100644 --- a/Time/sunpos.cxx +++ b/Time/sunpos.cxx @@ -273,8 +273,8 @@ void fgSunPosition(time_t ssue, double *lon, double *lat) { // update the cur_time_params structure with the current sun position void fgUpdateSunPos( void ) { fgLIGHT *l; - struct fgTIME *t; - struct fgVIEW *v; + fgTIME *t; + fgVIEW *v; MAT3vec nup, nsun, v0; double sun_gd_lat, sl_radius; double ntmp; @@ -346,6 +346,9 @@ void fgUpdateSunPos( void ) { // $Log$ +// Revision 1.6 1998/04/28 01:22:18 curt +// Type-ified fgTIME and fgVIEW. +// // Revision 1.5 1998/04/26 05:10:05 curt // "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd. // -- 2.39.2