]> git.mxchange.org Git - flightgear.git/commitdiff
Make build information readonly and clean up debug output.
authorThomas Geymayer <tomgey@gmail.com>
Sun, 20 Oct 2013 10:58:20 +0000 (12:58 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Sun, 20 Oct 2013 10:59:44 +0000 (12:59 +0200)
src/Include/config_cmake.h.in
src/Main/fg_commands.cxx
src/Main/fg_io.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Scripting/NasalModelData.cxx

index 599a3c41d92e99f13b97b65dc31889ec0236ccdf..7f3ee6a04a8e959877e4f7532bfe17eeabaef4fa 100644 (file)
@@ -32,8 +32,9 @@
 #define PKGLIBDIR "@FG_DATA_DIR@"
 #define WEB_BROWSER "@WEB_BROWSER@"
 
-#cmakedefine FG_HAVE_HLA
-#cmakedefine FG_HAVE_GPERFTOOLS
+// Ensure FG_HAVE_xxx always have a value
+#define FG_HAVE_HLA (@FG_HAVE_HLA@ + 0)
+#define FG_HAVE_GPERFTOOLS (@FG_HAVE_GPERFTOOLS@ + 0)
 #cmakedefine FG_JPEG_SERVER
 
 #cmakedefine SYSTEM_SQLITE
index 2a93954c6b4546c4c6f128fc935ee902c55be954..3849b5061764c6b77c69d20c8b03e5d9e2d65f7d 100644 (file)
@@ -52,7 +52,7 @@
 
 #include <boost/scoped_array.hpp>
 
-#ifdef FG_HAVE_GPERFTOOLS
+#if FG_HAVE_GPERFTOOLS
 # include <google/profiler.h>
 #endif
 
@@ -1528,7 +1528,7 @@ do_release_cockpit_button (const SGPropertyNode *arg)
 // Optional profiling commands using gperftools:
 // http://code.google.com/p/gperftools/
 
-#ifndef FG_HAVE_GPERFTOOLS
+#if !FG_HAVE_GPERFTOOLS
 static void
 no_profiling_support()
 {
@@ -1544,7 +1544,7 @@ no_profiling_support()
 static bool
 do_profiler_start(const SGPropertyNode *arg)
 {
-#ifdef FG_HAVE_GPERFTOOLS
+#if FG_HAVE_GPERFTOOLS
   const char *filename = arg->getStringValue("filename", "fgfs.profile");
   ProfilerStart(filename);
   return true;
@@ -1557,7 +1557,7 @@ do_profiler_start(const SGPropertyNode *arg)
 static bool
 do_profiler_stop(const SGPropertyNode *arg)
 {
-#ifdef FG_HAVE_GPERFTOOLS
+#if FG_HAVE_GPERFTOOLS
   ProfilerStop();
   return true;
 #else
@@ -1667,14 +1667,8 @@ fgInitCommands ()
   fgTie( "/command/view/next", dummy(0), do_view_next );
   fgTie( "/command/view/prev", dummy(0), do_view_prev );
 
-  SGPropertyNode* profiler_available =
-    globals->get_props()->getNode("/sim/debug/profiler-available", true);
-#ifdef FG_HAVE_GPERFTOOLS
-  profiler_available->setBoolValue(true);
-#else
-  profiler_available->setBoolValue(false);
-#endif
-  profiler_available->setAttributes(SGPropertyNode::READ);
+  globals->get_props()->setValueReadOnly( "/sim/debug/profiler-available",
+                                          bool(FG_HAVE_GPERFTOOLS) );
 }
 
 // end of fg_commands.cxx
index 0aa1fa377d3fc2aa372937441b56ca7c35335eda..45d6a1e61ad926dd62939817636c2a53d8caae8f 100644 (file)
@@ -67,7 +67,7 @@
 #include <Network/rul.hxx>
 #include <Network/generic.hxx>
 
-#ifdef FG_HAVE_HLA
+#if FG_HAVE_HLA
 #include <Network/HLA/hla.hxx>
 #endif
 
@@ -228,7 +228,7 @@ FGIO::parse_port_config( const string& config )
 
             return NULL;
         }
-#ifdef FG_HAVE_HLA
+#if FG_HAVE_HLA
         else if ( protocol == "hla" ) {
             return new FGHLA(tokens);
         }
index 47817c6f1bdb2febcecc8365e40912763fbf95a8..12d55fdd1f6e31f79280e51618eb6919d355307d 100644 (file)
@@ -328,12 +328,6 @@ int fgMainInit( int argc, char **argv ) {
     SG_LOG( SG_GENERAL, SG_INFO, "FlightGear:  Version "
             << version );
     SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR << std::endl );
-    SG_LOG( SG_GL,
-            SG_INFO,
-            "osg::Referenced thread safe reference counting is "
-            << (osg::Referenced::getThreadSafeReferenceCounting() ? "enabled"
-                                                                  : "disabled")
-          );
 
     // Allocate global data structures.  This needs to happen before
     // we parse command line options
index 261343b13e96bb8cfcf4dd52f60fb6eea1694ffb..9be906cba0de78fcba939abf7f4a6467f0e3816e 100644 (file)
@@ -225,19 +225,18 @@ fgSetDefaults ()
     fgSetInt("/sim/multiplay/rxport", 0);
     fgSetInt("/sim/multiplay/txport", 0);
     
-    fgSetString("/sim/version/flightgear", FLIGHTGEAR_VERSION);
-    fgSetString("/sim/version/simgear", SG_STRINGIZE(SIMGEAR_VERSION));
-    fgSetString("/sim/version/openscenegraph", osgGetVersion());
-    fgSetString("/sim/version/revision", REVISION);
-    fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
-    fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);
-#ifdef FG_HAVE_HLA     // -DENABLE_RTI=ON
-    fgSetBool("/sim/version/hla-support", true);
-#else                  // -DENABLE_RTI=OFF
-    fgSetBool("/sim/version/hla-support", false);
-#endif
-
-  char* envp = ::getenv( "http_proxy" );
+    SGPropertyNode* v = globals->get_props()->getNode("/sim/version", true);
+    v->setValueReadOnly("flightgear", FLIGHTGEAR_VERSION);
+    v->setValueReadOnly("simgear", SG_STRINGIZE(SIMGEAR_VERSION));
+    v->setValueReadOnly("openscenegraph", osgGetVersion());
+    v->setValueReadOnly("openscenegraph-thread-safe-reference-counting",
+                         osg::Referenced::getThreadSafeReferenceCounting());
+    v->setValueReadOnly("revision", REVISION);
+    v->setValueReadOnly("build-number", HUDSON_BUILD_NUMBER);
+    v->setValueReadOnly("build-id", HUDSON_BUILD_ID);
+    v->setValueReadOnly("hla-support", bool(FG_HAVE_HLA));
+
+    char* envp = ::getenv( "http_proxy" );
     if( envp != NULL )
       fgSetupProxy( envp );
 }
@@ -1461,7 +1460,7 @@ struct OptionDesc {
     {"proxy",                        true,  OPTION_FUNC,    "", false, "", fgSetupProxy },
     {"callsign",                     true,  OPTION_FUNC,    "", false, "", fgOptCallSign},
     {"multiplay",                    true,  OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
-#ifdef FG_HAVE_HLA
+#if FG_HAVE_HLA
     {"hla",                          true,  OPTION_CHANNEL, "", false, "", 0 },
     {"hla-local",                    true,  OPTION_CHANNEL, "", false, "", 0 },
 #endif
index 2bf3d03d27e85e9c38edd98cd598e876980e7bdc..4d0bda95cb55ddf17087d00c85427b840613e17e 100644 (file)
@@ -87,8 +87,7 @@ FGNasalModelData::FGNasalModelData( SGPropertyNode *root,
     SG_INFO,
     "New model with attached script(s) "
     "(branch = " << branch << ","
-    " path = " << simgear::getNodePathString(branch) <<
-    " thread-safe = " << branch->getThreadSafeRefUnref() << ")"
+    " path = " << simgear::getNodePathString(branch) << ")"
   );
 }