[08/10] test: ipc: unixsocket: Define local function in anonymous namespace
diff mbox series

Message ID 20240624192941.22943-9-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Enable -Wmissing-declarations
Related show

Commit Message

Laurent Pinchart June 24, 2024, 7:29 p.m. UTC
A local function in the unixsocket test is defined in the global
namespace without the static keyword. This compiles fine for now, but
will cause a missing declaration warning when we enable them. To prepare
for that, enclose the function declaration in an anonymous namespace.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/ipc/unixsocket.cpp | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kieran Bingham June 24, 2024, 9:40 p.m. UTC | #1
Quoting Laurent Pinchart (2024-06-24 20:29:39)
> A local function in the unixsocket test is defined in the global
> namespace without the static keyword. This compiles fine for now, but
> will cause a missing declaration warning when we enable them. To prepare
> for that, enclose the function declaration in an anonymous namespace.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  test/ipc/unixsocket.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp
> index f44ab9c90e25..2546882da085 100644
> --- a/test/ipc/unixsocket.cpp
> +++ b/test/ipc/unixsocket.cpp
> @@ -34,6 +34,8 @@ using namespace libcamera;
>  using namespace std;
>  using namespace std::chrono_literals;
>  
> +namespace {
> +
>  int calculateLength(int fd)
>  {
>         lseek(fd, 0, 0);
> @@ -43,6 +45,8 @@ int calculateLength(int fd)
>         return size;
>  }
>  
> +} /* namespace */
> +
>  class UnixSocketTestSlave
>  {
>  public:
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp
index f44ab9c90e25..2546882da085 100644
--- a/test/ipc/unixsocket.cpp
+++ b/test/ipc/unixsocket.cpp
@@ -34,6 +34,8 @@  using namespace libcamera;
 using namespace std;
 using namespace std::chrono_literals;
 
+namespace {
+
 int calculateLength(int fd)
 {
 	lseek(fd, 0, 0);
@@ -43,6 +45,8 @@  int calculateLength(int fd)
 	return size;
 }
 
+} /* namespace */
+
 class UnixSocketTestSlave
 {
 public: