Changeset 1240 for pjproject/trunk/pjmedia/src/pjmedia/sdp.c
- Timestamp:
- May 1, 2007 4:54:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r1210 r1240 104 104 PJ_ASSERT_RETURN(pool && name, NULL); 105 105 106 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));106 attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr); 107 107 pj_strdup2(pool, &attr->name, name); 108 108 … … 124 124 PJ_ASSERT_RETURN(pool && rhs, NULL); 125 125 126 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));126 attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr); 127 127 128 128 pj_strdup(pool, &attr->name, &rhs->name); … … 308 308 status = PJ_SUCCESS; 309 309 } 310 PJ_CATCH (SYNTAX_ERROR){310 PJ_CATCH_ANY { 311 311 status = PJMEDIA_SDP_EINRTPMAP; 312 312 } … … 403 403 404 404 } 405 PJ_CATCH (SYNTAX_ERROR){405 PJ_CATCH_ANY { 406 406 status = PJMEDIA_SDP_EINRTCP; 407 407 } … … 420 420 PJ_ASSERT_RETURN(pool && attr && p_rtpmap, PJ_EINVAL); 421 421 422 *p_rtpmap = pj_pool_alloc(pool, sizeof(pjmedia_sdp_rtpmap));422 *p_rtpmap = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_rtpmap); 423 423 PJ_ASSERT_RETURN(*p_rtpmap, PJ_ENOMEM); 424 424 … … 443 443 444 444 445 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));445 attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr); 446 446 PJ_ASSERT_RETURN(attr != NULL, PJ_ENOMEM); 447 447 … … 465 465 466 466 attr->value.slen = len; 467 attr->value.ptr = pj_pool_alloc(pool, attr->value.slen);467 attr->value.ptr = (char*) pj_pool_alloc(pool, attr->value.slen); 468 468 pj_memcpy(attr->value.ptr, tempbuf, attr->value.slen); 469 469 … … 494 494 const pjmedia_sdp_conn *rhs) 495 495 { 496 pjmedia_sdp_conn *c = pj_pool_alloc (pool, sizeof(pjmedia_sdp_conn));496 pjmedia_sdp_conn *c = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_conn); 497 497 if (!c) return NULL; 498 498 … … 589 589 { 590 590 unsigned int i; 591 pjmedia_sdp_media *m = pj_pool_alloc (pool, sizeof(pjmedia_sdp_media));591 pjmedia_sdp_media *m = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_media); 592 592 PJ_ASSERT_RETURN(m != NULL, NULL); 593 593 … … 968 968 ctx->last_error = PJMEDIA_SDP_EINATTR; 969 969 970 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));970 attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr); 971 971 972 972 /* check equal sign */ … … 1016 1016 pjmedia_sdp_session *session; 1017 1017 pjmedia_sdp_media *media = NULL; 1018 void*attr;1018 pjmedia_sdp_attr *attr; 1019 1019 pjmedia_sdp_conn *conn; 1020 1020 pj_str_t dummy; … … 1028 1028 1029 1029 pj_scan_init(&scanner, buf, len, 0, &on_scanner_error); 1030 session = pj_pool_calloc(pool, 1, sizeof(pjmedia_sdp_session));1030 session = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session); 1031 1031 PJ_ASSERT_RETURN(session != NULL, PJ_ENOMEM); 1032 1032 … … 1052 1052 break; 1053 1053 case 'c': 1054 conn = pj_pool_calloc(pool, 1, sizeof(*conn));1054 conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn); 1055 1055 parse_connection_info(&scanner, conn, &ctx); 1056 1056 if (media) { … … 1064 1064 break; 1065 1065 case 'm': 1066 media = pj_pool_calloc(pool, 1, sizeof(*media));1066 media = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); 1067 1067 parse_media(&scanner, media, &ctx); 1068 1068 session->media[ session->media_count++ ] = media; … … 1095 1095 1096 1096 } 1097 PJ_CATCH (SYNTAX_ERROR){1097 PJ_CATCH_ANY { 1098 1098 1099 1099 char errmsg[PJ_ERR_MSG_SIZE]; … … 1138 1138 PJ_ASSERT_RETURN(pool && rhs, NULL); 1139 1139 1140 sess = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_session));1140 sess = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session); 1141 1141 PJ_ASSERT_RETURN(sess != NULL, NULL); 1142 1142
Note: See TracChangeset
for help on using the changeset viewer.