[{"id":3439,"web_url":"https://patchwork.libcamera.org/comment/3439/","msgid":"<c33c4a63-f7fd-cb7b-78d7-0a0508042e4a@ideasonboard.com>","date":"2020-01-14T02:01:18","subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: Switch from\n\tutils::make_unique to std::make_unique","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 14/01/2020 00:15, Laurent Pinchart wrote:\n> Now that we're using C++-14, drop utils::make_unique for\n> std::make_unique.\n\nLooks good to me, and removes code!\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/android/camera_device.cpp                      |  2 +-\n>  src/ipa/ipa_vimc.cpp                               |  3 +--\n>  src/ipa/libipa/ipa_interface_wrapper.cpp           |  2 +-\n>  src/ipa/rkisp1/rkisp1.cpp                          |  2 +-\n>  src/libcamera/bound_method.cpp                     |  5 ++---\n>  src/libcamera/control_serializer.cpp               |  2 +-\n>  src/libcamera/device_enumerator.cpp                |  5 ++---\n>  src/libcamera/include/ipa_proxy.h                  |  3 +--\n>  src/libcamera/include/utils.h                      |  7 -------\n>  src/libcamera/ipa_manager.cpp                      |  2 +-\n>  src/libcamera/pipeline/ipu3/ipu3.cpp               |  2 +-\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 14 +++++++-------\n>  src/libcamera/pipeline/uvcvideo.cpp                |  2 +-\n>  src/libcamera/pipeline/vimc.cpp                    |  2 +-\n>  .../proxy/worker/ipa_proxy_linux_worker.cpp        |  3 +--\n>  src/libcamera/utils.cpp                            |  5 -----\n>  src/libcamera/v4l2_device.cpp                      |  2 +-\n>  src/libcamera/v4l2_videodevice.cpp                 |  2 +-\n>  src/v4l2/v4l2_camera.cpp                           |  3 +--\n>  src/v4l2/v4l2_camera_proxy.cpp                     |  2 +-\n>  test/ipa/ipa_wrappers_test.cpp                     |  3 +--\n>  test/message.cpp                                   |  5 ++---\n>  22 files changed, 29 insertions(+), 49 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index a98fd744f534..67c1d47e67ed 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -860,7 +860,7 @@ std::unique_ptr<CameraMetadata> CameraDevice::getResultMetadata(int frame_number\n>  \t * Currently: 12 entries, 36 bytes\n>  \t */\n>  \tstd::unique_ptr<CameraMetadata> resultMetadata =\n> -\t\tutils::make_unique<CameraMetadata>(15, 50);\n> +\t\tstd::make_unique<CameraMetadata>(15, 50);\n>  \tif (!resultMetadata->isValid()) {\n>  \t\tLOG(HAL, Error) << \"Failed to allocate static metadata\";\n>  \t\treturn nullptr;\n> diff --git a/src/ipa/ipa_vimc.cpp b/src/ipa/ipa_vimc.cpp\n> index 8f03e811acc7..4751ad919a0f 100644\n> --- a/src/ipa/ipa_vimc.cpp\n> +++ b/src/ipa/ipa_vimc.cpp\n> @@ -20,7 +20,6 @@\n>  #include \"libipa/ipa_interface_wrapper.h\"\n>  \n>  #include \"log.h\"\n> -#include \"utils.h\"\n>  \n>  namespace libcamera {\n>  \n> @@ -113,7 +112,7 @@ const struct IPAModuleInfo ipaModuleInfo = {\n>  \n>  struct ipa_context *ipaCreate()\n>  {\n> -\treturn new IPAInterfaceWrapper(utils::make_unique<IPAVimc>());\n> +\treturn new IPAInterfaceWrapper(std::make_unique<IPAVimc>());\n>  }\n>  }\n>  \n> diff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp\n> index 3628a785dc3e..b93c1c1f1c1a 100644\n> --- a/src/ipa/libipa/ipa_interface_wrapper.cpp\n> +++ b/src/ipa/libipa/ipa_interface_wrapper.cpp\n> @@ -45,7 +45,7 @@ namespace libcamera {\n>   *\n>   * struct ipa_context *ipaCreate()\n>   * {\n> - * \treturn new IPAInterfaceWrapper(utils::make_unique<MyIPA>());\n> + * \treturn new IPAInterfaceWrapper(std::make_unique<MyIPA>());\n>   * }\n>   * \\endcode\n>   *\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index a8dd1645d3e8..438b3c66f77a 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -278,7 +278,7 @@ const struct IPAModuleInfo ipaModuleInfo = {\n>  \n>  struct ipa_context *ipaCreate()\n>  {\n> -\treturn new IPAInterfaceWrapper(utils::make_unique<IPARkISP1>());\n> +\treturn new IPAInterfaceWrapper(std::make_unique<IPARkISP1>());\n>  }\n>  }\n>  \n> diff --git a/src/libcamera/bound_method.cpp b/src/libcamera/bound_method.cpp\n> index 8e95c7eec92c..e18c2eb4c68e 100644\n> --- a/src/libcamera/bound_method.cpp\n> +++ b/src/libcamera/bound_method.cpp\n> @@ -10,7 +10,6 @@\n>  #include \"message.h\"\n>  #include \"semaphore.h\"\n>  #include \"thread.h\"\n> -#include \"utils.h\"\n>  \n>  /**\n>   * \\file bound_method.h\n> @@ -84,7 +83,7 @@ bool BoundMethodBase::activatePack(std::shared_ptr<BoundMethodPackBase> pack,\n>  \n>  \tcase ConnectionTypeQueued: {\n>  \t\tstd::unique_ptr<Message> msg =\n> -\t\t\tutils::make_unique<InvokeMessage>(this, pack, nullptr, deleteMethod);\n> +\t\t\tstd::make_unique<InvokeMessage>(this, pack, nullptr, deleteMethod);\n>  \t\tobject_->postMessage(std::move(msg));\n>  \t\treturn false;\n>  \t}\n> @@ -93,7 +92,7 @@ bool BoundMethodBase::activatePack(std::shared_ptr<BoundMethodPackBase> pack,\n>  \t\tSemaphore semaphore;\n>  \n>  \t\tstd::unique_ptr<Message> msg =\n> -\t\t\tutils::make_unique<InvokeMessage>(this, pack, &semaphore, deleteMethod);\n> +\t\t\tstd::make_unique<InvokeMessage>(this, pack, &semaphore, deleteMethod);\n>  \t\tobject_->postMessage(std::move(msg));\n>  \n>  \t\tsemaphore.acquire();\n> diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp\n> index a5d6d875c76f..803ac16c2456 100644\n> --- a/src/libcamera/control_serializer.cpp\n> +++ b/src/libcamera/control_serializer.cpp\n> @@ -414,7 +414,7 @@ ControlInfoMap ControlSerializer::deserialize<ControlInfoMap>(ByteStreamBuffer &\n>  \t\t * \\todo Find a way to preserve the control name for debugging\n>  \t\t * purpose.\n>  \t\t */\n> -\t\tcontrolIds_.emplace_back(utils::make_unique<ControlId>(entry.id, \"\", type));\n> +\t\tcontrolIds_.emplace_back(std::make_unique<ControlId>(entry.id, \"\", type));\n>  \n>  \t\tif (entry.offset != values.offset()) {\n>  \t\t\tLOG(Serializer, Error)\n> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\n> index 0b596bcec363..a8b5c90f5a5d 100644\n> --- a/src/libcamera/device_enumerator.cpp\n> +++ b/src/libcamera/device_enumerator.cpp\n> @@ -13,7 +13,6 @@\n>  \n>  #include \"log.h\"\n>  #include \"media_device.h\"\n> -#include \"utils.h\"\n>  \n>  /**\n>   * \\file device_enumerator.h\n> @@ -145,7 +144,7 @@ std::unique_ptr<DeviceEnumerator> DeviceEnumerator::create()\n>  \tstd::unique_ptr<DeviceEnumerator> enumerator;\n>  \n>  #ifdef HAVE_LIBUDEV\n> -\tenumerator = utils::make_unique<DeviceEnumeratorUdev>();\n> +\tenumerator = std::make_unique<DeviceEnumeratorUdev>();\n>  \tif (!enumerator->init())\n>  \t\treturn enumerator;\n>  #endif\n> @@ -154,7 +153,7 @@ std::unique_ptr<DeviceEnumerator> DeviceEnumerator::create()\n>  \t * Either udev is not available or udev initialization failed. Fall back\n>  \t * on the sysfs enumerator.\n>  \t */\n> -\tenumerator = utils::make_unique<DeviceEnumeratorSysfs>();\n> +\tenumerator = std::make_unique<DeviceEnumeratorSysfs>();\n>  \tif (!enumerator->init())\n>  \t\treturn enumerator;\n>  \n> diff --git a/src/libcamera/include/ipa_proxy.h b/src/libcamera/include/ipa_proxy.h\n> index add40b4b3368..e696551af39f 100644\n> --- a/src/libcamera/include/ipa_proxy.h\n> +++ b/src/libcamera/include/ipa_proxy.h\n> @@ -14,7 +14,6 @@\n>  #include <ipa/ipa_interface.h>\n>  \n>  #include \"ipa_module.h\"\n> -#include \"utils.h\"\n>  \n>  namespace libcamera {\n>  \n> @@ -56,7 +55,7 @@ public:\t\t\t\t\t\t\t\\\n>  \tproxy##Factory() : IPAProxyFactory(#proxy) {}\t\\\n>  \tstd::unique_ptr<IPAProxy> create(IPAModule *ipam)\t\\\n>  \t{\t\t\t\t\t\t\\\n> -\t\treturn utils::make_unique<proxy>(ipam);\t\\\n> +\t\treturn std::make_unique<proxy>(ipam);\t\\\n>  \t}\t\t\t\t\t\t\\\n>  };\t\t\t\t\t\t\t\\\n>  static proxy##Factory global_##proxy##Factory;\n> diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h\n> index badc77533fa1..e467eb21c518 100644\n> --- a/src/libcamera/include/utils.h\n> +++ b/src/libcamera/include/utils.h\n> @@ -32,13 +32,6 @@ namespace utils {\n>  \n>  const char *basename(const char *path);\n>  \n> -/* C++11 doesn't provide std::make_unique */\n> -template<typename T, typename... Args>\n> -std::unique_ptr<T> make_unique(Args&&... args)\n> -{\n> -\treturn std::unique_ptr<T>(new T(std::forward<Args>(args)...));\n> -}\n> -\n>  char *secure_getenv(const char *name);\n>  \n>  template<class InputIt1, class InputIt2>\n> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp\n> index 90eef12dbaf5..92adc6c45015 100644\n> --- a/src/libcamera/ipa_manager.cpp\n> +++ b/src/libcamera/ipa_manager.cpp\n> @@ -264,7 +264,7 @@ std::unique_ptr<IPAInterface> IPAManager::createIPA(PipelineHandler *pipe,\n>  \tif (!ctx)\n>  \t\treturn nullptr;\n>  \n> -\treturn utils::make_unique<IPAContextWrapper>(ctx);\n> +\treturn std::make_unique<IPAContextWrapper>(ctx);\n>  }\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 7894084a025e..8e8e370922ad 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -876,7 +876,7 @@ int PipelineHandlerIPU3::registerCameras()\n>  \tunsigned int numCameras = 0;\n>  \tfor (unsigned int id = 0; id < 4 && numCameras < 2; ++id) {\n>  \t\tstd::unique_ptr<IPU3CameraData> data =\n> -\t\t\tutils::make_unique<IPU3CameraData>(this);\n> +\t\t\tstd::make_unique<IPU3CameraData>(this);\n>  \t\tstd::set<Stream *> streams = {\n>  \t\t\t&data->outStream_,\n>  \t\t\t&data->vfStream_,\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 389a99cf52bd..0b3dd9759387 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -388,9 +388,9 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,\n>  \tswitch (action.operation) {\n>  \tcase RKISP1_IPA_ACTION_V4L2_SET: {\n>  \t\tconst ControlList &controls = action.controls[0];\n> -\t\ttimeline_.scheduleAction(utils::make_unique<RkISP1ActionSetSensor>(frame,\n> -\t\t\t\t\t\t\t\t\t\t   sensor_,\n> -\t\t\t\t\t\t\t\t\t\t   controls));\n> +\t\ttimeline_.scheduleAction(std::make_unique<RkISP1ActionSetSensor>(frame,\n> +\t\t\t\t\t\t\t\t\t\t sensor_,\n> +\t\t\t\t\t\t\t\t\t\t controls));\n>  \t\tbreak;\n>  \t}\n>  \tcase RKISP1_IPA_ACTION_PARAM_FILLED: {\n> @@ -846,9 +846,9 @@ int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera,\n>  \top.controls = { request->controls() };\n>  \tdata->ipa_->processEvent(op);\n>  \n> -\tdata->timeline_.scheduleAction(utils::make_unique<RkISP1ActionQueueBuffers>(data->frame_,\n> -\t\t\t\t\t\t\t\t\t\t    data,\n> -\t\t\t\t\t\t\t\t\t\t    this));\n> +\tdata->timeline_.scheduleAction(std::make_unique<RkISP1ActionQueueBuffers>(data->frame_,\n> +\t\t\t\t\t\t\t\t\t\t  data,\n> +\t\t\t\t\t\t\t\t\t\t  this));\n>  \n>  \tdata->frame_++;\n>  \n> @@ -892,7 +892,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>  \tint ret;\n>  \n>  \tstd::unique_ptr<RkISP1CameraData> data =\n> -\t\tutils::make_unique<RkISP1CameraData>(this);\n> +\t\tstd::make_unique<RkISP1CameraData>(this);\n>  \n>  \tControlInfoMap::Map ctrls;\n>  \tctrls.emplace(std::piecewise_construct,\n> diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\n> index 47916ffb4536..83093676ec73 100644\n> --- a/src/libcamera/pipeline/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo.cpp\n> @@ -296,7 +296,7 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n>  \tif (!media)\n>  \t\treturn false;\n>  \n> -\tstd::unique_ptr<UVCCameraData> data = utils::make_unique<UVCCameraData>(this);\n> +\tstd::unique_ptr<UVCCameraData> data = std::make_unique<UVCCameraData>(this);\n>  \n>  \t/* Locate and initialise the camera data with the default video node. */\n>  \tconst std::vector<MediaEntity *> &entities = media->entities();\n> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> index 1700ac967299..c99560a45cfa 100644\n> --- a/src/libcamera/pipeline/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc.cpp\n> @@ -365,7 +365,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n>  \tif (!media)\n>  \t\treturn false;\n>  \n> -\tstd::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this);\n> +\tstd::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this);\n>  \n>  \tdata->ipa_ = IPAManager::instance()->createIPA(this, 0, 0);\n>  \tif (data->ipa_ == nullptr)\n> diff --git a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp\n> index 07380c16e2d5..7d6287c7115b 100644\n> --- a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp\n> +++ b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp\n> @@ -17,7 +17,6 @@\n>  #include \"ipc_unixsocket.h\"\n>  #include \"log.h\"\n>  #include \"thread.h\"\n> -#include \"utils.h\"\n>  \n>  using namespace libcamera;\n>  \n> @@ -58,7 +57,7 @@ int main(int argc, char **argv)\n>  \t\t<< \"Starting worker for IPA module \" << argv[1]\n>  \t\t<< \" with IPC fd = \" << fd;\n>  \n> -\tstd::unique_ptr<IPAModule> ipam = utils::make_unique<IPAModule>(argv[1]);\n> +\tstd::unique_ptr<IPAModule> ipam = std::make_unique<IPAModule>(argv[1]);\n>  \tif (!ipam->isValid() || !ipam->load()) {\n>  \t\tLOG(IPAProxyLinuxWorker, Error)\n>  \t\t\t<< \"IPAModule \" << argv[1] << \" should be valid but isn't\";\n> diff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp\n> index 5de9e4813353..4beffdab5eb6 100644\n> --- a/src/libcamera/utils.cpp\n> +++ b/src/libcamera/utils.cpp\n> @@ -70,11 +70,6 @@ char *secure_getenv(const char *name)\n>  #endif\n>  }\n>  \n> -/**\n> - * \\fn libcamera::utils::make_unique(Args &&... args)\n> - * \\brief Constructs an object of type T and wraps it in a std::unique_ptr.\n> - */\n> -\n>  /**\n>   * \\fn libcamera::utils::set_overlap(InputIt1 first1, InputIt1 last1,\n>   *\t\t\t\t     InputIt2 first2, InputIt2 last2)\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index c13eddc84c7c..1698d2451449 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -380,7 +380,7 @@ void V4L2Device::listControls()\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> -\t\tcontrolIds_.emplace_back(utils::make_unique<V4L2ControlId>(ctrl));\n> +\t\tcontrolIds_.emplace_back(std::make_unique<V4L2ControlId>(ctrl));\n>  \t\tctrls.emplace(controlIds_.back().get(), V4L2ControlRange(ctrl));\n>  \t}\n>  \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 66adf7b29572..18220b81af21 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1054,7 +1054,7 @@ V4L2VideoDevice::createBuffer(const struct v4l2_buffer &buf)\n>  \t\tplanes.push_back(std::move(plane));\n>  \t}\n>  \n> -\treturn utils::make_unique<FrameBuffer>(std::move(planes));\n> +\treturn std::make_unique<FrameBuffer>(std::move(planes));\n>  }\n>  \n>  FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index,\n> diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp\n> index 44cb4e7c551b..e7018b566475 100644\n> --- a/src/v4l2/v4l2_camera.cpp\n> +++ b/src/v4l2/v4l2_camera.cpp\n> @@ -10,7 +10,6 @@\n>  #include <errno.h>\n>  \n>  #include \"log.h\"\n> -#include \"utils.h\"\n>  \n>  using namespace libcamera;\n>  \n> @@ -81,7 +80,7 @@ void V4L2Camera::requestComplete(Request *request)\n>  \tbufferLock_.lock();\n>  \tFrameBuffer *buffer = request->buffers().begin()->second;\n>  \tstd::unique_ptr<Buffer> metadata =\n> -\t\tutils::make_unique<Buffer>(request->cookie(), buffer->metadata());\n> +\t\tstd::make_unique<Buffer>(request->cookie(), buffer->metadata());\n>  \tcompletedBuffers_.push_back(std::move(metadata));\n>  \tbufferLock_.unlock();\n>  \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 28e587226a97..3013a3d17568 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -32,7 +32,7 @@ LOG_DECLARE_CATEGORY(V4L2Compat);\n>  V4L2CameraProxy::V4L2CameraProxy(unsigned int index,\n>  \t\t\t\t std::shared_ptr<Camera> camera)\n>  \t: refcount_(0), index_(index), bufferCount_(0), currentBuf_(0),\n> -\t  vcam_(utils::make_unique<V4L2Camera>(camera))\n> +\t  vcam_(std::make_unique<V4L2Camera>(camera))\n>  {\n>  \tquerycap(camera);\n>  }\n> diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp\n> index e711e4fe318d..1ae1781169c8 100644\n> --- a/test/ipa/ipa_wrappers_test.cpp\n> +++ b/test/ipa/ipa_wrappers_test.cpp\n> @@ -18,7 +18,6 @@\n>  #include \"device_enumerator.h\"\n>  #include \"ipa_context_wrapper.h\"\n>  #include \"media_device.h\"\n> -#include \"utils.h\"\n>  #include \"v4l2_subdevice.h\"\n>  \n>  #include \"test.h\"\n> @@ -254,7 +253,7 @@ protected:\n>  \t\tif (ret)\n>  \t\t\treturn TestFail;\n>  \n> -\t\tstd::unique_ptr<IPAInterface> intf = utils::make_unique<TestIPAInterface>();\n> +\t\tstd::unique_ptr<IPAInterface> intf = std::make_unique<TestIPAInterface>();\n>  \t\twrapper_ = new IPAContextWrapper(new IPAInterfaceWrapper(std::move(intf)));\n>  \t\twrapper_->queueFrameAction.connect(this, &IPAWrappersTest::queueFrameAction);\n>  \n> diff --git a/test/message.cpp b/test/message.cpp\n> index 7ebedb557502..478bc79dffa6 100644\n> --- a/test/message.cpp\n> +++ b/test/message.cpp\n> @@ -12,7 +12,6 @@\n>  #include \"message.h\"\n>  #include \"thread.h\"\n>  #include \"test.h\"\n> -#include \"utils.h\"\n>  \n>  using namespace std;\n>  using namespace libcamera;\n> @@ -92,7 +91,7 @@ protected:\n>  \n>  \t\tthread_.start();\n>  \n> -\t\treceiver.postMessage(utils::make_unique<Message>(Message::None));\n> +\t\treceiver.postMessage(std::make_unique<Message>(Message::None));\n>  \n>  \t\tthis_thread::sleep_for(chrono::milliseconds(100));\n>  \n> @@ -114,7 +113,7 @@ protected:\n>  \t\t */\n>  \t\tSlowMessageReceiver *slowReceiver = new SlowMessageReceiver();\n>  \t\tslowReceiver->moveToThread(&thread_);\n> -\t\tslowReceiver->postMessage(utils::make_unique<Message>(Message::None));\n> +\t\tslowReceiver->postMessage(std::make_unique<Message>(Message::None));\n>  \n>  \t\tthis_thread::sleep_for(chrono::milliseconds(10));\n>  \n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C66ED6070F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2020 03:01:22 +0100 (CET)","from [192.168.1.106]\n\t(cpc108967-cmbg20-2-0-cust420.5-4.cable.virginm.net [81.101.7.165])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E9C1B563;\n\tTue, 14 Jan 2020 03:01:21 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1578967282;\n\tbh=7QTJbgKxMQtY8CFLyrm7s6A0aSoX/Ovi6g0tz5KBvX0=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=E9PpJ2k7R7W7+08Q5WIWjoqq+JNZr+B1DmNAvnvZC3wWt9V5D4Lono82LGE/PTQ54\n\t/3pfOmJ51YrgtUt5CYdw3Bj4BJWMwoDYHQlbJ7fJf+71pbnm/uzSznOPq6A0nHqXQ8\n\tBsO0RyuHbcbrKb0zEx6k7u9SUj+10SG1Tu41BJPY=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20200114001531.27129-1-laurent.pinchart@ideasonboard.com>\n\t<20200114001531.27129-2-laurent.pinchart@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\t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\n\tWZw01QYHU/GUV/zHJSFk","Organization":"Ideas on Board","Message-ID":"<c33c4a63-f7fd-cb7b-78d7-0a0508042e4a@ideasonboard.com>","Date":"Tue, 14 Jan 2020 02:01:18 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.9.0","MIME-Version":"1.0","In-Reply-To":"<20200114001531.27129-2-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: Switch from\n\tutils::make_unique to std::make_unique","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 14 Jan 2020 02:01:23 -0000"}},{"id":3447,"web_url":"https://patchwork.libcamera.org/comment/3447/","msgid":"<20200114142217.GB925806@oden.dyn.berto.se>","date":"2020-01-14T14:22:17","subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: Switch from\n\tutils::make_unique to std::make_unique","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your patch.\n\nOn 2020-01-14 02:15:31 +0200, Laurent Pinchart wrote:\n> Now that we're using C++-14, drop utils::make_unique for\n> std::make_unique.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/android/camera_device.cpp                      |  2 +-\n>  src/ipa/ipa_vimc.cpp                               |  3 +--\n>  src/ipa/libipa/ipa_interface_wrapper.cpp           |  2 +-\n>  src/ipa/rkisp1/rkisp1.cpp                          |  2 +-\n>  src/libcamera/bound_method.cpp                     |  5 ++---\n>  src/libcamera/control_serializer.cpp               |  2 +-\n>  src/libcamera/device_enumerator.cpp                |  5 ++---\n>  src/libcamera/include/ipa_proxy.h                  |  3 +--\n>  src/libcamera/include/utils.h                      |  7 -------\n>  src/libcamera/ipa_manager.cpp                      |  2 +-\n>  src/libcamera/pipeline/ipu3/ipu3.cpp               |  2 +-\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 14 +++++++-------\n>  src/libcamera/pipeline/uvcvideo.cpp                |  2 +-\n>  src/libcamera/pipeline/vimc.cpp                    |  2 +-\n>  .../proxy/worker/ipa_proxy_linux_worker.cpp        |  3 +--\n>  src/libcamera/utils.cpp                            |  5 -----\n>  src/libcamera/v4l2_device.cpp                      |  2 +-\n>  src/libcamera/v4l2_videodevice.cpp                 |  2 +-\n>  src/v4l2/v4l2_camera.cpp                           |  3 +--\n>  src/v4l2/v4l2_camera_proxy.cpp                     |  2 +-\n>  test/ipa/ipa_wrappers_test.cpp                     |  3 +--\n>  test/message.cpp                                   |  5 ++---\n>  22 files changed, 29 insertions(+), 49 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index a98fd744f534..67c1d47e67ed 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -860,7 +860,7 @@ std::unique_ptr<CameraMetadata> CameraDevice::getResultMetadata(int frame_number\n>  \t * Currently: 12 entries, 36 bytes\n>  \t */\n>  \tstd::unique_ptr<CameraMetadata> resultMetadata =\n> -\t\tutils::make_unique<CameraMetadata>(15, 50);\n> +\t\tstd::make_unique<CameraMetadata>(15, 50);\n>  \tif (!resultMetadata->isValid()) {\n>  \t\tLOG(HAL, Error) << \"Failed to allocate static metadata\";\n>  \t\treturn nullptr;\n> diff --git a/src/ipa/ipa_vimc.cpp b/src/ipa/ipa_vimc.cpp\n> index 8f03e811acc7..4751ad919a0f 100644\n> --- a/src/ipa/ipa_vimc.cpp\n> +++ b/src/ipa/ipa_vimc.cpp\n> @@ -20,7 +20,6 @@\n>  #include \"libipa/ipa_interface_wrapper.h\"\n>  \n>  #include \"log.h\"\n> -#include \"utils.h\"\n>  \n>  namespace libcamera {\n>  \n> @@ -113,7 +112,7 @@ const struct IPAModuleInfo ipaModuleInfo = {\n>  \n>  struct ipa_context *ipaCreate()\n>  {\n> -\treturn new IPAInterfaceWrapper(utils::make_unique<IPAVimc>());\n> +\treturn new IPAInterfaceWrapper(std::make_unique<IPAVimc>());\n>  }\n>  }\n>  \n> diff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp\n> index 3628a785dc3e..b93c1c1f1c1a 100644\n> --- a/src/ipa/libipa/ipa_interface_wrapper.cpp\n> +++ b/src/ipa/libipa/ipa_interface_wrapper.cpp\n> @@ -45,7 +45,7 @@ namespace libcamera {\n>   *\n>   * struct ipa_context *ipaCreate()\n>   * {\n> - * \treturn new IPAInterfaceWrapper(utils::make_unique<MyIPA>());\n> + * \treturn new IPAInterfaceWrapper(std::make_unique<MyIPA>());\n>   * }\n>   * \\endcode\n>   *\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index a8dd1645d3e8..438b3c66f77a 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -278,7 +278,7 @@ const struct IPAModuleInfo ipaModuleInfo = {\n>  \n>  struct ipa_context *ipaCreate()\n>  {\n> -\treturn new IPAInterfaceWrapper(utils::make_unique<IPARkISP1>());\n> +\treturn new IPAInterfaceWrapper(std::make_unique<IPARkISP1>());\n>  }\n>  }\n>  \n> diff --git a/src/libcamera/bound_method.cpp b/src/libcamera/bound_method.cpp\n> index 8e95c7eec92c..e18c2eb4c68e 100644\n> --- a/src/libcamera/bound_method.cpp\n> +++ b/src/libcamera/bound_method.cpp\n> @@ -10,7 +10,6 @@\n>  #include \"message.h\"\n>  #include \"semaphore.h\"\n>  #include \"thread.h\"\n> -#include \"utils.h\"\n>  \n>  /**\n>   * \\file bound_method.h\n> @@ -84,7 +83,7 @@ bool BoundMethodBase::activatePack(std::shared_ptr<BoundMethodPackBase> pack,\n>  \n>  \tcase ConnectionTypeQueued: {\n>  \t\tstd::unique_ptr<Message> msg =\n> -\t\t\tutils::make_unique<InvokeMessage>(this, pack, nullptr, deleteMethod);\n> +\t\t\tstd::make_unique<InvokeMessage>(this, pack, nullptr, deleteMethod);\n>  \t\tobject_->postMessage(std::move(msg));\n>  \t\treturn false;\n>  \t}\n> @@ -93,7 +92,7 @@ bool BoundMethodBase::activatePack(std::shared_ptr<BoundMethodPackBase> pack,\n>  \t\tSemaphore semaphore;\n>  \n>  \t\tstd::unique_ptr<Message> msg =\n> -\t\t\tutils::make_unique<InvokeMessage>(this, pack, &semaphore, deleteMethod);\n> +\t\t\tstd::make_unique<InvokeMessage>(this, pack, &semaphore, deleteMethod);\n>  \t\tobject_->postMessage(std::move(msg));\n>  \n>  \t\tsemaphore.acquire();\n> diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp\n> index a5d6d875c76f..803ac16c2456 100644\n> --- a/src/libcamera/control_serializer.cpp\n> +++ b/src/libcamera/control_serializer.cpp\n> @@ -414,7 +414,7 @@ ControlInfoMap ControlSerializer::deserialize<ControlInfoMap>(ByteStreamBuffer &\n>  \t\t * \\todo Find a way to preserve the control name for debugging\n>  \t\t * purpose.\n>  \t\t */\n> -\t\tcontrolIds_.emplace_back(utils::make_unique<ControlId>(entry.id, \"\", type));\n> +\t\tcontrolIds_.emplace_back(std::make_unique<ControlId>(entry.id, \"\", type));\n>  \n>  \t\tif (entry.offset != values.offset()) {\n>  \t\t\tLOG(Serializer, Error)\n> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\n> index 0b596bcec363..a8b5c90f5a5d 100644\n> --- a/src/libcamera/device_enumerator.cpp\n> +++ b/src/libcamera/device_enumerator.cpp\n> @@ -13,7 +13,6 @@\n>  \n>  #include \"log.h\"\n>  #include \"media_device.h\"\n> -#include \"utils.h\"\n>  \n>  /**\n>   * \\file device_enumerator.h\n> @@ -145,7 +144,7 @@ std::unique_ptr<DeviceEnumerator> DeviceEnumerator::create()\n>  \tstd::unique_ptr<DeviceEnumerator> enumerator;\n>  \n>  #ifdef HAVE_LIBUDEV\n> -\tenumerator = utils::make_unique<DeviceEnumeratorUdev>();\n> +\tenumerator = std::make_unique<DeviceEnumeratorUdev>();\n>  \tif (!enumerator->init())\n>  \t\treturn enumerator;\n>  #endif\n> @@ -154,7 +153,7 @@ std::unique_ptr<DeviceEnumerator> DeviceEnumerator::create()\n>  \t * Either udev is not available or udev initialization failed. Fall back\n>  \t * on the sysfs enumerator.\n>  \t */\n> -\tenumerator = utils::make_unique<DeviceEnumeratorSysfs>();\n> +\tenumerator = std::make_unique<DeviceEnumeratorSysfs>();\n>  \tif (!enumerator->init())\n>  \t\treturn enumerator;\n>  \n> diff --git a/src/libcamera/include/ipa_proxy.h b/src/libcamera/include/ipa_proxy.h\n> index add40b4b3368..e696551af39f 100644\n> --- a/src/libcamera/include/ipa_proxy.h\n> +++ b/src/libcamera/include/ipa_proxy.h\n> @@ -14,7 +14,6 @@\n>  #include <ipa/ipa_interface.h>\n>  \n>  #include \"ipa_module.h\"\n> -#include \"utils.h\"\n>  \n>  namespace libcamera {\n>  \n> @@ -56,7 +55,7 @@ public:\t\t\t\t\t\t\t\\\n>  \tproxy##Factory() : IPAProxyFactory(#proxy) {}\t\\\n>  \tstd::unique_ptr<IPAProxy> create(IPAModule *ipam)\t\\\n>  \t{\t\t\t\t\t\t\\\n> -\t\treturn utils::make_unique<proxy>(ipam);\t\\\n> +\t\treturn std::make_unique<proxy>(ipam);\t\\\n>  \t}\t\t\t\t\t\t\\\n>  };\t\t\t\t\t\t\t\\\n>  static proxy##Factory global_##proxy##Factory;\n> diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h\n> index badc77533fa1..e467eb21c518 100644\n> --- a/src/libcamera/include/utils.h\n> +++ b/src/libcamera/include/utils.h\n> @@ -32,13 +32,6 @@ namespace utils {\n>  \n>  const char *basename(const char *path);\n>  \n> -/* C++11 doesn't provide std::make_unique */\n> -template<typename T, typename... Args>\n> -std::unique_ptr<T> make_unique(Args&&... args)\n> -{\n> -\treturn std::unique_ptr<T>(new T(std::forward<Args>(args)...));\n> -}\n> -\n>  char *secure_getenv(const char *name);\n>  \n>  template<class InputIt1, class InputIt2>\n> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp\n> index 90eef12dbaf5..92adc6c45015 100644\n> --- a/src/libcamera/ipa_manager.cpp\n> +++ b/src/libcamera/ipa_manager.cpp\n> @@ -264,7 +264,7 @@ std::unique_ptr<IPAInterface> IPAManager::createIPA(PipelineHandler *pipe,\n>  \tif (!ctx)\n>  \t\treturn nullptr;\n>  \n> -\treturn utils::make_unique<IPAContextWrapper>(ctx);\n> +\treturn std::make_unique<IPAContextWrapper>(ctx);\n>  }\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 7894084a025e..8e8e370922ad 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -876,7 +876,7 @@ int PipelineHandlerIPU3::registerCameras()\n>  \tunsigned int numCameras = 0;\n>  \tfor (unsigned int id = 0; id < 4 && numCameras < 2; ++id) {\n>  \t\tstd::unique_ptr<IPU3CameraData> data =\n> -\t\t\tutils::make_unique<IPU3CameraData>(this);\n> +\t\t\tstd::make_unique<IPU3CameraData>(this);\n>  \t\tstd::set<Stream *> streams = {\n>  \t\t\t&data->outStream_,\n>  \t\t\t&data->vfStream_,\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 389a99cf52bd..0b3dd9759387 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -388,9 +388,9 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,\n>  \tswitch (action.operation) {\n>  \tcase RKISP1_IPA_ACTION_V4L2_SET: {\n>  \t\tconst ControlList &controls = action.controls[0];\n> -\t\ttimeline_.scheduleAction(utils::make_unique<RkISP1ActionSetSensor>(frame,\n> -\t\t\t\t\t\t\t\t\t\t   sensor_,\n> -\t\t\t\t\t\t\t\t\t\t   controls));\n> +\t\ttimeline_.scheduleAction(std::make_unique<RkISP1ActionSetSensor>(frame,\n> +\t\t\t\t\t\t\t\t\t\t sensor_,\n> +\t\t\t\t\t\t\t\t\t\t controls));\n>  \t\tbreak;\n>  \t}\n>  \tcase RKISP1_IPA_ACTION_PARAM_FILLED: {\n> @@ -846,9 +846,9 @@ int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera,\n>  \top.controls = { request->controls() };\n>  \tdata->ipa_->processEvent(op);\n>  \n> -\tdata->timeline_.scheduleAction(utils::make_unique<RkISP1ActionQueueBuffers>(data->frame_,\n> -\t\t\t\t\t\t\t\t\t\t    data,\n> -\t\t\t\t\t\t\t\t\t\t    this));\n> +\tdata->timeline_.scheduleAction(std::make_unique<RkISP1ActionQueueBuffers>(data->frame_,\n> +\t\t\t\t\t\t\t\t\t\t  data,\n> +\t\t\t\t\t\t\t\t\t\t  this));\n>  \n>  \tdata->frame_++;\n>  \n> @@ -892,7 +892,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>  \tint ret;\n>  \n>  \tstd::unique_ptr<RkISP1CameraData> data =\n> -\t\tutils::make_unique<RkISP1CameraData>(this);\n> +\t\tstd::make_unique<RkISP1CameraData>(this);\n>  \n>  \tControlInfoMap::Map ctrls;\n>  \tctrls.emplace(std::piecewise_construct,\n> diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\n> index 47916ffb4536..83093676ec73 100644\n> --- a/src/libcamera/pipeline/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo.cpp\n> @@ -296,7 +296,7 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n>  \tif (!media)\n>  \t\treturn false;\n>  \n> -\tstd::unique_ptr<UVCCameraData> data = utils::make_unique<UVCCameraData>(this);\n> +\tstd::unique_ptr<UVCCameraData> data = std::make_unique<UVCCameraData>(this);\n>  \n>  \t/* Locate and initialise the camera data with the default video node. */\n>  \tconst std::vector<MediaEntity *> &entities = media->entities();\n> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> index 1700ac967299..c99560a45cfa 100644\n> --- a/src/libcamera/pipeline/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc.cpp\n> @@ -365,7 +365,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n>  \tif (!media)\n>  \t\treturn false;\n>  \n> -\tstd::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this);\n> +\tstd::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this);\n>  \n>  \tdata->ipa_ = IPAManager::instance()->createIPA(this, 0, 0);\n>  \tif (data->ipa_ == nullptr)\n> diff --git a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp\n> index 07380c16e2d5..7d6287c7115b 100644\n> --- a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp\n> +++ b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp\n> @@ -17,7 +17,6 @@\n>  #include \"ipc_unixsocket.h\"\n>  #include \"log.h\"\n>  #include \"thread.h\"\n> -#include \"utils.h\"\n>  \n>  using namespace libcamera;\n>  \n> @@ -58,7 +57,7 @@ int main(int argc, char **argv)\n>  \t\t<< \"Starting worker for IPA module \" << argv[1]\n>  \t\t<< \" with IPC fd = \" << fd;\n>  \n> -\tstd::unique_ptr<IPAModule> ipam = utils::make_unique<IPAModule>(argv[1]);\n> +\tstd::unique_ptr<IPAModule> ipam = std::make_unique<IPAModule>(argv[1]);\n>  \tif (!ipam->isValid() || !ipam->load()) {\n>  \t\tLOG(IPAProxyLinuxWorker, Error)\n>  \t\t\t<< \"IPAModule \" << argv[1] << \" should be valid but isn't\";\n> diff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp\n> index 5de9e4813353..4beffdab5eb6 100644\n> --- a/src/libcamera/utils.cpp\n> +++ b/src/libcamera/utils.cpp\n> @@ -70,11 +70,6 @@ char *secure_getenv(const char *name)\n>  #endif\n>  }\n>  \n> -/**\n> - * \\fn libcamera::utils::make_unique(Args &&... args)\n> - * \\brief Constructs an object of type T and wraps it in a std::unique_ptr.\n> - */\n> -\n>  /**\n>   * \\fn libcamera::utils::set_overlap(InputIt1 first1, InputIt1 last1,\n>   *\t\t\t\t     InputIt2 first2, InputIt2 last2)\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index c13eddc84c7c..1698d2451449 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -380,7 +380,7 @@ void V4L2Device::listControls()\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> -\t\tcontrolIds_.emplace_back(utils::make_unique<V4L2ControlId>(ctrl));\n> +\t\tcontrolIds_.emplace_back(std::make_unique<V4L2ControlId>(ctrl));\n>  \t\tctrls.emplace(controlIds_.back().get(), V4L2ControlRange(ctrl));\n>  \t}\n>  \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 66adf7b29572..18220b81af21 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1054,7 +1054,7 @@ V4L2VideoDevice::createBuffer(const struct v4l2_buffer &buf)\n>  \t\tplanes.push_back(std::move(plane));\n>  \t}\n>  \n> -\treturn utils::make_unique<FrameBuffer>(std::move(planes));\n> +\treturn std::make_unique<FrameBuffer>(std::move(planes));\n>  }\n>  \n>  FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index,\n> diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp\n> index 44cb4e7c551b..e7018b566475 100644\n> --- a/src/v4l2/v4l2_camera.cpp\n> +++ b/src/v4l2/v4l2_camera.cpp\n> @@ -10,7 +10,6 @@\n>  #include <errno.h>\n>  \n>  #include \"log.h\"\n> -#include \"utils.h\"\n>  \n>  using namespace libcamera;\n>  \n> @@ -81,7 +80,7 @@ void V4L2Camera::requestComplete(Request *request)\n>  \tbufferLock_.lock();\n>  \tFrameBuffer *buffer = request->buffers().begin()->second;\n>  \tstd::unique_ptr<Buffer> metadata =\n> -\t\tutils::make_unique<Buffer>(request->cookie(), buffer->metadata());\n> +\t\tstd::make_unique<Buffer>(request->cookie(), buffer->metadata());\n>  \tcompletedBuffers_.push_back(std::move(metadata));\n>  \tbufferLock_.unlock();\n>  \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 28e587226a97..3013a3d17568 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -32,7 +32,7 @@ LOG_DECLARE_CATEGORY(V4L2Compat);\n>  V4L2CameraProxy::V4L2CameraProxy(unsigned int index,\n>  \t\t\t\t std::shared_ptr<Camera> camera)\n>  \t: refcount_(0), index_(index), bufferCount_(0), currentBuf_(0),\n> -\t  vcam_(utils::make_unique<V4L2Camera>(camera))\n> +\t  vcam_(std::make_unique<V4L2Camera>(camera))\n>  {\n>  \tquerycap(camera);\n>  }\n> diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp\n> index e711e4fe318d..1ae1781169c8 100644\n> --- a/test/ipa/ipa_wrappers_test.cpp\n> +++ b/test/ipa/ipa_wrappers_test.cpp\n> @@ -18,7 +18,6 @@\n>  #include \"device_enumerator.h\"\n>  #include \"ipa_context_wrapper.h\"\n>  #include \"media_device.h\"\n> -#include \"utils.h\"\n>  #include \"v4l2_subdevice.h\"\n>  \n>  #include \"test.h\"\n> @@ -254,7 +253,7 @@ protected:\n>  \t\tif (ret)\n>  \t\t\treturn TestFail;\n>  \n> -\t\tstd::unique_ptr<IPAInterface> intf = utils::make_unique<TestIPAInterface>();\n> +\t\tstd::unique_ptr<IPAInterface> intf = std::make_unique<TestIPAInterface>();\n>  \t\twrapper_ = new IPAContextWrapper(new IPAInterfaceWrapper(std::move(intf)));\n>  \t\twrapper_->queueFrameAction.connect(this, &IPAWrappersTest::queueFrameAction);\n>  \n> diff --git a/test/message.cpp b/test/message.cpp\n> index 7ebedb557502..478bc79dffa6 100644\n> --- a/test/message.cpp\n> +++ b/test/message.cpp\n> @@ -12,7 +12,6 @@\n>  #include \"message.h\"\n>  #include \"thread.h\"\n>  #include \"test.h\"\n> -#include \"utils.h\"\n>  \n>  using namespace std;\n>  using namespace libcamera;\n> @@ -92,7 +91,7 @@ protected:\n>  \n>  \t\tthread_.start();\n>  \n> -\t\treceiver.postMessage(utils::make_unique<Message>(Message::None));\n> +\t\treceiver.postMessage(std::make_unique<Message>(Message::None));\n>  \n>  \t\tthis_thread::sleep_for(chrono::milliseconds(100));\n>  \n> @@ -114,7 +113,7 @@ protected:\n>  \t\t */\n>  \t\tSlowMessageReceiver *slowReceiver = new SlowMessageReceiver();\n>  \t\tslowReceiver->moveToThread(&thread_);\n> -\t\tslowReceiver->postMessage(utils::make_unique<Message>(Message::None));\n> +\t\tslowReceiver->postMessage(std::make_unique<Message>(Message::None));\n>  \n>  \t\tthis_thread::sleep_for(chrono::milliseconds(10));\n>  \n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com\n\t[IPv6:2a00:1450:4864:20::22b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C94DE6017C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2020 15:22:18 +0100 (CET)","by mail-lj1-x22b.google.com with SMTP id y4so14543598ljj.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2020 06:22:18 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tp136sm7459878lfa.8.2020.01.14.06.22.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 14 Jan 2020 06:22:17 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=FsA739K8Pbdvgmnu7b65HTpa+YEpBOFpL3plbU9Ecwg=;\n\tb=SV774mlSD89SGOKp2vH8ZyfKRnoh0zHsgOkJALHUgRdCFLYC3nBDf9roNuE2MAXVza\n\t3fOv9mEqpO3Dd0LtxNXgiPxu6vM93fnhQIb0B63WrP+W7/NjNkn1gCRDwZ84bF0wsOt0\n\tCVAiN6Td2VFrTffpv03vsDq5qNI3BsRnSbsc0zoBk1fLvaQMnSuPuQAEvo/KMBPGE1kX\n\tIQYU8RIywG+rwCAKAu3xMrukEM/spzsUXRu3t4Jx//fH0ae3bFo0MScqQwGuCuViokrl\n\t6NzkJWPyLlARAzOGSaKn/XSBKHzgrtvhBaOKC4cUdFe0jxj0u2/VKpdG4bc3RUpDpmYR\n\tfsrw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=FsA739K8Pbdvgmnu7b65HTpa+YEpBOFpL3plbU9Ecwg=;\n\tb=bHOfKtJRHn+xL71MHtiZnrWRtxLqVd+M+l9I4g89yGNA9hu1nt5HPDO+lAEJUUSMYj\n\tgsZoRLSrWs/OA0SsWCTSMSLw1bWdnoAf1St3ZHBJ1YMWRmR4utr3CiywtF0+cXQ+dsEu\n\tWxKZAR0YV4PLSyEPE9VX30PnWvnIrCQs6NWI5MFiZPFCTNniPWa8zmJGfUYB8OGnOQgr\n\tZqV2u4ardS50eMI0/eySiF7voCk8ilpUHi1PdjEZoP9+nLmvA+TeYg7Q/u1QBw2tuaj3\n\tN2RQc40J3ZWNXjIakDZrRDs/F0HiV/nvO1kVjzpAGMN4fPUG7EbiaNjW2Bbj1W036Kn+\n\tE20A==","X-Gm-Message-State":"APjAAAXwyuR3ENR6sPsNUiBwZG22jNTV9xRivDaMRpcYszZ4HkBxQX0r\n\t4bFMob/xRPI40EoRUa0MInjCAYQWvvV0Cg==","X-Google-Smtp-Source":"APXvYqxoGSxWDzBifIOLRGCxwW2vyomJW746t1kpGLwB2A0S2H72HtdNbbKHu0znLaO2sxKts6Uv3g==","X-Received":"by 2002:a2e:88d6:: with SMTP id\n\ta22mr13516243ljk.163.1579011738153; \n\tTue, 14 Jan 2020 06:22:18 -0800 (PST)","Date":"Tue, 14 Jan 2020 15:22:17 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200114142217.GB925806@oden.dyn.berto.se>","References":"<20200114001531.27129-1-laurent.pinchart@ideasonboard.com>\n\t<20200114001531.27129-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200114001531.27129-2-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: Switch from\n\tutils::make_unique to std::make_unique","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 14 Jan 2020 14:22:19 -0000"}}]