]> git.mxchange.org Git - flightgear.git/commitdiff
Fiddling around with views, fdm data passing and management to try to be
authorcurt <curt>
Thu, 9 Sep 1999 00:17:06 +0000 (00:17 +0000)
committercurt <curt>
Thu, 9 Sep 1999 00:17:06 +0000 (00:17 +0000)
  more sensible so we can do a more reasonable external view.
Fixed some const incorrectness.

src/Time/fg_time.cxx
src/Time/fg_time.hxx
src/Time/lowleveltime.cxx
src/Time/lowleveltime.h

index fe31c5c9aed7dcedf49a700625ee3e49e24c7070..503503d6d49a751b1f5bc6f33f593377fc4b0cf4 100644 (file)
@@ -100,7 +100,7 @@ FGTime::~FGTime()
 
 // Initialize the time dependent variables (maybe I'll put this in the
 // constructor later)
-void FGTime::init(FGInterface *f) 
+void FGTime::init(const FGInterface& f) 
 {
     FG_LOG( FG_EVENT, FG_INFO, "Initializing Time" );
     gst_diff = -9999.0;
@@ -121,8 +121,8 @@ void FGTime::init(FGInterface *f)
     // printf ("Current greenwich mean time = %24s", asctime(gmtime(&cur_time)));
     // printf ("Current local time          = %24s", asctime(localtime(&cur_time)));
     // time_t tmp = cur_time;
-    GeoCoord location(RAD_TO_DEG * f->get_Latitude(), 
-                     RAD_TO_DEG * f->get_Longitude());
+    GeoCoord location(RAD_TO_DEG * f.get_Latitude(), 
+                     RAD_TO_DEG * f.get_Longitude());
 
     GeoCoord* nearestTz = tzContainer->getNearest(location);
 
@@ -316,7 +316,7 @@ double FGTime::sidereal_course(double lng)
 
 
 // Update time variables such as gmt, julian date, and sidereal time
-void FGTime::update(FGInterface *f) 
+void FGTime::update(const FGInterface& f) 
 {
     double gst_precise, gst_course;
 
@@ -368,17 +368,17 @@ void FGTime::update(FGInterface *f)
       
        gst_diff = gst_precise - gst_course;
 
-       lst = sidereal_course(-(f->get_Longitude() * RAD_TO_DEG)) + gst_diff;
+       lst = sidereal_course(-(f.get_Longitude() * RAD_TO_DEG)) + gst_diff;
     } else {
        // course + difference should drift off very slowly
        gst = sidereal_course( 0.00                              ) + gst_diff;
-       lst = sidereal_course( -(f->get_Longitude() * RAD_TO_DEG)) + gst_diff;
+       lst = sidereal_course( -(f.get_Longitude() * RAD_TO_DEG)) + gst_diff;
     }
     FG_LOG( FG_EVENT, FG_DEBUG,
            "  Current lon=0.00 Sidereal Time = " << gst );
     FG_LOG( FG_EVENT, FG_DEBUG,
            "  Current LOCAL Sidereal Time = " << lst << " (" 
-           << sidereal_precise(-(f->get_Longitude() * RAD_TO_DEG)) 
+           << sidereal_precise(-(f.get_Longitude() * RAD_TO_DEG)) 
            << ") (diff = " << gst_diff << ")" );
 }
 
index c87fc2403969bab479e54d3fff53bb58930166b8..f591eca39b22b0b978160fccb751d636f4de67a4 100644 (file)
@@ -118,10 +118,10 @@ public:
     void togglePauseMode() { pause = !pause; }; 
 
     // Initialize the time dependent variables
-    void init(FGInterface *f);
+    void init(const FGInterface& f);
 
     // Update the time dependent variables
-    void update(FGInterface *f);
+    void update(const FGInterface& f);
 
     void cal_mjd (int mn, double dy, int yr);
     void utc_gst(); 
index 393096d8e77b811b6ae56ad6dfc9ba3e566884be..5b7bb2dd06f87498a0d5051c8f2d94bf4e91ea1d 100644 (file)
@@ -114,7 +114,7 @@ static size_t num_leaps;
 static struct leap *leaps = NULL;
 
 
-static void fgtzset_internal (int always, char*tz);
+static void fgtzset_internal (int always, const char *tz);
 static int fgtz_compute(time_t timer, const struct tm *tm);
 static int fgcompute_change(fgtz_rule *rule, int year);
 static struct ttinfo *fgfind_transition (time_t timer);
@@ -162,7 +162,7 @@ struct tm _fgtmbuf;
 
 
 /* Return the `struct tm' representation of *T in local time.  */
-struct tm * fgLocaltime (const time_t *t, char *tzName)
+struct tm * fgLocaltime (const time_t *t, const char *tzName)
 {
   return fgtz_convert (t, 1, &_fgtmbuf, tzName);
 }
@@ -170,7 +170,7 @@ struct tm * fgLocaltime (const time_t *t, char *tzName)
 
 /* Return the `struct tm' representation of *TIMER in the local timezone.
    Use local time if USE_LOCALTIME is nonzero, UTC otherwise.  */
-struct tm * fgtz_convert (const time_t *timer, int use_localtime, struct tm *tp, char *tzName)
+struct tm * fgtz_convert (const time_t *timer, int use_localtime, struct tm *tp, const char *tzName)
 {
   long int leap_correction;
   long int offsetCorr;                 // ADDED TO RESOLVE NON-ANSI FIELDS IN struct tm
@@ -276,7 +276,7 @@ static char *abbr(struct tm *tmp)
 
 
 /* Interpret the TZ envariable.  */
-static void fgtzset_internal (int always, char* tz)
+static void fgtzset_internal (int always, const char *tz)
 {
   time_t now;
   time(&now);
index f2d48769b9dc4220d4845a7072dad0bcd2b76228..9a2235c8c0658af1c2a06746ec9bf528e1e40789 100644 (file)
 void show (const char *zone, time_t t, int v);
 
 /* adapted from <time.h> */
-struct tm * fgLocaltime (const time_t *t, char *tzName);
+struct tm * fgLocaltime (const time_t *t, const char *tzName);
 
 /* Prototype for the internal function to get information based on TZ.  */
 extern struct tm *fgtz_convert (const time_t *t, int use_localtime,
-                                    struct tm *tp, char *tzName);
+                                    struct tm *tp, const char *tzName);
 
 /* This structure contains all the information about a
    timezone given in the POSIX standard TZ envariable.  */