Module: sip-router
Branch: master
Commit: e91db504fda2a878418b94f6ab454b22c44fa369
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e91db50…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Oct 18 11:10:51 2011 +0200
core and modules: fix compile warning
---
modules_k/db_sqlite/db_sqlite.c | 1 +
modules_k/dmq/dmqnode.c | 28 ++++++++++++++--------------
modules_k/dmq/worker.c | 4 ++--
modules_k/presence_conference/pidf.c | 15 ++++++++-------
xavp.c | 3 ++-
5 files changed, 27 insertions(+), 24 deletions(-)
diff --git a/modules_k/db_sqlite/db_sqlite.c b/modules_k/db_sqlite/db_sqlite.c
index 4d0ce56..520cc38 100644
--- a/modules_k/db_sqlite/db_sqlite.c
+++ b/modules_k/db_sqlite/db_sqlite.c
@@ -26,6 +26,7 @@
#include <sqlite3.h>
#include "../../sr_module.h"
+#include "../../lib/srdb1/db_query.h"
#include "../../lib/srdb1/db.h"
#include "dbase.h"
diff --git a/modules_k/dmq/dmqnode.c b/modules_k/dmq/dmqnode.c
index 25334bc..d567a34 100644
--- a/modules_k/dmq/dmqnode.c
+++ b/modules_k/dmq/dmqnode.c
@@ -36,7 +36,7 @@ dmq_node_list_t* init_dmq_node_list() {
return node_list;
}
-inline int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode) {
+int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode) {
if(!node || !cmpnode) {
LM_ERR("cmp_dmq_node - null node received\n");
return -1;
@@ -45,7 +45,7 @@ inline int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode) {
STR_EQ(node->uri.port, cmpnode->uri.port);
}
-static str* get_param_value(param_t* params, str* param) {
+str* get_param_value(param_t* params, str* param) {
while (params) {
if ((params->name.len == param->len) &&
(strncmp(params->name.s, param->s, param->len) == 0)) {
@@ -56,7 +56,7 @@ static str* get_param_value(param_t* params, str* param) {
return NULL;
}
-inline int set_dmq_node_params(dmq_node_t* node, param_t* params) {
+int set_dmq_node_params(dmq_node_t* node, param_t* params) {
str* status;
if(!params) {
LM_DBG("no parameters given\n");
@@ -80,12 +80,12 @@ error:
return -1;
}
-inline int set_default_dmq_node_params(dmq_node_t* node) {
+int set_default_dmq_node_params(dmq_node_t* node) {
node->status = DMQ_NODE_ACTIVE;
return 0;
}
-inline dmq_node_t* build_dmq_node(str* uri, int shm) {
+dmq_node_t* build_dmq_node(str* uri, int shm) {
dmq_node_t* ret;
param_hooks_t hooks;
param_t* params;
@@ -135,7 +135,7 @@ error:
return NULL;
}
-inline dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri) {
+dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri) {
dmq_node_t *ret, *find;
find = build_dmq_node(uri, 0);
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)
{
return ret;
}
-inline void destroy_dmq_node(dmq_node_t* node, int shm) {
+void destroy_dmq_node(dmq_node_t* node, int shm) {
if(shm) {
shm_free_node(node);
} else {
@@ -151,7 +151,7 @@ inline void destroy_dmq_node(dmq_node_t* node, int shm) {
}
}
-inline dmq_node_t* find_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
+dmq_node_t* find_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
dmq_node_t* cur = list->nodes;
while(cur) {
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) {
return NULL;
}
-inline dmq_node_t* shm_dup_node(dmq_node_t* node) {
+dmq_node_t* shm_dup_node(dmq_node_t* node) {
dmq_node_t* newnode = shm_malloc(sizeof(dmq_node_t));
memcpy(newnode, node, sizeof(dmq_node_t));
shm_str_dup(&newnode->orig_uri, &node->orig_uri);
@@ -177,17 +177,17 @@ error:
return NULL;
}
-inline void shm_free_node(dmq_node_t* node) {
+void shm_free_node(dmq_node_t* node) {
shm_free(node->orig_uri.s);
shm_free(node);
}
-inline void pkg_free_node(dmq_node_t* node) {
+void pkg_free_node(dmq_node_t* node) {
pkg_free(node->orig_uri.s);
pkg_free(node);
}
-inline int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
+int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
dmq_node_t *cur, **prev;
lock_get(&list->lock);
cur = list->nodes;
@@ -206,7 +206,7 @@ inline int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node) {
return 0;
}
-inline dmq_node_t* add_dmq_node(dmq_node_list_t* list, str* uri) {
+dmq_node_t* add_dmq_node(dmq_node_list_t* list, str* uri) {
dmq_node_t* newnode = build_dmq_node(uri, 1);
if(!newnode) {
LM_ERR("error creating node\n");
@@ -245,4 +245,4 @@ int build_node_str(dmq_node_t* node, char* buf, int buflen) {
memcpy(buf + len, get_status_str(node->status)->s,
get_status_str(node->status)->len);
len += get_status_str(node->status)->len;
return len;
-}
\ No newline at end of file
+}
diff --git a/modules_k/dmq/worker.c b/modules_k/dmq/worker.c
index cf206f0..fbf5443 100644
--- a/modules_k/dmq/worker.c
+++ b/modules_k/dmq/worker.c
@@ -91,7 +91,7 @@ void worker_loop(int id) {
int add_dmq_job(struct sip_msg* msg, dmq_peer_t* peer) {
int i, found_available = 0;
- dmq_job_t new_job;
+ dmq_job_t new_job = { 0 };
dmq_worker_t* worker;
new_job.f = peer->callback;
new_job.msg = msg;
@@ -182,4 +182,4 @@ dmq_job_t* job_queue_pop(job_queue_t* queue) {
atomic_dec(&queue->count);
lock_release(&queue->lock);
return front;
-}
\ No newline at end of file
+}
diff --git a/modules_k/presence_conference/pidf.c b/modules_k/presence_conference/pidf.c
index 2b2d45c..a4c1179 100644
--- a/modules_k/presence_conference/pidf.c
+++ b/modules_k/presence_conference/pidf.c
@@ -31,13 +31,6 @@
* \ingroup presence_xml
*/
-#include <string.h>
-#include <stdlib.h>
-#include <libxml/parser.h>
-#include "../../dprint.h"
-#include "../../sr_module.h"
-#include "pidf.h"
-
/**
* make strptime available
* use 600 for 'Single UNIX Specification, Version 3'
@@ -48,6 +41,7 @@
#define _BSD_SOURCE 1 /* needed on linux to "fix" the effect
of the above define on
features.h/unistd.h syscall() */
+ #define _DARWIN_C_SOURCE 1
#else
#define _XOPEN_SOURCE_EXTENDED 1 /* solaris */
#endif
@@ -57,6 +51,13 @@
#undef _XOPEN_SOURCE
#undef _XOPEN_SOURCE_EXTENDED
+#include <string.h>
+#include <stdlib.h>
+#include <libxml/parser.h>
+#include "../../dprint.h"
+#include "../../sr_module.h"
+#include "pidf.h"
+
xmlAttrPtr xmlNodeGetAttrByName(xmlNodePtr node, const char *name)
{
xmlAttrPtr attr = node->properties;
diff --git a/xavp.c b/xavp.c
index 265729e..fed62ee 100644
--- a/xavp.c
+++ b/xavp.c
@@ -428,7 +428,8 @@ void xavp_print_list_content(sr_xavp_t **head, int level)
LM_INFO(" XAVP value: %s\n", avp->val.v.s.s);
break;
case SR_XTYPE_TIME:
- LM_INFO(" XAVP value: %lu\n", avp->val.v.t);
+ LM_INFO(" XAVP value: %lu\n",
+ (long unsigned int)avp->val.v.t);
break;
case SR_XTYPE_LONG:
LM_INFO(" XAVP value: %ld\n", avp->val.v.l);