]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7046: fix data types and casting on some vars to silence windows build warnings
authorBrian West <brian@freeswitch.org>
Wed, 3 Dec 2014 21:06:31 +0000 (15:06 -0600)
committerBrian West <brian@freeswitch.org>
Wed, 3 Dec 2014 21:07:29 +0000 (15:07 -0600)
src/mod/endpoints/mod_verto/mcast/mcast.c
src/mod/endpoints/mod_verto/mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.h

index 978c3dc6a57d3cce37fca018ed92d81493c454e9..e37ac08efc8cb2c86f601be9a4c47ba17899a2e1 100644 (file)
 #ifndef WIN32
 #include <unistd.h>
 #endif
-#include "mcast.h"
 #ifndef WIN32
 #include <poll.h>
 #endif
 #include <switch_utils.h>
+#include "mcast.h"
+
 
 int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle, mcast_flag_t flags)
 {
@@ -68,7 +69,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
        handle->send_addr.sin_addr.s_addr = inet_addr(host);
        handle->send_addr.sin_port = htons(port);
        
-       if ( setsockopt(handle->sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) != 0 ) {
+       if ( setsockopt(handle->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(one)) != 0 ) {
                close(handle->sock);
                return -1;
        }
@@ -84,7 +85,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
                mreq.imr_multiaddr.s_addr = inet_addr(host);
                mreq.imr_interface.s_addr = htonl(INADDR_ANY);
 
-               if (setsockopt(handle->sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
+               if (setsockopt(handle->sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&mreq, sizeof(mreq)) < 0) {
                        close(handle->sock);
                        handle->sock = -1;
                        return -1;
@@ -125,7 +126,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
                handle->ttl = 255;
        }
 
-       if ( setsockopt(handle->sock, IPPROTO_IP, IP_MULTICAST_TTL, &handle->ttl, sizeof(handle->ttl)) != 0 ) {
+       if ( setsockopt(handle->sock, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&handle->ttl, sizeof(handle->ttl)) != 0 ) {
                return -1;
        }
 
index c784d8d1a28ca8410813b5f98bb11b9e37884079..0e5d7c5d04a2da55e8f66fd6897f8f0791f7b043 100644 (file)
@@ -1518,7 +1518,7 @@ new_req:
                !strncmp(request.content_type, "application/x-www-form-urlencoded", 33)) {
 
                char *buffer = NULL;
-               int len = 0, bytes = 0;
+               switch_size_t len = 0, bytes = 0;
 
                if (request.content_length > 2 * 1024 * 1024 - 1) {
                        char *data = "HTTP/1.1 413 Request Entity Too Large\r\n"
@@ -3735,7 +3735,7 @@ static int start_jsock(verto_profile_t *profile, ws_socket_t sock)
        return -1;
 }
 
-static ws_socket_t prepare_socket(int ip, int port) 
+static ws_socket_t prepare_socket(int ip, uint16_t port) 
 {
        ws_socket_t sock = ws_sock_invalid;
 #ifndef WIN32
@@ -3840,7 +3840,7 @@ static int profile_one_loop(verto_profile_t *profile)
                }
                        
                if (pfds[x].revents & SWITCH_POLL_READ) {
-                       if (profile->mcast_ip && pfds[x].sock == profile->mcast_sub.sock) {
+                       if (profile->mcast_ip && pfds[x].sock == (switch_os_socket_t)profile->mcast_sub.sock) {
                                handle_mcast_sub(profile);
                        } else {
                                start_jsock(profile, pfds[x].sock);
@@ -3969,7 +3969,7 @@ static void do_shutdown(void)
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Done\n");
 }
 
-static void parse_ip(char *host, int *port, in_addr_t *addr, char *input)
+static void parse_ip(char *host, uint16_t *port, in_addr_t *addr, char *input)
 {
        char *p;
        struct hostent *hent;
@@ -3978,7 +3978,7 @@ static void parse_ip(char *host, int *port, in_addr_t *addr, char *input)
 
        if ((p = strchr(host, ':')) != NULL) {
                *p++  = '\0';
-               *port = atoi(p);
+               *port = (uint16_t)atoi(p);
        }
 
        if ( host[0] < '0' || host[0] > '9' ) {
index e1953f67b7cb97f68bc6976514fd86903e604194..b864dcf8b7b55f1d85e7555f8a3b25824f6aa544 100644 (file)
@@ -156,7 +156,7 @@ typedef struct jsock_s jsock_t;
 struct ips {
        char local_ip[256];
        in_addr_t local_ip_addr;
-       int local_port;
+       uint16_t local_port;
        int secure;
 };