Преглед изворни кода

- even more warning fixes, this time for icc

Andrei Pelinescu-Onciul пре 23 година
родитељ
комит
e0a6ffa6a7
11 измењених фајлова са 70 додато и 63 уклоњено
  1. 1 1
      Makefile
  2. 4 3
      Makefile.defs
  3. 0 34
      modules/tm/lock.c
  4. 47 9
      modules/tm/lock.h
  5. 3 2
      modules/tm/t_funcs.c
  6. 1 1
      modules/tm/t_funcs.h
  7. 1 1
      modules/tm/t_fwd.c
  8. 6 6
      modules/tm/t_lookup.c
  9. 4 4
      modules/tm/t_reply.c
  10. 1 1
      modules/tm/tm.c
  11. 2 1
      udp_server.c

+ 1 - 1
Makefile

@@ -10,7 +10,7 @@ auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
 #include  source related defs
 include Makefile.sources
 
-exclude_modules=CVS mysql
+exclude_modules=CVS mysql auth rr usrloc
 static_modules=
 static_modules_path=$(addprefix modules/, $(static_modules))
 extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))

+ 4 - 3
Makefile.defs

@@ -1,4 +1,4 @@
-#
+# $Id$
 #
 # makefile defs (CC, LD,a.s.o)
 #
@@ -8,7 +8,7 @@
 VERSION = 0
 PATCHLEVEL = 8
 SUBLEVEL = 7
-EXTRAVERSION = -4-icc
+EXTRAVERSION = -5-unstable
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 OS = $(shell uname -s)
@@ -79,8 +79,9 @@ DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
 	 -DDNS_IP_HACK  -DPKG_MALLOC \
 	 -DF_MALLOC  -DUSE_SYNONIM\
 	 -DSHM_MEM  -DSHM_MMAP \
+	 -DNO_DEBUG \
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
-	 -DWAIT -DNEW_HNAME  -DNOISY_REPLIES -DBOGDAN_TRIFLE \
+	 -DWAIT -DNEW_HNAME  #-DNOISY_REPLIES -DBOGDAN_TRIFLE \
 	 #-DNO_DEBUG \
 	 #-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=0 \
 	 #-DNOSMP \

+ 0 - 34
modules/tm/lock.c

@@ -322,40 +322,6 @@ void lock_cleanup()
 #endif /*FAST_LOCK*/
 
 
-/* lock semaphore s */
-#ifdef DBG_LOCK
-inline int _lock( ser_lock_t* s , char *file, char *function, unsigned int line )
-#else
-inline int _lock( ser_lock_t* s )
-#endif
-{
-#ifdef DBG_LOCK
-	DBG("DEBUG: lock : entered from %s , %s(%d)\n", function, file, line );
-#endif
-#ifdef FAST_LOCK
-	get_lock(s);
-	return 0;
-#else
-	return change_semaphore( s, -1 );
-#endif
-}
-
-#ifdef DBG_LOCK
-inline int _unlock( ser_lock_t* s, char *file, char *function, unsigned int line )
-#else
-inline int _unlock( ser_lock_t* s )
-#endif
-{
-#ifdef DBG_LOCK
-	DBG("DEBUG: unlock : entered from %s, %s:%d\n", file, function, line );
-#endif
-#ifdef FAST_LOCK
-	release_lock(s);
-	return 0;
-#else
-	return change_semaphore( s, +1 );
-#endif
-}
 
 
 

+ 47 - 9
modules/tm/lock.h

@@ -9,6 +9,7 @@
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
+#include "../../dprint.h"
 
 
 
@@ -56,22 +57,13 @@ static int init_semaphore_set( int size );
 */
 
 #ifdef DBG_LOCK
-int _lock( ser_lock_t* s , char *file, char *function, unsigned int line );
-int _unlock( ser_lock_t* s, char *file, char *function, unsigned int line );
 #define lock(_s) _lock( (_s), __FILE__, __FUNCTION__, __LINE__ )
 #define unlock(_s) _unlock( (_s), __FILE__, __FUNCTION__, __LINE__ )
 #else
-int _lock( ser_lock_t* s );
-int _unlock( ser_lock_t* s );
 #define lock(_s) _lock( (_s) )
 #define unlock(_s) _unlock( (_s) )
 #endif
 
-/*
-#ifndef FAST_LOCK
-static int change_semaphore( ser_lock_t s  , int val );
-#endif
-*/
 
 int init_cell_lock( struct cell *cell );
 int init_entry_lock( struct s_table* hash_table, struct entry *entry );
@@ -82,5 +74,51 @@ int release_cell_lock( struct cell *cell );
 int release_entry_lock( struct entry *entry );
 int release_timerlist_lock( struct timer *timerlist );
 
+
+#ifndef FAST_LOCK
+static int change_semaphore( ser_lock_t s  , int val );
+#endif
+
+
+/* lock semaphore s */
+#ifdef DBG_LOCK
+static inline int _lock( ser_lock_t* s , char *file, char *function,
+							unsigned int line )
+#else
+static inline int _lock( ser_lock_t* s )
+#endif
+{
+#ifdef DBG_LOCK
+	DBG("DEBUG: lock : entered from %s , %s(%d)\n", function, file, line );
+#endif
+#ifdef FAST_LOCK
+	get_lock(s);
+	return 0;
+#else
+	return change_semaphore( s, -1 );
+#endif
+}
+
+
+
+#ifdef DBG_LOCK
+static inline int _unlock( ser_lock_t* s, char *file, char *function,
+		unsigned int line )
+#else
+static inline int _unlock( ser_lock_t* s )
+#endif
+{
+#ifdef DBG_LOCK
+	DBG("DEBUG: unlock : entered from %s, %s:%d\n", file, function, line );
+#endif
+#ifdef FAST_LOCK
+	release_lock(s);
+	return 0;
+#else
+	return change_semaphore( s, +1 );
+#endif
+}
+
+
 #endif
 

