Changeset 789 for pjproject/branches/symbian/pjsip/src/pjsip/sip_msg.c
- Timestamp:
- Oct 29, 2006 6:13:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/symbian/pjsip/src/pjsip/sip_msg.c
r453 r789 238 238 PJ_DEF(pjsip_msg*) pjsip_msg_create( pj_pool_t *pool, pjsip_msg_type_e type) 239 239 { 240 pjsip_msg *msg = pj_pool_alloc(pool, sizeof(pjsip_msg));240 pjsip_msg *msg = (pjsip_msg *) pj_pool_alloc(pool, sizeof(pjsip_msg)); 241 241 pj_list_init(&msg->hdr); 242 242 msg->type = type; … … 248 248 pjsip_hdr_e hdr_type, const void *start) 249 249 { 250 const pjsip_hdr *hdr= start, *end=&msg->hdr;250 const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr; 251 251 252 252 if (hdr == NULL) { … … 264 264 const void *start) 265 265 { 266 const pjsip_hdr *hdr= start, *end=&msg->hdr;266 const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr; 267 267 268 268 if (hdr == NULL) { … … 284 284 pjsip_hdr_e hdr_type, void *start) 285 285 { 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); 287 287 if (hdr) { 288 288 pj_list_erase(hdr); … … 316 316 317 317 /* Add URI */ 318 uri = pjsip_uri_get_uri(msg->line.req.uri);318 uri = (pjsip_uri*) pjsip_uri_get_uri(msg->line.req.uri); 319 319 len = pjsip_uri_print( PJSIP_URI_IN_REQ_URI, uri, p, end-p); 320 320 if (len < 1) … … 448 448 PJ_DEF(void*) pjsip_hdr_clone( pj_pool_t *pool, const void *hdr_ptr ) 449 449 { 450 const pjsip_hdr *hdr = hdr_ptr;450 const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr; 451 451 return (*hdr->vptr->clone)(pool, hdr_ptr); 452 452 } … … 455 455 PJ_DEF(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr_ptr ) 456 456 { 457 const pjsip_hdr *hdr = hdr_ptr;457 const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr; 458 458 return (*hdr->vptr->shallow_clone)(pool, hdr_ptr); 459 459 } … … 461 461 PJ_DEF(int) pjsip_hdr_print_on( void *hdr_ptr, char *buf, pj_size_t len) 462 462 { 463 pjsip_hdr *hdr = hdr_ptr;463 pjsip_hdr *hdr = (pjsip_hdr *)hdr_ptr; 464 464 return (*hdr->vptr->print_on)(hdr_ptr, buf, len); 465 465 } … … 507 507 const pj_str_t *hvalue) 508 508 { 509 pjsip_generic_string_hdr *hdr = mem;509 pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr *)mem; 510 510 511 511 init_hdr(hdr, PJSIP_H_OTHER, &generic_hdr_vptr); … … 567 567 const pjsip_generic_string_hdr *rhs ) 568 568 { 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)); 570 571 pj_memcpy(hdr, rhs, sizeof(*hdr)); 571 572 return hdr; … … 596 597 int value) 597 598 { 598 pjsip_generic_int_hdr *hdr = mem;599 pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) mem; 599 600 600 601 init_hdr(hdr, PJSIP_H_OTHER, &generic_int_hdr_vptr); … … 636 637 const pjsip_generic_int_hdr *rhs) 637 638 { 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)); 639 641 pj_memcpy(hdr, rhs, sizeof(*hdr)); 640 642 return hdr; … … 644 646 const pjsip_generic_int_hdr *rhs ) 645 647 { 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)); 647 650 pj_memcpy(hdr, rhs, sizeof(*hdr)); 648 651 return hdr; … … 671 674 const pj_str_t *hnames) 672 675 { 673 pjsip_generic_array_hdr *hdr = mem;676 pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) mem; 674 677 675 678 init_hdr(hdr, PJSIP_H_OTHER, &generic_array_hdr_vptr); … … 715 718 { 716 719 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)); 718 722 719 723 pj_memcpy(hdr, rhs, sizeof(*hdr)); … … 729 733 const pjsip_generic_array_hdr *rhs) 730 734 { 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)); 732 737 pj_memcpy(hdr, rhs, sizeof(*hdr)); 733 738 return hdr; … … 741 746 void *mem ) 742 747 { 743 pjsip_accept_hdr *hdr = mem;748 pjsip_accept_hdr *hdr = (pjsip_accept_hdr *) mem; 744 749 745 750 PJ_UNUSED_ARG(pool); … … 765 770 void *mem ) 766 771 { 767 pjsip_allow_hdr *hdr = mem;772 pjsip_allow_hdr *hdr = (pjsip_allow_hdr *) mem; 768 773 769 774 PJ_UNUSED_ARG(pool); … … 788 793 void *mem ) 789 794 { 790 pjsip_cid_hdr *hdr = mem;795 pjsip_cid_hdr *hdr = (pjsip_cid_hdr *) mem; 791 796 792 797 PJ_UNUSED_ARG(pool); … … 822 827 void *mem ) 823 828 { 824 pjsip_clen_hdr *hdr = mem;829 pjsip_clen_hdr *hdr = (pjsip_clen_hdr *) mem; 825 830 826 831 PJ_UNUSED_ARG(pool); … … 884 889 void *mem ) 885 890 { 886 pjsip_cseq_hdr *hdr = mem;891 pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr *) mem; 887 892 888 893 PJ_UNUSED_ARG(pool); … … 939 944 const pjsip_cseq_hdr *rhs ) 940 945 { 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)); 942 948 pj_memcpy(hdr, rhs, sizeof(*hdr)); 943 949 return hdr; … … 963 969 void *mem ) 964 970 { 965 pjsip_contact_hdr *hdr = mem;971 pjsip_contact_hdr *hdr = (pjsip_contact_hdr *) mem; 966 972 967 973 PJ_UNUSED_ARG(pool); … … 1055 1061 return hdr; 1056 1062 1057 hdr->uri = pjsip_uri_clone(pool, rhs->uri);1063 hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri); 1058 1064 hdr->q1000 = rhs->q1000; 1059 1065 hdr->expires = rhs->expires; … … 1066 1072 const pjsip_contact_hdr *rhs) 1067 1073 { 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)); 1069 1076 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1070 1077 pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); … … 1092 1099 void *mem ) 1093 1100 { 1094 pjsip_ctype_hdr *hdr = mem;1101 pjsip_ctype_hdr *hdr = (pjsip_ctype_hdr *) mem; 1095 1102 1096 1103 PJ_UNUSED_ARG(pool); … … 1169 1176 int value) 1170 1177 { 1171 pjsip_expires_hdr *hdr = mem;1178 pjsip_expires_hdr *hdr = (pjsip_expires_hdr *) mem; 1172 1179 1173 1180 PJ_UNUSED_ARG(pool); … … 1208 1215 void *mem ) 1209 1216 { 1210 pjsip_from_hdr *hdr = mem;1217 pjsip_from_hdr *hdr = (pjsip_from_hdr *) mem; 1211 1218 1212 1219 PJ_UNUSED_ARG(pool); … … 1227 1234 void *mem ) 1228 1235 { 1229 pjsip_to_hdr *hdr = mem;1236 pjsip_to_hdr *hdr = (pjsip_to_hdr *) mem; 1230 1237 1231 1238 PJ_UNUSED_ARG(pool); … … 1296 1303 hdr->name = rhs->name; 1297 1304 hdr->sname = rhs->sname; 1298 hdr->uri = pjsip_uri_clone(pool, rhs->uri);1305 hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri); 1299 1306 pj_strdup( pool, &hdr->tag, &rhs->tag); 1300 1307 pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param); … … 1307 1314 const pjsip_fromto_hdr *rhs) 1308 1315 { 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)); 1310 1318 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1311 1319 pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); … … 1322 1330 int value) 1323 1331 { 1324 pjsip_max_fwd_hdr *hdr = mem;1332 pjsip_max_fwd_hdr *hdr = (pjsip_max_fwd_hdr *) mem; 1325 1333 1326 1334 PJ_UNUSED_ARG(pool); … … 1348 1356 int value ) 1349 1357 { 1350 pjsip_min_expires_hdr *hdr = mem;1358 pjsip_min_expires_hdr *hdr = (pjsip_min_expires_hdr *) mem; 1351 1359 1352 1360 PJ_UNUSED_ARG(pool); … … 1382 1390 void *mem ) 1383 1391 { 1384 pjsip_rr_hdr *hdr = mem;1392 pjsip_rr_hdr *hdr = (pjsip_rr_hdr *) mem; 1385 1393 1386 1394 PJ_UNUSED_ARG(pool); … … 1402 1410 void *mem ) 1403 1411 { 1404 pjsip_route_hdr *hdr = mem;1412 pjsip_route_hdr *hdr = (pjsip_route_hdr *) mem; 1405 1413 1406 1414 PJ_UNUSED_ARG(pool); … … 1462 1470 const pjsip_routing_hdr *rhs ) 1463 1471 { 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)); 1465 1474 1466 1475 init_hdr(hdr, rhs->type, rhs->vptr); … … 1474 1483 const pjsip_routing_hdr *rhs ) 1475 1484 { 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)); 1477 1487 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1478 1488 pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); … … 1488 1498 void *mem ) 1489 1499 { 1490 pjsip_require_hdr *hdr = mem;1500 pjsip_require_hdr *hdr = (pjsip_require_hdr *) mem; 1491 1501 1492 1502 PJ_UNUSED_ARG(pool); … … 1511 1521 int value ) 1512 1522 { 1513 pjsip_retry_after_hdr *hdr = mem;1523 pjsip_retry_after_hdr *hdr = (pjsip_retry_after_hdr *) mem; 1514 1524 1515 1525 PJ_UNUSED_ARG(pool); … … 1535 1545 void *mem ) 1536 1546 { 1537 pjsip_supported_hdr *hdr = mem;1547 pjsip_supported_hdr *hdr = (pjsip_supported_hdr *) mem; 1538 1548 1539 1549 PJ_UNUSED_ARG(pool); … … 1557 1567 void *mem ) 1558 1568 { 1559 pjsip_unsupported_hdr *hdr = mem;1569 pjsip_unsupported_hdr *hdr = (pjsip_unsupported_hdr *) mem; 1560 1570 1561 1571 PJ_UNUSED_ARG(pool); … … 1590 1600 void *mem ) 1591 1601 { 1592 pjsip_via_hdr *hdr = mem;1602 pjsip_via_hdr *hdr = (pjsip_via_hdr *) mem; 1593 1603 1594 1604 PJ_UNUSED_ARG(pool); … … 1697 1707 const pjsip_via_hdr *rhs ) 1698 1708 { 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)); 1700 1710 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1701 1711 pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); … … 1715 1725 pj_str_t hvalue; 1716 1726 1717 hvalue.ptr = pj_pool_alloc(pool, 10 + /* code */ 1727 hvalue.ptr = (char*) 1728 pj_pool_alloc(pool, 10 + /* code */ 1718 1729 host->slen + 2 + /* host */ 1719 1730 text->slen + 2); /* text */ … … 1755 1766 1756 1767 if (len) { 1757 newdata = pj_pool_alloc(pool, len);1768 newdata = (char*) pj_pool_alloc(pool, len); 1758 1769 pj_memcpy(newdata, data, len); 1759 1770 } … … 1797 1808 pj_status_t status; 1798 1809 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)); 1800 1811 PJ_ASSERT_RETURN(new_body, NULL); 1801 1812 … … 1815 1826 PJ_ASSERT_RETURN(pool && type && subtype && text, NULL); 1816 1827 1817 body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));1828 body = (pjsip_msg_body*) pj_pool_zalloc(pool, sizeof(pjsip_msg_body)); 1818 1829 PJ_ASSERT_RETURN(body != NULL, NULL); 1819 1830
Note: See TracChangeset
for help on using the changeset viewer.