MinGW: Cast away a -Wincompatible-pointer-types warning

extcap/androiddump.c:1712:36: warning: passing argument 2 of 'ws_inet_pton4' from incompatible pointer type [-Wincompatible-pointer-types]
 1712 |         ws_inet_pton4(bt_local_ip, &(server.sin_addr.s_addr));
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    u_long * {aka long unsigned int *}
This commit is contained in:
João Valverde 2023-01-14 01:35:07 +00:00
parent 389e70722c
commit cdff6da68e
2 changed files with 4 additions and 4 deletions

View File

@ -549,7 +549,7 @@ static socket_handle_t adb_connect(const char *server_ip, unsigned short *server
server.sin_family = AF_INET;
server.sin_port = GINT16_TO_BE(*server_tcp_port);
ws_inet_pton4(server_ip, &(server.sin_addr.s_addr));
ws_inet_pton4(server_ip, (ws_in4_addr *)&(server.sin_addr.s_addr));
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {
ws_warning("Cannot open system TCP socket: %s", strerror(errno));
@ -1709,7 +1709,7 @@ static int capture_android_bluetooth_external_parser(char *interface,
memset(&server, 0 , sizeof(server));
server.sin_family = AF_INET;
server.sin_port = GINT16_TO_BE(*bt_local_tcp_port);
ws_inet_pton4(bt_local_ip, &(server.sin_addr.s_addr));
ws_inet_pton4(bt_local_ip, (ws_in4_addr *)&(server.sin_addr.s_addr));
useSndTimeout(sock);
@ -1784,7 +1784,7 @@ static int capture_android_bluetooth_external_parser(char *interface,
server.sin_family = AF_INET;
server.sin_port = GINT16_TO_BE(*bt_local_tcp_port);
ws_inet_pton4(bt_local_ip, &(server.sin_addr.s_addr));
ws_inet_pton4(bt_local_ip, (ws_in4_addr *)&(server.sin_addr.s_addr));
useSndTimeout(sock);

View File

@ -130,7 +130,7 @@ socket_init(char *path)
return INVALID_SOCKET;
s_in.sin_family = AF_INET;
ws_inet_pton4(path, &(s_in.sin_addr.s_addr));
ws_inet_pton4(path, (ws_in4_addr *)&(s_in.sin_addr.s_addr));
s_in.sin_port = g_htons(port);
*port_sep = ':';