Commit f9abdf60 authored by Michael Jerris's avatar Michael Jerris

Fix gcc build with -stdÉ9 -pedantic-errors (RE-RECORDED)

It is not possible to cast function pointers to (void *) in C99
(section 6.2.2.3).

C99 printf formatting expects (void *) for %p argument
(section 7.13.6.1 p. 335).

darcs-hash:20070207193814-16063-b6f3632e0911cee2ab67a1b184bbf18d3b7bd174.gz
parent 76c2acaa
......@@ -1047,7 +1047,7 @@ static su_port_t *su_source_port_create(void)
su_perror("su_source_port_create(): g_source_new");
}
SU_DEBUG_1(("su_source_port_create() returns %p\n", self));
SU_DEBUG_1(("su_source_port_create() returns %p\n", (void *)self));
return self;
}
......
......@@ -950,7 +950,8 @@ int auth_readdb_if_needed(auth_mod_t *am)
#include <sys/file.h>
#endif
#define auth_apw_local auth_readdb_internal
/* This is just a magic value */
#define auth_apw_local ((void *)(intptr_t)auth_readdb_internal)
/** Read authentication database */
static
......
......@@ -126,7 +126,7 @@ static int delayed_auth_init(auth_mod_t *am,
struct auth_splugin_t
{
void const *asp_tag;
void const *asp_cookie;
auth_splugin_t *asp_next;
auth_splugin_t **asp_prev;
auth_mod_t *asp_am;
......@@ -136,6 +136,8 @@ struct auth_splugin_t
int asp_canceled;
};
/* This is unique identifier */
#define delayed_asp_cookie ((void const *)(intptr_t)delayed_auth_cancel)
static void delayed_auth_method_recv(su_root_magic_t *rm,
su_msg_r msg,
......@@ -162,7 +164,7 @@ static void delayed_auth_method(auth_mod_t *am,
asp = su_msg_data(mamc); assert(asp);
asp->asp_tag = delayed_auth_cancel;
asp->asp_cookie = delayed_asp_cookie;
asp->asp_am = am;
asp->asp_as = as;
asp->asp_header = auth;
......@@ -216,7 +218,7 @@ static void delayed_auth_cancel(auth_mod_t *am, auth_status_t *as)
(void)ap; /* xyzzy */
if (as->as_plugin && as->as_plugin->asp_tag == delayed_auth_cancel)
if (as->as_plugin && as->as_plugin->asp_cookie == delayed_asp_cookie)
as->as_plugin->asp_canceled = 1;
as->as_status = 500, as->as_phrase = "Authentication canceled";
......
......@@ -105,7 +105,7 @@ struct auth_scheme
typedef struct
{
unsigned apw_index; /**< Key to hash table */
void const *apw_type; /**< Magic pointer */
void const *apw_type; /**< Magic identifier */
char const *apw_user; /**< Username */
char const *apw_realm; /**< Realm */
......
......@@ -56,7 +56,8 @@ SOFIA_BEGIN_DECLS
* 1) Header class definitions.
*/
#if HAVE_STRUCT_KEYWORDS
/* Do not use keywords until you fix msg_kind_foo_critical thing! */ \
#if HAVE_STRUCT_KEYWORDS && 0
/** Define a header class */
#define MSG_HEADER_CLASS(pr, c, l, s, params, kind, dup, upd) \
{{ \
......@@ -74,6 +75,7 @@ SOFIA_BEGIN_DECLS
hc_kind: msg_kind_##kind, \
}}
#else
/** Define a header class */
#define MSG_HEADER_CLASS(pr, c, l, s, params, kind, dup, upd) \
{{ \
pr##c##_hash, \
......
......@@ -496,14 +496,14 @@ nea_server_t *nea_server_create(nta_agent_t *agent,
nes->nes_eventity_uri &&
(nes->nes_leg || leg == NULL) &&
nes->nes_timer) {
SU_DEBUG_5(("nea_server_create(%p): success\n", nes));
SU_DEBUG_5(("nea_server_create(%p): success\n", (void *)nes));
su_timer_set(nes->nes_timer, nes_event_timer, nes);
nes->nes_callback = callback;
nes->nes_context = context;
}
else {
SU_DEBUG_5(("nea_server_create(%p): failed\n", nes));
SU_DEBUG_5(("nea_server_create(%p): failed\n", (void *)nes));
nea_server_destroy(nes), nes = NULL;
}
}
......@@ -551,11 +551,11 @@ int nea_server_shutdown(nea_server_t *nes,
return 500;
if (nes->nes_in_callback) {
SU_DEBUG_5(("nea_server_shutdown(%p) while in callback\n", nes));
SU_DEBUG_5(("nea_server_shutdown(%p) while in callback\n", (void *)nes));
return 100;
}
SU_DEBUG_5(("nea_server_shutdown(%p)\n", nes));
SU_DEBUG_5(("nea_server_shutdown(%p)\n", (void *)nes));
in_callback = nes->nes_in_callback; nes->nes_in_callback = 1;
......@@ -585,12 +585,12 @@ void nea_server_destroy(nea_server_t *nes)
return;
if (nes->nes_in_callback) {
SU_DEBUG_5(("nea_server_destroy(%p) while in callback\n", nes));
SU_DEBUG_5(("nea_server_destroy(%p) while in callback\n", (void *)nes));
nes->nes_pending_destroy = 1;
return;
}
SU_DEBUG_5(("nea_server_destroy(%p)\n", nes));
SU_DEBUG_5(("nea_server_destroy(%p)\n", (void *)nes));
nta_leg_destroy(nes->nes_leg), nes->nes_leg = NULL;
......@@ -837,8 +837,8 @@ int nea_view_update(nea_server_t *nes,
if (evq->evq_content_type)
nea_view_queue(nes, evv, evq);
SU_DEBUG_7(("nea_server_update(%p): %s (%s)\n",
nes, ev->ev_event->o_type, evv->evv_content_type->c_type));
SU_DEBUG_7(("nea_server_update(%p): %s (%s)\n", (void *)nes,
ev->ev_event->o_type, evv->evv_content_type->c_type));
return 1;
}
......@@ -1019,7 +1019,8 @@ int nea_server_notify(nea_server_t *nes, nea_event_t *ev)
nea_sub_t *s;
int notified = 0, throttled = nes->nes_throttled;
SU_DEBUG_7(("nea_server_notify(%p): %s\n", nes, ev ? ev->ev_event->o_type: ""));
SU_DEBUG_7(("nea_server_notify(%p): %s\n", (void *)nes,
ev ? ev->ev_event->o_type: ""));
++nes->nes_in_list;
......
......@@ -1532,7 +1532,7 @@ int nta_agent_add_tport(nta_agent_t *self,
(nta_compressor_vtable == NULL ||
strcasecmp(tpn->tpn_comp, nta_compressor_vtable->ncv_name) != 0)) {
SU_DEBUG_1(("nta(%p): comp=%s not supported for " URL_PRINT_FORMAT "\n",
self, tpn->tpn_comp, URL_PRINT_ARGS(url)));
(void *)self, tpn->tpn_comp, URL_PRINT_ARGS(url)));
}
}
......@@ -2017,7 +2017,8 @@ static void agent_update_tport(nta_agent_t *self, tport_t *tport)
}
else {
/* XXX - we should do something else? */
SU_DEBUG_3(("nta(%p): transport address updated\n", self));
SU_DEBUG_3(("%s(%p): %s\n", "nta", (void *)self,
"transport address updated"));
}
}
......@@ -3478,7 +3479,7 @@ nta_leg_t *nta_leg_tcreate(nta_agent_t *agent,
leg_insert(agent, leg);
SU_DEBUG_9(("nta_leg_create(%p)\n", leg));
SU_DEBUG_9(("nta_leg_create(%p)\n", (void *)leg));
return leg;
......@@ -3528,7 +3529,7 @@ void leg_insert(nta_agent_t *sa, nta_leg_t *leg)
*/
void nta_leg_destroy(nta_leg_t *leg)
{
SU_DEBUG_9(("nta_leg_destroy(%p)\n", leg));
SU_DEBUG_9(("nta_leg_destroy(%p)\n", (void *)leg));
if (leg) {
leg_htable_t *leg_hash;
......@@ -3817,7 +3818,7 @@ void leg_recv(nta_leg_t *leg, msg_t *msg, sip_t *sip, tport_t *tport)
if (!(irq = incoming_create(agent, msg, sip, tport, tag))) {
SU_DEBUG_3(("nta: leg_recv(%p): cannot create transaction for %s\n",
leg, method_name));
(void *)leg, method_name));
nta_msg_treply(agent, msg,
SIP_500_INTERNAL_SERVER_ERROR,
NTATAG_TPORT(tport),
......@@ -3843,12 +3844,12 @@ void leg_recv(nta_leg_t *leg, msg_t *msg, sip_t *sip, tport_t *tport)
if (status < 100 || status > 699) {
SU_DEBUG_3(("nta_leg(%p): invalid status %03d from callback\n",
leg, status));
(void *)leg, status));
status = 500;
}
else if (method == sip_method_invite && status >= 200 && status < 300) {
SU_DEBUG_3(("nta_leg(%p): invalid INVITE status %03d from callback\n",
leg, status));
(void *)leg, status));
status = 500;
}
......@@ -4504,7 +4505,7 @@ int incoming_callback(nta_leg_t *leg, nta_incoming_t *irq, sip_t *sip)
if (leg->leg_rseq > sip->sip_cseq->cs_seq) {
SU_DEBUG_3(("nta_leg(%p): out-of-order %s (%u < %u)\n",
leg, method_name, seq, leg->leg_rseq));
(void *)leg, method_name, seq, leg->leg_rseq));
return 500;
}
......@@ -4691,7 +4692,7 @@ void incoming_reset_timer(nta_incoming_t *irq)
static
void incoming_free(nta_incoming_t *irq)
{
SU_DEBUG_9(("nta: incoming_free(%p)\n", irq));
SU_DEBUG_9(("nta: incoming_free(%p)\n", (void *)irq));
incoming_cut_off(irq);
incoming_reclaim(irq);
......@@ -4771,7 +4772,8 @@ void incoming_reclaim_queued(su_root_magic_t *rm,
incoming_queue_t *q = u->a_incoming_queue;
nta_incoming_t *irq, *irq_next;
SU_DEBUG_9(("incoming_reclaim_all(%p, %p, %p)\n", rm, msg, u));
SU_DEBUG_9(("incoming_reclaim_all(%p, %p, %p)\n",
(void *)rm, (void *)msg, (void *)u));
for (irq = q->q_head; irq; irq = irq_next) {
irq_next = irq->irq_next;
......@@ -6494,7 +6496,8 @@ void nta_outgoing_destroy(nta_outgoing_t *orq)
return;
if (orq->orq_destroyed) {
SU_DEBUG_1(("nta_outgoing_destroy(%p): already destroyed\n", orq));
SU_DEBUG_1(("%s(%p): %s\n", "nta_outgoing_destroy", (void *)orq,
"already destroyed"));
return;
}
......@@ -7457,7 +7460,7 @@ void outgoing_reset_timer(nta_outgoing_t *orq)
static
void outgoing_free(nta_outgoing_t *orq)
{
SU_DEBUG_9(("nta: outgoing_free(%p)\n", orq));
SU_DEBUG_9(("nta: outgoing_free(%p)\n", (void *)orq));
outgoing_cut_off(orq);
outgoing_reclaim(orq);
}
......@@ -7524,7 +7527,8 @@ void outgoing_reclaim_queued(su_root_magic_t *rm,
outgoing_queue_t *q = u->a_outgoing_queue;
nta_outgoing_t *orq, *orq_next;
SU_DEBUG_9(("outgoing_reclaim_all(%p, %p, %p)\n", rm, msg, u));
SU_DEBUG_9(("outgoing_reclaim_all(%p, %p, %p)\n",
(void *)rm, (void *)msg, (void *)u));
for (orq = q->q_head; orq; orq = orq_next) {
orq_next = orq->orq_next;
......@@ -7717,7 +7721,8 @@ void outgoing_timeout(nta_outgoing_t *orq, su_duration_t now)
nta_outgoing_t *cancel;
if (outgoing_other_destinations(orq)) {
SU_DEBUG_5(("nta(%p): try next after timeout\n", orq));
SU_DEBUG_5(("%s(%p): %s\n", "nta", (void *)orq,
"try next after timeout"));
outgoing_try_another(orq);
return;
}
......@@ -8305,7 +8310,8 @@ int outgoing_reply(nta_outgoing_t *orq, int status, char const *phrase,
if (orq->orq_method == sip_method_ack) {
if (status != delayed)
SU_DEBUG_3(("nta(%p): responding %u %s to ACK!\n", orq, status, phrase));
SU_DEBUG_3(("nta(%p): responding %u %s to ACK!\n",
(void *)orq, status, phrase));
orq->orq_status = status;
if (orq->orq_queue == NULL)
outgoing_complete(orq); /* Timer D/K */
......@@ -8585,8 +8591,8 @@ outgoing_resolve(nta_outgoing_t *orq)
/* Nothing found */
if (!sr->sr_tports[0]) {
SU_DEBUG_3(("nta(%p): transport %s is not supported%s%s\n", orq, tpname,
ident ? " by interface " : "", ident ? ident : ""));
SU_DEBUG_3(("nta(%p): transport %s is not supported%s%s\n", (void *)orq,
tpname, ident ? " by interface " : "", ident ? ident : ""));
outgoing_resolving_error(orq, SIPDNS_503_ERROR);
return;
}
......@@ -9200,10 +9206,10 @@ void outgoing_answer_aaaa(sres_context_t *orq, sres_query_t *q,
inet_ntop(AF_INET6, &aaaa->aaaa_addr, addr, sizeof(addr));
if (j == 0)
SU_DEBUG_5(("nta(%p): %s IN AAAA %s\n", orq,
SU_DEBUG_5(("nta(%p): %s IN AAAA %s\n", (void *)orq,
aaaa->aaaa_record->r_name, addr));
else
SU_DEBUG_5(("nta(%p): AAAA %s\n", orq, addr));
SU_DEBUG_5(("nta(%p): AAAA %s\n", (void *)orq, addr));
assert(j < found);
results[j++] = su_strdup(home, addr);
......@@ -9285,7 +9291,7 @@ void outgoing_answer_a(sres_context_t *orq, sres_query_t *q,
if (j == 0)
SU_DEBUG_5(("nta: %s IN A %s\n", a->a_record->r_name, addr));
else
SU_DEBUG_5(("nta(%p): A %s\n", orq, addr));
SU_DEBUG_5(("nta(%p): A %s\n", (void *)orq, addr));
assert(j < found);
results[j++] = su_strdup(home, addr);
......@@ -9309,7 +9315,7 @@ outgoing_query_results(nta_outgoing_t *orq,
sq->sq_type != sr->sr_a_aaaa2) {
sq->sq_type = sr->sr_a_aaaa2;
SU_DEBUG_7(("nta(%p): %s %s record still unresolved\n", orq,
SU_DEBUG_7(("nta(%p): %s %s record still unresolved\n", (void *)orq,
sq->sq_domain, sq->sq_type == sres_type_a ? "A" : "AAAA"));
/*
......@@ -9769,7 +9775,7 @@ void nta_reliable_destroy(nta_reliable_t *rel)
return;
if (rel->rel_callback == nta_reliable_destroyed)
SU_DEBUG_1(("%s(%p): already destroyed\n", __func__, rel));
SU_DEBUG_1(("%s(%p): %s\n", __func__, (void *)rel, "already destroyed"));
rel->rel_callback = nta_reliable_destroyed;
......@@ -9796,7 +9802,7 @@ int nta_reliable_destroyed(nta_reliable_magic_t *rmagic,
if (!*prev) {
assert(*prev);
SU_DEBUG_1(("%s(%p): not linked\n", __func__, rel));
SU_DEBUG_1(("%s(%p): %s\n", __func__, (void *)rel, "not linked"));
return 200;
}
......@@ -9877,7 +9883,8 @@ nta_outgoing_t *nta_outgoing_tagged(nta_outgoing_t *orq,
if (orq == NULL || to_tag == NULL)
return NULL;
if (orq->orq_to->a_tag) {
SU_DEBUG_1(("%s: transaction %p already in dialog\n", __func__, orq));
SU_DEBUG_1(("%s: transaction %p already in dialog\n", __func__,
(void *)orq));
return NULL;
}
......
......@@ -1094,7 +1094,7 @@ int hc_reply(nth_client_t * hc, int status, char const *phrase)
assert(status >= 400);
SU_DEBUG_5(("nth: hc_reply(%p, %u, %s)\n", hc, status, phrase));
SU_DEBUG_5(("nth: hc_reply(%p, %u, %s)\n", (void *)hc, status, phrase));
if (hc->hc_pending) {
tport_release(hc->hc_tport, hc->hc_pending, hc->hc_request, NULL, hc,
......
......@@ -212,7 +212,8 @@ void nua_destroy(nua_t *nua)
if (nua) {
if (!nua->nua_shutdown_final) {
SU_DEBUG_0(("nua_destroy(%p): FATAL: nua_shutdown not completed\n", nua));
SU_DEBUG_0(("nua_destroy(%p): FATAL: nua_shutdown not completed\n",
(void *)nua));
assert(nua->nua_shutdown);
return;
}
......@@ -591,7 +592,7 @@ void nua_get_params(nua_t *nua, tag_type_t tag, tag_value_t value, ...)
ta_end(ta); \
} \
else { \
SU_DEBUG_1(("nua: " #event " with invalid handle %p\n", nh)); \
SU_DEBUG_1(("nua: " #event " with invalid handle %p\n", (void *)nh)); \
}
/* Documented with nua_stack_set_params() */
......@@ -876,7 +877,7 @@ void nua_respond(nua_handle_t *nh,
ta_end(ta);
}
else {
SU_DEBUG_1(("nua: respond with invalid handle %p\n", nh));
SU_DEBUG_1(("nua: respond with invalid handle %p\n", (void *)nh));
}
}
......@@ -955,7 +956,8 @@ void nua_signal(nua_t *nua, nua_handle_t *nh, msg_t *msg, int always,
e->e_status = status;
e->e_phrase = phrase;
SU_DEBUG_7(("nua(%p): signal %s\n", nh, nua_event_name(event) + 4));
SU_DEBUG_7(("nua(%p): signal %s\n", (void *)nh,
nua_event_name(event) + 4));
if (su_msg_send(sumsg) != 0 && event != nua_r_destroy)
nua_handle_unref(nh);
......@@ -986,13 +988,13 @@ void nua_event(nua_t *root_magic, su_msg_r sumsg, event_t *e)
if (!nh || !nh->nh_valid) { /* Handle has been destroyed */
if (nua_log->log_level >= 7) {
char const *name = nua_event_name(e->e_event) + 4;
SU_DEBUG_7(("nua(%p): event %s dropped\n", nh, name));
SU_DEBUG_7(("nua(%p): event %s dropped\n", (void *)nh, name));
}
if (nh && !NH_IS_DEFAULT(nh) && nua_handle_unref(nh)) {
#if HAVE_NUA_HANDLE_DEBUG
SU_DEBUG_0(("nua(%p): freed by application\n", nh));
SU_DEBUG_0(("nua(%p): freed by application\n", (void *)nh));
#else
SU_DEBUG_9(("nua(%p): freed by application\n", nh));
SU_DEBUG_9(("nua(%p): freed by application\n", (void *)nh));
#endif
}
if (e->e_msg)
......@@ -1023,9 +1025,9 @@ void nua_event(nua_t *root_magic, su_msg_r sumsg, event_t *e)
if (nh && !NH_IS_DEFAULT(nh) && nua_handle_unref(nh)) {
#if HAVE_NUA_HANDLE_DEBUG
SU_DEBUG_0(("nua(%p): freed by application\n", nh));
SU_DEBUG_0(("nua(%p): freed by application\n", (void *)nh));
#else
SU_DEBUG_9(("nua(%p): freed by application\n", nh));
SU_DEBUG_9(("nua(%p): freed by application\n", (void *)nh));
#endif
}
......@@ -1081,7 +1083,7 @@ void nua_destroy_event(nua_saved_event_t saved[1])
msg_destroy(e->e_msg), e->e_msg = NULL;
if (nh && !NH_IS_DEFAULT(nh) && nua_handle_unref(nh)) {
SU_DEBUG_9(("nua(%p): freed by application\n", nh));
SU_DEBUG_9(("nua(%p): freed by application\n", (void *)nh));
}
su_msg_destroy(saved);
......
......@@ -110,13 +110,14 @@ nua_handle_t *nh_create_handle(nua_t *nua,
assert(nua->nua_home);
if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) {
nh->nh_valid = nua_handle;
nh->nh_valid = nua_valid_handle_cookie;
nh->nh_nua = nua;
nh->nh_magic = hmagic;
nh->nh_prefs = nua->nua_dhandle->nh_prefs;
if (nua_handle_save_tags(nh, tags) < 0) {
SU_DEBUG_5(("nua(%p): creating handle %p failed\n", nua, nh));
SU_DEBUG_5(("nua(%p): creating handle %p failed\n",
(void *)nua, (void *)nh));
su_home_unref(nh->nh_home), nh = NULL;
}
......@@ -136,7 +137,7 @@ nua_handle_t *nh_create_handle(nua_t *nua,
}
else {
_handle_lifetime = 2;
SU_DEBUG_0(("nh_handle_create(%p)\n", nh));
SU_DEBUG_0(("nh_handle_create(%p)\n", (void *)nh));
su_home_destructor(nh->nh_home, nh_destructor);
}
}
......@@ -159,7 +160,7 @@ extern char const _NUA_HANDLE_DEBUG[];
static void nh_destructor(void *arg)
{
nua_handle_t *nh = arg;
SU_DEBUG_0(("nh_destructor(%p)\n", nh));
SU_DEBUG_0(("nh_destructor(%p)\n", (void *)nh));
}
#undef nua_handle_ref
......
......@@ -269,7 +269,7 @@ nua_dialog_usage_t *nua_dialog_usage_add(nua_owner_t *own,
du = *prev_du;
if (du) { /* Already exists */
SU_DEBUG_5(("nua(%p): adding already existing %s usage%s%s\n",
own, nua_dialog_usage_name(du),
(void *)own, nua_dialog_usage_name(du),
event ? " with event " : "", event ? event->o_type : ""));
if (prev_du != &ds->ds_usage) {
......@@ -297,7 +297,7 @@ nua_dialog_usage_t *nua_dialog_usage_add(nua_owner_t *own,
}
SU_DEBUG_5(("nua(%p): adding %s usage%s%s\n",
own, nua_dialog_usage_name(du),
(void *)own, nua_dialog_usage_name(du),
o ? " with event " : "", o ? o->o_type :""));
su_home_ref(own);
......@@ -371,7 +371,7 @@ void nua_dialog_usage_remove_at(nua_owner_t *own,
o = du->du_event;
SU_DEBUG_5(("nua(%p): removing %s usage%s%s\n",
own, nua_dialog_usage_name(du),
(void *)own, nua_dialog_usage_name(du),
o ? " with event " : "", o ? o->o_type :""));
du->du_class->usage_remove(own, ds, du);
su_home_unref(own);
......@@ -420,7 +420,7 @@ void nua_dialog_log_usage(nua_owner_t *own, nua_dialog_state_t *ds)
}
}
SU_DEBUG_3(("nua(%p): handle with %s%s%s\n", own,
SU_DEBUG_3(("nua(%p): handle with %s%s%s\n", (void *)own,
ds->ds_has_session ? "session and " : "",
ds->ds_has_events ? "events " : "",
buffer));
......
......@@ -220,7 +220,7 @@ void authorize_watcher(nea_server_t *nes,
what = "active";
}
SU_DEBUG_7(("nua(%p): authorize_watcher: %s\n", nh, what));
SU_DEBUG_7(("nua(%p): authorize_watcher: %s\n", (void *)nh, what));
nea_sub_auth(sn->sn_subscriber, substate,
TAG_IF(substate == nua_substate_pending,
NEATAG_FAKE(1)),
......@@ -232,7 +232,7 @@ void authorize_watcher(nea_server_t *nes,
substate = nua_substate_terminated;
nea_server_flush(nes, NULL);
SU_DEBUG_7(("nua(%p): authorize_watcher: %s\n",
nh, "watcher is removed"));
(void *)nh, "watcher is removed"));
}
nua_stack_tevent(nua, nh, msg, nua_i_subscription, status, phrase,
......
......@@ -255,7 +255,7 @@ void nua_session_usage_destroy(nua_handle_t *nh,
/* Remove usage */
nua_dialog_usage_remove(nh, nh->nh_ds, nua_dialog_usage_public(ss));
SU_DEBUG_5(("nua: terminated session %p\n", nh));
SU_DEBUG_5(("nua: terminated session %p\n", (void *)nh));
}
/* ======================================================================== */
......@@ -683,16 +683,16 @@ static int nua_invite_client_preliminary(nua_client_request_t *cr,
}
if (!rseq) {
SU_DEBUG_5(("nua(%p): 100rel missing RSeq\n", nh));
SU_DEBUG_5(("nua(%p): 100rel missing RSeq\n", (void *)nh));
}
else if (nta_outgoing_rseq(cr->cr_orq) > rseq->rs_response) {
SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", nh,
SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", (void *)nh,
(unsigned)rseq->rs_response,
nta_outgoing_rseq(cr->cr_orq)));
return 1; /* Do not send event */
}
else if (nta_outgoing_setrseq(cr->cr_orq, rseq->rs_response) < 0) {
SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", nh,
SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", (void *)nh,
(unsigned)rseq->rs_response));
cr->cr_graceful = 1;
ss->ss_reason = "SIP;cause=400;text=\"Bad RSeq\"";
......@@ -717,11 +717,11 @@ static int nua_session_client_response(nua_client_request_t *cr,
#define LOG3(m) \
SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s\n", \
nh, cr->cr_method_name, (m), \
(void *)nh, cr->cr_method_name, (m), \
received ? received : "SDP", status, phrase))
#define LOG5(m) \
SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s\n", \
nh, cr->cr_method_name, (m), received, status, phrase))
(void *)nh, cr->cr_method_name, (m), received, status, phrase))
if (nh->nh_soa == NULL || !ss || !sip || 300 <= status)
/* Xyzzy */;
......@@ -1432,7 +1432,7 @@ static int nua_prack_client_request(nua_client_request_t *cr,
session_include_description(nh->nh_soa, 1, msg, sip) < 0) {
status = soa_error_as_sip_response(nh->nh_soa, &phrase);
SU_DEBUG_3(("nua(%p): local response to PRACK: %d %s\n",
nh, status, phrase));
(void *)nh, status, phrase));
nua_stack_event(nh->nh_nua, nh, NULL,
nua_i_media_error, status, phrase,
NULL);
......@@ -1448,7 +1448,8 @@ static int nua_prack_client_request(nua_client_request_t *cr,
if (soa_generate_offer(nh->nh_soa, 0, NULL) < 0 ||
session_include_description(nh->nh_soa, 1, msg, sip) < 0) {
status = soa_error_as_sip_response(nh->nh_soa, &phrase);
SU_DEBUG_3(("nua(%p): PRACK offer: %d %s\n", nh, status, phrase));
SU_DEBUG_3(("nua(%p): PRACK offer: %d %s\n", (void *)nh,
status, phrase));
nua_stack_event(nh->nh_nua, nh, NULL,
nua_i_media_error, status, phrase, NULL);
return nua_client_return(cr, status, phrase, msg);
......@@ -1790,7 +1791,8 @@ int nua_invite_server_preprocess(nua_server_request_t *sr)
if (sr->sr_sdp) {
if (soa_set_remote_sdp(nh->nh_soa, NULL,
sr->sr_sdp, sr->sr_sdp_len) < 0) {
SU_DEBUG_5(("nua(%p): error parsing SDP in INVITE\n", nh));
SU_DEBUG_5(("nua(%p): %s server: error parsing SDP\n", (void *)nh,
"INVITE"));
return SR_STATUS(sr, 400, "Bad Session Description");
}
else
......@@ -2372,7 +2374,8 @@ int nua_prack_server_init(nua_server_request_t *sr)
if (nh->nh_soa &&
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
SU_DEBUG_5(("nua(%p): error parsing SDP in PRACK\n", nh));
SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
"PRACK", "offer"));
return
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
......@@ -2400,7 +2403,10 @@ int nua_prack_server_respond(nua_server_request_t *sr, tagi_t const *tags)
if ((sr->sr_offer_recv && soa_generate_answer(nh->nh_soa, NULL) < 0) ||
(sr->sr_answer_recv && soa_process_answer(nh->nh_soa, NULL) < 0)) {
SU_DEBUG_5(("nua(%p): error processing SDP in %s\n", nh, "PRACK"));
SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
(void *)nh, "PRACK",
"error processing",
sr->sr_offer_recv ? "offer" : "answer"));
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
else if (sr->sr_offer_recv) {
......@@ -2697,7 +2703,7 @@ nh_referral_respond(nua_handle_t *nh, int status, char const *phrase)
if (ref) {
if (ref->ref_handle)
SU_DEBUG_1(("nh_handle_referral: stale referral handle %p\n",
ref->ref_handle));
(void *)ref->ref_handle));
ref->ref_handle = NULL;
}
return;
......@@ -3152,7 +3158,8 @@ int nua_update_server_init(nua_server_request_t *sr)
if (nh->nh_soa &&
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
SU_DEBUG_5(("nua(%p): error parsing SDP in UPDATE\n", nh));
SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
"UPDATE", "offer"));
return
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
......@@ -3183,12 +3190,13 @@ int nua_update_server_respond(nua_server_request_t *sr, tagi_t const *tags)
if (200 <= sr->sr_status && sr->sr_status < 300 && soa && sr->sr_sdp) {
if (soa_generate_answer(nh->nh_soa, NULL) < 0) {
SU_DEBUG_5(("nua(%p): error processing SDP in UPDATE\n", nh));
SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
(void *)nh, "UPDATE", "error processing", "offer"));
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
else if (soa_activate(nh->nh_soa, NULL) < 0) {
SU_DEBUG_5(("nua(%p): error activating media after %s\n",
nh, "UPDATE"));
SU_DEBUG_5(("nua(%p): %s server: error activating media\n",
(void *)nh, "UPDATE"));
/* XXX */
}
else if (session_include_description(nh->nh_soa, 1, msg, sip) < 0) {
......@@ -3566,14 +3574,14 @@ static void signal_call_state_change(nua_handle_t *nh,
if (ss_state < nua_callstate_ready || next_state > nua_callstate_ready)
SU_DEBUG_5(("nua(%p): call state changed: %s -> %s%s%s%s%s\n",
nh, nua_callstate_name(ss_state),
(void *)nh, nua_callstate_name(ss_state),
nua_callstate_name(next_state),
oa_recv ? ", received " : "", oa_recv ? oa_recv : "",
oa_sent && oa_recv ? ", and sent " :
oa_sent ? ", sent " : "", oa_sent ? oa_sent : ""));
else
SU_DEBUG_5(("nua(%p): ready call updated: %s%s%s%s%s\n",
nh, nua_callstate_name(next_state),
(void *)nh, nua_callstate_name(next_state),
oa_recv ? " received " : "", oa_recv ? oa_recv : "",
oa_sent && oa_recv ? ", sent " :
oa_sent ? " sent " : "", oa_sent ? oa_sent : ""));
......
......@@ -149,7 +149,7 @@ int nua_stack_init(su_root_t *root, nua_t *nua)
return -1;
dnh->nh_prefs = (void *)(dnh + 1);
dnh->nh_valid = nua_handle;
dnh->nh_valid = nua_valid_handle_cookie;
dnh->nh_nua = nua;
nua_handle_ref(dnh); dnh->nh_ref_by_stack = 1;
nua_handle_ref(dnh); dnh->nh_ref_by_user = 1;
......@@ -259,9 +259,9 @@ int nua_stack_event(nua_t *nua, nua_handle_t *nh, msg_t *msg,
char const *p = phrase ? phrase : "";
if (status == 0)
SU_DEBUG_5(("nua(%p): event %s %s\n", nh, name, p));
SU_DEBUG_5(("nua(%p): event %s %s\n", (void *)nh, name, p));
else
SU_DEBUG_5(("nua(%p): event %s %u %s\n", nh, name, status, p));
SU_DEBUG_5(("nua(%p): event %s %u %s\n", (void *)nh, name, status, p));
}
if (event == nua_r_destroy) {
......@@ -348,7 +348,7 @@ void nua_stack_signal(nua_t *nua, su_msg_r msg, nua_event_data_t *e)
if (nua_log->log_level >= 7) {
char const *name = nua_event_name(e->e_event) + 4;
SU_DEBUG_7(("nua(%p): recv %s\n", nh, name));
SU_DEBUG_7(("nua(%p): recv %s\n", (void *)nh, name));
}
if (nh) {
......@@ -364,10 +364,11 @@ void nua_stack_signal(nua_t *nua, su_msg_r msg, nua_event_data_t *e)
if (nua_log->log_level >= 5) {
char const *name = nua_event_name(e->e_event);
if (e->e_status == 0)
SU_DEBUG_5(("nua(%p): signal %s\n", nh, name + 4));
SU_DEBUG_5(("nua(%p): signal %s\n", (void *)nh, name + 4));
else
SU_DEBUG_5(("nua(%p): signal %s %u %s\n",
nh, name + 4, e->e_status, e->e_phrase ? e->e_phrase : ""));
(void *)nh, name + 4,
e->e_status, e->e_phrase ? e->e_phrase : ""));