summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-06-23 10:20:03 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-06-23 10:20:03 +0200
commit5cabc167e646e9d80b70d6617a3f031d77453979 (patch)
treec95e00cb8002f429fc7040da85fdeb91c2b35728
parent69954149a432f7a77f2613e348a2089bf5bb2012 (diff)
downloadsink-5cabc167e646e9d80b70d6617a3f031d77453979.tar.gz
sink-5cabc167e646e9d80b70d6617a3f031d77453979.zip
Build with flatbuffers 1.7
There's a new template version that expects methods that QByteArray doesn't have but breaks the implicit conversion to const char *, std::string is safer anyways (doesn't require a null terminated string).
-rw-r--r--common/bufferutils.h2
-rw-r--r--common/pipeline.cpp8
-rw-r--r--common/resourceaccess.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/common/bufferutils.h b/common/bufferutils.h
index 6763ced..f0460b7 100644
--- a/common/bufferutils.h
+++ b/common/bufferutils.h
@@ -38,7 +38,7 @@ static flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::
38{ 38{
39 std::vector<flatbuffers::Offset<flatbuffers::String>> modifiedPropertiesList; 39 std::vector<flatbuffers::Offset<flatbuffers::String>> modifiedPropertiesList;
40 for (const auto &change : list) { 40 for (const auto &change : list) {
41 auto s = fbb.CreateString(change); 41 auto s = fbb.CreateString(change.toStdString());
42 modifiedPropertiesList.push_back(s); 42 modifiedPropertiesList.push_back(s);
43 } 43 }
44 return fbb.CreateVector(modifiedPropertiesList); 44 return fbb.CreateVector(modifiedPropertiesList);
diff --git a/common/pipeline.cpp b/common/pipeline.cpp
index dc6f128..f29c7db 100644
--- a/common/pipeline.cpp
+++ b/common/pipeline.cpp
@@ -303,8 +303,8 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size)
303 SinkTraceCtx(d->logCtx) << "Move of " << current.identifier() << "was successfull"; 303 SinkTraceCtx(d->logCtx) << "Move of " << current.identifier() << "was successfull";
304 if (isMove) { 304 if (isMove) {
305 flatbuffers::FlatBufferBuilder fbb; 305 flatbuffers::FlatBufferBuilder fbb;
306 auto entityId = fbb.CreateString(current.identifier()); 306 auto entityId = fbb.CreateString(current.identifier().toStdString());
307 auto type = fbb.CreateString(bufferType); 307 auto type = fbb.CreateString(bufferType.toStdString());
308 auto location = Sink::Commands::CreateDeleteEntity(fbb, current.revision(), entityId, type, true); 308 auto location = Sink::Commands::CreateDeleteEntity(fbb, current.revision(), entityId, type, true);
309 Sink::Commands::FinishDeleteEntityBuffer(fbb, location); 309 Sink::Commands::FinishDeleteEntityBuffer(fbb, location);
310 const auto data = BufferUtils::extractBuffer(fbb); 310 const auto data = BufferUtils::extractBuffer(fbb);
@@ -450,8 +450,8 @@ void Preprocessor::createEntity(const Sink::ApplicationDomain::ApplicationDomain
450 const auto entityBuffer = BufferUtils::extractBuffer(entityFbb); 450 const auto entityBuffer = BufferUtils::extractBuffer(entityFbb);
451 451
452 flatbuffers::FlatBufferBuilder fbb; 452 flatbuffers::FlatBufferBuilder fbb;
453 auto entityId = fbb.CreateString(entity.identifier()); 453 auto entityId = fbb.CreateString(entity.identifier().toStdString());
454 auto type = fbb.CreateString(typeName); 454 auto type = fbb.CreateString(typeName.toStdString());
455 auto delta = Sink::EntityBuffer::appendAsVector(fbb, entityBuffer.constData(), entityBuffer.size()); 455 auto delta = Sink::EntityBuffer::appendAsVector(fbb, entityBuffer.constData(), entityBuffer.size());
456 auto location = Sink::Commands::CreateCreateEntity(fbb, entityId, type, delta); 456 auto location = Sink::Commands::CreateCreateEntity(fbb, entityId, type, delta);
457 Sink::Commands::FinishCreateEntityBuffer(fbb, location); 457 Sink::Commands::FinishCreateEntityBuffer(fbb, location);
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp
index cf8b2e0..808d892 100644
--- a/common/resourceaccess.cpp
+++ b/common/resourceaccess.cpp
@@ -477,7 +477,7 @@ void ResourceAccess::connected()
477 477
478 { 478 {
479 flatbuffers::FlatBufferBuilder fbb; 479 flatbuffers::FlatBufferBuilder fbb;
480 auto name = fbb.CreateString(QString("PID: %1 ResourceAccess: %2").arg(QCoreApplication::applicationPid()).arg(reinterpret_cast<qlonglong>(this)).toLatin1()); 480 auto name = fbb.CreateString(QString("PID: %1 ResourceAccess: %2").arg(QCoreApplication::applicationPid()).arg(reinterpret_cast<qlonglong>(this)).toLatin1().toStdString());
481 auto command = Sink::Commands::CreateHandshake(fbb, name); 481 auto command = Sink::Commands::CreateHandshake(fbb, name);
482 Sink::Commands::FinishHandshakeBuffer(fbb, command); 482 Sink::Commands::FinishHandshakeBuffer(fbb, command);
483 Commands::write(d->socket.data(), ++d->messageId, Commands::HandshakeCommand, fbb); 483 Commands::write(d->socket.data(), ++d->messageId, Commands::HandshakeCommand, fbb);