Browse code

- even more warning fixes, this time for icc

Andrei Pelinescu-Onciul authored on 02/03/2002 06:47:27
Showing 11 changed files
... ...
@@ -10,7 +10,7 @@ auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
10 10
 #include  source related defs
11 11
 include Makefile.sources
12 12
 
13
-exclude_modules=CVS mysql
13
+exclude_modules=CVS mysql auth rr usrloc
14 14
 static_modules=
15 15
 static_modules_path=$(addprefix modules/, $(static_modules))
16 16
 extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
... ...
@@ -1,4 +1,4 @@
1
-#
1
+# $Id$
2 2
 #
3 3
 # makefile defs (CC, LD,a.s.o)
4 4
 #
... ...
@@ -8,7 +8,7 @@
8 8
 VERSION = 0
9 9
 PATCHLEVEL = 8
10 10
 SUBLEVEL = 7
11
-EXTRAVERSION = -4-icc
11
+EXTRAVERSION = -5-unstable
12 12
 
13 13
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
14 14
 OS = $(shell uname -s)
... ...
@@ -79,8 +79,9 @@ DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
79 79
 	 -DDNS_IP_HACK  -DPKG_MALLOC \
80 80
 	 -DF_MALLOC  -DUSE_SYNONIM\
81 81
 	 -DSHM_MEM  -DSHM_MMAP \
82
+	 -DNO_DEBUG \
82 83
 	 -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 \
83
-	 -DWAIT -DNEW_HNAME  -DNOISY_REPLIES -DBOGDAN_TRIFLE \
84
+	 -DWAIT -DNEW_HNAME  #-DNOISY_REPLIES -DBOGDAN_TRIFLE \
84 85
 	 #-DNO_DEBUG \
85 86
 	 #-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=0 \
86 87
 	 #-DNOSMP \
... ...
@@ -322,40 +322,6 @@ void lock_cleanup()
322 322
 #endif /*FAST_LOCK*/
323 323
 
324 324
 
325
-/* lock semaphore s */
326
-#ifdef DBG_LOCK
327
-inline int _lock( ser_lock_t* s , char *file, char *function, unsigned int line )
328
-#else
329
-inline int _lock( ser_lock_t* s )
330
-#endif
331
-{
332
-#ifdef DBG_LOCK
333
-	DBG("DEBUG: lock : entered from %s , %s(%d)\n", function, file, line );
334
-#endif
335
-#ifdef FAST_LOCK
336
-	get_lock(s);
337
-	return 0;
338
-#else
339
-	return change_semaphore( s, -1 );
340
-#endif
341
-}
342
-
343
-#ifdef DBG_LOCK
344
-inline int _unlock( ser_lock_t* s, char *file, char *function, unsigned int line )
345
-#else
346
-inline int _unlock( ser_lock_t* s )
347
-#endif
348
-{
349
-#ifdef DBG_LOCK
350
-	DBG("DEBUG: unlock : entered from %s, %s:%d\n", file, function, line );
351
-#endif
352
-#ifdef FAST_LOCK
353
-	release_lock(s);
354
-	return 0;
355
-#else
356
-	return change_semaphore( s, +1 );
357
-#endif
358
-}
359 325
 
360 326
 
361 327
 
... ...
@@ -9,6 +9,7 @@
9 9
 #include <sys/types.h>
10 10
 #include <sys/ipc.h>
11 11
 #include <sys/sem.h>
12
+#include "../../dprint.h"
12 13
 
13 14
 
14 15
 
... ...
@@ -56,22 +57,13 @@ static int init_semaphore_set( int size );
56 56
 */
57 57
 
58 58
 #ifdef DBG_LOCK
59
-int _lock( ser_lock_t* s , char *file, char *function, unsigned int line );
60
-int _unlock( ser_lock_t* s, char *file, char *function, unsigned int line );
61 59
 #define lock(_s) _lock( (_s), __FILE__, __FUNCTION__, __LINE__ )
62 60
 #define unlock(_s) _unlock( (_s), __FILE__, __FUNCTION__, __LINE__ )
