Commit ddedd067 authored by Pekka Pessi's avatar Pekka Pessi

Fixed const/non-const problems with gcc4/vc6.

darcs-hash:20050908151216-65a35-f904acfa0e4a772e6c22671f17eaccf407cd65e7.gz
parent ccc96686
......@@ -615,7 +615,7 @@ int msg_multipart_complete(su_home_t *home,
if (!(b = msg_params_find(c->c_params, "boundary="))) {
/* Generate boundary */
int tlen = 16 * 4 / 3;
enum { tlen = 16 * 4 / 3 };
char token[sizeof("boundary=") + tlen + 1];
if (mp->mp_data) {
......@@ -906,13 +906,13 @@ int msg_multipart_e(char b[], int bsiz, msg_header_t const *h, int flags)
/** Calculate extra size of a multipart */
int msg_multipart_dup_xtra(msg_header_t const *h, int offset)
{
msg_multipart_t *mp = h->sh_multipart;
msg_header_t **hh;
msg_multipart_t const *mp = h->sh_multipart;
msg_header_t const **hh;
offset = msg_payload_dup_xtra(h, offset);
for (hh = (msg_header_t **)&mp->mp_content_type;
hh <= (msg_header_t **)&mp->mp_close_delim;
for (hh = (msg_header_t const **)&mp->mp_content_type;
hh <= (msg_header_t const **)&mp->mp_close_delim;
hh++) {
for (h = *hh; h; h = h->sh_next) {
MSG_STRUCT_SIZE_ALIGN(offset);
......@@ -2008,7 +2008,7 @@ int msg_warning_d(su_home_t *home, msg_header_t *h, char *s, int slen)
int msg_warning_e(char b[], int bsiz, msg_header_t const *h, int f)
{
msg_warning_t *w = h->sh_warning;
msg_warning_t const *w = h->sh_warning;
char const *port = w->w_port;
int n;
......
......@@ -302,7 +302,7 @@ unsigned msg_buf_size(msg_t const *msg)
{
assert(msg);
if (msg) {
struct msg_mbuffer_s *mb = msg->m_buffer;
struct msg_mbuffer_s const *mb = msg->m_buffer;
return mb->mb_size - mb->mb_commit - mb->mb_used;
}
else
......
......@@ -4570,7 +4570,7 @@ nta_incoming_t *incoming_find(nta_agent_t const *agent,
sip_from_t const *from = sip->sip_from;
sip_request_t *rq = sip->sip_request;
int is_uas_ack = ack && agent->sa_is_a_uas && rq->rq_method == sip_method_ack;
incoming_htable_t *iht = agent->sa_incoming;
incoming_htable_t const *iht = agent->sa_incoming;
hash_value_t hash = NTA_HASH(i, cseq->cs_seq);
nta_incoming_t **ii, *irq, *maybe;
......@@ -7201,9 +7201,9 @@ nta_outgoing_t *outgoing_find(nta_agent_t const *sa,
sip_via_t const *v)
{
nta_outgoing_t **oo, *orq;
outgoing_htable_t *oht = sa->sa_outgoing;
sip_cseq_t *cseq = sip->sip_cseq;
sip_call_id_t *i = sip->sip_call_id;
outgoing_htable_t const *oht = sa->sa_outgoing;
sip_cseq_t const *cseq = sip->sip_cseq;
sip_call_id_t const *i = sip->sip_call_id;
hash_value_t hash;
sip_method_t method, method2;
unsigned short status = sip->sip_status ? sip->sip_status->st_status : 0;
......
......@@ -1824,7 +1824,7 @@ int sip_retry_after_d(su_home_t *home, sip_header_t *h, char *s, int slen)
int sip_retry_after_e(char b[], int bsiz, sip_header_t const *h, int f)
{
sip_retry_after_t *af = h->sh_retry_after;
sip_retry_after_t const *af = h->sh_retry_after;
int const compact = MSG_IS_COMPACT(f);
char *b0 = b, *end = b + bsiz;
......
......@@ -576,7 +576,7 @@ int sip_privacy_d(su_home_t *home, sip_header_t *h, char *s, int slen)
int sip_privacy_e(char b[], int bsiz, sip_header_t const *h, int f)
{
sip_privacy_t *priv = h->sh_privacy;
sip_privacy_t const *priv = h->sh_privacy;
char *b0 = b, *end = b + bsiz;
int i;
......
......@@ -501,7 +501,7 @@ static void sip_fragment_clear_chain(sip_header_t *h)
void const *next;
for (h = h; h; h = h->sh_succ) {
next = h->sh_data + h->sh_len;
next = (char *)h->sh_data + h->sh_len;
sip_fragment_clear(h->sh_common);
......@@ -527,7 +527,7 @@ sip_route_t *sip_route_fix(sip_route_t *route)
for (r = route; r; r = r->r_next) {
/* Keep track of first header structure on this header line */
if (!h
|| h->sh_data + h->sh_len != r->r_common->h_data
|| (char *)h->sh_data + h->sh_len != r->r_common->h_data
|| r->r_common->h_len)
h = (sip_header_t *)r;
......
......@@ -97,9 +97,9 @@ typedef struct prefix##_s { \
HTABLE_SCOPE int prefix##_resize(su_home_t *, prefix##_t pr[1], unsigned); \
HTABLE_SCOPE int prefix##_is_full(prefix##_t const *); \
HTABLE_SCOPE entry_t **prefix##_hash(prefix##_t const *, hash_value_t hv); \
HTABLE_SCOPE entry_t **prefix##_next(prefix##_t const *, entry_t **ee); \
HTABLE_SCOPE void prefix##_append(prefix##_t *pr, entry_t *e); \
HTABLE_SCOPE void prefix##_insert(prefix##_t *pr, entry_t *e); \
HTABLE_SCOPE entry_t **prefix##_next(prefix##_t const *, entry_t * const *ee); \
HTABLE_SCOPE void prefix##_append(prefix##_t *pr, entry_t const *e); \
HTABLE_SCOPE void prefix##_insert(prefix##_t *pr, entry_t const *e); \
HTABLE_SCOPE void prefix##_remove(prefix##_t *, entry_t const *e)
/** Hash table implementation.
......@@ -176,27 +176,27 @@ entry_t **prefix##_hash(prefix##_t const *pr, hash_value_t hv) \
} \
\
HTABLE_SCOPE \
entry_t **prefix##_next(prefix##_t const *pr, entry_t **ee) \
entry_t **prefix##_next(prefix##_t const *pr, entry_t * const *ee) \
{ \
if (++ee < pr->pr##_table + pr->pr##_size && ee >= pr->pr##_table) \
return ee; \
return (entry_t **)ee; \
else \
return pr->pr##_table; \
} \
\
HTABLE_SCOPE \
void prefix##_append(prefix##_t *pr, entry_t *e) \
void prefix##_append(prefix##_t *pr, entry_t const *e) \
{ \
entry_t **ee; \
\
pr->pr##_used++; \
for (ee = prefix##_hash(pr, hfun(e)); *ee; ee = prefix##_next(pr, ee)) \
; \
*ee = e; \
*ee = (entry_t *)e; \
} \
\
HTABLE_SCOPE \
void prefix##_insert(prefix##_t *pr, entry_t *e) \
void prefix##_insert(prefix##_t *pr, entry_t const *e) \
{ \
entry_t *e0, **ee; \
\
......@@ -205,8 +205,8 @@ void prefix##_insert(prefix##_t *pr, entry_t *e) \
for (ee = prefix##_hash(pr, hfun(e)); \
(e0 = *ee); \
ee = prefix##_next(pr, ee)) \
*ee = e, e = e0; \
*ee = e; \
*ee = (entry_t *)e, e = e0; \
*ee = (entry_t *)e; \
} \
\
HTABLE_SCOPE \
......
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