Commit f9863401 authored by Michael Jerris's avatar Michael Jerris

fix safe to fix msvc 2005 level 3 warnings with /w64 by changing many types of...

fix safe to fix msvc 2005 level 3 warnings with /w64 by changing many types of variables internal to fuctions, to be more strongly typed to function prototypes and returns

darcs-hash:20060910073404-16063-6395b472c0c75b26c4bdd35bef7bccb2b8e9257b.gz
parent 9611ae3d
...@@ -154,7 +154,7 @@ static issize_t cookie_scanner(char *s) ...@@ -154,7 +154,7 @@ static issize_t cookie_scanner(char *s)
/* get value */ /* get value */
if (*s == '"') { if (*s == '"') {
int qlen = span_quoted(s); isize_t qlen = span_quoted(s);
if (!qlen) if (!qlen)
return -1; return -1;
s += qlen; s += qlen;
...@@ -226,7 +226,7 @@ issize_t http_cookie_e(char b[], isize_t bsiz, msg_header_t const *h, int flags) ...@@ -226,7 +226,7 @@ issize_t http_cookie_e(char b[], isize_t bsiz, msg_header_t const *h, int flags)
/** Calculate extra storage used by Cookie header field */ /** Calculate extra storage used by Cookie header field */
isize_t http_cookie_dup_xtra(msg_header_t const *h, isize_t offset) isize_t http_cookie_dup_xtra(msg_header_t const *h, isize_t offset)
{ {
int rv = offset; isize_t rv = offset;
http_cookie_t const *c = (http_cookie_t *)h; http_cookie_t const *c = (http_cookie_t *)h;
MSG_PARAMS_SIZE(rv, c->c_params); MSG_PARAMS_SIZE(rv, c->c_params);
...@@ -443,7 +443,7 @@ issize_t http_set_cookie_e(char b[], isize_t bsiz, msg_header_t const *h, int fl ...@@ -443,7 +443,7 @@ issize_t http_set_cookie_e(char b[], isize_t bsiz, msg_header_t const *h, int fl
/** Calculate extra storage used by Set-Cookie header field */ /** Calculate extra storage used by Set-Cookie header field */
isize_t http_set_cookie_dup_xtra(msg_header_t const *h, isize_t offset) isize_t http_set_cookie_dup_xtra(msg_header_t const *h, isize_t offset)
{ {
int rv = offset; isize_t rv = offset;
http_set_cookie_t const *sc = (http_set_cookie_t *)h; http_set_cookie_t const *sc = (http_set_cookie_t *)h;
MSG_PARAMS_SIZE(rv, sc->sc_params); MSG_PARAMS_SIZE(rv, sc->sc_params);
......
...@@ -84,7 +84,7 @@ issize_t http_extract_chunk(msg_t *, http_t *, char b[], isize_t bsiz, int eos); ...@@ -84,7 +84,7 @@ issize_t http_extract_chunk(msg_t *, http_t *, char b[], isize_t bsiz, int eos);
issize_t http_extract_body(msg_t *msg, http_t *http, char b[], isize_t bsiz, int eos) issize_t http_extract_body(msg_t *msg, http_t *http, char b[], isize_t bsiz, int eos)
{ {
issize_t m = 0; issize_t m = 0;
unsigned body_len; size_t body_len;
int flags = http->http_flags; int flags = http->http_flags;
...@@ -326,7 +326,7 @@ int http_version_d(char **ss, char const **ver) ...@@ -326,7 +326,7 @@ int http_version_d(char **ss, char const **ver)
result = http_version_0_9; result = http_version_0_9;
} else { } else {
/* Version consists of one or two tokens, separated by / */ /* Version consists of one or two tokens, separated by / */
int l1 = 0, l2 = 0, n; size_t l1 = 0, l2 = 0, n;
result = s; result = s;
......
...@@ -91,7 +91,7 @@ isize_t base64_d(char buf[], isize_t bsiz, char const *b64s) ...@@ -91,7 +91,7 @@ isize_t base64_d(char buf[], isize_t bsiz, char const *b64s)
decode[i] = B64NOP; decode[i] = B64NOP;
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
decode[code[i]] = i; decode[code[i]] = (unsigned char)i;
} }
decode['='] = B64EOF; decode['='] = B64EOF;
decode['\0'] = B64EOF; decode['\0'] = B64EOF;
......
...@@ -720,7 +720,7 @@ int auc_digest_authorization(auth_client_t *ca, ...@@ -720,7 +720,7 @@ int auc_digest_authorization(auth_client_t *ca,
unsigned nc = ++cda->cda_ncount; unsigned nc = ++cda->cda_ncount;
char *uri = url_as_string(home, url); char *uri = url_as_string(home, url);
void const *data = body ? body->pl_data : ""; void const *data = body ? body->pl_data : "";
int dlen = body ? body->pl_len : 0; usize_t dlen = body ? body->pl_len : 0;
msg_header_t *h; msg_header_t *h;
auth_hexmd5_t sessionkey, response; auth_hexmd5_t sessionkey, response;
......
...@@ -509,7 +509,7 @@ void auth_method_basic(auth_mod_t *am, ...@@ -509,7 +509,7 @@ void auth_method_basic(auth_mod_t *am,
auth_challenger_t const *ach) auth_challenger_t const *ach)
{ {
char *userpass, buffer[128]; char *userpass, buffer[128];
int n, upsize; size_t n, upsize;
char *pass; char *pass;
auth_passwd_t *apw; auth_passwd_t *apw;
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
static inline static inline
size_t msg_params_copy_xtra(msg_param_t const pp[], size_t offset) size_t msg_params_copy_xtra(msg_param_t const pp[], size_t offset)
{ {
int n = msg_params_count(pp); size_t n = msg_params_count(pp);
if (n) { if (n) {
MSG_STRUCT_SIZE_ALIGN(offset); MSG_STRUCT_SIZE_ALIGN(offset);
offset += MSG_PARAMS_NUM(n + 1) * sizeof(pp[0]); offset += MSG_PARAMS_NUM(n + 1) * sizeof(pp[0]);
...@@ -68,7 +68,7 @@ char *msg_params_copy(char *b, size_t size, ...@@ -68,7 +68,7 @@ char *msg_params_copy(char *b, size_t size,
msg_param_t **dst, msg_param_t **dst,
msg_param_t const src[]) msg_param_t const src[])
{ {
int n = msg_params_count(src); size_t n = msg_params_count(src);
if (n) { if (n) {
MSG_STRUCT_ALIGN(b); MSG_STRUCT_ALIGN(b);
......
...@@ -471,7 +471,7 @@ issize_t msg_recv_buffer(msg_t *msg, void **return_buffer) ...@@ -471,7 +471,7 @@ issize_t msg_recv_buffer(msg_t *msg, void **return_buffer)
msg_payload_t *pl; msg_payload_t *pl;
for (pl = msg->m_chunk; pl; pl = pl->pl_next) { for (pl = msg->m_chunk; pl; pl = pl->pl_next) {
unsigned n = MSG_CHUNK_AVAIL(pl); size_t n = MSG_CHUNK_AVAIL(pl);
if (n) { if (n) {
*return_buffer = MSG_CHUNK_BUFFER(pl); *return_buffer = MSG_CHUNK_BUFFER(pl);
return n; return n;
...@@ -554,7 +554,7 @@ isize_t msg_recv_commit(msg_t *msg, usize_t n, int eos) ...@@ -554,7 +554,7 @@ isize_t msg_recv_commit(msg_t *msg, usize_t n, int eos)
msg_t *msg_next(msg_t *msg) msg_t *msg_next(msg_t *msg)
{ {
msg_t *next; msg_t *next;
unsigned n; usize_t n;
if (msg && msg->m_next) { if (msg && msg->m_next) {
next = msg->m_next; next = msg->m_next;
...@@ -1300,7 +1300,7 @@ issize_t msg_extract_payload(msg_t *msg, msg_pub_t *mo, ...@@ -1300,7 +1300,7 @@ issize_t msg_extract_payload(msg_t *msg, msg_pub_t *mo,
if (msg_get_flags(msg, MSG_FLG_CHUNKING)) { if (msg_get_flags(msg, MSG_FLG_CHUNKING)) {
/* Application supports chunking, use multiple chunks for payload */ /* Application supports chunking, use multiple chunks for payload */
unsigned current, rest; usize_t current, rest;
current = msg->m_buffer->mb_size - msg->m_buffer->mb_used; current = msg->m_buffer->mb_size - msg->m_buffer->mb_used;
rest = body_len - current; rest = body_len - current;
......
...@@ -194,7 +194,7 @@ size_t msgobjtag_xtra(tagi_t const *t, size_t offset) ...@@ -194,7 +194,7 @@ size_t msgobjtag_xtra(tagi_t const *t, size_t offset)
{ {
msg_header_t const *h; msg_header_t const *h;
msg_pub_t const *mo; msg_pub_t const *mo;
int rv; size_t rv;
assert(t); assert(t);
......
...@@ -1216,7 +1216,7 @@ nea_event_t *nea_event_tcreate(nea_server_t *nes, ...@@ -1216,7 +1216,7 @@ nea_event_t *nea_event_tcreate(nea_server_t *nes,
tag_type_t tag, tag_value_t value, ...) tag_type_t tag, tag_value_t value, ...)
{ {
nea_event_t *ev, **pev; nea_event_t *ev, **pev;
int len = strlen(name); size_t len = strlen(name);
ta_list ta; ta_list ta;
/* Find a matching event */ /* Find a matching event */
......
...@@ -1871,7 +1871,7 @@ int nta_tpn_by_url(su_home_t *home, ...@@ -1871,7 +1871,7 @@ int nta_tpn_by_url(su_home_t *home,
url_string_t const *us) url_string_t const *us)
{ {
url_t url[1]; url_t url[1];
int n; isize_t n;
char *b; char *b;
n = url_xtra(us->us_url); n = url_xtra(us->us_url);
...@@ -2264,7 +2264,7 @@ int agent_check_request_via(nta_agent_t *agent, ...@@ -2264,7 +2264,7 @@ int agent_check_request_via(nta_agent_t *agent,
return -1; return -1;
if (strcasecmp(hostport, v->v_host)) { if (strcasecmp(hostport, v->v_host)) {
int rlen; size_t rlen;
/* Add the "received" field */ /* Add the "received" field */
memcpy(received, "received=", receivedlen); memcpy(received, "received=", receivedlen);
...@@ -8476,7 +8476,8 @@ int outgoing_make_srv_query(nta_outgoing_t *orq) ...@@ -8476,7 +8476,8 @@ int outgoing_make_srv_query(nta_outgoing_t *orq)
su_home_t *home = msg_home(orq->orq_request); su_home_t *home = msg_home(orq->orq_request);
struct sipdns_query *sq; struct sipdns_query *sq;
char const *host; char const *host;
int i, hlen; int i;
size_t hlen;
sr->sr_use_srv = 0; sr->sr_use_srv = 0;
...@@ -8485,7 +8486,7 @@ int outgoing_make_srv_query(nta_outgoing_t *orq) ...@@ -8485,7 +8486,7 @@ int outgoing_make_srv_query(nta_outgoing_t *orq)
for (i = 0; sr->sr_tports[i]; i++) { for (i = 0; sr->sr_tports[i]; i++) {
char const *prefix = sr->sr_tports[i]->prefix; char const *prefix = sr->sr_tports[i]->prefix;
int plen = strlen(prefix); size_t plen = strlen(prefix);
sq = su_zalloc(home, (sizeof *sq) + plen + hlen); sq = su_zalloc(home, (sizeof *sq) + plen + hlen);
if (sq) { if (sq) {
...@@ -8598,7 +8599,8 @@ void outgoing_answer_naptr(sres_context_t *orq, ...@@ -8598,7 +8599,8 @@ void outgoing_answer_naptr(sres_context_t *orq,
sres_query_t *q, sres_query_t *q,
sres_record_t *answers[]) sres_record_t *answers[])
{ {
int i, j, order = -1, rlen; int i, j, order = -1;
size_t rlen;
su_home_t *home = msg_home(orq->orq_request); su_home_t *home = msg_home(orq->orq_request);
nta_agent_t *agent = orq->orq_agent; nta_agent_t *agent = orq->orq_agent;
struct sipdns_resolver *sr = orq->orq_resolver; struct sipdns_resolver *sr = orq->orq_resolver;
...@@ -8763,7 +8765,8 @@ outgoing_answer_srv(sres_context_t *orq, sres_query_t *q, ...@@ -8763,7 +8765,8 @@ outgoing_answer_srv(sres_context_t *orq, sres_query_t *q,
struct sipdns_resolver *sr = orq->orq_resolver; struct sipdns_resolver *sr = orq->orq_resolver;
su_home_t *home = msg_home(orq->orq_request); su_home_t *home = msg_home(orq->orq_request);
struct sipdns_query *sq0, *sq, *selected = NULL, **tail = &selected, **at; struct sipdns_query *sq0, *sq, *selected = NULL, **tail = &selected, **at;
int i, tlen; int i;
size_t tlen;
sr->sr_query = NULL; sr->sr_query = NULL;
......
...@@ -72,7 +72,7 @@ sip_payload_t *sl_read_payload(su_home_t *home, char const *fname) ...@@ -72,7 +72,7 @@ sip_payload_t *sl_read_payload(su_home_t *home, char const *fname)
sip_payload_t *sl_fread_payload(su_home_t *home, FILE *f) sip_payload_t *sl_fread_payload(su_home_t *home, FILE *f)
{ {
sip_payload_t *pl; sip_payload_t *pl;
int n; size_t n;
char *buf; char *buf;
char const *who; char const *who;
size_t used, size; size_t used, size;
......
...@@ -267,8 +267,8 @@ void sl_payload_log(su_log_t *log, int level, ...@@ -267,8 +267,8 @@ void sl_payload_log(su_log_t *log, int level,
log = su_log_default; log = su_log_default;
while (s < end && *s != '\0') { while (s < end && *s != '\0') {
int n = strncspn(s, end - s, "\r\n"); size_t n = strncspn(s, end - s, "\r\n");
int crlf = strnspn(s + n, end - s - n, "\r\n"); size_t crlf = strnspn(s + n, end - s - n, "\r\n");
if (n < 70) { if (n < 70) {
memcpy(line, s, n); memcpy(line, s, n);
line[n] = '\0'; line[n] = '\0';
......
...@@ -228,7 +228,7 @@ int sl_allow_print(FILE *stream, char const *fmt, sip_allow_t const *allow) ...@@ -228,7 +228,7 @@ int sl_allow_print(FILE *stream, char const *fmt, sip_allow_t const *allow)
int sl_payload_print(FILE *stream, char const *prefix, sip_payload_t const *pl) int sl_payload_print(FILE *stream, char const *prefix, sip_payload_t const *pl)
{ {
char *s = pl->pl_data, *end = pl->pl_data + pl->pl_len; char *s = pl->pl_data, *end = pl->pl_data + pl->pl_len;
int n, crlf = 1, total = 0; size_t n, total = 0, crlf = 1;
while (s < end && *s != '\0') { while (s < end && *s != '\0') {
n = strncspn(s, end - s, "\r\n"); n = strncspn(s, end - s, "\r\n");
......
...@@ -901,7 +901,7 @@ int nth_request_treply(nth_request_t *req, ...@@ -901,7 +901,7 @@ int nth_request_treply(nth_request_t *req,
if (http->http_payload && !http->http_content_length) { if (http->http_payload && !http->http_content_length) {
http_content_length_t *l; http_content_length_t *l;
http_payload_t *pl; http_payload_t *pl;
unsigned len = 0; usize_t len = 0;
for (pl = http->http_payload; pl; pl = pl->pl_next) for (pl = http->http_payload; pl; pl = pl->pl_next)
len += pl->pl_len; len += pl->pl_len;
......
...@@ -266,7 +266,7 @@ int outbound_set_options(outbound_t *ob, ...@@ -266,7 +266,7 @@ int outbound_set_options(outbound_t *ob,
#define MATCH(v) (len == sizeof(#v) - 1 && strncasecmp(#v, s, len) == 0) #define MATCH(v) (len == sizeof(#v) - 1 && strncasecmp(#v, s, len) == 0)
for (s = options; s && s[0]; ) { for (s = options; s && s[0]; ) {
int len = span_token(s); size_t len = span_token(s);
int value = 1; int value = 1;
if (len > 3 && strncasecmp(s, "no-", 3) == 0) if (len > 3 && strncasecmp(s, "no-", 3) == 0)
......
...@@ -431,7 +431,7 @@ sdp_media_t *sdp_media_dup_ex(su_home_t *home, ...@@ -431,7 +431,7 @@ sdp_media_t *sdp_media_dup_ex(su_home_t *home,
static static
int origin_xtra(sdp_origin_t const *o) int origin_xtra(sdp_origin_t const *o)
{ {
int rv = sizeof(*o); size_t rv = sizeof(*o);
STR_XTRA(rv, o->o_username); STR_XTRA(rv, o->o_username);
PTR_XTRA(rv, o->o_address, connection_xtra); PTR_XTRA(rv, o->o_address, connection_xtra);
return rv; return rv;
...@@ -456,7 +456,7 @@ sdp_origin_t *origin_dup(char **pp, sdp_origin_t const *src) ...@@ -456,7 +456,7 @@ sdp_origin_t *origin_dup(char **pp, sdp_origin_t const *src)
static static
int connection_xtra(sdp_connection_t const *c) int connection_xtra(sdp_connection_t const *c)
{ {
int rv = sizeof(*c); size_t rv = sizeof(*c);
STR_XTRA(rv, c->c_address); STR_XTRA(rv, c->c_address);
return rv; return rv;
} }
...@@ -479,7 +479,7 @@ sdp_connection_t *connection_dup(char **pp, sdp_connection_t const *src) ...@@ -479,7 +479,7 @@ sdp_connection_t *connection_dup(char **pp, sdp_connection_t const *src)
int bandwidth_xtra(sdp_bandwidth_t const *b) int bandwidth_xtra(sdp_bandwidth_t const *b)
{ {
int rv = sizeof(*b); size_t rv = sizeof(*b);
STR_XTRA(rv, b->b_modifier_name); STR_XTRA(rv, b->b_modifier_name);
return rv; return rv;
} }
...@@ -503,7 +503,7 @@ sdp_bandwidth_t *bandwidth_dup(char **pp, sdp_bandwidth_t const *src) ...@@ -503,7 +503,7 @@ sdp_bandwidth_t *bandwidth_dup(char **pp, sdp_bandwidth_t const *src)
int time_xtra(sdp_time_t const *t) int time_xtra(sdp_time_t const *t)
{ {
int rv = sizeof(*t); size_t rv = sizeof(*t);
PTR_XTRA(rv, t->t_repeat, repeat_xtra); PTR_XTRA(rv, t->t_repeat, repeat_xtra);
PTR_XTRA(rv, t->t_zone, zone_xtra); PTR_XTRA(rv, t->t_zone, zone_xtra);
return rv; return rv;
...@@ -569,7 +569,7 @@ sdp_zone_t *zone_dup(char **pp, sdp_zone_t const *src) ...@@ -569,7 +569,7 @@ sdp_zone_t *zone_dup(char **pp, sdp_zone_t const *src)
int key_xtra(sdp_key_t const *k) int key_xtra(sdp_key_t const *k)
{ {
int rv = sizeof(*k); size_t rv = sizeof(*k);
STR_XTRA(rv, k->k_method_name); STR_XTRA(rv, k->k_method_name);
STR_XTRA(rv, k->k_material); STR_XTRA(rv, k->k_material);
return rv; return rv;
...@@ -594,7 +594,7 @@ sdp_key_t *key_dup(char **pp, sdp_key_t const *src) ...@@ -594,7 +594,7 @@ sdp_key_t *key_dup(char **pp, sdp_key_t const *src)
int attribute_xtra(sdp_attribute_t const *a) int attribute_xtra(sdp_attribute_t const *a)
{ {
int rv = sizeof(*a); size_t rv = sizeof(*a);
STR_XTRA(rv, a->a_name); STR_XTRA(rv, a->a_name);
STR_XTRA(rv, a->a_value); STR_XTRA(rv, a->a_value);
return rv; return rv;
...@@ -620,7 +620,7 @@ sdp_attribute_t *attribute_dup(char **pp, sdp_attribute_t const *src) ...@@ -620,7 +620,7 @@ sdp_attribute_t *attribute_dup(char **pp, sdp_attribute_t const *src)
int media_xtra(sdp_media_t const *m) int media_xtra(sdp_media_t const *m)
{ {
int rv = sizeof(*m); size_t rv = sizeof(*m);
STR_XTRA(rv, m->m_type_name); STR_XTRA(rv, m->m_type_name);
STR_XTRA(rv, m->m_proto_name); STR_XTRA(rv, m->m_proto_name);
...@@ -748,7 +748,7 @@ sdp_media_t *media_dup_ex(char **pp, ...@@ -748,7 +748,7 @@ sdp_media_t *media_dup_ex(char **pp,
static static
int media_xtra_all(sdp_media_t const *m) int media_xtra_all(sdp_media_t const *m)
{ {
int rv = 0; size_t rv = 0;
for (; m; m = m->m_next) { for (; m; m = m->m_next) {
rv += STRUCT_ALIGN(rv); rv += STRUCT_ALIGN(rv);
...@@ -782,7 +782,7 @@ sdp_media_t *media_dup_all(char **pp, ...@@ -782,7 +782,7 @@ sdp_media_t *media_dup_all(char **pp,
int list_xtra(sdp_list_t const *l) int list_xtra(sdp_list_t const *l)
{ {
int rv = sizeof(*l); size_t rv = sizeof(*l);
rv += strlen(l->l_text) + 1; rv += strlen(l->l_text) + 1;
return rv; return rv;
} }
...@@ -805,7 +805,7 @@ sdp_list_t *list_dup(char **pp, sdp_list_t const *src) ...@@ -805,7 +805,7 @@ sdp_list_t *list_dup(char **pp, sdp_list_t const *src)
int rtpmap_xtra(sdp_rtpmap_t const *rm) int rtpmap_xtra(sdp_rtpmap_t const *rm)
{ {
int rv = sizeof(*rm); size_t rv = sizeof(*rm);
STR_XTRA(rv, rm->rm_encoding); STR_XTRA(rv, rm->rm_encoding);
STR_XTRA(rv, rm->rm_params); STR_XTRA(rv, rm->rm_params);
STR_XTRA(rv, rm->rm_fmtp); STR_XTRA(rv, rm->rm_fmtp);
...@@ -835,7 +835,7 @@ static ...@@ -835,7 +835,7 @@ static
int list_xtra_all(xtra_f *xtra, int list_xtra_all(xtra_f *xtra,
void const *v) void const *v)
{ {
int rv = 0; size_t rv = 0;
sdp_list_t const *l; sdp_list_t const *l;
for (l = v; l; l = l->l_next) { for (l = v; l; l = l->l_next) {
...@@ -897,7 +897,7 @@ sdp_XXX_t *XXX_dup(char **pp, sdp_XXX_t const *src) ...@@ -897,7 +897,7 @@ sdp_XXX_t *XXX_dup(char **pp, sdp_XXX_t const *src)
static static
int session_xtra(sdp_session_t const *sdp) int session_xtra(sdp_session_t const *sdp)
{ {
int rv = sizeof(*sdp); size_t rv = sizeof(*sdp);
PTR_XTRA(rv, sdp->sdp_origin, origin_xtra); PTR_XTRA(rv, sdp->sdp_origin, origin_xtra);
STR_XTRA(rv, sdp->sdp_subject); STR_XTRA(rv, sdp->sdp_subject);
...@@ -968,7 +968,7 @@ sdp_session_t *sdp_session_dup(su_home_t *h, sdp_session_t const *sdp) ...@@ -968,7 +968,7 @@ sdp_session_t *sdp_session_dup(su_home_t *h, sdp_session_t const *sdp)
static static
int session_without_media_xtra(sdp_session_t const *sdp) int session_without_media_xtra(sdp_session_t const *sdp)
{ {
int rv = sizeof(*sdp); size_t rv = sizeof(*sdp);
PTR_XTRA(rv, sdp->sdp_origin, origin_xtra); PTR_XTRA(rv, sdp->sdp_origin, origin_xtra);
STR_XTRA(rv, sdp->sdp_subject); STR_XTRA(rv, sdp->sdp_subject);
...@@ -1080,7 +1080,7 @@ int sdptag_session_snprintf(tagi_t const *t, char b[], size_t size) ...@@ -1080,7 +1080,7 @@ int sdptag_session_snprintf(tagi_t const *t, char b[], size_t size)
{ {
sdp_session_t const *sdp; sdp_session_t const *sdp;
sdp_printer_t *print; sdp_printer_t *print;
int retval; size_t retval;
assert(t); assert(t);
......
...@@ -705,7 +705,7 @@ static void sdp_printf(sdp_printer_t *p, const char *fmt, ...) ...@@ -705,7 +705,7 @@ static void sdp_printf(sdp_printer_t *p, const char *fmt, ...)
} }
else if (p->pr_may_realloc) { else if (p->pr_may_realloc) {
char *buffer; char *buffer;
int size; size_t size;
if (p->pr_bsiz < SDP_BLOCK) if (p->pr_bsiz < SDP_BLOCK)
size = SDP_BLOCK; size = SDP_BLOCK;
else else
......
...@@ -981,7 +981,7 @@ issize_t sip_call_id_d(su_home_t *home, ...@@ -981,7 +981,7 @@ issize_t sip_call_id_d(su_home_t *home,
issize_t sip_call_id_e(char b[], isize_t bsiz, sip_header_t const *h, int flags) issize_t sip_call_id_e(char b[], isize_t bsiz, sip_header_t const *h, int flags)
{ {
int n = strlen(h->sh_call_id->i_id); issize_t n = strlen(h->sh_call_id->i_id);
if (bsiz > n) if (bsiz > n)
strcpy(b, h->sh_call_id->i_id); strcpy(b, h->sh_call_id->i_id);
...@@ -1044,7 +1044,7 @@ char *sip_call_id_dup_one(sip_header_t *dst, sip_header_t const *src, ...@@ -1044,7 +1044,7 @@ char *sip_call_id_dup_one(sip_header_t *dst, sip_header_t const *src,
sip_call_id_t *sip_call_id_create(su_home_t *home, char const *domain) sip_call_id_t *sip_call_id_create(su_home_t *home, char const *domain)
{ {
sip_call_id_t *i; sip_call_id_t *i;
int xtra = su_guid_strlen + 1 + (domain ? strlen(domain) + 1 : 0); size_t xtra = su_guid_strlen + 1 + (domain ? strlen(domain) + 1 : 0);
i = sip_header_alloc(home, sip_call_id_class, xtra)->sh_call_id; i = sip_header_alloc(home, sip_call_id_class, xtra)->sh_call_id;
......
...@@ -504,7 +504,7 @@ int sip_complete_message(msg_t *msg) ...@@ -504,7 +504,7 @@ int sip_complete_message(msg_t *msg)
{ {
sip_t *sip = sip_object(msg); sip_t *sip = sip_object(msg);
su_home_t *home = msg_home(msg); su_home_t *home = msg_home(msg);
unsigned len = 0; usize_t len = 0;
if (sip == NULL) if (sip == NULL)
return -1; return -1;
......
...@@ -336,7 +336,8 @@ int sip_contact_accept(sip_contact_t const *m, ...@@ -336,7 +336,8 @@ int sip_contact_accept(sip_contact_t const *m,
int *return_error) int *return_error)
{ {
char const *cap, *acc; char const *cap, *acc;
unsigned i, S, N, eq; unsigned i, S, N;
size_t eq;
if (!return_N) return_N = &N; if (!return_N) return_N = &N;
if (!return_S) return_S = &S; if (!return_S) return_S = &S;
......
...@@ -132,7 +132,7 @@ tagi_t *siptag_filter(tagi_t *dst, ...@@ -132,7 +132,7 @@ tagi_t *siptag_filter(tagi_t *dst,
return dst; return dst;
stub[0].t_tag = tt; stub[0].t_tag = tt;
stub[0].t_value = (long)h; stub[0].t_value = (tag_value_t)h;
src = stub; sctt = tt; src = stub; sctt = tt;
} }
......
...@@ -366,7 +366,7 @@ issize_t sip_header_field_d(su_home_t *home, sip_header_t *h, char *s, isize_t s ...@@ -366,7 +366,7 @@ issize_t sip_header_field_d(su_home_t *home, sip_header_t *h, char *s, isize_t s
assert(SIP_HDR_TEST(h)); assert(SIP_HDR_TEST(h));
if (h && s && s[slen] == '\0') { if (h && s && s[slen] == '\0') {
int n = span_lws(s); isize_t n = span_lws(s);
s += n; slen -= n; s += n; slen -= n;
for (n = slen - 1; n >= 0 && IS_LWS(s[n]); n--) for (n = slen - 1; n >= 0 && IS_LWS(s[n]); n--)
......
...@@ -764,7 +764,8 @@ char *stun_determine_ip_address(int family) ...@@ -764,7 +764,8 @@ char *stun_determine_ip_address(int family)
char *local_ip_address; char *local_ip_address;
su_localinfo_t *li = NULL, hints[1] = {{ LI_CANONNAME|LI_NUMERIC }}; su_localinfo_t *li = NULL, hints[1] = {{ LI_CANONNAME|LI_NUMERIC }};
int error, address_size; int error;
size_t address_size;
struct sockaddr_in *sa = NULL; struct sockaddr_in *sa = NULL;
su_sockaddr_t *temp; su_sockaddr_t *temp;
......
...@@ -141,7 +141,7 @@ su_md5_update(su_md5_t *ctx, ...@@ -141,7 +141,7 @@ su_md5_update(su_md5_t *ctx,
t = ctx->bits[0]; t = ctx->bits[0];
if ((ctx->bits[0] = (t + ((uint32_t)len << 3)) & 0xffffffff) < t) if ((ctx->bits[0] = (t + ((uint32_t)len << 3)) & 0xffffffff) < t)
ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29; ctx->bits[1] += (uint32_t)(len >> 29);
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
...@@ -210,7 +210,7 @@ su_md5_iupdate(su_md5_t *ctx, ...@@ -210,7 +210,7 @@ su_md5_iupdate(su_md5_t *ctx,
t = ctx->bits[0]; t = ctx->bits[0];
if ((ctx->bits[0] = (t + ((uint32_t)len << 3)) & 0xffffffff) < t) if ((ctx->bits[0] = (t + ((uint32_t)len << 3)) & 0xffffffff) < t)
ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29; ctx->bits[1] += (uint32_t)(len >> 29);
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
...@@ -222,7 +222,7 @@ su_md5_iupdate(su_md5_t *ctx, ...@@ -222,7 +222,7 @@ su_md5_iupdate(su_md5_t *ctx,
t = sizeof(ctx->in) - t; t = sizeof(ctx->in) - t;
if (len < t) { if (len < t) {
mem_i_cpy(p, buf, len); mem_i_cpy(p, buf, (uint32_t)len);
return; return;
}