From: curt Date: Fri, 28 Dec 2001 23:37:34 +0000 (+0000) Subject: Small tweaks to class initialization. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=45d3e19c38769bd0057297121b2ac83947a55a86;p=simgear.git Small tweaks to class initialization. --- 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 ) {