Browse code

core and modules: fix compile warning

Daniel-Constantin Mierla authored on 18/10/2011 09:10:51
Showing 5 changed files
... ...
@@ -26,6 +26,7 @@
26 26
 #include <sqlite3.h>
27 27
 
28 28
 #include "../../sr_module.h"
29
+#include "../../lib/srdb1/db_query.h"
29 30
 #include "../../lib/srdb1/db.h"
30 31
 #include "dbase.h"
31 32
 
... ...
@@ -36,7 +36,7 @@ dmq_node_list_t* init_dmq_node_list() {
36 36
 	return node_list;
37 37
 }
38 38
 
39
-inline int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode) {
39
+int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode) {
40 40
 	if(!node || !cmpnode) {
41 41
 		LM_ERR("cmp_dmq_node - null node received\n");
42 42
 		return -1;
... ...
@@ -45,7 +45,7 @@ inline int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode) {
45 45
 	       STR_EQ(node->uri.port, cmpnode->uri.port);
46 46
 }
47 47
 
48
-static str* get_param_value(param_t* params, str* param) {
48
+str* get_param_value(param_t* params, str* param) {
49 49
 	while (params) {
50 50
 		if ((params->name.len == param->len) &&
51 51
 		    (strncmp(params->name.s, param->s, param->len) == 0)) {
... ...
@@ -56,7 +56,7 @@ static str* get_param_value(param_t* params, str* param) {
56 56
 	return NULL;
57 57
 }
58 58
 
59
-inline int set_dmq_node_params(dmq_node_t* node, param_t* params) {
59
+int set_dmq_node_params(dmq_node_t* node, param_t* params) {
60 60
 	str* status;
61 61
 	if(!params) {
62 62
 		LM_DBG("no parameters given\n");
... ...
@@ -80,12 +80,12 @@ error:
80 80
 	return -1;
81 81
 }
82 82
 
83
-inline int set_default_dmq_node_params(dmq_node_t* node) {
83
+int set_default_dmq_node_params(dmq_node_t* node) {
84 84
 	node->status = DMQ_NODE_ACTIVE;
85 85
 	return 0;
86 86
 }
87 87
 
88
-inline dmq_node_t* build_dmq_node(str* uri, int shm) {
88
+dmq_node_t* build_dmq_node(str* uri, int shm) {
89 89
 	dmq_node_t* ret;
90 90
 	param_hooks_t hooks;
91 91
 	param_t* params;
... ...
@@ -135,7 +135,7 @@ error:
135 135
 	return NULL;
136 136
 }
137 137
 
138
-inline dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri) {
138
+dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri) {
139 139
 	dmq_node_t *ret, *find;
140 140
 	find =  build_dmq_node(uri, 0);
141 141
 	ret = find_dmq_node(list, find);
... ...
@@ -143,7 +143,7 @@ inline dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri) {
143 143
 	return ret;
144 144
 }
145 145
 
146
-inline void destroy_dmq_node(dmq_node_t* node, int shm) {
146
+void destroy_dmq_node(dmq_node_t* node, int shm) {
147 147
 	if(shm) {
148 148
 		shm_free_node(node);
149 149
 	} else {
... ...
@@ -151,7 +151,7 @@ inline void destroy_dmq_node(dmq_node_t* node, int shm) {
151 151
 	}
152 152
 }
153 153
 
154
-inline dmq_node_t* find_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
154
+dmq_node_t* find_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
155 155
 	dmq_node_t* cur = list->nodes;
156 156
 	while(cur) {
157 157
 		if(cmp_dmq_node(cur, node)) {
... ...
@@ -162,7 +162,7 @@ inline dmq_node_t* find_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
162 162
 	return NULL;
163 163
 }
164 164
 
165
-inline dmq_node_t* shm_dup_node(dmq_node_t* node) {
165
+dmq_node_t* shm_dup_node(dmq_node_t* node) {
166 166
 	dmq_node_t* newnode = shm_malloc(sizeof(dmq_node_t));
167 167
 	memcpy(newnode, node, sizeof(dmq_node_t));
168 168
 	shm_str_dup(&newnode->orig_uri, &node->orig_uri);
... ...
@@ -177,17 +177,17 @@ error:
177 177
 	return NULL;
178 178
 }
179 179
 
180
-inline void shm_free_node(dmq_node_t* node) {
180
+void shm_free_node(dmq_node_t* node) {
181 181
 	shm_free(node->orig_uri.s);
182 182
 	shm_free(node);
183 183
 }
184 184
 
185
-inline void pkg_free_node(dmq_node_t* node) {
185
+void pkg_free_node(dmq_node_t* node) {
186 186
 	pkg_free(node->orig_uri.s);
187 187
 	pkg_free(node);
188 188
 }
189 189
 
190
-inline int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
190
+int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
191 191
 	dmq_node_t *cur, **prev;
192 192
 	lock_get(&list->lock);
193 193
 	cur = list->nodes;
... ...
@@ -206,7 +206,7 @@ inline int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
206 206
 	return 0;
207 207
 }
208 208
 
209
-inline dmq_node_t* add_dmq_node(dmq_node_list_t* list, str* uri) {
209
+dmq_node_t* add_dmq_node(dmq_node_list_t* list, str* uri) {
210 210
 	dmq_node_t* newnode = build_dmq_node(uri, 1);
211 211
 	if(!newnode) {
212 212
 		LM_ERR("error creating node\n");
... ...
@@ -245,4 +245,4 @@ int build_node_str(dmq_node_t* node, char* buf, int buflen) {
245 245
 	memcpy(buf + len, get_status_str(node->status)->s, get_status_str(node->status)->len);
246 246
 	len += get_status_str(node->status)->len;
247 247
 	return len;
248
-}
249 248
\ No newline at end of file
249
+}
... ...
@@ -91,7 +91,7 @@ void worker_loop(int id) {
91 91
 
92 92
 int add_dmq_job(struct sip_msg* msg, dmq_peer_t* peer) {
93 93
 	int i, found_available = 0;
94
-	dmq_job_t new_job;
94
+	dmq_job_t new_job = { 0 };
95 95
 	dmq_worker_t* worker;
96 96
 	new_job.f = peer->callback;
97 97
 	new_job.msg = msg;
... ...
@@ -182,4 +182,4 @@ dmq_job_t* job_queue_pop(job_queue_t* queue) {
182 182
 	atomic_dec(&queue->count);
183 183
 	lock_release(&queue->lock);
184 184
 	return front;
185
-}
186 185
\ No newline at end of file
186
+}
... ...
@@ -31,13 +31,6 @@
31 31
  * \ingroup presence_xml
32 32
  */
33 33
 
34
-#include <string.h>
35
-#include <stdlib.h>
36
-#include <libxml/parser.h>
37
-#include "../../dprint.h"
38
-#include "../../sr_module.h"
39
-#include "pidf.h"
40
-
41 34
 /**
42 35
  * make strptime available
43 36
  * use 600 for 'Single UNIX Specification, Version 3'
... ...
@@ -48,6 +41,7 @@
48 48
 	#define _BSD_SOURCE 1				/* needed on linux to "fix" the effect
49 49
 										  of the above define on
50 50
 										  features.h/unistd.h syscall() */
51
+   #define _DARWIN_C_SOURCE 1
51 52
 #else
52 53
 	#define _XOPEN_SOURCE_EXTENDED 1   /* solaris */
53 54
 #endif
... ...
@@ -57,6 +51,13 @@
57 57
 #undef _XOPEN_SOURCE
58 58
 #undef _XOPEN_SOURCE_EXTENDED
59 59
 
60
+#include <string.h>
61
+#include <stdlib.h>
62
+#include <libxml/parser.h>
63
+#include "../../dprint.h"
64
+#include "../../sr_module.h"
65
+#include "pidf.h"
66
+
60 67
 xmlAttrPtr xmlNodeGetAttrByName(xmlNodePtr node, const char *name)
61 68
 {
62 69
 	xmlAttrPtr attr = node->properties;
... ...
@@ -428,7 +428,8 @@ void xavp_print_list_content(sr_xavp_t **head, int level)
428 428
 				LM_INFO("     XAVP value: %s\n", avp->val.v.s.s);
429 429
 			break;
430 430
 			case SR_XTYPE_TIME:
431
-				LM_INFO("     XAVP value: %lu\n", avp->val.v.t);
431
+				LM_INFO("     XAVP value: %lu\n",
432
+						(long unsigned int)avp->val.v.t);
432 433
 			break;
433 434
 			case SR_XTYPE_LONG:
434 435
 				LM_INFO("     XAVP value: %ld\n", avp->val.v.l);