From 05b6da04244e76caa31d4d7e58763faa51911352 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Oct 2023 15:16:47 +0100 Subject: Anonymous namespace over static --- libpqpp/pq-connection.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libpqpp/pq-connection.cpp b/libpqpp/pq-connection.cpp index ee1ddf9..a65d88b 100644 --- a/libpqpp/pq-connection.cpp +++ b/libpqpp/pq-connection.cpp @@ -18,19 +18,21 @@ NAMEDFACTORY("postgresql", PQ::Connection, DB::ConnectionFactory) -static void setup() __attribute__((constructor(101))); - -static void -setup() -{ - // NOLINTNEXTLINE(hicpp-no-array-decay) - BOOST_ASSERT(PQisthreadsafe() == 1); - PQinitOpenSSL(1, 0); -} +namespace { + void setup() __attribute__((constructor(101))); + + void + setup() + { + // NOLINTNEXTLINE(hicpp-no-array-decay) + BOOST_ASSERT(PQisthreadsafe() == 1); + PQinitOpenSSL(1, 0); + } -static void -noNoticeProcessor(void *, const char *) -{ + void + noNoticeProcessor(void *, const char *) + { + } } // NOLINTNEXTLINE(bugprone-throw-keyword-missing) -- cgit v1.2.3