Browse code

Provide two useful macros for str initialization: STR_STATIC_INIT() and STR_NULL. Adjust all modules to use those macros where appropriate.

Verified by: md5(1) (those modules, which actually compile)

Maxim Sobolev authored on 17/11/2005 03:49:37
Showing 2 changed files
... ...
@@ -669,7 +669,7 @@ static int assemble_msg(struct sip_msg* msg, struct tw_info *twi)
669 669
 	static char     route_buffer[ROUTE_BUFFER_MAX];
670 670
 	static char     append_buf[APPEND_BUFFER_MAX];
671 671
 	static char     cmd_buf[CMD_BUFFER_MAX];
672
-	static str      empty_param = {".",1};
672
+	static str      empty_param = STR_STATIC_INIT(".");
673 673
 	unsigned int      hash_index, label;
674 674
 	contact_body_t*   cb=0;
675 675
 	contact_t*        c=0;
... ...
@@ -37,5 +37,7 @@ struct _str{
37 37
 
38 38
 typedef struct _str str;
39 39
 
40
+#define STR_STATIC_INIT(v) {(v), sizeof(v) - 1}
41
+#define STR_NULL {NULL, 0}
40 42
 
41 43
 #endif