Преглед на файлове

core and modules: fix compile warnings on freebsd
(cherry picked from commit 7dfda822e579a543bbda65dc4764b0f426a144e5)

Daniel-Constantin Mierla преди 14 години
родител
ревизия
7bbcaadba5

+ 3 - 1
lib/srdb2/db_uri.c

@@ -71,6 +71,7 @@ db_uri_t* db_uri(const char* uri)
 	char* colon;
 	int len;
 	db_uri_t* newp;
+	char *turi;
     
 	newp = (db_uri_t*)pkg_malloc(sizeof(db_uri_t));
 	if (newp == NULL) goto error;
@@ -78,7 +79,8 @@ db_uri_t* db_uri(const char* uri)
 	if (db_gen_init(&newp->gen) < 0) goto error;	
 
 	len = strlen(uri);
-	colon = q_memchr((char *)uri, ':', len);
+	turi = (char*)uri;
+	colon = q_memchr(turi, ':', len);
 	if (colon == NULL) {
 		newp->scheme.s = pkg_malloc(len + 1);
 		if (newp->scheme.s == NULL) goto error;

+ 2 - 2
modules_k/acc/acc_cdr.c

@@ -242,9 +242,9 @@ static int time2string( struct timeval* time_value, str* time_str)
     buffer_length = snprintf( time_buffer,
                               TIME_BUFFER_LENGTH,
                               "%ld%c%03d",
-                              time_value->tv_sec,
+                              (long int)time_value->tv_sec,
                               time_separator,
-                              (int)time_value->tv_usec/1000);
+                              (int)(time_value->tv_usec/1000));
 
     if( buffer_length < 0)
     {

+ 2 - 1
modules_k/dmq/bind_dmq.c

@@ -8,4 +8,5 @@ int bind_dmq(dmq_api_t* api) {
 	api->send_message = send_dmq_message;
 	api->bcast_message = bcast_dmq_message;
 	return 0;
-}
+}
+

+ 2 - 1
modules_k/dmq/bind_dmq.h

@@ -18,4 +18,5 @@ typedef int (*bind_dmq_f)(dmq_api_t* api);
 
 int bind_dmq(dmq_api_t* api);
 
-#endif
+#endif
+

+ 2 - 1
modules_k/dmq/dmq.c

@@ -280,4 +280,5 @@ static int parse_server_address(str* uri, struct sip_uri* parsed_uri) {
 empty:
 	uri->s = NULL;
 	return 0;
-}
+}
+

+ 2 - 1
modules_k/dmq/dmq.h

@@ -49,4 +49,5 @@ static inline int dmq_load_api(dmq_api_t* api) {
 
 int handle_dmq_message(struct sip_msg* msg, char* str1 ,char* str2);
 
-#endif
+#endif
+

+ 1 - 0
modules_k/dmq/dmq_funcs.c

@@ -167,3 +167,4 @@ void ping_servers(unsigned int ticks,void *param) {
 		LM_ERR("error broadcasting message\n");
 	}
 }
+

+ 2 - 1
modules_k/dmq/dmq_funcs.h

@@ -25,4 +25,5 @@ dmq_peer_t* register_dmq_peer(dmq_peer_t* peer);
 int send_dmq_message(dmq_peer_t* peer, str* body, dmq_node_t* node, dmq_resp_cback_t* resp_cback, int max_forwards);
 int bcast_dmq_message(dmq_peer_t* peer, str* body, dmq_node_t* except, dmq_resp_cback_t* resp_cback, int max_forwards);
 
-#endif
+#endif
+

+ 1 - 0
modules_k/dmq/dmqnode.c

@@ -246,3 +246,4 @@ int build_node_str(dmq_node_t* node, char* buf, int buflen) {
 	len += get_status_str(node->status)->len;
 	return len;
 }
+

+ 2 - 1
modules_k/dmq/dmqnode.h

@@ -54,4 +54,5 @@ int build_node_str(dmq_node_t* node, char* buf, int buflen);
 extern dmq_node_t* self_node;
 extern dmq_node_t* notification_node;	
 
-#endif
+#endif
+

+ 2 - 1
modules_k/dmq/message.c

@@ -47,4 +47,5 @@ int handle_dmq_message(struct sip_msg* msg, char* str1, char* str2) {
 	return 0;
 error:
 	return -1;
-}
+}
+

+ 2 - 1
modules_k/dmq/message.h

@@ -1,2 +1,3 @@
 
-int handle_dmq_message(struct sip_msg*, char*, char*);
+int handle_dmq_message(struct sip_msg*, char*, char*);
+

+ 1 - 0
modules_k/dmq/notification_peer.c

@@ -218,3 +218,4 @@ int notification_resp_callback_f(struct sip_msg* msg, int code, dmq_node_t* node
 	}
 	return 0;
 }
