- Timestamp:
- May 2, 2007 5:14:29 AM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/build.symbian/pjsip_simple.mmp
r1240 r1241 10 10 MACRO PJ_IMPORTING 11 11 12 //OPTION CW -lang c++12 OPTION CW -lang c++ 13 13 14 14 -
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r974 r1241 52 52 const pjsip_method pjsip_subscribe_method = 53 53 { 54 PJSIP_SUBSCRIBE_METHOD,54 (pjsip_method_e) PJSIP_SUBSCRIBE_METHOD, 55 55 { "SUBSCRIBE", 9 } 56 56 }; … … 58 58 const pjsip_method pjsip_notify_method = 59 59 { 60 PJSIP_NOTIFY_METHOD,60 (pjsip_method_e) PJSIP_NOTIFY_METHOD, 61 61 { "NOTIFY", 6 } 62 62 }; … … 328 328 PJ_DEF(pjsip_evsub*) pjsip_tsx_get_evsub(pjsip_transaction *tsx) 329 329 { 330 return tsx->mod_data[mod_evsub.mod.id];330 return (pjsip_evsub*) tsx->mod_data[mod_evsub.mod.id]; 331 331 } 332 332 … … 396 396 /* Create new event package: */ 397 397 398 pkg = pj_pool_alloc(mod_evsub.pool, sizeof(struct evpkg));398 pkg = PJ_POOL_ALLOC_T(mod_evsub.pool, struct evpkg); 399 399 pkg->pkg_mod = pkg_mod; 400 400 pkg->pkg_expires = expires; … … 509 509 set_timer(sub, TIMER_TYPE_NONE, 0); 510 510 511 /* Remo te this session from dialog's list of subscription */512 dlgsub_head = sub->dlg->mod_data[mod_evsub.mod.id];511 /* Remove this session from dialog's list of subscription */ 512 dlgsub_head = (struct dlgsub *) sub->dlg->mod_data[mod_evsub.mod.id]; 513 513 dlgsub = dlgsub_head->next; 514 514 while (dlgsub != dlgsub_head) { … … 573 573 PJ_UNUSED_ARG(timer_heap); 574 574 575 sub = entry->user_data;575 sub = (pjsip_evsub*) entry->user_data; 576 576 577 577 pjsip_dlg_inc_lock(sub->dlg); … … 674 674 /* Init attributes: */ 675 675 676 sub = pj_pool_zalloc(dlg->pool, sizeof(struct pjsip_evsub));676 sub = PJ_POOL_ZALLOC_T(dlg->pool, struct pjsip_evsub); 677 677 sub->pool = dlg->pool; 678 678 sub->endpt = dlg->endpt; … … 685 685 sub->state_str = evsub_state_names[sub->state]; 686 686 sub->expires = pjsip_expires_hdr_create(sub->pool, pkg->pkg_expires); 687 sub->accept = pjsip_hdr_clone(sub->pool, pkg->pkg_accept); 687 sub->accept = (pjsip_accept_hdr*) 688 pjsip_hdr_clone(sub->pool, pkg->pkg_accept); 688 689 689 690 sub->timer.user_data = sub; … … 707 708 /* Create subcription list: */ 708 709 709 dlgsub_head = pj_pool_alloc(sub->pool, sizeof(struct dlgsub));710 dlgsub = pj_pool_alloc(sub->pool, sizeof(struct dlgsub));710 dlgsub_head = PJ_POOL_ALLOC_T(sub->pool, struct dlgsub); 711 dlgsub = PJ_POOL_ALLOC_T(sub->pool, struct dlgsub); 711 712 dlgsub->sub = sub; 712 713 … … 829 830 830 831 /* Just duplicate Event header from the request */ 831 sub->event = pjsip_hdr_clone(sub->pool, event_hdr);832 sub->event = (pjsip_event_hdr*) pjsip_hdr_clone(sub->pool, event_hdr); 832 833 833 834 /* Set the method: */ … … 851 852 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); 852 853 if (accept_hdr) 853 sub->accept = pjsip_hdr_clone(sub->pool,accept_hdr);854 sub->accept = (pjsip_accept_hdr*)pjsip_hdr_clone(sub->pool,accept_hdr); 854 855 855 856 /* We can start the session: */ … … 942 943 943 944 /* Add Event header: */ 944 pjsip_msg_add_hdr( tdata->msg, 945 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 945 946 pjsip_hdr_shallow_clone(tdata->pool, sub->event)); 946 947 … … 948 949 if (expires >= 0) 949 950 sub->expires->ivalue = expires; 950 pjsip_msg_add_hdr( tdata->msg, 951 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 951 952 pjsip_hdr_shallow_clone(tdata->pool, sub->expires)); 952 953 953 954 /* Add Accept header: */ 954 pjsip_msg_add_hdr( tdata->msg, 955 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 955 956 pjsip_hdr_shallow_clone(tdata->pool, sub->accept)); 956 957 957 958 958 959 /* Add Allow-Events header: */ 959 pjsip_msg_add_hdr( tdata->msg, 960 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 960 961 pjsip_hdr_shallow_clone(tdata->pool, 961 962 mod_evsub.allow_events_hdr)); … … 1012 1013 1013 1014 /* Add expires header: */ 1014 pjsip_msg_add_hdr( tdata->msg, 1015 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1015 1016 pjsip_hdr_shallow_clone(tdata->pool, sub->expires)); 1016 1017 … … 1019 1020 const pjsip_hdr *hdr = hdr_list->next; 1020 1021 while (hdr != hdr_list) { 1021 pjsip_msg_add_hdr( tdata->msg, 1022 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1022 1023 pjsip_hdr_clone(tdata->pool, hdr)); 1023 1024 hdr = hdr->next; … … 1118 1119 1119 1120 /* Add Event header */ 1120 pjsip_msg_add_hdr(tdata->msg, 1121 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1121 1122 pjsip_hdr_shallow_clone(tdata->pool, sub->event)); 1122 1123 … … 1127 1128 1128 1129 /* Add Allow-Events header */ 1129 pjsip_msg_add_hdr(tdata->msg, 1130 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1130 1131 pjsip_hdr_shallow_clone(tdata->pool, mod_evsub.allow_events_hdr)); 1131 1132 … … 1259 1260 } 1260 1261 1261 event_hdr = pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1262 event_hdr = (pjsip_event_hdr*) 1263 pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1262 1264 if (!event_hdr) { 1263 1265 /* Not subscription related message */ … … 1269 1271 */ 1270 1272 1271 dlgsub_head = dlg->mod_data[mod_evsub.mod.id];1273 dlgsub_head = (struct dlgsub*) dlg->mod_data[mod_evsub.mod.id]; 1272 1274 if (dlgsub_head == NULL) { 1273 dlgsub_head = pj_pool_alloc(dlg->pool, sizeof(struct dlgsub));1275 dlgsub_head = PJ_POOL_ALLOC_T(dlg->pool, struct dlgsub); 1274 1276 pj_list_init(dlgsub_head); 1275 1277 dlg->mod_data[mod_evsub.mod.id] = dlgsub_head; … … 1417 1419 hdr = res_hdr->next; 1418 1420 while (hdr != res_hdr) { 1419 pjsip_msg_add_hdr( tdata->msg, 1421 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1420 1422 pjsip_hdr_clone(tdata->pool, hdr)); 1421 1423 hdr = hdr->next; … … 1550 1552 1551 1553 msg = event->body.tsx_state.src.rdata->msg_info.msg; 1552 expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1554 expires = (pjsip_expires_hdr*) 1555 pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1553 1556 if (expires) { 1554 1557 sub->expires->ivalue = expires->ivalue; … … 1656 1659 1657 1660 /* Get subscription state header. */ 1658 sub_state = pjsip_msg_find_hdr_by_name(msg, &STR_SUB_STATE, NULL); 1661 sub_state = (pjsip_sub_state_hdr*) 1662 pjsip_msg_find_hdr_by_name(msg, &STR_SUB_STATE, NULL); 1659 1663 if (sub_state == NULL) { 1660 1664 … … 1804 1808 * or package default expiration time. 1805 1809 */ 1806 event_hdr = pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1807 expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1810 event_hdr = (pjsip_event_hdr*) 1811 pjsip_msg_find_hdr_by_name(msg, &STR_EVENT, NULL); 1812 expires = (pjsip_expires_hdr*) 1813 pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 1808 1814 if (event_hdr && expires) { 1809 1815 struct evpkg *evpkg; … … 1860 1866 if (status == PJ_SUCCESS) { 1861 1867 /* Add expires header: */ 1862 pjsip_msg_add_hdr( tdata->msg, 1868 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1863 1869 pjsip_hdr_shallow_clone(tdata->pool, 1864 1870 sub->expires)); -
pjproject/trunk/pjsip/src/pjsip-simple/evsub_msg.c
r974 r1241 44 44 PJ_DEF(pjsip_event_hdr*) pjsip_event_hdr_create(pj_pool_t *pool) 45 45 { 46 pjsip_event_hdr *hdr = pj_pool_zalloc(pool, sizeof(*hdr));46 pjsip_event_hdr *hdr = PJ_POOL_ZALLOC_T(pool, pjsip_event_hdr); 47 47 hdr->type = PJSIP_H_OTHER; 48 48 hdr->name.ptr = "Event"; … … 94 94 const pjsip_event_hdr *rhs ) 95 95 { 96 pjsip_event_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));96 pjsip_event_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_event_hdr); 97 97 pj_memcpy(hdr, rhs, sizeof(*hdr)); 98 98 pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); … … 143 143 { 144 144 pj_str_t sub_state = { "Subscription-State", 18 }; 145 pjsip_sub_state_hdr *hdr = pj_pool_zalloc(pool, sizeof(*hdr));145 pjsip_sub_state_hdr *hdr = PJ_POOL_ZALLOC_T(pool, pjsip_sub_state_hdr); 146 146 hdr->type = PJSIP_H_OTHER; 147 147 hdr->name = hdr->sname = sub_state; … … 209 209 const pjsip_sub_state_hdr *rhs) 210 210 { 211 pjsip_sub_state_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));211 pjsip_sub_state_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_sub_state_hdr); 212 212 pj_memcpy(hdr, rhs, sizeof(*hdr)); 213 213 pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); … … 235 235 hdr->id_param = pvalue; 236 236 } else { 237 pjsip_param *param = pj_pool_alloc(ctx->pool, sizeof(pjsip_param));237 pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param); 238 238 param->name = pname; 239 239 param->value = pvalue; … … 272 272 273 273 } else { 274 pjsip_param *param = pj_pool_alloc(ctx->pool, sizeof(pjsip_param));274 pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param); 275 275 param->name = pname; 276 276 param->value = pvalue; -
pjproject/trunk/pjsip/src/pjsip-simple/iscomposing.c
r974 r1241 96 96 if (is_composing && refresh > 1 && refresh < 3601) { 97 97 node = pj_xml_node_new(pool, &STR_REFRESH); 98 node->content.ptr = pj_pool_alloc(pool, 10);98 node->content.ptr = (char*) pj_pool_alloc(pool, 10); 99 99 node->content.slen = pj_utoa(refresh, node->content.ptr); 100 100 pj_xml_add_node(doc, node); … … 114 114 char *buf, pj_size_t size) 115 115 { 116 return pj_xml_print(msg_body->data, buf, size, PJ_TRUE); 116 return pj_xml_print((const pj_xml_node*)msg_body->data, buf, size, 117 PJ_TRUE); 117 118 } 118 119 … … 124 125 { 125 126 PJ_UNUSED_ARG(len); 126 return pj_xml_clone( pool, data);127 return pj_xml_clone( pool, (const pj_xml_node*)data); 127 128 } 128 129 … … 144 145 145 146 146 body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));147 body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); 147 148 body->content_type.type = STR_MIME_TYPE; 148 149 body->content_type.subtype = STR_MIME_SUBTYPE; -
pjproject/trunk/pjsip/src/pjsip-simple/pidf.c
r1146 r1241 89 89 const pj_str_t *value) 90 90 { 91 pj_xml_attr *attr = pj_pool_alloc(pool, sizeof(*attr));91 pj_xml_attr *attr = PJ_POOL_ALLOC_T(pool, pj_xml_attr); 92 92 attr->name = *name; 93 93 pj_strdup(pool, &attr->value, value); … … 111 111 const pj_str_t *id) 112 112 { 113 pjpidf_tuple *t = pj_pool_alloc(pool, sizeof(*t));113 pjpidf_tuple *t = PJ_POOL_ALLOC_T(pool, pjpidf_tuple); 114 114 pjpidf_tuple_construct(pool, t, id); 115 115 pj_xml_add_node(pres, t); … … 130 130 static pj_bool_t find_tuple_by_id(pj_xml_node *node, const void *id) 131 131 { 132 return pj_xml_find_attr(node, &ID, id) != NULL;132 return pj_xml_find_attr(node, &ID, (const pj_str_t*)id) != NULL; 133 133 } 134 134 … … 147 147 const pj_str_t *text) 148 148 { 149 pjpidf_note *note = pj_pool_alloc(pool, sizeof(*note));149 pjpidf_note *note = PJ_POOL_ALLOC_T(pool, pjpidf_note); 150 150 xml_init_node(pool, note, &NOTE, text); 151 151 pj_xml_add_node(pres, note); … … 174 174 attr = xml_create_attr(pool, &ID, id); 175 175 pj_xml_add_attr(t, attr); 176 st = pj_pool_alloc(pool, sizeof(*st));176 st = PJ_POOL_ALLOC_T(pool, pjpidf_status); 177 177 pjpidf_status_construct(pool, st); 178 178 pj_xml_add_node(t, st); … … 215 215 pj_xml_node *node = pj_xml_find_node(t, &CONTACT); 216 216 if (!node) { 217 node = pj_pool_alloc(pool, sizeof(*node));217 node = PJ_POOL_ALLOC_T(pool, pj_xml_node); 218 218 xml_init_node(pool, node, &CONTACT, contact); 219 219 pj_xml_add_node(t, node); … … 230 230 231 231 if (!node) { 232 node = pj_pool_alloc(pool, sizeof(*node));232 node = PJ_POOL_ALLOC_T(pool, pj_xml_node); 233 233 xml_init_node(pool, node, &CONTACT, NULL); 234 234 pj_xml_add_node(t, node); … … 260 260 const pj_str_t *text) 261 261 { 262 pjpidf_note *note = pj_pool_alloc(pool, sizeof(*note));262 pjpidf_note *note = PJ_POOL_ALLOC_T(pool, pjpidf_note); 263 263 xml_init_node(pool, note, &NOTE, text); 264 264 pj_xml_add_node(t, note); … … 288 288 pj_xml_node *node = pj_xml_find_node(t, &TIMESTAMP); 289 289 if (!node) { 290 node = pj_pool_alloc(pool, sizeof(*node));290 node = PJ_POOL_ALLOC_T(pool, pj_xml_node); 291 291 xml_init_node(pool, node, &TIMESTAMP, ts); 292 292 } else { … … 301 301 pj_xml_node *node = pj_xml_find_node(t, &TIMESTAMP); 302 302 if (!node) { 303 node = pj_pool_alloc(pool, sizeof(*node));303 node = PJ_POOL_ALLOC_T(pool, pj_xml_node); 304 304 xml_init_node(pool, node, &TIMESTAMP, ts); 305 305 } else { … … 315 315 316 316 xml_init_node(pool, st, &STATUS, NULL); 317 node = pj_pool_alloc(pool, sizeof(*node));317 node = PJ_POOL_ALLOC_T(pool, pj_xml_node); 318 318 xml_init_node(pool, node, &BASIC, &CLOSED); 319 319 pj_xml_add_node(st, node); … … 336 336 PJ_DEF(pjpidf_pres*) pjpidf_create(pj_pool_t *pool, const pj_str_t *entity) 337 337 { 338 pjpidf_pres *pres = pj_pool_alloc(pool, sizeof(*pres));338 pjpidf_pres *pres = PJ_POOL_ALLOC_T(pool, pjpidf_pres); 339 339 pjpidf_pres_construct(pool, pres, entity); 340 340 return pres; -
pjproject/trunk/pjsip/src/pjsip-simple/presence.c
r974 r1241 198 198 199 199 /* Create presence */ 200 pres = pj_pool_zalloc(dlg->pool, sizeof(pjsip_pres));200 pres = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_pres); 201 201 pres->dlg = dlg; 202 202 pres->sub = sub; … … 245 245 246 246 /* Check that Event header contains "presence" */ 247 event = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL); 247 event = (pjsip_event_hdr*) 248 pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL); 248 249 if (!event) { 249 250 return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_REQUEST); … … 254 255 255 256 /* Check that request contains compatible Accept header. */ 256 accept = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); 257 accept = (pjsip_accept_hdr*) 258 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); 257 259 if (accept) { 258 260 unsigned i; … … 281 283 282 284 /* Check that expires is not too short. */ 283 expires_hdr=pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, NULL); 285 expires_hdr=(pjsip_expires_hdr*) 286 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, NULL); 284 287 if (expires_hdr) { 285 288 if (expires_hdr->ivalue < 5) { … … 305 308 306 309 /* Create server presence subscription */ 307 pres = pj_pool_zalloc(dlg->pool, sizeof(pjsip_pres));310 pres = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_pres); 308 311 pres->dlg = dlg; 309 312 pres->sub = sub; … … 367 370 PJ_ASSERT_RETURN(sub && status, PJ_EINVAL); 368 371 369 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);372 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 370 373 PJ_ASSERT_RETURN(pres!=NULL, PJSIP_SIMPLE_ENOPRESENCE); 371 374 … … 390 393 PJ_ASSERT_RETURN(sub && status, PJ_EINVAL); 391 394 392 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);395 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 393 396 PJ_ASSERT_RETURN(pres!=NULL, PJSIP_SIMPLE_ENOPRESENCE); 394 397 … … 423 426 424 427 /* Get publisher URI */ 425 entity.ptr = pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE);428 entity.ptr = (char*) pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE); 426 429 entity.slen = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, 427 430 pres->dlg->local.info->uri, … … 463 466 464 467 /* Get the presence object. */ 465 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);468 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 466 469 PJ_ASSERT_RETURN(pres != NULL, PJSIP_SIMPLE_ENOPRESENCE); 467 470 … … 509 512 510 513 /* Get the presence object. */ 511 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);514 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 512 515 PJ_ASSERT_RETURN(pres != NULL, PJSIP_SIMPLE_ENOPRESENCE); 513 516 … … 559 562 pjsip_pres *pres; 560 563 561 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);564 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 562 565 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 563 566 … … 574 577 pjsip_pres *pres; 575 578 576 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);579 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 577 580 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 578 581 … … 594 597 pjsip_pres *pres; 595 598 596 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);599 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 597 600 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 598 601 … … 722 725 pj_status_t status; 723 726 724 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);727 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 725 728 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 726 729 … … 774 777 pjsip_pres *pres; 775 778 776 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);779 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 777 780 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 778 781 … … 796 799 pjsip_pres *pres; 797 800 798 pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);801 pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id); 799 802 PJ_ASSERT_ON_FAIL(pres!=NULL, {return;}); 800 803 -
pjproject/trunk/pjsip/src/pjsip-simple/presence_body.c
r974 r1241 43 43 char *buf, pj_size_t size) 44 44 { 45 return pj_xml_print(msg_body->data, buf, size, PJ_TRUE); 45 return pj_xml_print((const pj_xml_node*)msg_body->data, buf, size, 46 PJ_TRUE); 46 47 } 47 48 … … 53 54 { 54 55 PJ_UNUSED_ARG(len); 55 return pj_xml_clone( pool, data);56 return pj_xml_clone( pool, (const pj_xml_node*) data); 56 57 } 57 58 … … 101 102 } 102 103 103 body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));104 body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); 104 105 body->data = pidf; 105 106 body->content_type.type = STR_APPLICATION; … … 140 141 pjxpidf_set_status( xpidf, PJ_FALSE); 141 142 142 body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));143 body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); 143 144 body->data = xpidf; 144 145 body->content_type.type = STR_APPLICATION; … … 165 166 166 167 pidf = pjpidf_parse(rdata->tp_info.pool, 167 rdata->msg_info.msg->body->data,168 (char*)rdata->msg_info.msg->body->data, 168 169 rdata->msg_info.msg->body->len); 169 170 if (pidf == NULL) … … 210 211 211 212 xpidf = pjxpidf_parse(rdata->tp_info.pool, 212 rdata->msg_info.msg->body->data,213 (char*)rdata->msg_info.msg->body->data, 213 214 rdata->msg_info.msg->body->len); 214 215 if (xpidf == NULL) -
pjproject/trunk/pjsip/src/pjsip-simple/publishc.c
r974 r1241 51 51 const pjsip_method pjsip_publish_method = 52 52 { 53 PJSIP_PUBLISH_METHOD,53 (pjsip_method_e)PJSIP_PUBLISH_METHOD, 54 54 { "PUBLISH", 7 } 55 55 }; … … 123 123 PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); 124 124 125 pubc = pj_pool_zalloc(pool, sizeof(struct pjsip_publishc));125 pubc = PJ_POOL_ZALLOC_T(pool, pjsip_publishc); 126 126 127 127 pubc->pool = pool; … … 292 292 const pjsip_route_hdr *route; 293 293 294 route_pos = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 294 route_pos = (pjsip_hdr*) 295 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 295 296 if (!route_pos) 296 297 route_pos = &tdata->msg->hdr; … … 298 299 route = pubc->route_set.next; 299 300 while (route != &pubc->route_set) { 300 pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, route); 301 pjsip_hdr *new_hdr = (pjsip_hdr*) 302 pjsip_hdr_shallow_clone(tdata->pool, route); 301 303 pj_list_insert_after(route_pos, new_hdr); 302 304 route_pos = new_hdr; … … 346 348 pjsip_hdr *dup; 347 349 348 dup = pjsip_hdr_shallow_clone(tdata->pool, pubc->expires_hdr); 350 dup = (pjsip_hdr*) 351 pjsip_hdr_shallow_clone(tdata->pool, pubc->expires_hdr); 349 352 if (dup) 350 353 pjsip_msg_add_hdr(tdata->msg, dup); … … 425 428 struct pj_timer_entry *entry) 426 429 { 427 pjsip_publishc *pubc = entry->user_data;430 pjsip_publishc *pubc = (pjsip_publishc*) entry->user_data; 428 431 pjsip_tx_data *tdata; 429 432 pj_status_t status; … … 447 450 { 448 451 pj_status_t status; 449 pjsip_publishc *pubc = token;452 pjsip_publishc *pubc = (pjsip_publishc*) token; 450 453 pjsip_transaction *tsx = event->body.tsx_state.tsx; 451 454 … … 508 511 509 512 /* Update expires value */ 510 expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 513 expires = (pjsip_expires_hdr*) 514 pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 511 515 512 516 if (expires) … … 575 579 /* Increment CSeq */ 576 580 cseq = ++pubc->cseq_hdr->cseq; 577 cseq_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL); 581 cseq_hdr = (pjsip_cseq_hdr*) 582 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL); 578 583 cseq_hdr->cseq = cseq; 579 584 -
pjproject/trunk/pjsip/src/pjsip-simple/xpidf.c
r974 r1241 41 41 pj_xml_node *node; 42 42 43 node = pj_pool_alloc(pool, sizeof(pj_xml_node));43 node = PJ_POOL_ALLOC_T(pool, pj_xml_node); 44 44 pj_list_init(&node->attr_head); 45 45 pj_list_init(&node->node_head); … … 54 54 const pj_str_t *value) 55 55 { 56 pj_xml_attr *attr = pj_pool_alloc(pool, sizeof(*attr));56 pj_xml_attr *attr = PJ_POOL_ALLOC_T(pool, pj_xml_attr); 57 57 attr->name = *name; 58 58 pj_strdup(pool, &attr->value, value); … … 80 80 81 81 /* uri attribute */ 82 uri.ptr = pj_pool_alloc(pool, uri_cstr->slen + STR_SUBSCRIBE_PARAM.slen); 82 uri.ptr = (char*) pj_pool_alloc(pool, uri_cstr->slen + 83 STR_SUBSCRIBE_PARAM.slen); 83 84 pj_strcpy( &uri, uri_cstr); 84 85 pj_strcat( &uri, &STR_SUBSCRIBE_PARAM); -
pjproject/trunk/pjsip/src/pjsip/sip_tel_uri.c
r974 r1241 76 76 pj_bool_t parse_params); 77 77 78 #ifdef __GNUC__ 79 # define HAPPY_FLAG (void*) 80 #else 81 # define HAPPY_FLAG 82 #endif 78 typedef const pj_str_t* (*P_GET_SCHEME)(const void*); 79 typedef void* (*P_GET_URI)(void*); 80 typedef pj_ssize_t (*P_PRINT_URI)(pjsip_uri_context_e,const void *, 81 char*,unsigned); 82 typedef int (*P_CMP_URI)(pjsip_uri_context_e, const void*, 83 const void*); 84 typedef void* (*P_CLONE)(pj_pool_t*, const void*); 83 85 84 86 static pjsip_uri_vptr tel_uri_vptr = 85 87 { 86 HAPPY_FLAG&tel_uri_get_scheme,87 HAPPY_FLAG&tel_uri_get_uri,88 HAPPY_FLAG&tel_uri_print,89 HAPPY_FLAG&tel_uri_cmp,90 HAPPY_FLAG&tel_uri_clone88 (P_GET_SCHEME) &tel_uri_get_scheme, 89 (P_GET_URI) &tel_uri_get_uri, 90 (P_PRINT_URI) &tel_uri_print, 91 (P_CMP_URI) &tel_uri_cmp, 92 (P_CLONE) &tel_uri_clone 91 93 }; 92 94 … … 94 96 PJ_DEF(pjsip_tel_uri*) pjsip_tel_uri_create(pj_pool_t *pool) 95 97 { 96 pjsip_tel_uri *uri = pj_pool_zalloc(pool, sizeof(pjsip_tel_uri));98 pjsip_tel_uri *uri = PJ_POOL_ZALLOC_T(pool, pjsip_tel_uri); 97 99 uri->vptr = &tel_uri_vptr; 98 100 pj_list_init(&uri->other_param); … … 427 429 uri->context = pvalue; 428 430 } else { 429 pjsip_param *param = pj_pool_alloc(pool, sizeof(pjsip_param));431 pjsip_param *param = PJ_POOL_ALLOC_T(pool, pjsip_param); 430 432 param->name = pname; 431 433 param->value = pvalue; -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r1210 r1241 289 289 9 + /* Via port. */ 290 290 16; /* Separator+Allowance. */ 291 key = p = pj_pool_alloc(pool, len_required);291 key = p = (char*) pj_pool_alloc(pool, len_required); 292 292 end = p + len_required; 293 293 … … 356 356 PJ_ASSERT_RETURN(pool && key && method && branch, PJ_EINVAL); 357 357 358 p = key->ptr = pj_pool_alloc(pool, branch->slen + method->name.slen + 4 ); 358 p = key->ptr = (char*) 359 pj_pool_alloc(pool, branch->slen + method->name.slen + 4 ); 359 360 360 361 /* Add role. */ … … 594 595 595 596 pj_mutex_lock(mod_tsx_layer.mutex); 596 tsx = pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, &hval ); 597 tsx = (pjsip_transaction*) 598 pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, &hval ); 597 599 pj_mutex_unlock(mod_tsx_layer.mutex); 598 600 … … 645 647 it = pj_hash_first(mod_tsx_layer.htable, &it_buf); 646 648 while (it) { 647 pjsip_transaction *tsx = pj_hash_this(mod_tsx_layer.htable, it); 649 pjsip_transaction *tsx = (pjsip_transaction*) 650 pj_hash_this(mod_tsx_layer.htable, it); 648 651 pj_hash_iterator_t *next = pj_hash_next(mod_tsx_layer.htable, it); 649 652 if (tsx) { … … 706 709 pj_mutex_lock( mod_tsx_layer.mutex ); 707 710 708 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 711 tsx = (pjsip_transaction*) 712 pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 709 713 710 714 … … 754 758 pj_mutex_lock( mod_tsx_layer.mutex ); 755 759 756 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 760 tsx = (pjsip_transaction*) 761 pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 757 762 758 763 … … 792 797 PJ_DEF(pjsip_transaction*) pjsip_rdata_get_tsx( pjsip_rx_data *rdata ) 793 798 { 794 return rdata->endpt_info.mod_data[mod_tsx_layer.mod.id]; 799 return (pjsip_transaction*) 800 rdata->endpt_info.mod_data[mod_tsx_layer.mod.id]; 795 801 } 796 802 … … 817 823 } else { 818 824 while (it != NULL) { 819 pjsip_transaction *tsx = pj_hash_this(mod_tsx_layer.htable,it); 825 pjsip_transaction *tsx = (pjsip_transaction*) 826 pj_hash_this(mod_tsx_layer.htable,it); 820 827 821 828 PJ_LOG(3, (THIS_FILE, " %s %s|%d|%s", … … 895 902 return PJ_ENOMEM; 896 903 897 tsx = pj_pool_zalloc(pool, sizeof(pjsip_transaction));904 tsx = PJ_POOL_ZALLOC_T(pool, pjsip_transaction); 898 905 tsx->pool = pool; 899 906 tsx->tsx_user = tsx_user; … … 966 973 967 974 /* Clear TLS, so that mutex will not be unlocked */ 968 lck = pj_thread_local_get(pjsip_tsx_lock_tls_id);975 lck = (struct tsx_lock_data*) pj_thread_local_get(pjsip_tsx_lock_tls_id); 969 976 while (lck) { 970 977 if (lck->tsx == tsx) { … … 990 997 { 991 998 pjsip_event event; 992 pjsip_transaction *tsx = entry->user_data;999 pjsip_transaction *tsx = (pjsip_transaction*) entry->user_data; 993 1000 struct tsx_lock_data lck; 994 1001 … … 1043 1050 */ 1044 1051 if (event_src_type==PJSIP_EVENT_RX_MSG && tsx->tsx_user) { 1045 pjsip_rx_data *rdata = event_src;1052 pjsip_rx_data *rdata = (pjsip_rx_data*) event_src; 1046 1053 1047 1054 pj_assert(rdata != NULL); … … 1124 1131 1125 1132 /* Make sure CSeq header is present. */ 1126 cseq = pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);1133 cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL); 1127 1134 if (!cseq) { 1128 1135 pj_assert(!"CSeq header not present in outgoing message!"); … … 1150 1157 1151 1158 /* Generate Via header if it doesn't exist. */ 1152 via = pjsip_msg_find_hdr(msg, PJSIP_H_VIA, NULL);1159 via = (pjsip_via_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_VIA, NULL); 1153 1160 if (via == NULL) { 1154 1161 via = pjsip_via_hdr_create(tdata->pool); … … 1159 1166 if (via->branch_param.slen == 0) { 1160 1167 pj_str_t tmp; 1161 via->branch_param.ptr = pj_pool_alloc(tsx->pool, PJSIP_MAX_BRANCH_LEN); 1168 via->branch_param.ptr = (char*) 1169 pj_pool_alloc(tsx->pool, PJSIP_MAX_BRANCH_LEN); 1162 1170 via->branch_param.slen = PJSIP_MAX_BRANCH_LEN; 1163 1171 pj_memcpy(via->branch_param.ptr, PJSIP_RFC3261_BRANCH_ID, … … 1510 1518 pj_ssize_t sent, pj_bool_t *cont ) 1511 1519 { 1512 pjsip_transaction *tsx = send_state->token;1520 pjsip_transaction *tsx = (pjsip_transaction*) send_state->token; 1513 1521 struct tsx_lock_data lck; 1514 1522 … … 1630 1638 { 1631 1639 if (sent < 0) { 1632 pjsip_transaction *tsx = token;1640 pjsip_transaction *tsx = (pjsip_transaction*) token; 1633 1641 struct tsx_lock_data lck; 1634 1642 char errmsg[PJ_ERR_MSG_SIZE]; … … 2274 2282 */ 2275 2283 if (!tsx->is_reliable) { 2276 pjsip_cseq_hdr *cseq = pjsip_msg_find_hdr( msg, PJSIP_H_CSEQ, 2284 pjsip_cseq_hdr *cseq = (pjsip_cseq_hdr*) 2285 pjsip_msg_find_hdr( msg, PJSIP_H_CSEQ, 2277 2286 NULL); 2278 2287 if (cseq->method.id == PJSIP_INVITE_METHOD) { -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r1080 r1241 315 315 return PJ_ENOMEM; 316 316 317 tdata = pj_pool_zalloc(pool, sizeof(pjsip_tx_data));317 tdata = PJ_POOL_ZALLOC_T(pool, pjsip_tx_data); 318 318 tdata->pool = pool; 319 319 tdata->mgr = mgr; … … 397 397 int len; 398 398 399 cseq = pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);399 cseq = (const pjsip_cseq_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL); 400 400 PJ_ASSERT_RETURN(cseq != NULL, "INVALID MSG"); 401 401 … … 419 419 } 420 420 421 info = pj_pool_alloc(pool, len+1);421 info = (char*) pj_pool_alloc(pool, len+1); 422 422 pj_memcpy(info, info_buf, len+1); 423 423 … … 493 493 pj_ssize_t size) 494 494 { 495 pjsip_tx_data *tdata = token;495 pjsip_tx_data *tdata = (pjsip_tx_data*) token; 496 496 497 497 PJ_UNUSED_ARG(transport); … … 518 518 /* Allocate buffer if necessary. */ 519 519 if (tdata->buf.start == NULL) { 520 tdata->buf.start = pj_pool_alloc( tdata->pool, PJSIP_MAX_PKT_LEN); 520 tdata->buf.start = (char*) 521 pj_pool_alloc( tdata->pool, PJSIP_MAX_PKT_LEN); 521 522 tdata->buf.cur = tdata->buf.start; 522 523 tdata->buf.end = tdata->buf.start + PJSIP_MAX_PKT_LEN; … … 613 614 struct pj_timer_entry *entry) 614 615 { 615 pjsip_transport *tp = entry->user_data;616 pjsip_transport *tp = (pjsip_transport*) entry->user_data; 616 617 pj_assert(tp != NULL); 617 618 … … 901 902 902 903 /* Create and initialize transport manager. */ 903 mgr = pj_pool_zalloc(pool, sizeof(*mgr));904 mgr = PJ_POOL_ZALLOC_T(pool, pjsip_tpmgr); 904 905 mgr->endpt = endpt; 905 906 mgr->on_rx_msg = rx_cb; … … 1036 1037 pjsip_transport *transport; 1037 1038 1038 transport = pj_hash_this(mgr->table, itr);1039 transport = (pjsip_transport*) pj_hash_this(mgr->table, itr); 1039 1040 1040 1041 next = pj_hash_next(mgr->table, itr); … … 1344 1345 pj_memcpy(&key.addr, remote, addr_len); 1345 1346 1346 transport = pj_hash_get(mgr->table, &key, key_len, NULL); 1347 transport = (pjsip_transport*) 1348 pj_hash_get(mgr->table, &key, key_len, NULL); 1347 1349 if (transport == NULL) { 1348 1350 unsigned flag = pjsip_transport_get_flag_from_type(type); … … 1357 1359 pj_bzero(addr, sizeof(pj_sockaddr_in)); 1358 1360 key_len = sizeof(key.type) + sizeof(pj_sockaddr_in); 1359 transport = pj_hash_get(mgr->table, &key, key_len, NULL); 1361 transport = (pjsip_transport*) 1362 pj_hash_get(mgr->table, &key, key_len, NULL); 1360 1363 } 1361 1364 /* For datagram INET transports, try lookup with zero address. … … 1370 1373 1371 1374 key_len = sizeof(key.type) + sizeof(pj_sockaddr_in); 1372 transport = pj_hash_get(mgr->table, &key, key_len, NULL); 1375 transport = (pjsip_transport*) 1376 pj_hash_get(mgr->table, &key, key_len, NULL); 1373 1377 } 1374 1378 } … … 1411 1415 /* Request factory to create transport. */ 1412 1416 status = factory->create_transport(factory, mgr, mgr->endpt, 1413 remote, addr_len, tp); 1417 (const pj_sockaddr*) remote, addr_len, 1418 tp); 1414 1419 if (status == PJ_SUCCESS) { 1415 1420 PJ_ASSERT_ON_FAIL(tp!=NULL, … … 1455 1460 1456 1461 do { 1457 pjsip_transport *t = pj_hash_this(mgr->table, itr); 1462 pjsip_transport *t = (pjsip_transport*) 1463 pj_hash_this(mgr->table, itr); 1458 1464 1459 1465 PJ_LOG(3, (THIS_FILE, " %s %s (refcnt=%d%s)", -
pjproject/trunk/pjsip/src/pjsip/sip_transport_loop.c
r974 r1241 79 79 return NULL; 80 80 81 pkt = pj_pool_zalloc(pool, sizeof(struct recv_list));81 pkt = PJ_POOL_ZALLOC_T(pool, struct recv_list); 82 82 83 83 /* Initialize rdata. */ … … 121 121 pjsip_tx_data_add_ref(tdata); 122 122 pj_lock_acquire(tdata->lock); 123 sent_status = pj_pool_alloc(tdata->pool, sizeof(struct send_list));123 sent_status = PJ_POOL_ALLOC_T(tdata->pool, struct send_list); 124 124 pj_lock_release(tdata->lock); 125 125 … … 254 254 static int loop_transport_worker_thread(void *arg) 255 255 { 256 struct loop_transport *loop = arg;256 struct loop_transport *loop = (struct loop_transport*) arg; 257 257 struct recv_list r; 258 258 struct send_list s; … … 357 357 358 358 /* Create the loop structure. */ 359 loop = pj_pool_zalloc(pool, sizeof(struct loop_transport));359 loop = PJ_POOL_ZALLOC_T(pool, struct loop_transport); 360 360 361 361 /* Initialize transport properties. */ -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r1159 r1241 171 171 { 172 172 enum { M = 48 }; 173 host_port->host.ptr = pj_pool_alloc(pool, M);173 host_port->host.ptr = (char*) pj_pool_alloc(pool, M); 174 174 host_port->host.slen = pj_ansi_snprintf( host_port->host.ptr, M, "%s", 175 175 pj_inet_ntoa(addr->sin_addr)); … … 223 223 224 224 225 listener = pj_pool_zalloc(pool, sizeof(struct tcp_listener));225 listener = PJ_POOL_ZALLOC_T(pool, struct tcp_listener); 226 226 listener->factory.pool = pool; 227 227 listener->factory.type = PJSIP_TRANSPORT_TCP; … … 346 346 } 347 347 348 listener->accept_op[i] = pj_pool_zalloc(pool,349 sizeof(struct pending_accept));348 listener->accept_op[i] = PJ_POOL_ZALLOC_T(pool, 349 struct pending_accept); 350 350 pj_ioqueue_op_key_init(&listener->accept_op[i]->op_key, 351 351 sizeof(listener->accept_op[i]->op_key)); … … 508 508 * Create and initialize basic transport structure. 509 509 */ 510 tcp = pj_pool_zalloc(pool, sizeof(*tcp));510 tcp = PJ_POOL_ZALLOC_T(pool, struct tcp_transport); 511 511 tcp->sock = sock; 512 512 tcp->is_server = is_server; … … 533 533 tcp->base.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TCP); 534 534 535 tcp->base.info = pj_pool_alloc(pool, 64);535 tcp->base.info = (char*) pj_pool_alloc(pool, 64); 536 536 pj_ansi_snprintf(tcp->base.info, 64, "TCP to %s:%d", 537 537 pj_inet_ntoa(remote->sin_addr), … … 890 890 int err_cnt = 0; 891 891 892 listener = pj_ioqueue_get_user_data(key);892 listener = (struct tcp_listener*) pj_ioqueue_get_user_data(key); 893 893 accept_op = (struct pending_accept*) op_key; 894 894 … … 949 949 pool = pjsip_endpt_create_pool(listener->endpt, "tcps%p", 950 950 POOL_TP_INIT, POOL_TP_INC); 951 new_op = pj_pool_zalloc(pool, sizeof(struct pending_accept));951 new_op = PJ_POOL_ZALLOC_T(pool, struct pending_accept); 952 952 new_op->pool = pool; 953 953 new_op->listener = listener; … … 1003 1003 pj_ssize_t bytes_sent) 1004 1004 { 1005 struct tcp_transport *tcp = pj_ioqueue_get_user_data(key); 1005 struct tcp_transport *tcp = (struct tcp_transport*) 1006 pj_ioqueue_get_user_data(key); 1006 1007 pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key; 1007 1008 … … 1082 1083 * the delayed list. 1083 1084 */ 1084 delayed_tdata = pj_pool_alloc(tdata->pool,1085 sizeof(*delayed_tdata));1085 delayed_tdata = PJ_POOL_ALLOC_T(tdata->pool, 1086 struct delayed_tdata); 1086 1087 delayed_tdata->tdata_op_key = &tdata->op_key; 1087 1088 … … 1293 1294 int addrlen; 1294 1295 1295 tcp = pj_ioqueue_get_user_data(key);1296 tcp = (struct tcp_transport*) pj_ioqueue_get_user_data(key); 1296 1297 1297 1298 /* Mark that pending connect() operation has completed. */ -
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r1080 r1241 83 83 //pj_pool_reset(pool); 84 84 85 rdata = pj_pool_zalloc(pool, sizeof(pjsip_rx_data));85 rdata = PJ_POOL_ZALLOC_T(pool, pjsip_rx_data); 86 86 87 87 /* Init tp_info part. */ … … 262 262 pj_ssize_t bytes_sent) 263 263 { 264 struct udp_transport *tp = pj_ioqueue_get_user_data(key); 264 struct udp_transport *tp = (struct udp_transport*) 265 pj_ioqueue_get_user_data(key); 265 266 pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key; 266 267 … … 447 448 448 449 /* Create the UDP transport object. */ 449 tp = pj_pool_zalloc(pool, sizeof(struct udp_transport));450 tp = PJ_POOL_ZALLOC_T(pool, struct udp_transport); 450 451 451 452 /* Save pool. */ … … 497 498 498 499 /* Transport info. */ 499 tp->base.info = pj_pool_alloc(pool, M);500 tp->base.info = (char*) pj_pool_alloc(pool, M); 500 501 pj_ansi_snprintf( 501 502 tp->base.info, M, "udp %s:%d [published as %s:%d]", … … 543 544 /* Create rdata and put it in the array. */ 544 545 tp->rdata_cnt = 0; 545 tp->rdata = pj_pool_calloc(tp->base.pool, async_cnt, 546 tp->rdata = (pjsip_rx_data**) 547 pj_pool_calloc(tp->base.pool, async_cnt, 546 548 sizeof(pjsip_rx_data*)); 547 549 for (i=0; i<async_cnt; ++i) { -
pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
r989 r1241 166 166 167 167 /* Get the dialog where this transaction belongs. */ 168 dlg = tsx->mod_data[mod_ua.mod.id];168 dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id]; 169 169 170 170 /* If dialog instance has gone, it could mean that the dialog … … 245 245 246 246 set_key->slen = call_id->slen + local_tag->slen + 1; 247 set_key->ptr = pj_pool_alloc(pool, set_key->slen);247 set_key->ptr = (char*) pj_pool_alloc(pool, set_key->slen); 248 248 pj_assert(set_key->ptr != NULL); 249 249 … … 268 268 return set; 269 269 } else { 270 set = pj_pool_alloc(mod_ua.pool, sizeof(struct dlg_set));270 set = PJ_POOL_ALLOC_T(mod_ua.pool, struct dlg_set); 271 271 return set; 272 272 } … … 299 299 struct dlg_set *dlg_set; 300 300 301 dlg_set = pj_hash_get( mod_ua.dlg_table, dlg->local.info->tag.ptr, 301 dlg_set = (struct dlg_set*) 302 pj_hash_get( mod_ua.dlg_table, dlg->local.info->tag.ptr, 302 303 dlg->local.info->tag.slen, 303 304 &dlg->local.tag_hval); … … 367 368 368 369 /* Find this dialog from the dialog set. */ 369 dlg_set = dlg->dlg_set;370 dlg_set = (struct dlg_set*) dlg->dlg_set; 370 371 d = dlg_set->dlg_list.next; 371 372 while (d != (pjsip_dialog*)&dlg_set->dlg_list && d != dlg) { … … 401 402 PJ_DEF(pjsip_dialog*) pjsip_rdata_get_dlg( pjsip_rx_data *rdata ) 402 403 { 403 return rdata->endpt_info.mod_data[mod_ua.mod.id];404 return (pjsip_dialog*) rdata->endpt_info.mod_data[mod_ua.mod.id]; 404 405 } 405 406 406 407 PJ_DEF(pjsip_dialog*) pjsip_tsx_get_dlg( pjsip_transaction *tsx ) 407 408 { 408 return tsx->mod_data[mod_ua.mod.id];409 return (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id]; 409 410 } 410 411 … … 427 428 428 429 /* Lookup the dialog set. */ 429 dlg_set = pj_hash_get(mod_ua.dlg_table, local_tag->ptr, local_tag->slen, 430 dlg_set = (struct dlg_set*) 431 pj_hash_get(mod_ua.dlg_table, local_tag->ptr, local_tag->slen, 430 432 NULL); 431 433 if (dlg_set == NULL) { … … 517 519 /* We should find the dialog attached to the INVITE transaction */ 518 520 if (tsx) { 519 dlg = tsx->mod_data[mod_ua.mod.id];521 dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id]; 520 522 pj_mutex_unlock(tsx->mutex); 521 523 … … 523 525 * (e.g. during debugging where initially there is a dialog) 524 526 */ 525 return dlg ? dlg->dlg_set : NULL;527 return dlg ? (struct dlg_set*) dlg->dlg_set : NULL; 526 528 527 529 } else { … … 540 542 541 543 /* Lookup the dialog set. */ 542 dlg_set = pj_hash_get(mod_ua.dlg_table, tag->ptr, tag->slen, NULL); 544 dlg_set = (struct dlg_set*) 545 pj_hash_get(mod_ua.dlg_table, tag->ptr, tag->slen, NULL); 543 546 return dlg_set; 544 547 } … … 705 708 706 709 /* Get the dialog set. */ 707 dlg_set = dlg->dlg_set;710 dlg_set = (struct dlg_set*) dlg->dlg_set; 708 711 709 712 /* Even if transaction is found and (candidate) dialog has been … … 733 736 734 737 /* Get the dialog set. */ 735 dlg_set = pj_hash_get(mod_ua.dlg_table, 738 dlg_set = (struct dlg_set*) 739 pj_hash_get(mod_ua.dlg_table, 736 740 rdata->msg_info.from->tag.ptr, 737 741 rdata->msg_info.from->tag.slen, … … 918 922 const char *title; 919 923 920 dlg_set = pj_hash_this(mod_ua.dlg_table, it);924 dlg_set = (struct dlg_set*) pj_hash_this(mod_ua.dlg_table, it); 921 925 if (!dlg_set || pj_list_empty(&dlg_set->dlg_list)) continue; 922 926 -
pjproject/trunk/pjsip/src/pjsip/sip_uri.c
r1221 r1241 61 61 pj_list_init(dst_list); 62 62 while (p != src_list) { 63 pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param));63 pjsip_param *new_param = PJ_POOL_ALLOC_T(pool, pjsip_param); 64 64 pj_strdup(pool, &new_param->name, &p->name); 65 65 pj_strdup(pool, &new_param->value, &p->value); … … 78 78 pj_list_init(dst_list); 79 79 while (p != src_list) { 80 pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param));80 pjsip_param *new_param = PJ_POOL_ALLOC_T(pool, pjsip_param); 81 81 new_param->name = p->name; 82 82 new_param->value = p->value; … … 137 137 static pj_str_t sip_str = { "sip", 3 }; 138 138 static pj_str_t sips_str = { "sips", 4 }; 139 140 #ifdef __GNUC__141 # define HAPPY_FLAG (void*)142 #else143 # define HAPPY_FLAG144 #endif145 139 146 140 static pjsip_name_addr* pjsip_name_addr_clone( pj_pool_t *pool, … … 161 155 const pjsip_sip_uri *rhs); 162 156 157 typedef const pj_str_t* (*P_GET_SCHEME)(const void*); 158 typedef void* (*P_GET_URI)(void*); 159 typedef pj_ssize_t (*P_PRINT_URI)(pjsip_uri_context_e,const void *, 160 char*,unsigned); 161 typedef int (*P_CMP_URI)(pjsip_uri_context_e, const void*, 162 const void*); 163 typedef void* (*P_CLONE)(pj_pool_t*, const void*); 164 165 163 166 static pjsip_uri_vptr sip_url_vptr = 164 167 { 165 HAPPY_FLAG&pjsip_url_get_scheme,166 HAPPY_FLAG&pjsip_get_uri,167 HAPPY_FLAG&pjsip_url_print,168 HAPPY_FLAG&pjsip_url_compare,169 HAPPY_FLAG&pjsip_url_clone168 (P_GET_SCHEME) &pjsip_url_get_scheme, 169 (P_GET_URI) &pjsip_get_uri, 170 (P_PRINT_URI) &pjsip_url_print, 171 (P_CMP_URI) &pjsip_url_compare, 172 (P_CLONE) &pjsip_url_clone 170 173 }; 171 174 172 175 static pjsip_uri_vptr sips_url_vptr = 173 176 { 174 HAPPY_FLAG&pjsips_url_get_scheme,175 HAPPY_FLAG&pjsip_get_uri,176 HAPPY_FLAG&pjsip_url_print,177 HAPPY_FLAG&pjsip_url_compare,178 HAPPY_FLAG&pjsip_url_clone177 (P_GET_SCHEME) &pjsips_url_get_scheme, 178 (P_GET_URI) &pjsip_get_uri, 179 (P_PRINT_URI) &pjsip_url_print, 180 (P_CMP_URI) &pjsip_url_compare, 181 (P_CLONE) &pjsip_url_clone 179 182 }; 180 183 181 184 static pjsip_uri_vptr name_addr_vptr = 182 185 { 183 HAPPY_FLAG&pjsip_name_addr_get_scheme,184 HAPPY_FLAG&pjsip_name_addr_get_uri,185 HAPPY_FLAG&pjsip_name_addr_print,186 HAPPY_FLAG&pjsip_name_addr_compare,187 HAPPY_FLAG&pjsip_name_addr_clone186 (P_GET_SCHEME) &pjsip_name_addr_get_scheme, 187 (P_GET_URI) &pjsip_name_addr_get_uri, 188 (P_PRINT_URI) &pjsip_name_addr_print, 189 (P_CMP_URI) &pjsip_name_addr_compare, 190 (P_CLONE) &pjsip_name_addr_clone 188 191 }; 189 192 … … 228 231 pj_bool_t secure ) 229 232 { 230 pjsip_sip_uri *url = pj_pool_alloc(pool, sizeof(pjsip_sip_uri));233 pjsip_sip_uri *url = PJ_POOL_ALLOC_T(pool, pjsip_sip_uri); 231 234 pjsip_sip_uri_init(url, secure); 232 235 return url; … … 497 500 static pjsip_sip_uri* pjsip_url_clone(pj_pool_t *pool, const pjsip_sip_uri *rhs) 498 501 { 499 pjsip_sip_uri *url = pj_pool_alloc(pool, sizeof(pjsip_sip_uri));502 pjsip_sip_uri *url = PJ_POOL_ALLOC_T(pool, pjsip_sip_uri); 500 503 if (!url) 501 504 return NULL; … … 521 524 PJ_DEF(pjsip_name_addr*) pjsip_name_addr_create(pj_pool_t *pool) 522 525 { 523 pjsip_name_addr *name_addr = pj_pool_alloc(pool, sizeof(pjsip_name_addr));526 pjsip_name_addr *name_addr = PJ_POOL_ALLOC_T(pool, pjsip_name_addr); 524 527 pjsip_name_addr_init(name_addr); 525 528 return name_addr; … … 535 538 pjsip_uri *uri; 536 539 537 uri = pjsip_uri_get_uri(name->uri);540 uri = (pjsip_uri*) pjsip_uri_get_uri(name->uri); 538 541 pj_assert(uri != NULL); 539 542 … … 566 569 { 567 570 pj_strdup( pool, &dst->display, &src->display); 568 dst->uri = pjsip_uri_clone(pool, src->uri);571 dst->uri = (pjsip_uri*) pjsip_uri_clone(pool, src->uri); 569 572 } 570 573 … … 572 575 const pjsip_name_addr *rhs) 573 576 { 574 pjsip_name_addr *addr = pj_pool_alloc(pool, sizeof(pjsip_name_addr));577 pjsip_name_addr *addr = PJ_POOL_ALLOC_T(pool, pjsip_name_addr); 575 578 if (!addr) 576 579 return NULL; -
pjproject/trunk/pjsip/src/pjsip/sip_util.c
r1127 r1241 85 85 endpt_hdr = pjsip_endpt_get_request_headers(endpt)->next; 86 86 while (endpt_hdr != pjsip_endpt_get_request_headers(endpt)) { 87 pjsip_hdr *hdr = pjsip_hdr_shallow_clone(tdata->pool, endpt_hdr); 87 pjsip_hdr *hdr = (pjsip_hdr*) 88 pjsip_hdr_shallow_clone(tdata->pool, endpt_hdr); 88 89 pjsip_msg_add_hdr( tdata->msg, hdr ); 89 90 endpt_hdr = endpt_hdr->next; … … 93 94 if (param_from->tag.slen == 0) 94 95 pj_create_unique_string(tdata->pool, ¶m_from->tag); 95 pjsip_msg_add_hdr(msg, ( void*)param_from);96 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_from); 96 97 97 98 /* Add To header. */ 98 pjsip_msg_add_hdr(msg, ( void*)param_to);99 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_to); 99 100 100 101 /* Add Contact header. */ 101 102 if (param_contact) { 102 pjsip_msg_add_hdr(msg, ( void*)param_contact);103 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_contact); 103 104 } 104 105 105 106 /* Add Call-ID header. */ 106 pjsip_msg_add_hdr(msg, ( void*)param_call_id);107 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_call_id); 107 108 108 109 /* Add CSeq header. */ 109 pjsip_msg_add_hdr(msg, ( void*)param_cseq);110 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_cseq); 110 111 111 112 /* Add a blank Via header in the front of the message. */ 112 113 via = pjsip_via_hdr_create(tdata->pool); 113 114 via->rport_param = 0; 114 pjsip_msg_insert_first_hdr(msg, ( void*)via);115 pjsip_msg_insert_first_hdr(msg, (pjsip_hdr*)via); 115 116 116 117 /* Add header params as request headers */ … … 135 136 /* Create message body. */ 136 137 if (param_text) { 137 body = pj_pool_calloc(tdata->pool, 1, sizeof(pjsip_msg_body));138 body = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_msg_body); 138 139 body->content_type.type = str_TEXT; 139 140 body->content_type.subtype = str_PLAIN; … … 297 298 PJ_TRY { 298 299 /* Duplicate target URI and headers. */ 299 target = pjsip_uri_clone(tdata->pool, param_target);300 from = pjsip_hdr_clone(tdata->pool, param_from);300 target = (pjsip_uri*) pjsip_uri_clone(tdata->pool, param_target); 301 from = (pjsip_from_hdr*) pjsip_hdr_clone(tdata->pool, param_from); 301 302 pjsip_fromto_hdr_set_from(from); 302 to = pjsip_hdr_clone(tdata->pool, param_to);303 to = (pjsip_to_hdr*) pjsip_hdr_clone(tdata->pool, param_to); 303 304 pjsip_fromto_hdr_set_to(to); 304 if (param_contact) 305 contact = pjsip_hdr_clone(tdata->pool, param_contact); 306 else 305 if (param_contact) { 306 contact = (pjsip_contact_hdr*) 307 pjsip_hdr_clone(tdata->pool, param_contact); 308 } else { 307 309 contact = NULL; 308 call_id = pjsip_hdr_clone(tdata->pool, param_call_id); 310 } 311 call_id = (pjsip_cid_hdr*) pjsip_hdr_clone(tdata->pool, param_call_id); 309 312 cseq = pjsip_cseq_hdr_create(tdata->pool); 310 313 if (param_cseq >= 0) … … 386 389 via = rdata->msg_info.via; 387 390 while (via) { 388 pjsip_msg_add_hdr( msg, pjsip_hdr_clone(tdata->pool, via));391 pjsip_msg_add_hdr( msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, via)); 389 392 via = via->next; 390 393 if (via != (void*)&req_msg->hdr) 391 via = pjsip_msg_find_hdr(req_msg, PJSIP_H_VIA, via); 394 via = (pjsip_via_hdr*) 395 pjsip_msg_find_hdr(req_msg, PJSIP_H_VIA, via); 392 396 else 393 397 break; … … 395 399 396 400 /* Copy all Record-Route headers, in order. */ 397 rr = pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, NULL); 401 rr = (pjsip_rr_hdr*) 402 pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, NULL); 398 403 while (rr) { 399 pjsip_msg_add_hdr(msg, pjsip_hdr_clone(tdata->pool, rr));404 pjsip_msg_add_hdr(msg, (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rr)); 400 405 rr = rr->next; 401 406 if (rr != (void*)&req_msg->hdr) 402 rr = pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, rr); 407 rr = (pjsip_rr_hdr*) pjsip_msg_find_hdr(req_msg, 408 PJSIP_H_RECORD_ROUTE, rr); 403 409 else 404 410 break; … … 406 412 407 413 /* Copy Call-ID header. */ 408 hdr = pjsip_msg_find_hdr( req_msg, PJSIP_H_CALL_ID, NULL);409 pjsip_msg_add_hdr(msg, pjsip_hdr_clone(tdata->pool, hdr));414 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( req_msg, PJSIP_H_CALL_ID, NULL); 415 pjsip_msg_add_hdr(msg, (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr)); 410 416 411 417 /* Copy From header. */ 412 hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.from);418 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.from); 413 419 pjsip_msg_add_hdr( msg, hdr); 414 420 415 421 /* Copy To header. */ 416 hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.to);422 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.to); 417 423 pjsip_msg_add_hdr( msg, hdr); 418 424 419 425 /* Copy CSeq header. */ 420 hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.cseq);426 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.cseq); 421 427 pjsip_msg_add_hdr( msg, hdr); 422 428 … … 495 501 496 502 /* Clear Via headers in the new request. */ 497 while ((via= pjsip_msg_find_hdr(ack->msg, PJSIP_H_VIA, NULL)) != NULL)503 while ((via=(pjsip_hdr*)pjsip_msg_find_hdr(ack->msg, PJSIP_H_VIA, NULL)) != NULL) 498 504 pj_list_erase(via); 499 505 500 506 /* Must contain single Via, just as the original INVITE. */ 501 hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_VIA, NULL); 502 pjsip_msg_insert_first_hdr( ack->msg, pjsip_hdr_clone(ack->pool,hdr) ); 507 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_VIA, NULL); 508 pjsip_msg_insert_first_hdr( ack->msg, 509 (pjsip_hdr*) pjsip_hdr_clone(ack->pool,hdr) ); 503 510 504 511 /* If the original INVITE has Route headers, those header fields MUST 505 512 * appear in the ACK. 506 513 */ 507 hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, NULL);514 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, NULL); 508 515 while (hdr != NULL) { 509 pjsip_msg_add_hdr( ack->msg, pjsip_hdr_clone(ack->pool, hdr) ); 516 pjsip_msg_add_hdr( ack->msg, 517 (pjsip_hdr*) pjsip_hdr_clone(ack->pool, hdr) ); 510 518 hdr = hdr->next; 511 519 if (hdr == &invite_msg->hdr) 512 520 break; 513 hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, hdr);521 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, hdr); 514 522 } 515 523 … … 579 587 580 588 /* Clear Via headers in the new request. */ 581 while ((via= pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_VIA, NULL)) != NULL)589 while ((via=(pjsip_hdr*)pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_VIA, NULL)) != NULL) 582 590 pj_list_erase(via); 583 591 … … 586 594 * request being cancelled. 587 595 */ 588 hdr = pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_VIA, NULL);596 hdr = (pjsip_hdr*) pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_VIA, NULL); 589 597 if (hdr) { 590 598 pjsip_msg_insert_first_hdr(cancel_tdata->msg, 591 pjsip_hdr_clone(cancel_tdata->pool, hdr));599 (pjsip_hdr*)pjsip_hdr_clone(cancel_tdata->pool, hdr)); 592 600 } 593 601 … … 596 604 * Copy "Route" header from the request. 597 605 */ 598 hdr = pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_ROUTE, NULL);606 hdr = (pjsip_hdr*) pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_ROUTE, NULL); 599 607 while (hdr != NULL) { 600 608 pjsip_msg_add_hdr(cancel_tdata->msg, 601 pjsip_hdr_clone(cancel_tdata->pool, hdr));609 (pjsip_hdr*) pjsip_hdr_clone(cancel_tdata->pool, hdr)); 602 610 hdr = hdr->next; 603 611 if (hdr != &req_tdata->msg->hdr) 604 hdr = pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_ROUTE, hdr); 612 hdr = (pjsip_hdr*) pjsip_msg_find_hdr(req_tdata->msg, 613 PJSIP_H_ROUTE, hdr); 605 614 else 606 615 break; … … 638 647 /* Get the first "Route" header from the message. 639 648 */ 640 first_route_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, NULL); 649 first_route_hdr = (const pjsip_route_hdr*) 650 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, NULL); 641 651 if (first_route_hdr) { 642 652 target_uri = first_route_hdr->name_addr.uri; … … 698 708 699 709 /* Find the first and last "Route" headers from the message. */ 700 last_route_hdr = first_route_hdr = 710 last_route_hdr = first_route_hdr = (pjsip_route_hdr*) 701 711 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, NULL); 702 712 if (first_route_hdr) { … … 704 714 while (last_route_hdr->next != (void*)&tdata->msg->hdr) { 705 715 pjsip_route_hdr *hdr; 706 hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, 716 hdr = (pjsip_route_hdr*) 717 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, 707 718 last_route_hdr->next); 708 719 if (!hdr) … … 729 740 PJSIP_URI_SCHEME_IS_SIPS(topmost_route_uri)) 730 741 { 731 const pjsip_sip_uri *url = 742 const pjsip_sip_uri *url = (const pjsip_sip_uri*) 732 743 pjsip_uri_get_uri((void*)topmost_route_uri); 733 744 has_lr_param = url->lr_param; … … 748 759 */ 749 760 } else { 750 new_request_uri = pjsip_uri_get_uri((void*)topmost_route_uri); 761 new_request_uri = (const pjsip_uri*) 762 pjsip_uri_get_uri((pjsip_uri*)topmost_route_uri); 751 763 pj_list_erase(first_route_hdr); 752 764 if (first_route_hdr == last_route_hdr) … … 794 806 if (new_request_uri && new_request_uri!=tdata->msg->line.req.uri) { 795 807 pjsip_route_hdr *route = pjsip_route_hdr_create(tdata->pool); 796 route->name_addr.uri = pjsip_uri_get_uri(tdata->msg->line.req.uri); 808 route->name_addr.uri = (pjsip_uri*) 809 pjsip_uri_get_uri(tdata->msg->line.req.uri); 797 810 if (last_route_hdr) 798 811 pj_list_insert_after(last_route_hdr, route); … … 815 828 pj_ssize_t sent ) 816 829 { 817 pjsip_send_state *stateless_data = token;830 pjsip_send_state *stateless_data = (pjsip_send_state*) token; 818 831 819 832 PJ_UNUSED_ARG(tdata); … … 916 929 if (via->branch_param.slen == 0) { 917 930 pj_str_t tmp; 918 via->branch_param.ptr = pj_pool_alloc(tdata->pool,919 PJSIP_MAX_BRANCH_LEN);931 via->branch_param.ptr = (char*)pj_pool_alloc(tdata->pool, 932 PJSIP_MAX_BRANCH_LEN); 920 933 via->branch_param.slen = PJSIP_MAX_BRANCH_LEN; 921 934 pj_memcpy(via->branch_param.ptr, PJSIP_RFC3261_BRANCH_ID, … … 961 974 const struct pjsip_server_addresses *addr) 962 975 { 963 pjsip_send_state *stateless_data = token;976 pjsip_send_state *stateless_data = (pjsip_send_state*) token; 964 977 965 978 /* Fail on server resolution. */ … … 1009 1022 1010 1023 /* Keep stateless data. */ 1011 stateless_data = pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state));1024 stateless_data = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_send_state); 1012 1025 stateless_data->token = token; 1013 1026 stateless_data->endpt = endpt; … … 1136 1149 pj_ssize_t sent) 1137 1150 { 1138 pjsip_send_state *send_state = token;1151 pjsip_send_state *send_state = (pjsip_send_state*) token; 1139 1152 pj_bool_t cont = PJ_FALSE; 1140 1153 … … 1156 1169 const pjsip_server_addresses *addr ) 1157 1170 { 1158 pjsip_send_state *send_state = token;1171 pjsip_send_state *send_state = (pjsip_send_state*) token; 1159 1172 1160 1173 if (status != PJ_SUCCESS) { … … 1225 1238 1226 1239 /* Create structure to keep the sending state. */ 1227 send_state = pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state));1240 send_state = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_send_state); 1228 1241 send_state->endpt = endpt; 1229 1242 send_state->tdata = tdata; … … 1318 1331 const pjsip_hdr *hdr = hdr_list->next; 1319 1332 while (hdr != hdr_list) { 1320 pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) ); 1333 pjsip_msg_add_hdr(tdata->msg, 1334 (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr) ); 1321 1335 hdr = hdr->next; 1322 1336 } -
pjproject/trunk/pjsip/src/pjsip/sip_util_proxy.c
r1127 r1241 129 129 /* Set request URI */ 130 130 if (uri) { 131 dst->line.req.uri = pjsip_uri_clone(tdata->pool, uri); 131 dst->line.req.uri = (pjsip_uri*) 132 pjsip_uri_clone(tdata->pool, uri); 132 133 } else { 133 dst->line.req.uri = pjsip_uri_clone(tdata->pool, src->line.req.uri); 134 dst->line.req.uri= (pjsip_uri*) 135 pjsip_uri_clone(tdata->pool, src->line.req.uri); 134 136 } 135 137 … … 193 195 194 196 /* Clone the header */ 195 hdst = pjsip_hdr_clone(tdata->pool, hsrc);197 hdst = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hsrc); 196 198 197 199 /* If this is Max-Forward header, decrement the value */ … … 292 294 } 293 295 294 pjsip_msg_add_hdr(dst, pjsip_hdr_clone(tdata->pool, hsrc)); 296 pjsip_msg_add_hdr(dst, 297 (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hsrc)); 295 298 296 299 hsrc = hsrc->next; … … 342 345 pj_md5_final(&ctx, digest); 343 346 344 branch.ptr = pj_pool_alloc(rdata->tp_info.pool, 347 branch.ptr = (char*) 348 pj_pool_alloc(rdata->tp_info.pool, 345 349 32 + PJSIP_RFC3261_BRANCH_LEN); 346 350 pj_memcpy(branch.ptr, PJSIP_RFC3261_BRANCH_ID, PJSIP_RFC3261_BRANCH_LEN); -
pjproject/trunk/pjsip/src/pjsip/sip_util_statefull.c
r1210 r1241 62 62 return; 63 63 64 tsx_data = tsx->mod_data[mod_stateful_util.id];64 tsx_data = (struct tsx_data*) tsx->mod_data[mod_stateful_util.id]; 65 65 if (tsx_data == NULL) 66 66 return; … … 103 103 } 104 104 105 tsx_data = pj_pool_alloc(tsx->pool, sizeof(struct tsx_data));105 tsx_data = PJ_POOL_ALLOC_T(tsx->pool, struct tsx_data); 106 106 tsx_data->token = token; 107 107 tsx_data->cb = cb; … … 148 148 const pjsip_hdr *hdr = hdr_list->next; 149 149 while (hdr != hdr_list) { 150 pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) ); 150 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 151 pjsip_hdr_clone(tdata->pool, hdr) ); 151 152 hdr = hdr->next; 152 153 }
Note: See TracChangeset
for help on using the changeset viewer.