From 5a70245ba942fbdd97b2ae80151765f53ec4c6e2 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 18 Feb 2021 23:15:34 +0000 Subject: [PATCH] src/Aircraft/replay.*: modified to match change to simgear::HTTP::FileRequest::setCallback(). We now use a function pointer instead of a lambda. --- src/Aircraft/replay.cxx | 12 ++++++++---- src/Aircraft/replay.hxx | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Aircraft/replay.cxx b/src/Aircraft/replay.cxx index 1d1f308e6..fdc638ae6 100644 --- a/src/Aircraft/replay.cxx +++ b/src/Aircraft/replay.cxx @@ -1980,6 +1980,13 @@ void FGReplay::indexContinuousRecording(const void* data, size_t numbytes) } } +void FGReplay::call_indexContinuousRecording(void* ref, const void* data, size_t numbytes) +{ + FGReplay* self = (FGReplay*) ref; + SG_LOG(SG_GENERAL, SG_BULK, "calling indexContinuousRecording() data=" << data << " numbytes=" << numbytes); + self->indexContinuousRecording(data, numbytes); +} + /** Read a flight recorder tape with given filename from disk. * Copies MetaData's "meta" node into MetaMeta out-param. * Actual data and signal configuration is not read when in "Preview" mode. @@ -2026,10 +2033,7 @@ FGReplay::loadTape(const SGPath& Filename, bool Preview, SGPropertyNode& MetaMet // Always call indexContinuousRecording once in case there is // nothing to download. indexContinuousRecording(nullptr, 1 /*Zero means EOF. */); - filerequest->setCallback( [this](const void* data, size_t numbytes) { - SG_LOG(SG_GENERAL, SG_BULK, "calling indexContinuousRecording() data=" << data << " numbytes=" << numbytes); - indexContinuousRecording(data, numbytes); - }); + filerequest->setCallback(call_indexContinuousRecording, this); } else { indexContinuousRecording(nullptr, 0); diff --git a/src/Aircraft/replay.hxx b/src/Aircraft/replay.hxx index ed697e2c0..c3988e699 100644 --- a/src/Aircraft/replay.hxx +++ b/src/Aircraft/replay.hxx @@ -191,6 +191,10 @@ private: // void indexContinuousRecording(const void* data, size_t numbytes); + // Callback for use with simgear::HTTP::FileRequest::setCallback(). + // + static void call_indexContinuousRecording(void* ref, const void* data, size_t numbytes); + SGPropertyNode_ptr continuousWriteHeader( std::ofstream& out, const SGPath& path,