glib-aux: move forward declaration of inet_ntop() out of function scope

lgtm.com doesn't like this:

  Query pack:com.lgtm/cpp-queries
  Query ID:cpp/function-in-block

  Functions should always be declared at file scope. It is confusing
  to declare a function at block scope, and the visibility of the function
  is not what would be expected.
This commit is contained in:
Thomas Haller
2021-06-01 17:32:32 +02:00
parent 43c99f0b99
commit ecd5d07b3a

View File

@@ -452,13 +452,14 @@ nm_utils_ip4_address_is_zeronet(in_addr_t network)
#define NM_UTILS_INET_ADDRSTRLEN INET6_ADDRSTRLEN
/* Forward declare function so we don't have to drag in <arpa/inet.h>. */
const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
static inline const char *
nm_utils_inet_ntop(int addr_family, gconstpointer addr, char *dst)
{
const char *s;
const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
nm_assert_addr_family(addr_family);
nm_assert(addr);
nm_assert(dst);