63 61
 #else
64
-int _lock( ser_lock_t* s );
65
-int _unlock( ser_lock_t* s );
66 62
 #define lock(_s) _lock( (_s) )
67 63
 #define unlock(_s) _unlock( (_s) )
68 64
 #endif
69 65
 
70
-/*
71
-#ifndef FAST_LOCK
72
-static int change_semaphore( ser_lock_t s  , int val );
73
-#endif
74
-*/
75 66
 
76 67
 int init_cell_lock( struct cell *cell );
77 68
 int init_entry_lock( struct s_table* hash_table, struct entry *entry );
... ...
@@ -82,5 +74,51 @@ int release_cell_lock( struct cell *cell );
82 82
 int release_entry_lock( struct entry *entry );
83 83
 int release_timerlist_lock( struct timer *timerlist );
84 84
 
85
+
86
+#ifndef FAST_LOCK
87
+static int change_semaphore( ser_lock_t s  , int val );
88
+#endif
89
+
90
+
91
+/* lock semaphore s */
92
+#ifdef DBG_LOCK
93
+static inline int _lock( ser_lock_t* s , char *file, char *function,
94
+							unsigned int line )
95
+#else
96
+static inline int _lock( ser_lock_t* s )
97
+#endif
98
+{
99
+#ifdef DBG_LOCK
100
+	DBG("DEBUG: lock : entered from %s , %s(%d)\n", function, file, line );
101
+#endif
102
+#ifdef FAST_LOCK
103
+	get_lock(s);
104
+	return 0;
105
+#else
106
+	return change_semaphore( s, -1 );
107
+#endif
108
+}
109
+
110
+
111
+
112
+#ifdef DBG_LOCK
113
+static inline int _unlock( ser_lock_t* s, char *file, char *function,
114
+		unsigned int line )
115
+#else
116
+static inline int _unlock( ser_lock_t* s )
117
+#endif
118
+{
119
+#ifdef DBG_LOCK
120
+	DBG("DEBUG: unlock : entered from %s, %s:%d\n", file, function, line );
121
+#endif
122
+#ifdef FAST_LOCK
123
+	release_lock(s);
124
+	return 0;
125
+#else
126
+	return change_semaphore( s, +1 );
127
+#endif
128
+}
129
+
130
+
85 131
 #endif
86 132
 
