From 048da049f87fe3f543795f3b1b511d774caa2787 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 28 Jun 2002 18:00:21 +0000 Subject: [PATCH] Patch from Julian Foad: Make locally-used strings local instead of global. (The safety and cleanliness benefit outweights the slight performance hit. If performance is an issue, the way these strings are used should be optimised.) Use existing defined constant instead of a literal number. --- src/Main/viewmgr.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Main/viewmgr.cxx b/src/Main/viewmgr.cxx index 7dbb9a159..eba47d0c9 100644 --- a/src/Main/viewmgr.cxx +++ b/src/Main/viewmgr.cxx @@ -28,8 +28,6 @@ #include "viewmgr.hxx" #include "fg_props.hxx" -// strings -string viewpath, nodepath, strdata; // Constructor FGViewMgr::FGViewMgr( void ) : @@ -48,6 +46,7 @@ void FGViewMgr::init () { char stridx [ 20 ]; + string viewpath, nodepath, strdata; bool from_model = false; bool at_model = false; int from_model_index = 0; @@ -175,6 +174,7 @@ void FGViewMgr::update (double dt) { char stridx [20]; + string viewpath, nodepath; double lon_deg, lat_deg, alt_ft, roll_deg, pitch_deg, heading_deg; FGViewer * view = get_current_view(); @@ -221,7 +221,7 @@ FGViewMgr::update (double dt) } // if lookat (type 1) then get target data... - if (loop_view->getType() == 1) { + if (loop_view->getType() == FG_LOOKAT) { nodepath = viewpath; nodepath += "/config/from-model"; if (!fgGetBool(nodepath.c_str())) { -- 2.39.5