Commit 56c7fb39 authored by Pekka Pessi's avatar Pekka Pessi

tport module: using isize_t/usize_t/issize_t in API.

darcs-hash:20060906221401-65a35-e1d9fd94e156376a6b3c379069cede5c87433271.gz
parent 632024ac
......@@ -97,7 +97,7 @@ typedef struct {
/** Ask stack to allocate a message. */
msg_t *(*tpac_alloc)(tp_stack_t *, int flags,
char const [], unsigned,
char const [], usize_t,
tport_t const *, tp_client_t *);
/** Indicate stack that address has changed */
......@@ -223,12 +223,12 @@ TPORT_DLL int tport_continue(tport_t *self);
/** Mark message as waiting for a response. */
TPORT_DLL int tport_pend(tport_t *self, msg_t *msg,
tport_pending_error_f *callback, tp_client_t *client);
tport_pending_error_f *callback, tp_client_t *client);
/** Do not wait for response anymore. */
TPORT_DLL int tport_release(tport_t *self, int pendd,
msg_t *msg, msg_t *reply, tp_client_t *client,
int still_pending);
msg_t *msg, msg_t *reply, tp_client_t *client,
int still_pending);
/** Return true if transport is master. */
TPORT_DLL int tport_is_master(tport_t const *self);
......@@ -323,18 +323,19 @@ TPORT_DLL int tport_delivered_from(tport_t *tp, msg_t const *msg,
TPORT_DLL int tport_name_is_resolved(tp_name_t const *);
/** Duplicate a transport name. */
TPORT_DLL int tport_name_dup(su_home_t *, tp_name_t *dst, tp_name_t const *src);
TPORT_DLL int tport_name_dup(su_home_t *,
tp_name_t *dst, tp_name_t const *src);
/** Convert a socket address to a transport name. */
TPORT_DLL int tport_convert_addr(su_home_t *home,
tp_name_t *tpn,
char const *protoname,
char const *canon,
su_sockaddr_t const *su);
tp_name_t *tpn,
char const *protoname,
char const *canon,
su_sockaddr_t const *su);
/** Print host and port separated with ':' to a string. */
TPORT_DLL char *tport_hostport(char buf[], isize_t bufsize,
su_sockaddr_t const *su, int with_port);
su_sockaddr_t const *su, int with_port);
/** Initialize STUN keepalives. */
TPORT_DLL int tport_keepalive(tport_t *tp, su_addrinfo_t const *ai,
......@@ -364,7 +365,7 @@ int tport_sigcomp_option(tport_t const *self,
/** Obtain a SigComp compartment with given name. */
TPORT_DLL struct sigcomp_compartment *
tport_sigcomp_compartment(tport_t *self,
char const *name, int namelen,
char const *name, isize_t namelen,
int create_if_needed);
TPORT_DLL struct sigcomp_compartment *
......
......@@ -324,7 +324,7 @@ static int new_test_msg(tp_test_t *tt, msg_t **retval,
su_md5_update(md5sum, payload->pl_data, payload->pl_len);
}
TEST_1(l = msg_content_length_format(home, "%u", N * payload->pl_len));
TEST_1(l = msg_content_length_format(home, "%zu", (size_t)(N * payload->pl_len)));
TEST(msg_header_insert(msg, (void *)tst, (msg_header_t *)l), 0);
su_md5_digest(md5sum, digest);
......@@ -734,7 +734,7 @@ static int udp_test(tp_test_t *tt)
TEST_1(pl = msg_payload_make(home, payload));
TEST(msg_header_insert(msg, (void *)tst, (msg_header_t *)pl), 0);
TEST_1(l = msg_content_length_format(home, "%u", pl->pl_len));
TEST_1(l = msg_content_length_format(home, "%zu", (size_t)pl->pl_len));
TEST(msg_header_insert(msg, (void *)tst, (msg_header_t *)l), 0);
TEST_1(md5 = msg_content_md5_make(home, "R6nitdrtJFpxYzrPaSXfrA=="));
......
......@@ -2754,9 +2754,10 @@ void tport_deliver(tport_t *self,
self->tp_rlogged = msg;
}
SU_DEBUG_7(("%s(%p): %smsg %p (%u bytes)"
SU_DEBUG_7(("%s(%p): %smsg %p (%zu bytes)"
" from " TPN_FORMAT " next=%p\n",
__func__, self, error ? "bad " : "", msg, msg_size(msg),
__func__, self, error ? "bad " : "",
msg, (size_t)msg_size(msg),
TPN_ARGS(d->d_from), next));
ref = tport_incref(self);
......
......@@ -141,11 +141,10 @@ void tport_stamp(tport_t const *self, msg_t *msg,
inet_ntop(su->su_family, SU_ADDR(su), name, sizeof(name));
snprintf(stamp, 128,
"%s %d bytes %s %s/[%s]:%u%s%s at %02u:%02u:%02u.%06lu:\n",
what, n, via, self->tp_name->tpn_proto,
"%s %zd bytes %s %s/[%s]:%u%s%s at %02u:%02u:%02u.%06lu:\n",
what, (size_t)n, via, self->tp_name->tpn_proto,
name, ntohs(su->su_port), label[0] ? label : "", comp,
hour, minute, second, now.tv_usec);
}
/** Dump the data from the iovec */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment