From 10355a74ace3a1edab5ec8c7968569239cc53bfd Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Mon, 14 Oct 2019 23:32:37 -0700 Subject: [PATCH] More agressive warning fixes capnp/lib/capnp.cpp:35163:294: warning: moving a temporary object prevents copy elision [-Wpessimizing-move] ...*)__pyx_t_3), new ::capnp::DynamicStruct::Pipeline(std::move((( ::capn... ^ capnp/lib/capnp.cpp:35163:294: note: remove std::move call here ...std::move((( ::capnp::DynamicValue::Pipeline)__pyx_v_self->thisptr->get(__pyx_t_5)).releaseAs< ::capnp::DynamicStruct>())... ^~~~~~~~~~ ~ capnp/lib/capnp.cpp:39540:53: warning: moving a temporary object prevents copy elision [-Wpessimizing-move] __pyx_v_self->thisptr = new ::kj::AsyncIoContext(std::move( ::kj::se... ^ capnp/lib/capnp.cpp:39540:53: note: remove std::move call here ...= new ::kj::AsyncIoContext(std::move( ::kj::setupAsyncIo())); ^~~~~~~~~~ ~ capnp/lib/capnp.cpp:47838:294: warning: moving a temporary object prevents copy elision [-Wpessimizing-move] ...*)__pyx_t_3), new ::capnp::DynamicStruct::Pipeline(std::move((( ::capn... ^ capnp/lib/capnp.cpp:47838:294: note: remove std::move call here ...std::move((( ::capnp::DynamicValue::Pipeline)__pyx_v_self->thisptr->get(__pyx_t_5)).releaseAs< ::capnp::DynamicStruct>())... ^~~~~~~~~~ ~ --- capnp/lib/capnp.pyx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/capnp/lib/capnp.pyx b/capnp/lib/capnp.pyx index 1310ea1..a222e2b 100644 --- a/capnp/lib/capnp.pyx +++ b/capnp/lib/capnp.pyx @@ -1477,7 +1477,7 @@ cdef class _DynamicStructPipeline: if type == capnp.TYPE_CAPABILITY: return _DynamicCapabilityClient()._init((self.thisptr.get(field)).asCapability(), self._parent) elif type == capnp.TYPE_STRUCT: - return _DynamicStructPipeline()._init(new C_DynamicStruct.Pipeline(moveStructPipeline((self.thisptr.get(field)).asStruct())), self._parent) + return _DynamicStructPipeline()._init(new C_DynamicStruct.Pipeline((self.thisptr.get(field)).asStruct()), self._parent) elif type == capnp.TYPE_UNKNOWN: raise KjException("Cannot convert type to Python. Type is unknown by capnproto library") else: @@ -1636,7 +1636,7 @@ cdef class _EventLoop: self._init() cdef _init(self) except +reraise_kj_exception: - self.thisptr = new capnp.AsyncIoContext(moveAsyncContext(capnp.setupAsyncIo())) + self.thisptr = new capnp.AsyncIoContext(capnp.setupAsyncIo()) def __dealloc__(self): del self.thisptr #TODO:MEMORY: fix problems with Promises still being around @@ -1976,7 +1976,7 @@ cdef class _RemotePromise: if type == capnp.TYPE_CAPABILITY: return _DynamicCapabilityClient()._init((self.thisptr.get(field)).asCapability(), self._parent) elif type == capnp.TYPE_STRUCT: - return _DynamicStructPipeline()._init(new C_DynamicStruct.Pipeline(moveStructPipeline((self.thisptr.get(field)).asStruct())), self._parent) + return _DynamicStructPipeline()._init(new C_DynamicStruct.Pipeline((self.thisptr.get(field)).asStruct()), self._parent) elif type == capnp.TYPE_UNKNOWN: raise KjException("Cannot convert type to Python. Type is unknown by capnproto library") else: @@ -3128,6 +3128,7 @@ cdef class SchemaParser: self._last_import_array = importArray ret = _ParsedSchema() + # TODO (HaaTa): Convert to parseFromDirectory() as per deprecation note ret._init_child(self.thisptr.parseDiskFile(displayName, diskPath, importArray.asArrayPtr())) return ret