From 45d3e19c38769bd0057297121b2ac83947a55a86 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 28 Dec 2001 23:37:34 +0000 Subject: [PATCH] Small tweaks to class initialization. --- simgear/ephemeris/stardata.cxx | 8 ++++++-- simgear/misc/sg_path.cxx | 9 ++++++--- simgear/timing/timestamp.hxx | 5 ++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/simgear/ephemeris/stardata.cxx b/simgear/ephemeris/stardata.cxx index d7d82a38..f3dffb17 100644 --- a/simgear/ephemeris/stardata.cxx +++ b/simgear/ephemeris/stardata.cxx @@ -32,10 +32,14 @@ #endif // Constructor -SGStarData::SGStarData() { +SGStarData::SGStarData() : + nstars(0) +{ } -SGStarData::SGStarData( SGPath path ) { +SGStarData::SGStarData( SGPath path ) : + nstars(0) +{ data_path = SGPath( path ); load(); } diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index cecbdd5d..7d70a6fe 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -53,13 +53,16 @@ static string fix_path( const string path ) { // default constructor -SGPath::SGPath() { - path = ""; +SGPath::SGPath() : + path("") +{ } // create a path based on "path" -SGPath::SGPath( const string p ) { +SGPath::SGPath( const string p ) : + path("") +{ set( p ); } diff --git a/simgear/timing/timestamp.hxx b/simgear/timing/timestamp.hxx index 3a31ba58..2f95ad07 100644 --- a/simgear/timing/timestamp.hxx +++ b/simgear/timing/timestamp.hxx @@ -102,7 +102,10 @@ public: inline long get_usec() const { return usec; } }; -inline SGTimeStamp::SGTimeStamp() { +inline SGTimeStamp::SGTimeStamp() : + seconds(0), + usec(0) +{ } inline SGTimeStamp::SGTimeStamp( const long s, const long u ) { -- 2.39.5