diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index f5395faf56..92488462ce 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -184,7 +184,7 @@ SWITCH_DECLARE(char *) switch_string_replace(const char *string, const char *sea SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search, size_t search_len); #define SWITCH_READ_ACCEPTABLE(status) status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK -SWITCH_DECLARE(int) switch_url_encode(char *url, char *buf, size_t len); +SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len); SWITCH_DECLARE(char *) switch_url_decode(char *s); END_EXTERN_C diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index 80c267f36e..92e9b02848 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -31,6 +31,9 @@ */ #include #include +#ifdef ABYSS_WIN32 +#undef strcasecmp +#endif #include #include #include @@ -43,7 +46,7 @@ static const char modname[] = "mod_xml_rpc"; static struct { - int port; + uint16_t port; uint8_t running; char *url; } globals; @@ -78,7 +81,7 @@ static switch_xml_t xml_url_fetch(char *section, snprintf(url, sizeof(url), "%s?section=%s&tag_name=%s&key_name=%s&key_value=%s%s%s\n", globals.url, section, tag_name, key_name, key_value, params ? "&" : "", params ? params : ""); - srand(time(NULL) + strlen(url)); + srand((unsigned int)(time(NULL) + strlen(url))); snprintf(filename, sizeof(filename), "%s%04x.tmp", SWITCH_GLOBAL_dirs.temp_dir, (rand() & 0xffff)); curl_global_init(CURL_GLOBAL_ALL); curl_handle = curl_easy_init(); @@ -142,7 +145,7 @@ static switch_status_t do_config(void) if (!strcasecmp(var, "gateway_url")) { set_global_url(val); } else if (!strcasecmp(var, "http_port")) { - globals.port = atoi(val); + globals.port = (uint16_t)atoi(val); } } } @@ -193,7 +196,7 @@ static switch_status_t http_stream_write(switch_stream_handle_t *handle, char *f if (data) { ret = 0; - HTTPWrite(r, data, strlen(data)); + HTTPWrite(r, data, (uint32_t)strlen(data)); free(data); } diff --git a/src/switch_console.c b/src/switch_console.c index 3a6d95ac5f..9c63979f44 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -57,7 +57,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle va_end(ap); if (data) { - uint32_t len = handle->data_size - handle->data_len; + switch_size_t len = handle->data_size - handle->data_len; if (len <= strlen(data)) { ret = -1; @@ -65,7 +65,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle ret = 0; snprintf(end, len, data); handle->data_len = strlen(buf); - handle->end = handle->data + handle->data_len; + handle->end = (uint8_t *)(handle->data) + handle->data_len; } free(data); } diff --git a/src/switch_utils.c b/src/switch_utils.c index 82b3b5910c..8ba31be3fe 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -213,10 +213,10 @@ SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t *poll, int ms) } -SWITCH_DECLARE(int) switch_url_encode(char *url, char *buf, size_t len) +SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len) { char *p; - int x = 0; + size_t x = 0; const char urlunsafe[] = " \"#%&+:;<=>?@[\\]^`{|}"; const char hex[] = "0123456789ABCDEF"; @@ -246,7 +246,7 @@ SWITCH_DECLARE(char *) switch_url_decode(char *s) for (o = s; *s; s++, o++) { if (*s == '%' && strlen(s) > 2 && sscanf(s + 1, "%2x", &tmp) == 1) { - *o = tmp; + *o = (char)tmp; s += 2; } else { *o = *s;