Skip to content

Commit f6ae92e

Browse files
cbirkholdbcoconni
authored andcommitted
Fix: Don't pollute global namespace with std. (#1193)
1 parent 1dc9e11 commit f6ae92e

20 files changed

+191
-182
lines changed

matlab/JSBSimInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ JSBSimInterface::~JSBSimInterface(void)
8181
}
8282

8383
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84-
bool JSBSimInterface::OpenAircraft(const string& acName)
84+
bool JSBSimInterface::OpenAircraft(const std::string& acName)
8585
{
8686

8787
if (!fdmExec->GetAircraft()->GetAircraftName().empty()) return false;

src/initialization/FGLinearization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class JSBSIM_API FGLinearization
4040
{
4141
Vector2D<double> A,B,C,D;
4242
std::vector<double> x0, u0, y0;
43-
std::vector<string> x_names, u_names, y_names, x_units, u_units, y_units;
43+
std::vector<std::string> x_names, u_names, y_names, x_units, u_units, y_units;
4444
std::string aircraft_name;
4545
public:
4646
/**

src/initialization/FGTrim.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ CLASS DOCUMENTATION
110110
fgic->SetAltitudeFtIC(1000);
111111
fgic->SetClimbRate(500);
112112
if( !fgt.DoTrim() ) {
113-
cout << "Trim Failed" << endl;
113+
std::cout << "Trim Failed" << std::endl;
114114
}
115115
fgt.Report();
116116
@endcode

src/input_output/FGPropertyManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,15 @@ class JSBSIM_API FGPropertyManager
468468
{
469469
SGPropertyNode* property = root->getNode(name.c_str(), true);
470470
if (!property) {
471-
cerr << "Could not get or create property " << name << endl;
471+
std::cerr << "Could not get or create property " << name << std::endl;
472472
return;
473473
}
474474

475475
if (!property->tie(SGRawValuePointer<T>(pointer), false))
476-
cerr << "Failed to tie property " << name << " to a pointer" << endl;
476+
std::cerr << "Failed to tie property " << name << " to a pointer" << std::endl;
477477
else {
478478
tied_properties.push_back(PropertyState(property, nullptr));
479-
if (FGJSBBase::debug_lvl & 0x20) cout << name << endl;
479+
if (FGJSBBase::debug_lvl & 0x20) std::cout << name << std::endl;
480480
}
481481
}
482482

src/math/FGParameterValue.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ class JSBSIM_API FGParameterValue : public FGParameter
6464
FGParameterValue(Element* el, std::shared_ptr<FGPropertyManager> pm)
6565
: FGParameterValue(el->GetDataLine(), pm, el)
6666
{
67-
string value = el->GetDataLine();
67+
std::string value = el->GetDataLine();
6868

6969
if (el->GetNumDataLines() != 1 || value.empty()) {
70-
cerr << el->ReadFrom()
71-
<< "The element <" << el->GetName()
72-
<< "> must either contain a value number or a property name."
73-
<< endl;
70+
std::cerr << el->ReadFrom()
71+
<< "The element <" << el->GetName()
72+
<< "> must either contain a value number or a property name."
73+
<< std::endl;
7474
throw BaseException("FGParameterValue: Illegal argument defining: " + el->GetName());
7575
}
7676
}

src/math/FGPropertyValue.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ INCLUDES
3333

3434
#include "FGPropertyValue.h"
3535

36+
using namespace std;
37+
3638
namespace JSBSim {
3739

3840
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

src/models/FGAerodynamics.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ class JSBSIM_API FGAerodynamics : public FGModel
278278
typedef double (FGAerodynamics::*PMF)(int) const;
279279
void DetermineAxisSystem(Element* document);
280280
void ProcessAxesNameAndFrame(FGAerodynamics::eAxisType& axisType,
281-
const string& name, const string& frame,
282-
Element* el, const string& validNames);
281+
const std::string& name, const std::string& frame,
282+
Element* el, const std::string& validNames);
283283
void bind(void);
284284
void BuildStabilityTransformMatrices(void);
285285

src/models/FGAtmosphere.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ INCLUDES
4646
#include "FGAtmosphere.h"
4747
#include "input_output/FGLog.h"
4848

49+
using namespace std;
50+
4951
namespace JSBSim {
5052

5153
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

src/models/FGAtmosphere.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ class JSBSIM_API FGAtmosphere : public FGModel {
268268
/// Check that the pressure is within plausible boundaries.
269269
/// @param msg Message to display if the pressure is out of boundaries
270270
/// @param quiet Don't display the message if set to true
271-
double ValidatePressure(double p, const string& msg, bool quiet=false) const;
271+
double ValidatePressure(double p, const std::string& msg, bool quiet=false) const;
272272

273273
/// Check that the temperature is within plausible boundaries.
274274
/// @param msg Message to display if the pressure is out of boundaries
275275
/// @param quiet Don't display the message if set to true
276-
double ValidateTemperature(double t, const string& msg, bool quiet=false) const;
276+
double ValidateTemperature(double t, const std::string& msg, bool quiet=false) const;
277277

278278
/// @name ISA constants
279279
//@{

src/models/atmosphere/FGStandardAtmosphere.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ INCLUDES
5151
#include "FGStandardAtmosphere.h"
5252
#include "input_output/FGLog.h"
5353

54+
using namespace std;
55+
5456
namespace JSBSim {
5557

5658
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0 commit comments

Comments
 (0)