+ 3 - 2
modules/tm/t_funcs.c

@@ -712,7 +712,8 @@ int get_ip_and_port_from_uri( struct sip_msg* p_msg , unsigned int *param_ip, un
 	if ( parsed_uri.port.s==0 || parsed_uri.port.len==0 )
 		port = SIP_PORT;
 	else{
-		port = str2s( parsed_uri.port.s , parsed_uri.port.len , &err );
+		port = str2s( (unsigned char*) parsed_uri.port.s, parsed_uri.port.len,
+						&err );
 		if ( err<0 ){
 			LOG(L_ERR, "ERROR: get_ip_and_port_from_uri: converting port "
 				"from str to int failed; using default SIP port\n\turi:%.*s\n",
@@ -725,7 +726,7 @@ int get_ip_and_port_from_uri( struct sip_msg* p_msg , unsigned int *param_ip, un
 	/* getting host address*/
 #ifdef DNS_IP_HACK
 	len=strlen( parsed_uri.host.s );
-	ip=str2ip(parsed_uri.host.s, len, &err);
+	ip=str2ip( (unsigned char*)parsed_uri.host.s, len, &err);
 	if (err==0)
 		goto success;
 #endif

+ 1 - 1
modules/tm/t_funcs.h

@@ -248,7 +248,7 @@ int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
 	unsigned int dest_port_param );
 struct cell* t_lookupOriginalT(  struct s_table* hash_table,
 	struct sip_msg* p_msg );
-int t_reply_matching( struct sip_msg* , unsigned int* , unsigned int* );
+int t_reply_matching( struct sip_msg* , int* ,  int* );
 int t_store_incoming_reply( struct cell* , unsigned int , struct sip_msg* );
 int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked );
 int t_all_final( struct cell * );

+ 1 - 1
modules/tm/t_fwd.c

@@ -164,7 +164,7 @@ int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
 										unsigned int dest_port_param )
 {
 	int branch;
-	int len;
+	unsigned int len;
 	char *buf;
 	struct retrans_buff *srb;
 #ifdef _DONT_USE

+ 6 - 6
modules/tm/t_lookup.c

@@ -240,13 +240,13 @@ struct cell* t_lookupOriginalT(  struct s_table* hash_table ,
 /* Returns 0 - nothing found
  *         1  - T found
  */
-int t_reply_matching( struct sip_msg *p_msg , unsigned int *p_branch ,
-												unsigned int *local_cancel)
+int t_reply_matching( struct sip_msg *p_msg , int *p_branch ,
+											 int *local_cancel)
 {
 	struct cell*  p_cell;
-	unsigned int hash_index   = 0;
-	unsigned int entry_label  = 0;
-	unsigned int branch_id    = 0;
+	int hash_index   = 0;
+	int entry_label  = 0;
+	int branch_id    = 0;
 	char  *hashi, *syni, *branchi, *p, *n;
 	int hashl, synl, branchl;
 	int scan_space;
@@ -427,7 +427,7 @@ int t_check( struct sip_msg* p_msg , int *param_branch, int *param_cancel)
 int add_branch_label( struct cell *trans, struct sip_msg *p_msg, int branch )
 {
 	char *begin;
-	unsigned int size, orig_size;
+	int size, orig_size;
 
 	begin=p_msg->add_to_branch_s+p_msg->add_to_branch_len;
 	orig_size = size=MAX_BRANCH_PARAM_LEN - p_msg->add_to_branch_len;

+ 4 - 4
modules/tm/t_reply.c

@@ -121,7 +121,7 @@ error:
 
 
 
-
+#if 0
 /* Push a previously stored reply from UA Client to UA Server
  * and send it out */
 static int push_reply( struct cell* trans , unsigned int branch ,
@@ -181,7 +181,7 @@ error1:
 error:
 	return -1;
 }
-
+#endif
 
 
 
@@ -192,8 +192,8 @@ error:
   */
 int t_on_reply( struct sip_msg  *p_msg )
 {
-	unsigned int branch, msg_status, msg_class, save_clone;
-	unsigned int local_cancel;
+	int branch, msg_status, msg_class, save_clone;
+	int local_cancel;
 	struct sip_msg *clone=0, *backup=0;
 	int relay;
 	int start_fr = 0;

+ 1 - 1
modules/tm/tm.c

@@ -126,7 +126,7 @@ static int fixup_t_forward(void** param, int param_no)
 		name=*param;
 #ifdef DNS_IP_HACK
 		len=strlen(name);
-		ip=str2ip(name, len, &err);
+		ip=str2ip((unsigned char*)name, len, &err);
 		if (err==0){
 			goto copy;
 		}

+ 2 - 1
udp_server.c

@@ -53,7 +53,8 @@ int probe_max_receive_buffer( int udp_sock )
 		if (phase==0) optval <<= 1; else optval+=BUFFER_INCREMENT;
 		if (optval > maxbuffer){
 			if (phase==1) break; 
-		} else { phase=1; optval >>=1; continue; }
+			else { phase=1; optval >>=1; continue; }
+		}
 		LOG(L_DBG, "DEBUG: udp_init: trying SO_RCVBUF: %d\n", optval );
 		if (setsockopt( udp_sock, SOL_SOCKET, SO_RCVBUF,
 			(void*)&optval, sizeof(optval)) ==-1){