[libcamera-devel] [RFC PATCH 0/6] Remove using namespace in header files

Hirokazu Honda hiroh at chromium.org
Tue Oct 5 09:31:08 CEST 2021


According to Google C++ style guide, using-directives (i.e.
"using namespace foo") should not be used. However, libcamera has
been using the scheme in many files. Removing using-directives
entirely in the code definitely needs the dicussion.

This patch series resolves the porblem of using using-directives
in header file, which I expect I can handily get the agreement
from developers. Using-directives in a header file is propagated
to all the files including the header file. This pollutes
namespace severely.

[1] https://google.github.io/styleguide/cppguide.html#Namespaces

Hirokazu Honda (6):
  ipa: raspberrypi: agc: Remove using namespace in agc.hpp
  cam: Remove using namespace in stream_options.h
  qcam: Remove using namespace in header files
  v4l2: Remove using namespace in header files
  lc-compliance: Remove using namespace in header files
  test: Remove using namespace in header files

 src/cam/stream_options.h                      |  8 ++--
 src/ipa/raspberrypi/controller/rpi/agc.cpp    |  7 ++++
 src/ipa/raspberrypi/controller/rpi/agc.hpp    |  6 +--
 src/lc-compliance/environment.cpp             |  2 +-
 src/lc-compliance/environment.h               |  8 ++--
 src/qcam/dng_writer.h                         | 10 ++---
 src/qcam/main.cpp                             |  2 +-
 src/qcam/main_window.h                        | 40 +++++++++----------
 src/v4l2/v4l2_camera.h                        | 37 +++++++++--------
 src/v4l2/v4l2_camera_proxy.h                  | 15 ++++---
 src/v4l2/v4l2_compat_manager.h                |  4 +-
 test/camera/camera_reconfigure.cpp            |  1 +
 test/camera/capture.cpp                       |  1 +
 test/camera/configuration_default.cpp         |  1 +
 test/camera/configuration_set.cpp             |  1 +
 test/camera/statemachine.cpp                  |  1 +
 test/gstreamer/gstreamer_test.h               |  2 -
 test/libtest/buffer_source.cpp                |  2 +
 test/libtest/buffer_source.h                  | 10 ++---
 test/libtest/camera_test.h                    |  6 +--
 test/mapped-buffer.cpp                        |  1 +
 test/media_device/media_device_test.h         |  6 +--
 test/serialization/serialization_test.h       | 10 ++---
 test/v4l2_subdevice/v4l2_subdevice_test.h     |  8 ++--
 test/v4l2_videodevice/buffer_sharing.cpp      |  2 +
 test/v4l2_videodevice/capture_async.cpp       |  2 +
 test/v4l2_videodevice/v4l2_videodevice_test.h | 14 +++----
 27 files changed, 100 insertions(+), 107 deletions(-)

--
2.33.0.800.g4c38ced690-goog


More information about the libcamera-devel mailing list