فهرست منبع

- minor optimizations (tricking gcc into generating a little better code)

Andrei Pelinescu-Onciul 22 سال پیش
والد
کامیت
350a47c1b4
3فایلهای تغییر یافته به همراه7 افزوده شده و 5 حذف شده
  1. 2 0
      TODO
  2. 3 3
      parser/parse_uri.c
  3. 2 2
      test/p_uri.c

+ 2 - 0
TODO

@@ -22,6 +22,8 @@ x (different way) add request header bitmap field for the modules
 - BUG:?? ipv6 only and try to send to ipv4 => getsendsocket=>0 (send_ipv6=0)
   the reverse is also true
 - resolver should resolve [ipv6]
+- remove parse_uri debugging info
+- fix DBG("<%.*s>", len, _null_)
 
 
 High priority:

+ 3 - 3
parser/parse_uri.c

@@ -76,7 +76,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 					/* sctp */
 					VS_S, VS_C, VS_T, VS_P_FIN
 	};
-	enum states state;
+	register enum states state;
 	char* s;
 	char* b; /* param start */
 	char *v; /* value start */
@@ -85,7 +85,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 	str user;
 	str password;
 	int port_no;
-	char* p;
+	register char* p;
 	char* end;
 	char* pass;
 	int found_user;
@@ -316,7 +316,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 	
 	s=p;
 	for(;p<end; p++){
-		switch(state){
+		switch((unsigned char)state){
 			case URI_INIT:
 				switch(*p){
 					case '[':

+ 2 - 2
test/p_uri.c

@@ -64,7 +64,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 					/* sctp */
 					VS_S, VS_C, VS_T, VS_P_FIN
 	};
-	enum states state;
+	register enum states state;
 	char* s;
 	char* b; /* param start */
 	char *v; /* value start */
@@ -73,7 +73,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 	str user;
 	str password;
 	int port_no;
-	char* p;
+	register char* p;
 	char* end;
 	char* pass;
 	int found_user;