Changed grpc_inet_ntop signature to match Windows function

pull/7665/head
murgatroid99 9 years ago
parent cb6ce70b5a
commit 0b110dd28d
  1. 2
      src/core/lib/iomgr/socket_utils.h
  2. 4
      src/core/lib/iomgr/socket_utils_common_posix.c
  3. 2
      src/core/lib/iomgr/socket_utils_windows.c

@ -43,7 +43,7 @@
#endif #endif
/* A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems */ /* A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems */
const char *grpc_inet_ntop(int af, const void *src, const char *grpc_inet_ntop(int af, void *src,
char *dst, socklen_t size); char *dst, socklen_t size);
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */ #endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */

@ -297,9 +297,9 @@ grpc_error *grpc_create_dualstack_socket(const struct sockaddr *addr, int type,
return error_for_fd(*newfd, addr); return error_for_fd(*newfd, addr);
} }
const char *grpc_inet_ntop(int af, const void *src, const char *grpc_inet_ntop(int af, void *src,
char *dst, socklen_t size) { char *dst, socklen_t size) {
return inet_ntop(af, src, dst, size); return inet_ntop(af, (const void*)src, dst, size);
} }
#endif #endif

@ -39,7 +39,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
const char *grpc_inet_ntop(int af, const void *src, const char *grpc_inet_ntop(int af, void *src,
char *dst, socklen_t size) { char *dst, socklen_t size) {
GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t)); GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t));
return InetNtopA(af, src, dst, (size_t)size); return InetNtopA(af, src, dst, (size_t)size);

Loading…
Cancel
Save