1
0
Fork 0

Fix some warnings from current Apple clang

- remove some unused vars
- remove use of std::mem_fn / std::bind2nd
This commit is contained in:
James Turner 2020-03-10 17:02:08 +00:00
parent 40a85cae28
commit e509711075
4 changed files with 11 additions and 14 deletions

View file

@ -537,9 +537,6 @@ bool FGReportSetting::Test()
return d;
}
static const char* hexTable = "0123456789ABCDEF";
std::string FGReportSetting::reportBytes(const std::string& moduleName) const
{
FGNasalSys *nas = globals->get_subsystem<FGNasalSys>();
@ -576,7 +573,8 @@ std::string FGReportSetting::reportBytes(const std::string& moduleName) const
// can't access FGInputDevice here to check debugEvents flag
#if 0
std::ostringstream byteString;
static const char* hexTable = "0123456789ABCDEF";
for (int i=0; i<s.size(); ++i) {
uint8_t uc = static_cast<uint8_t>(s[i]);
byteString << hexTable[uc >> 4];

View file

@ -110,8 +110,9 @@ void SceneryPager::signalEndFrame()
}
if (!_pagerRequests.empty()) {
arePagerRequests = true;
for_each(_pagerRequests.begin(), _pagerRequests.end(),
bind2nd(mem_fun_ref(&PagerRequest::doRequest), this));
for (auto req : _pagerRequests) {
req.doRequest(this);
}
_pagerRequests.clear();
}
if (areDeleteRequests && !arePagerRequests) {

View file

@ -108,7 +108,9 @@ std::vector<T> extract( const std::vector<C1>& in,
T (C2::*getter)() const )
{
std::vector<T> ret(in.size());
std::transform(in.begin(), in.end(), ret.begin(), std::mem_fun(getter));
std::transform(in.begin(), in.end(), ret.begin(), [getter](const C1& c)
{ return (c->*getter)(); }
);
return ret;
}

View file

@ -219,15 +219,12 @@ static void f_timerObj_setSimTime(TimerObj& timer, naContext c, naRef value)
class TimeStampObj : public SGReferenced
{
public:
TimeStampObj(Context *c, FGNasalSys* sys) :
_sys(sys)
TimeStampObj(Context *c)
{
timestamp.stamp();
}
virtual ~TimeStampObj()
{
}
virtual ~TimeStampObj() = default;
void stamp()
{
@ -243,7 +240,6 @@ public:
}
private:
SGTimeStamp timestamp;
FGNasalSys* _sys;
};
typedef SGSharedPtr<TimeStampObj> TimeStampObjRef;
@ -600,7 +596,7 @@ static naRef f_makeTimer(naContext c, naRef me, int argc, naRef* args)
static naRef f_maketimeStamp(naContext c, naRef me, int argc, naRef* args)
{
TimeStampObj* timeStampObj = new TimeStampObj(c, nasalSys);
TimeStampObj* timeStampObj = new TimeStampObj(c);
return nasal::to_nasal(c, timeStampObj);
}