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:
@@ -452,13 +452,14 @@ nm_utils_ip4_address_is_zeronet(in_addr_t network)
|
|||||||
|
|
||||||
#define NM_UTILS_INET_ADDRSTRLEN INET6_ADDRSTRLEN
|
#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 *
|
static inline const char *
|
||||||
nm_utils_inet_ntop(int addr_family, gconstpointer addr, char *dst)
|
nm_utils_inet_ntop(int addr_family, gconstpointer addr, char *dst)
|
||||||
{
|
{
|
||||||
const char *s;
|
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_family(addr_family);
|
||||||
nm_assert(addr);
|
nm_assert(addr);
|
||||||
nm_assert(dst);
|
nm_assert(dst);
|
||||||
|
Reference in New Issue
Block a user