]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
msvc types tweaks.
authorMichael Jerris <mike@jerris.com>
Wed, 10 May 2006 16:37:56 +0000 (16:37 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 10 May 2006 16:37:56 +0000 (16:37 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1416 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
src/switch_console.c
src/switch_utils.c

index f5395faf56d55b875a4c3cd2ed76487a3754e2b4..92488462cedfa2eb5d60163f6d3c3538829c6702 100644 (file)
@@ -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
 
index 80c267f36e9b99eb27e042abf3ea6b7b7f88f265..92e9b0284815b5550512f3d46bf3c61d9bbb8722 100644 (file)
@@ -31,6 +31,9 @@
  */
 #include <switch.h>
 #include <xmlrpc-c/base.h>
+#ifdef ABYSS_WIN32
+#undef strcasecmp
+#endif
 #include <xmlrpc-c/abyss.h>
 #include <xmlrpc-c/server.h>
 #include <xmlrpc-c/server_abyss.h>
@@ -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);
        }
        
index 3a6d95ac5f24f9d88a99ca695350c15858610d05..9c63979f44cd9cc939fe5d6709b3f3fea2ac209f 100644 (file)
@@ -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);
        }
index 82b3b5910cd31ac713661bd671ad7c0c66f20c87..8ba31be3fed3b11791b334578752334f89876a96 100644 (file)
@@ -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;