Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Don't polute global namespace with std. #1193

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion matlab/JSBSimInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ JSBSimInterface::~JSBSimInterface(void)
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool JSBSimInterface::OpenAircraft(const string& acName)
bool JSBSimInterface::OpenAircraft(const std::string& acName)
{

if (!fdmExec->GetAircraft()->GetAircraftName().empty()) return false;
Expand Down
2 changes: 1 addition & 1 deletion src/initialization/FGLinearization.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class JSBSIM_API FGLinearization
{
Vector2D<double> A,B,C,D;
std::vector<double> x0, u0, y0;
std::vector<string> x_names, u_names, y_names, x_units, u_units, y_units;
std::vector<std::string> x_names, u_names, y_names, x_units, u_units, y_units;
std::string aircraft_name;
public:
/**
Expand Down
2 changes: 1 addition & 1 deletion src/initialization/FGTrim.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ CLASS DOCUMENTATION
fgic->SetAltitudeFtIC(1000);
fgic->SetClimbRate(500);
if( !fgt.DoTrim() ) {
cout << "Trim Failed" << endl;
std::cout << "Trim Failed" << std::endl;
}
fgt.Report();
@endcode
Expand Down
6 changes: 3 additions & 3 deletions src/input_output/FGPropertyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,15 +468,15 @@
{
SGPropertyNode* property = root->getNode(name.c_str(), true);
if (!property) {
cerr << "Could not get or create property " << name << endl;
std::cerr << "Could not get or create property " << name << std::endl;

Check warning on line 471 in src/input_output/FGPropertyManager.h

View check run for this annotation

Codecov / codecov/patch

src/input_output/FGPropertyManager.h#L471

Added line #L471 was not covered by tests
return;
}

if (!property->tie(SGRawValuePointer<T>(pointer), false))
cerr << "Failed to tie property " << name << " to a pointer" << endl;
std::cerr << "Failed to tie property " << name << " to a pointer" << std::endl;

Check warning on line 476 in src/input_output/FGPropertyManager.h

View check run for this annotation

Codecov / codecov/patch

src/input_output/FGPropertyManager.h#L476

Added line #L476 was not covered by tests
else {
tied_properties.push_back(PropertyState(property, nullptr));
if (FGJSBBase::debug_lvl & 0x20) cout << name << endl;
if (FGJSBBase::debug_lvl & 0x20) std::cout << name << std::endl;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/math/FGParameterValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ class JSBSIM_API FGParameterValue : public FGParameter
FGParameterValue(Element* el, std::shared_ptr<FGPropertyManager> pm)
: FGParameterValue(el->GetDataLine(), pm, el)
{
string value = el->GetDataLine();
std::string value = el->GetDataLine();

if (el->GetNumDataLines() != 1 || value.empty()) {
cerr << el->ReadFrom()
<< "The element <" << el->GetName()
<< "> must either contain a value number or a property name."
<< endl;
std::cerr << el->ReadFrom()
<< "The element <" << el->GetName()
<< "> must either contain a value number or a property name."
<< std::endl;
throw BaseException("FGParameterValue: Illegal argument defining: " + el->GetName());
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/math/FGPropertyValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ INCLUDES

#include "FGPropertyValue.h"

using namespace std;

namespace JSBSim {

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
4 changes: 2 additions & 2 deletions src/models/FGAerodynamics.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ class JSBSIM_API FGAerodynamics : public FGModel
typedef double (FGAerodynamics::*PMF)(int) const;
void DetermineAxisSystem(Element* document);
void ProcessAxesNameAndFrame(FGAerodynamics::eAxisType& axisType,
const string& name, const string& frame,
Element* el, const string& validNames);
const std::string& name, const std::string& frame,
Element* el, const std::string& validNames);
void bind(void);
void BuildStabilityTransformMatrices(void);

Expand Down
2 changes: 2 additions & 0 deletions src/models/FGAtmosphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ INCLUDES
#include "FGAtmosphere.h"
#include "input_output/FGLog.h"

using namespace std;

namespace JSBSim {

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
4 changes: 2 additions & 2 deletions src/models/FGAtmosphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ class JSBSIM_API FGAtmosphere : public FGModel {
/// Check that the pressure is within plausible boundaries.
/// @param msg Message to display if the pressure is out of boundaries
/// @param quiet Don't display the message if set to true
double ValidatePressure(double p, const string& msg, bool quiet=false) const;
double ValidatePressure(double p, const std::string& msg, bool quiet=false) const;

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

/// @name ISA constants
//@{
Expand Down
2 changes: 2 additions & 0 deletions src/models/atmosphere/FGStandardAtmosphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ INCLUDES
#include "FGStandardAtmosphere.h"
#include "input_output/FGLog.h"

using namespace std;

namespace JSBSim {

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
4 changes: 2 additions & 2 deletions src/models/propulsion/FGTurbine.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
public:
FGSpoolUp(FGTurbine* _turb, double BPR, double factor)
: turb(_turb), delay(factor * 90.0 / (BPR + 3.0)) {}
string GetName(void) const { return string(); };
std::string GetName(void) const { return std::string(); };

Check warning on line 331 in src/models/propulsion/FGTurbine.h

View check run for this annotation

Codecov / codecov/patch

src/models/propulsion/FGTurbine.h#L331

Added line #L331 was not covered by tests
double GetValue(void) const {
// adjust acceleration for N2 and atmospheric density
double n = std::min(1.0, turb->N2norm + 0.1);
Expand All @@ -345,7 +345,7 @@
FGSimplifiedTSFC(FGTurbine* _turb, double tsfcVal)
: turb(_turb), tsfc(tsfcVal) {}

string GetName(void) const { return string(); }
std::string GetName(void) const { return std::string(); }

Check warning on line 348 in src/models/propulsion/FGTurbine.h

View check run for this annotation

Codecov / codecov/patch

src/models/propulsion/FGTurbine.h#L348

Added line #L348 was not covered by tests

double GetValue(void) const {
// Correction/denormalisation for temp and thrust
Expand Down
1 change: 1 addition & 0 deletions src/simgear/props/props.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ using std::vector;
using std::stringstream;

using namespace simgear;
using namespace std;

////////////////////////////////////////////////////////////////////////
// Local classes.
Expand Down
2 changes: 0 additions & 2 deletions src/simgear/props/props.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ namespace boost {
// XXX This whole file should be in the simgear namespace, but I don't
// have the guts yet...

using namespace std;

namespace simgear
{

Expand Down
Loading
Loading