... ...
@@ -712,7 +712,8 @@ int get_ip_and_port_from_uri( struct sip_msg* p_msg , unsigned int *param_ip, un
712 712
 	if ( parsed_uri.port.s==0 || parsed_uri.port.len==0 )
713 713
 		port = SIP_PORT;
714 714
 	else{
715
-		port = str2s( parsed_uri.port.s , parsed_uri.port.len , &err );
715
+		port = str2s( (unsigned char*) parsed_uri.port.s, parsed_uri.port.len,
716
+						&err );
716 717
 		if ( err<0 ){
717 718
 			LOG(L_ERR, "ERROR: get_ip_and_port_from_uri: converting port "
718 719
 				"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
725 725
 	/* getting host address*/
726 726
 #ifdef DNS_IP_HACK
727 727
 	len=strlen( parsed_uri.host.s );
728
-	ip=str2ip(parsed_uri.host.s, len, &err);
728
+	ip=str2ip( (unsigned char*)parsed_uri.host.s, len, &err);
729 729
 	if (err==0)
730 730
 		goto success;
731 731
 #endif
... ...
@@ -248,7 +248,7 @@ int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
248 248
 	unsigned int dest_port_param );
249 249
 struct cell* t_lookupOriginalT(  struct s_table* hash_table,
250 250
 	struct sip_msg* p_msg );
251
-int t_reply_matching( struct sip_msg* , unsigned int* , unsigned int* );
251
+int t_reply_matching( struct sip_msg* , int* ,  int* );
252 252
 int t_store_incoming_reply( struct cell* , unsigned int , struct sip_msg* );
253 253
 int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked );
254 254
 int t_all_final( struct cell * );
... ...
@@ -164,7 +164,7 @@ int t_forward_ack( struct sip_msg* p_msg , unsigned int dest_ip_param ,
164 164
 										unsigned int dest_port_param )
165 165
 {
166 166
 	int branch;
167
-	int len;
167
+	unsigned int len;
168 168
 	char *buf;
169 169
 	struct retrans_buff *srb;
170 170
 #ifdef _DONT_USE
... ...
@@ -240,13 +240,13 @@ struct cell* t_lookupOriginalT(  struct s_table* hash_table ,
240 240
 /* Returns 0 - nothing found
241 241
  *         1  - T found
242 242
  */
243
-int t_reply_matching( struct sip_msg *p_msg , unsigned int *p_branch ,
244
-												unsigned int *local_cancel)
243
+int t_reply_matching( struct sip_msg *p_msg , int *p_branch ,
244
+											 int *local_cancel)
245 245
 {
246 246
 	struct cell*  p_cell;
247
-	unsigned int hash_index   = 0;
248
-	unsigned int entry_label  = 0;
249
-	unsigned int branch_id    = 0;
247
+	int hash_index   = 0;
248
+	int entry_label  = 0;
249
+	int branch_id    = 0;
250 250
 	char  *hashi, *syni, *branchi, *p, *n;
251 251
 	int hashl, synl, branchl;
252 252
 	int scan_space;
... ...
@@ -427,7 +427,7 @@ int t_check( struct sip_msg* p_msg , int *param_branch, int *param_cancel)
427 427
 int add_branch_label( struct cell *trans, struct sip_msg *p_msg, int branch )
428 428
 {
429 429
 	char *begin;
430
-	unsigned int size, orig_size;
430
+	int size, orig_size;
431 431
 
432 432
 	begin=p_msg->add_to_branch_s+p_msg->add_to_branch_len;
433 433
 	orig_size = size=MAX_BRANCH_PARAM_LEN - p_msg->add_to_branch_len;
... ...
@@ -121,7 +121,7 @@ error:
121 121
 
122 122
 
123 123
 
124
-
124
+#if 0
125 125
 /* Push a previously stored reply from UA Client to UA Server
126 126
  * and send it out */
127 127
 static int push_reply( struct cell* trans , unsigned int branch ,
... ...
@@ -181,7 +181,7 @@ error1:
181 181
 error:
182 182
 	return -1;
183 183
 }
184
-
184
+#endif
185 185
 
186 186
 
187 187
 
... ...
@@ -192,8 +192,8 @@ error:
192 192
   */
193 193
 int t_on_reply( struct sip_msg  *p_msg )
194 194
 {
195
-	unsigned int branch, msg_status, msg_class, save_clone;
196
-	unsigned int local_cancel;
195
+	int branch, msg_status, msg_class, save_clone;
196
+	int local_cancel;
197 197
 	struct sip_msg *clone=0, *backup=0;
198 198
 	int relay;
199 199
 	int start_fr = 0;
... ...
@@ -126,7 +126,7 @@ static int fixup_t_forward(void** param, int param_no)
126 126
 		name=*param;
127 127
 #ifdef DNS_IP_HACK
128 128
 		len=strlen(name);
129
-		ip=str2ip(name, len, &err);
129
+		ip=str2ip((unsigned char*)name, len, &err);
130 130
 		if (err==0){
131 131
 			goto copy;
132 132
 		}
... ...
@@ -53,7 +53,8 @@ int probe_max_receive_buffer( int udp_sock )
53 53
 		if (phase==0) optval <<= 1; else optval+=BUFFER_INCREMENT;
54 54
 		if (optval > maxbuffer){
55 55
 			if (phase==1) break; 
56
-		} else { phase=1; optval >>=1; continue; }
56
+			else { phase=1; optval >>=1; continue; }
57
+		}
57 58
 		LOG(L_DBG, "DEBUG: udp_init: trying SO_RCVBUF: %d\n", optval );
58 59
 		if (setsockopt( udp_sock, SOL_SOCKET, SO_RCVBUF,
59 60
 			(void*)&optval, sizeof(optval)) ==-1){