Ignore:
Timestamp:
Oct 29, 2006 6:13:13 PM (18 years ago)
Author:
bennylp
Message:

Another Symbian commit, ported all PJSIP libraries and sipstateless runs without crashes (still no SIP message though)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/symbian/pjsip/src/pjsip/sip_msg.c

    r453 r789  
    238238PJ_DEF(pjsip_msg*) pjsip_msg_create( pj_pool_t *pool, pjsip_msg_type_e type) 
    239239{ 
    240     pjsip_msg *msg = pj_pool_alloc(pool, sizeof(pjsip_msg)); 
     240    pjsip_msg *msg = (pjsip_msg *) pj_pool_alloc(pool, sizeof(pjsip_msg)); 
    241241    pj_list_init(&msg->hdr); 
    242242    msg->type = type; 
     
    248248                                   pjsip_hdr_e hdr_type, const void *start) 
    249249{ 
    250     const pjsip_hdr *hdr=start, *end=&msg->hdr; 
     250    const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr; 
    251251 
    252252    if (hdr == NULL) { 
     
    264264                                           const void *start) 
    265265{ 
    266     const pjsip_hdr *hdr=start, *end=&msg->hdr; 
     266    const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr; 
    267267 
    268268    if (hdr == NULL) { 
     
    284284                                         pjsip_hdr_e hdr_type, void *start) 
    285285{ 
    286     pjsip_hdr *hdr = pjsip_msg_find_hdr(msg, hdr_type, start); 
     286    pjsip_hdr *hdr = (pjsip_hdr *)pjsip_msg_find_hdr(msg, hdr_type, start); 
    287287    if (hdr) { 
    288288        pj_list_erase(hdr); 
     
    316316 
    317317        /* Add URI */ 
    318         uri = pjsip_uri_get_uri(msg->line.req.uri); 
     318        uri = (pjsip_uri*) pjsip_uri_get_uri(msg->line.req.uri); 
    319319        len = pjsip_uri_print( PJSIP_URI_IN_REQ_URI, uri, p, end-p); 
    320320        if (len < 1) 
     
    448448PJ_DEF(void*) pjsip_hdr_clone( pj_pool_t *pool, const void *hdr_ptr ) 
    449449{ 
    450     const pjsip_hdr *hdr = hdr_ptr; 
     450    const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr; 
    451451    return (*hdr->vptr->clone)(pool, hdr_ptr); 
    452452} 
     
    455455PJ_DEF(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr_ptr ) 
    456456{ 
    457     const pjsip_hdr *hdr = hdr_ptr; 
     457    const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr; 
    458458    return (*hdr->vptr->shallow_clone)(pool, hdr_ptr); 
    459459} 
     
    461461PJ_DEF(int) pjsip_hdr_print_on( void *hdr_ptr, char *buf, pj_size_t len) 
    462462{ 
    463     pjsip_hdr *hdr = hdr_ptr; 
     463    pjsip_hdr *hdr = (pjsip_hdr *)hdr_ptr; 
    464464    return (*hdr->vptr->print_on)(hdr_ptr, buf, len); 
    465465} 
     
    507507                               const pj_str_t *hvalue) 
    508508{ 
    509     pjsip_generic_string_hdr *hdr = mem; 
     509    pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr *)mem; 
    510510 
    511511    init_hdr(hdr, PJSIP_H_OTHER, &generic_hdr_vptr); 
     
    567567                                                           const pjsip_generic_string_hdr *rhs ) 
    568568{ 
    569     pjsip_generic_string_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     569    pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr *) 
     570                                     pj_pool_alloc(pool, sizeof(*hdr)); 
    570571    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    571572    return hdr; 
     
    596597                                                            int value) 
    597598{ 
    598     pjsip_generic_int_hdr *hdr = mem; 
     599    pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) mem; 
    599600 
    600601    init_hdr(hdr, PJSIP_H_OTHER, &generic_int_hdr_vptr); 
     
    636637                                                   const pjsip_generic_int_hdr *rhs) 
    637638{ 
    638     pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     639    pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) 
     640                                  pj_pool_alloc(pool, sizeof(*hdr)); 
    639641    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    640642    return hdr; 
     
    644646                                                           const pjsip_generic_int_hdr *rhs ) 
    645647{ 
    646     pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     648    pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) 
     649                                 pj_pool_alloc(pool, sizeof(*hdr)); 
    647650    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    648651    return hdr; 
     
    671674                                                               const pj_str_t *hnames) 
    672675{ 
    673     pjsip_generic_array_hdr *hdr = mem; 
     676    pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) mem; 
    674677 
    675678    init_hdr(hdr, PJSIP_H_OTHER, &generic_array_hdr_vptr); 
     
    715718{ 
    716719    unsigned i; 
    717     pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     720    pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) 
     721                                   pj_pool_alloc(pool, sizeof(*hdr)); 
    718722 
    719723    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
     
    729733                                                 const pjsip_generic_array_hdr *rhs) 
    730734{ 
    731     pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     735    pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) 
     736                                   pj_pool_alloc(pool, sizeof(*hdr)); 
    732737    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    733738    return hdr; 
     
    741746                                                 void *mem ) 
    742747{ 
    743     pjsip_accept_hdr *hdr = mem; 
     748    pjsip_accept_hdr *hdr = (pjsip_accept_hdr *) mem; 
    744749 
    745750    PJ_UNUSED_ARG(pool); 
     
    765770                                               void *mem ) 
    766771{ 
    767     pjsip_allow_hdr *hdr = mem; 
     772    pjsip_allow_hdr *hdr = (pjsip_allow_hdr *) mem; 
    768773 
    769774    PJ_UNUSED_ARG(pool); 
     
    788793                                           void *mem ) 
    789794{ 
    790     pjsip_cid_hdr *hdr = mem; 
     795    pjsip_cid_hdr *hdr = (pjsip_cid_hdr *) mem; 
    791796 
    792797    PJ_UNUSED_ARG(pool); 
     
    822827                                             void *mem ) 
    823828{ 
    824     pjsip_clen_hdr *hdr = mem; 
     829    pjsip_clen_hdr *hdr = (pjsip_clen_hdr *) mem; 
    825830 
    826831    PJ_UNUSED_ARG(pool); 
     
    884889                                             void *mem ) 
    885890{ 
    886     pjsip_cseq_hdr *hdr = mem; 
     891    pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr *) mem; 
    887892 
    888893    PJ_UNUSED_ARG(pool); 
     
    939944                                                     const pjsip_cseq_hdr *rhs ) 
    940945{ 
    941     pjsip_cseq_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     946    pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr *)  
     947                          pj_pool_alloc(pool, sizeof(*hdr)); 
    942948    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    943949    return hdr; 
     
    963969                                                   void *mem ) 
    964970{ 
    965     pjsip_contact_hdr *hdr = mem; 
     971    pjsip_contact_hdr *hdr = (pjsip_contact_hdr *) mem; 
    966972 
    967973    PJ_UNUSED_ARG(pool); 
     
    10551061        return hdr; 
    10561062 
    1057     hdr->uri = pjsip_uri_clone(pool, rhs->uri); 
     1063    hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri); 
    10581064    hdr->q1000 = rhs->q1000; 
    10591065    hdr->expires = rhs->expires; 
     
    10661072                                 const pjsip_contact_hdr *rhs) 
    10671073{ 
    1068     pjsip_contact_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1074    pjsip_contact_hdr *hdr = (pjsip_contact_hdr *)  
     1075                             pj_pool_alloc(pool, sizeof(*hdr)); 
    10691076    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    10701077    pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); 
     
    10921099                                               void *mem ) 
    10931100{ 
    1094     pjsip_ctype_hdr *hdr = mem; 
     1101    pjsip_ctype_hdr *hdr = (pjsip_ctype_hdr *) mem; 
    10951102 
    10961103    PJ_UNUSED_ARG(pool); 
     
    11691176                                                   int value) 
    11701177{ 
    1171     pjsip_expires_hdr *hdr = mem; 
     1178    pjsip_expires_hdr *hdr = (pjsip_expires_hdr *) mem; 
    11721179 
    11731180    PJ_UNUSED_ARG(pool); 
     
    12081215                                             void *mem ) 
    12091216{ 
    1210     pjsip_from_hdr *hdr = mem; 
     1217    pjsip_from_hdr *hdr = (pjsip_from_hdr *) mem; 
    12111218 
    12121219    PJ_UNUSED_ARG(pool); 
     
    12271234                                         void *mem ) 
    12281235{ 
    1229     pjsip_to_hdr *hdr = mem; 
     1236    pjsip_to_hdr *hdr = (pjsip_to_hdr *) mem; 
    12301237 
    12311238    PJ_UNUSED_ARG(pool); 
     
    12961303    hdr->name = rhs->name; 
    12971304    hdr->sname = rhs->sname; 
    1298     hdr->uri = pjsip_uri_clone(pool, rhs->uri); 
     1305    hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri); 
    12991306    pj_strdup( pool, &hdr->tag, &rhs->tag); 
    13001307    pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param); 
     
    13071314                                const pjsip_fromto_hdr *rhs) 
    13081315{ 
    1309     pjsip_fromto_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1316    pjsip_fromto_hdr *hdr = (pjsip_fromto_hdr *)  
     1317                            pj_pool_alloc(pool, sizeof(*hdr)); 
    13101318    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    13111319    pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); 
     
    13221330                                                   int value) 
    13231331{ 
    1324     pjsip_max_fwd_hdr *hdr = mem; 
     1332    pjsip_max_fwd_hdr *hdr = (pjsip_max_fwd_hdr *) mem; 
    13251333 
    13261334    PJ_UNUSED_ARG(pool); 
     
    13481356                                                           int value ) 
    13491357{ 
    1350     pjsip_min_expires_hdr *hdr = mem; 
     1358    pjsip_min_expires_hdr *hdr = (pjsip_min_expires_hdr *) mem; 
    13511359 
    13521360    PJ_UNUSED_ARG(pool); 
     
    13821390                                         void *mem ) 
    13831391{ 
    1384     pjsip_rr_hdr *hdr = mem; 
     1392    pjsip_rr_hdr *hdr = (pjsip_rr_hdr *) mem; 
    13851393 
    13861394    PJ_UNUSED_ARG(pool); 
     
    14021410                                               void *mem ) 
    14031411{ 
    1404     pjsip_route_hdr *hdr = mem; 
     1412    pjsip_route_hdr *hdr = (pjsip_route_hdr *) mem; 
    14051413 
    14061414    PJ_UNUSED_ARG(pool); 
     
    14621470                                                   const pjsip_routing_hdr *rhs ) 
    14631471{ 
    1464     pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1472    pjsip_routing_hdr *hdr = (pjsip_routing_hdr *) 
     1473                             pj_pool_alloc(pool, sizeof(*hdr)); 
    14651474 
    14661475    init_hdr(hdr, rhs->type, rhs->vptr); 
     
    14741483                                                           const pjsip_routing_hdr *rhs ) 
    14751484{ 
    1476     pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1485    pjsip_routing_hdr *hdr = (pjsip_routing_hdr *) 
     1486                             pj_pool_alloc(pool, sizeof(*hdr)); 
    14771487    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    14781488    pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); 
     
    14881498                                                   void *mem ) 
    14891499{ 
    1490     pjsip_require_hdr *hdr = mem; 
     1500    pjsip_require_hdr *hdr = (pjsip_require_hdr *) mem; 
    14911501 
    14921502    PJ_UNUSED_ARG(pool); 
     
    15111521                                                           int value ) 
    15121522{ 
    1513     pjsip_retry_after_hdr *hdr = mem; 
     1523    pjsip_retry_after_hdr *hdr = (pjsip_retry_after_hdr *) mem; 
    15141524 
    15151525    PJ_UNUSED_ARG(pool); 
     
    15351545                                                       void *mem ) 
    15361546{ 
    1537     pjsip_supported_hdr *hdr = mem; 
     1547    pjsip_supported_hdr *hdr = (pjsip_supported_hdr *) mem; 
    15381548 
    15391549    PJ_UNUSED_ARG(pool); 
     
    15571567                                                           void *mem ) 
    15581568{ 
    1559     pjsip_unsupported_hdr *hdr = mem; 
     1569    pjsip_unsupported_hdr *hdr = (pjsip_unsupported_hdr *) mem; 
    15601570     
    15611571    PJ_UNUSED_ARG(pool); 
     
    15901600                                           void *mem ) 
    15911601{ 
    1592     pjsip_via_hdr *hdr = mem; 
     1602    pjsip_via_hdr *hdr = (pjsip_via_hdr *) mem; 
    15931603 
    15941604    PJ_UNUSED_ARG(pool); 
     
    16971707                                                   const pjsip_via_hdr *rhs ) 
    16981708{ 
    1699     pjsip_via_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1709    pjsip_via_hdr *hdr = (pjsip_via_hdr *) pj_pool_alloc(pool, sizeof(*hdr)); 
    17001710    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    17011711    pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); 
     
    17151725    pj_str_t hvalue; 
    17161726 
    1717     hvalue.ptr = pj_pool_alloc(pool, 10 +               /* code */ 
     1727    hvalue.ptr = (char*) 
     1728                 pj_pool_alloc(pool, 10 +               /* code */ 
    17181729                                     host->slen + 2 +   /* host */ 
    17191730                                     text->slen + 2);   /* text */ 
     
    17551766 
    17561767    if (len) { 
    1757         newdata = pj_pool_alloc(pool, len); 
     1768        newdata = (char*) pj_pool_alloc(pool, len); 
    17581769        pj_memcpy(newdata, data, len); 
    17591770    } 
     
    17971808    pj_status_t status; 
    17981809 
    1799     new_body = pj_pool_alloc(pool, sizeof(pjsip_msg_body)); 
     1810    new_body = (pjsip_msg_body*) pj_pool_alloc(pool, sizeof(pjsip_msg_body)); 
    18001811    PJ_ASSERT_RETURN(new_body, NULL); 
    18011812 
     
    18151826    PJ_ASSERT_RETURN(pool && type && subtype && text, NULL); 
    18161827 
    1817     body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body)); 
     1828    body = (pjsip_msg_body*) pj_pool_zalloc(pool, sizeof(pjsip_msg_body)); 
    18181829    PJ_ASSERT_RETURN(body != NULL, NULL); 
    18191830 
Note: See TracChangeset for help on using the changeset viewer.