[Freeswitch-svn] [commit] r11333 - freeswitch/trunk/src/mod/applications/mod_http

FreeSWITCH SVN anthm at freeswitch.org
Wed Jan 21 11:18:51 PST 2009


Author: anthm
Date: Wed Jan 21 13:18:51 2009
New Revision: 11333

Log:
build

Modified:
   freeswitch/trunk/src/mod/applications/mod_http/bits.h
   freeswitch/trunk/src/mod/applications/mod_http/http_req.c
   freeswitch/trunk/src/mod/applications/mod_http/linkhash.c
   freeswitch/trunk/src/mod/applications/mod_http/linkhash.h
   freeswitch/trunk/src/mod/applications/mod_http/mod_http.c

Modified: freeswitch/trunk/src/mod/applications/mod_http/bits.h
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_http/bits.h	(original)
+++ freeswitch/trunk/src/mod/applications/mod_http/bits.h	Wed Jan 21 13:18:51 2009
@@ -11,7 +11,7 @@
 
 #ifndef _bits_h_
 #define _bits_h_
-
+#include <inttypes.h>
 #ifndef min
 #define min(a,b) ((a) < (b) ? (a) : (b))
 #endif
@@ -21,7 +21,7 @@
 #endif
 
 #define hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
-#define error_ptr(error) ((void*)error)
-#define is_error(ptr) ((unsigned long)ptr > (unsigned long)-4000L)
+#define error_ptr(error) ((void*)(intptr_t)error)
+#define is_error(ptr) ((uint32_t)(intptr_t)ptr > (uint32_t)-4000L)
 
 #endif

Modified: freeswitch/trunk/src/mod/applications/mod_http/http_req.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_http/http_req.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_http/http_req.c	Wed Jan 21 13:18:51 2009
@@ -244,7 +244,7 @@
         dprintf(s, "Host: %s:%d\r\n", hostname, port);   
     else dprintf(s, "Host: %s\r\n", hostname);   
     dprintf(s, "Connection: close\r\n");
-    dprintf(s, "Content-Length: %d\r\n", req->body_len); 
+    dprintf(s, "Content-Length: %ld\r\n", req->body_len); 
 
     for(i = 0; i < req->header_len; i++){
         dprintf(

Modified: freeswitch/trunk/src/mod/applications/mod_http/linkhash.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_http/linkhash.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_http/linkhash.c	Wed Jan 21 13:18:51 2009
@@ -28,10 +28,10 @@
 	exit(1);
 }
 
-unsigned long lh_ptr_hash(void *k)
+uint32_t lh_ptr_hash(void *k)
 {
 	/* CAW: refactored to be 64bit nice */
-	return (unsigned long)((((ptrdiff_t)k * LH_PRIME) >> 4) & ULONG_MAX);
+	return (uint32_t)((((ptrdiff_t)k * LH_PRIME) >> 4) & ULONG_MAX);
 }
 
 int lh_ptr_equal(void *k1, void *k2)
@@ -39,7 +39,7 @@
 	return (k1 == k2);
 }
 
-unsigned long lh_char_hash(void *k)
+uint32_t lh_char_hash(void *k)
 {
 	unsigned int h = 0;
 	const char* data = k;
@@ -123,7 +123,7 @@
 
 int lh_table_insert(struct lh_table *t, void *k, void *v)
 {
-	unsigned long h, n;
+	uint32_t h, n;
 
 	t->inserts++;
 	if(t->count > t->size * 0.66) lh_table_resize(t, t->size * 2);
@@ -157,8 +157,8 @@
 
 struct lh_entry* lh_table_lookup_entry(struct lh_table *t, void *k)
 {
-	unsigned long h = t->hash_fn(k);
-	unsigned long n = h % t->size;
+	uint32_t h = t->hash_fn(k);
+	uint32_t n = h % t->size;
 
 	t->lookups++;
 	while( 1 ) {

Modified: freeswitch/trunk/src/mod/applications/mod_http/linkhash.h
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_http/linkhash.h	(original)
+++ freeswitch/trunk/src/mod/applications/mod_http/linkhash.h	Wed Jan 21 13:18:51 2009
@@ -11,6 +11,7 @@
  
 #ifndef _linkhash_h_
 #define _linkhash_h_
+#include <inttypes.h>
 
 /**
  * golden prime used in hash functions
@@ -36,7 +37,7 @@
 /**
  * callback function prototypes
  */
-typedef unsigned long (lh_hash_fn) (void *k);
+typedef uint32_t (lh_hash_fn) (void *k);
 /**
  * callback function prototypes
  */
@@ -132,10 +133,10 @@
 /**
  * Pre-defined hash and equality functions
  */
-extern unsigned long lh_ptr_hash(void *k);
+extern uint32_t lh_ptr_hash(void *k);
 extern int lh_ptr_equal(void *k1, void *k2);
 
-extern unsigned long lh_char_hash(void *k);
+extern uint32_t lh_char_hash(void *k);
 extern int lh_char_equal(void *k1, void *k2);
 
 

Modified: freeswitch/trunk/src/mod/applications/mod_http/mod_http.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_http/mod_http.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_http/mod_http.c	Wed Jan 21 13:18:51 2009
@@ -359,7 +359,7 @@
     switch_log_printf(
         SWITCH_CHANNEL_LOG,
         SWITCH_LOG_NOTICE,
-        "RESERVED %d BYTES, USED %d BYTES, HTTP Response as JSON: %s\n",
+        "RESERVED %ld BYTES, USED %ld BYTES, HTTP Response as JSON: %s\n",
         l, 
         m,
         json_response



More information about the Freeswitch-svn mailing list