+

+ 2 - 1
modules_k/dmq/notification_peer.h

@@ -23,4 +23,5 @@ dmq_node_t* add_server_and_notify(str* server_address);
 
 /* helper functions */
 extern int notification_resp_callback_f(struct sip_msg* msg, int code, dmq_node_t* node, void* param);
-extern dmq_resp_cback_t notification_callback;
+extern dmq_resp_cback_t notification_callback;
+

+ 2 - 1
modules_k/dmq/peer.c

@@ -41,4 +41,5 @@ dmq_peer_t* find_peer(str peer_id) {
 	dmq_peer_t foo_peer;
 	foo_peer.peer_id = peer_id;
 	return search_peer_list(peer_list, &foo_peer);
-}
+}
+

+ 2 - 1
modules_k/dmq/peer.h

@@ -41,4 +41,5 @@ dmq_peer_t* add_peer(dmq_peer_list_t* peer_list, dmq_peer_t* peer);
 dmq_peer_t* find_peer(str peer_id);
 
 
-#endif
+#endif
+

+ 1 - 0
modules_k/dmq/worker.c

@@ -183,3 +183,4 @@ dmq_job_t* job_queue_pop(job_queue_t* queue) {
 	lock_release(&queue->lock);
 	return front;
 }
+

+ 2 - 1
modules_k/dmq/worker.h

@@ -40,4 +40,5 @@ void job_queue_push(job_queue_t* queue, dmq_job_t* job);
 dmq_job_t* job_queue_pop(job_queue_t* queue);
 int job_queue_size(job_queue_t* queue);
 
-#endif
+#endif
+

+ 2 - 2
modules_k/nat_traversal/nat_traversal.c

@@ -1626,8 +1626,8 @@ save_keepalive_state(void)
             fprintf(f, "%s %.*s %ld %ld\n",
                     contact->uri,
                     contact->socket->sock_str.len, contact->socket->sock_str.s,
-                    contact->registration_expire,
-                    contact->subscription_expire);
+                    (long int)contact->registration_expire,
+                    (long int)contact->subscription_expire);
             contact = contact->next;
         }
     }

+ 1 - 1
modules_k/p_usrloc/ul_db_handle.c

@@ -458,7 +458,7 @@ int check_handle(db_func_t * dbf, db1_con_t * dbh, ul_db_handle_t * handle){
 			} else if((handle->db[i].status == DB_ON) && handle->db[i].dbh) {
 				if((handle->db[i].failover_time < (time(NULL) - expire_time)) && (handle->db[i].failover_time != UL_DB_ZERO_TIME)){
 					LM_ERR("%s: failover_time: %ld, now: %ld, delta: %ld, now going to reset failover time\n", __FUNCTION__, 
-						handle->db[i].failover_time, time(NULL), (time(NULL) - handle->db[i].failover_time));
+						(long int)handle->db[i].failover_time, (long int)time(NULL), (long int)(time(NULL) - handle->db[i].failover_time));
 					if(db_reset_failover_time(handle, handle->db[i].no) < 0) {
 						LM_ERR("could not reset failover time for id %i, db %i.\n",
 							handle->id, handle->db[i].no);

+ 2 - 1
modules_k/presence_xml/pidf.c

@@ -31,6 +31,8 @@
  * \ingroup presence_xml
  */
 
+#include "../../sr_module.h"
+
 /**
  * make strptime available
  * use 600 for 'Single UNIX Specification, Version 3'
@@ -55,7 +57,6 @@
 #include <stdlib.h>
 #include <libxml/parser.h>
 #include "../../dprint.h"
-#include "../../sr_module.h"
 #include "pidf.h"
 
 xmlAttrPtr xmlNodeGetAttrByName(xmlNodePtr node, const char *name)

+ 2 - 2
modules_k/pv/pv_xavp.c

@@ -42,11 +42,11 @@ int pv_xavp_get_value(struct sip_msg *msg, pv_param_t *param,
 			return pv_get_strval(msg, param, res, &avp->val.v.s);
 		break;
 		case SR_XTYPE_TIME:
-			if(snprintf(_pv_xavp_buf, 128, "%lu", avp->val.v.t)<0)
+			if(snprintf(_pv_xavp_buf, 128, "%lu", (long unsigned)avp->val.v.t)<0)
 				return pv_get_null(msg, param, res);
 		break;
 		case SR_XTYPE_LONG:
-			if(snprintf(_pv_xavp_buf, 128, "%ld", avp->val.v.l)<0)
+			if(snprintf(_pv_xavp_buf, 128, "%ld", (long unsigned)avp->val.v.l)<0)
 				return pv_get_null(msg, param, res);
 		break;
 		case SR_XTYPE_LLONG: