- Timestamp:
- May 11, 2007 3:14:34 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 76 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util-test/encryption.c
r1016 r1266 385 385 386 386 /* CRC32 test data, generated from crc32 test on a Linux box */ 387 struct 387 struct crc32_test_t 388 388 { 389 389 char *input; … … 552 552 return PJ_ENOMEM; 553 553 554 input = pj_pool_alloc(pool, input_len);554 input = (pj_uint8_t*)pj_pool_alloc(pool, input_len); 555 555 pj_memset(input, '\xaa', input_len); 556 556 -
pjproject/trunk/pjlib/src/pj/except.c
r974 r1266 42 42 struct pj_exception_state_t *handler; 43 43 44 handler = pj_thread_local_get(thread_local_id); 44 handler = (struct pj_exception_state_t*) 45 pj_thread_local_get(thread_local_id); 45 46 if (handler == NULL) { 46 47 PJ_LOG(1,("except.c", "!!!FATAL: unhandled exception %s!\n", … … 79 80 pj_atexit(&exception_cleanup); 80 81 } 81 parent_handler = pj_thread_local_get(thread_local_id); 82 parent_handler = (struct pj_exception_state_t *) 83 pj_thread_local_get(thread_local_id); 82 84 rec->prev = parent_handler; 83 85 pj_thread_local_set(thread_local_id, rec); … … 88 90 struct pj_exception_state_t *handler; 89 91 90 handler = pj_thread_local_get(thread_local_id); 92 handler = (struct pj_exception_state_t *) 93 pj_thread_local_get(thread_local_id); 91 94 pj_assert(handler != NULL); 92 95 pj_thread_local_set(thread_local_id, handler->prev); -
pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
r1159 r1266 302 302 } else { 303 303 pj_assert(!"Invalid operation type!"); 304 write_op->op = 0;304 write_op->op = PJ_IOQUEUE_OP_NONE; 305 305 send_rc = PJ_EBUG; 306 306 } … … 319 319 { 320 320 321 write_op->op = 0;321 write_op->op = PJ_IOQUEUE_OP_NONE; 322 322 323 323 if (h->fd_type != PJ_SOCK_DGRAM) { … … 376 376 accept_op = h->accept_list.next; 377 377 pj_list_erase(accept_op); 378 accept_op->op = 0;378 accept_op->op = PJ_IOQUEUE_OP_NONE; 379 379 380 380 /* Clear bit in fdset if there is no more pending accept */ … … 418 418 419 419 if ((read_op->op == PJ_IOQUEUE_OP_RECV_FROM)) { 420 read_op->op = 0;420 read_op->op = PJ_IOQUEUE_OP_NONE; 421 421 rc = pj_sock_recvfrom(h->fd, read_op->buf, &bytes_read, 422 422 read_op->flags, … … 424 424 read_op->rmt_addrlen); 425 425 } else if ((read_op->op == PJ_IOQUEUE_OP_RECV)) { 426 read_op->op = 0;426 read_op->op = PJ_IOQUEUE_OP_NONE; 427 427 rc = pj_sock_recv(h->fd, read_op->buf, &bytes_read, 428 428 read_op->flags); 429 429 } else { 430 430 pj_assert(read_op->op == PJ_IOQUEUE_OP_READ); 431 read_op->op = 0;431 read_op->op = PJ_IOQUEUE_OP_NONE; 432 432 /* 433 433 * User has specified pj_ioqueue_read(). … … 562 562 563 563 read_op = (struct read_operation*)op_key; 564 read_op->op = 0;564 read_op->op = PJ_IOQUEUE_OP_NONE; 565 565 566 566 /* Check if key is closing. */ … … 631 631 632 632 read_op = (struct read_operation*)op_key; 633 read_op->op = 0;633 read_op->op = PJ_IOQUEUE_OP_NONE; 634 634 635 635 /* Try to see if there's data immediately available. … … 769 769 770 770 write_op->op = PJ_IOQUEUE_OP_SEND; 771 write_op->buf = ( void*)data;771 write_op->buf = (char*)data; 772 772 write_op->size = *length; 773 773 write_op->written = 0; … … 849 849 * Check that address storage can hold the address parameter. 850 850 */ 851 PJ_ASSERT_RETURN(addrlen <= sizeof(pj_sockaddr_in), PJ_EBUG);851 PJ_ASSERT_RETURN(addrlen <= (int)sizeof(pj_sockaddr_in), PJ_EBUG); 852 852 853 853 /* … … 884 884 885 885 write_op->op = PJ_IOQUEUE_OP_SEND_TO; 886 write_op->buf = ( void*)data;886 write_op->buf = (char*)data; 887 887 write_op->size = *length; 888 888 write_op->written = 0; … … 921 921 922 922 accept_op = (struct accept_operation*)op_key; 923 accept_op->op = 0;923 accept_op->op = PJ_IOQUEUE_OP_NONE; 924 924 925 925 /* Fast track: … … 1053 1053 if (op_rec == (void*)op_key) { 1054 1054 pj_list_erase(op_rec); 1055 op_rec->op = 0;1055 op_rec->op = PJ_IOQUEUE_OP_NONE; 1056 1056 pj_mutex_unlock(key->mutex); 1057 1057 … … 1067 1067 if (op_rec == (void*)op_key) { 1068 1068 pj_list_erase(op_rec); 1069 op_rec->op = 0;1069 op_rec->op = PJ_IOQUEUE_OP_NONE; 1070 1070 pj_mutex_unlock(key->mutex); 1071 1071 … … 1081 1081 if (op_rec == (void*)op_key) { 1082 1082 pj_list_erase(op_rec); 1083 op_rec->op = 0;1083 op_rec->op = PJ_IOQUEUE_OP_NONE; 1084 1084 pj_mutex_unlock(key->mutex); 1085 1085 -
pjproject/trunk/pjlib/src/pj/ioqueue_select.c
r1159 r1266 194 194 195 195 /* Create and init common ioqueue stuffs */ 196 ioqueue = pj_pool_alloc(pool, sizeof(pj_ioqueue_t));196 ioqueue = PJ_POOL_ALLOC_T(pool, pj_ioqueue_t); 197 197 ioqueue_init(ioqueue); 198 198 … … 231 231 pj_ioqueue_key_t *key; 232 232 233 key = pj_pool_alloc(pool, sizeof(pj_ioqueue_key_t));233 key = PJ_POOL_ALLOC_T(pool, pj_ioqueue_key_t); 234 234 key->ref_count = 0; 235 235 rc = pj_mutex_create_recursive(pool, NULL, &key->mutex); -
pjproject/trunk/pjlib/src/pj/log.c
r1042 r1266 147 147 } 148 148 len = len + print_len; 149 if (len > 0 && len < sizeof(log_buffer)-2) {149 if (len > 0 && len < (int)sizeof(log_buffer)-2) { 150 150 if (log_decor & PJ_LOG_HAS_CR) { 151 151 log_buffer[len++] = '\r'; -
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r1076 r1266 22 22 * the RTEMS port. 23 23 */ 24 #define _GNU_SOURCE 24 #ifndef _GNU_SOURCE 25 # define _GNU_SOURCE 26 #endif 25 27 #include <pj/os.h> 26 28 #include <pj/assert.h> … … 340 342 static void *thread_main(void *param) 341 343 { 342 pj_thread_t *rec = param;344 pj_thread_t *rec = (pj_thread_t*)param; 343 345 void *result; 344 346 pj_status_t rc; … … 507 509 { 508 510 #if PJ_HAS_THREADS 509 pj_thread_t *rec = pj_thread_local_get(thread_tls_id);511 pj_thread_t *rec = (pj_thread_t*)pj_thread_local_get(thread_tls_id); 510 512 511 513 if (rec == NULL) { … … 664 666 { 665 667 pj_status_t rc; 666 pj_atomic_t *atomic_var = pj_pool_calloc(pool, 1, sizeof(pj_atomic_t)); 668 pj_atomic_t *atomic_var; 669 670 atomic_var = PJ_POOL_ZALLOC_T(pool, pj_atomic_t); 671 667 672 PJ_ASSERT_RETURN(atomic_var, PJ_ENOMEM); 668 673 … … 908 913 909 914 /////////////////////////////////////////////////////////////////////////////// 915 #if defined(PJ_LINUX) && PJ_LINUX!=0 916 PJ_BEGIN_DECL 917 PJ_DECL(int) pthread_mutexattr_settype(pthread_mutexattr_t*,int); 918 PJ_END_DECL 919 #endif 920 910 921 static pj_status_t init_mutex(pj_mutex_t *mutex, const char *name, int type) 911 922 { … … 922 933 if (type == PJ_MUTEX_SIMPLE) { 923 934 #if defined(PJ_LINUX) && PJ_LINUX!=0 924 extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int);925 935 rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP); 926 936 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 … … 931 941 } else { 932 942 #if defined(PJ_LINUX) && PJ_LINUX!=0 933 extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int);934 943 rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); 935 944 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 … … 992 1001 PJ_ASSERT_RETURN(pool && ptr_mutex, PJ_EINVAL); 993 1002 994 mutex = pj_pool_alloc(pool, sizeof(*mutex));1003 mutex = PJ_POOL_ALLOC_T(pool, pj_mutex_t); 995 1004 PJ_ASSERT_RETURN(mutex, PJ_ENOMEM); 996 1005 … … 1229 1238 PJ_UNUSED_ARG(name); 1230 1239 1231 rwm = pj_pool_alloc(pool, sizeof(pj_rwmutex_t));1240 rwm = PJ_POOL_ALLOC_T(pool, pj_rwmutex_t); 1232 1241 PJ_ASSERT_RETURN(rwm, PJ_ENOMEM); 1233 1242 … … 1330 1339 PJ_ASSERT_RETURN(pool != NULL && ptr_sem != NULL, PJ_EINVAL); 1331 1340 1332 sem = pj_pool_alloc(pool, sizeof(*sem));1341 sem = PJ_POOL_ALLOC_T(pool, pj_sem_t); 1333 1342 PJ_ASSERT_RETURN(sem, PJ_ENOMEM); 1334 1343 -
pjproject/trunk/pjlib/src/pj/os_error_unix.c
r974 r1266 41 41 } 42 42 43 PJ_BEGIN_DECL 44 45 PJ_DECL(int) platform_strerror(pj_os_err_type code, 46 char *buf, pj_size_t bufsize ); 47 PJ_END_DECL 48 43 49 /* 44 50 * platform_strerror() -
pjproject/trunk/pjlib/src/pj/sock_bsd.c
r974 r1266 386 386 PJ_CHECK_STACK(); 387 387 388 PJ_ASSERT_RETURN(addr && len >= sizeof(struct sockaddr_in), PJ_EINVAL);388 PJ_ASSERT_RETURN(addr && len >= (int)sizeof(struct sockaddr_in), PJ_EINVAL); 389 389 390 390 if (bind(sock, (struct sockaddr*)addr, len) != 0) -
pjproject/trunk/pjlib/src/pjlib-test/file.c
r974 r1266 126 126 127 127 size = 0; 128 while (size < sizeof(readbuf)) {128 while (size < (pj_ssize_t)sizeof(readbuf)) { 129 129 pj_ssize_t read; 130 130 read = 1; -
pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c
r1236 r1266 506 506 507 507 best_bandwidth = 0; 508 for (i=0; i< sizeof(test_param)/sizeof(test_param[0]); ++i) {508 for (i=0; i<(int)(sizeof(test_param)/sizeof(test_param[0])); ++i) { 509 509 pj_size_t bandwidth; 510 510 -
pjproject/trunk/pjlib/src/pjlib-test/sock.c
r1238 r1266 142 142 PJ_LOG(3,("test", "...simple_sock_test()")); 143 143 144 for (i=0; i< sizeof(types)/sizeof(types[0]); ++i) {144 for (i=0; i<(int)(sizeof(types)/sizeof(types[0])); ++i) { 145 145 146 146 rc = pj_sock_socket(PJ_AF_INET, types[i], 0, &sock); -
pjproject/trunk/pjlib/src/pjlib-test/string.c
r1235 r1266 97 97 #define STRTEST(res,S1,S2,code) \ 98 98 do { \ 99 s1.ptr=S1; s1.slen= S1?len:0; \100 s2.ptr=S2; s2.slen= S2?len:0; \99 s1.ptr=S1; s1.slen=(S1)?len:0; \ 100 s2.ptr=S2; s2.slen=(S2)?len:0; \ 101 101 pj_get_timestamp(&t1); \ 102 102 if (C(pj_stricmp(&s1,&s2),res)) return code; \ … … 124 124 pj_thread_sleep(0); 125 125 126 #define SNULL 0 127 126 128 /* Compare empty strings. */ 127 129 len=0; 128 130 STRTEST( 0, "","",-500); 129 STRTEST( 0, NULL,"",-502);130 STRTEST( 0, "", NULL,-504);131 STRTEST( 0, NULL,NULL,-506);131 STRTEST( 0, SNULL,"",-502); 132 STRTEST( 0, "",SNULL,-504); 133 STRTEST( 0, SNULL,SNULL,-506); 132 134 STRTEST( 0, "hello","world",-508); 133 135 … … 140 142 STRTEST( 0, "a",buf+1,-512); 141 143 STRTEST( -1, "O", "P", -514); 142 STRTEST(-1, NULL, "a", -516);143 STRTEST(1, "a", NULL, -518);144 STRTEST(-1, SNULL, "a", -516); 145 STRTEST(1, "a", SNULL, -518); 144 146 145 147 /* equal, length=2 … … 267 269 len=0; 268 270 STR_TEST(0, "", "", -400); 269 STR_TEST(0, NULL, "", -405);270 STR_TEST(0, "", NULL, -410);271 STR_TEST(0, NULL,NULL, -415);271 STR_TEST(0, SNULL, "", -405); 272 STR_TEST(0, "", SNULL, -410); 273 STR_TEST(0, SNULL, SNULL, -415); 272 274 STR_TEST(0, "hello", "", -420); 273 STR_TEST(0, "hello", NULL, -425);275 STR_TEST(0, "hello", SNULL, -425); 274 276 275 277 /* Test with length != 0 */ … … 278 280 STR_TEST(1, "12", "1", -435); 279 281 STR_TEST(-1, "1", "12", -440); 280 STR_TEST(-1, NULL, "12", -445);281 STR_TEST(1, "12", NULL, -450);282 STR_TEST(-1, SNULL, "12", -445); 283 STR_TEST(1, "12", SNULL, -450); 282 284 283 285 return 0; … … 296 298 int i; 297 299 298 pool = pj_pool_create(mem, NULL, 4096, 0,NULL);300 pool = pj_pool_create(mem, SNULL, 4096, 0, SNULL); 299 301 if (!pool) return -5; 300 302 … … 368 370 s5 = pj_str("123456"); 369 371 370 pj_strtoul2(&s5, NULL, 10); /* Crash test */372 pj_strtoul2(&s5, SNULL, 10); /* Crash test */ 371 373 372 374 if (pj_strtoul2(&s5, &s4, 10) != 123456UL) … … 382 384 if (s4.slen != 4) 383 385 return -294; 384 if (s4.ptr == NULL || *s4.ptr != 'A')386 if (s4.ptr == SNULL || *s4.ptr != 'A') 385 387 return -295; 386 388 if (pj_strtoul2(&s5, &s4, 16) != 0x123ABCDUL) -
pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c
r1177 r1266 123 123 struct gsm_data 124 124 { 125 void*encoder;126 void*decoder;125 gsm_state *encoder; 126 gsm_state *decoder; 127 127 pj_bool_t plc_enabled; 128 128 #if !PLC_DISABLED … … 324 324 pj_list_erase(codec); 325 325 } else { 326 codec = pj_pool_zalloc(gsm_codec_factory.pool, 327 sizeof(pjmedia_codec)); 326 codec = PJ_POOL_ZALLOC_T(gsm_codec_factory.pool, pjmedia_codec); 328 327 PJ_ASSERT_RETURN(codec != NULL, PJ_ENOMEM); 329 328 codec->op = &gsm_op; 330 329 codec->factory = factory; 331 330 332 gsm_data = pj_pool_zalloc(gsm_codec_factory.pool, 333 sizeof(struct gsm_data)); 331 gsm_data = PJ_POOL_ZALLOC_T(gsm_codec_factory.pool, struct gsm_data); 334 332 codec->codec_data = gsm_data; 335 333 … … 372 370 PJ_ASSERT_RETURN(factory == &gsm_codec_factory.base, PJ_EINVAL); 373 371 374 gsm_data = codec->codec_data;372 gsm_data = (struct gsm_data*) codec->codec_data; 375 373 376 374 /* Close codec, if it's not closed. */ … … 418 416 pjmedia_codec_param *attr ) 419 417 { 420 struct gsm_data *gsm_data = codec->codec_data;418 struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data; 421 419 422 420 pj_assert(gsm_data != NULL); … … 442 440 static pj_status_t gsm_codec_close( pjmedia_codec *codec ) 443 441 { 444 struct gsm_data *gsm_data = codec->codec_data;442 struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data; 445 443 446 444 pj_assert(gsm_data != NULL); … … 465 463 const pjmedia_codec_param *attr ) 466 464 { 467 struct gsm_data *gsm_data = codec->codec_data;465 struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data; 468 466 469 467 pj_assert(gsm_data != NULL); … … 517 515 struct pjmedia_frame *output) 518 516 { 519 struct gsm_data *gsm_data = codec->codec_data;517 struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data; 520 518 521 519 pj_assert(gsm_data != NULL); … … 536 534 537 535 is_silence = pjmedia_silence_det_detect(gsm_data->vad, 538 input->buf,536 (const pj_int16_t*) input->buf, 539 537 (input->size >> 1), 540 538 NULL); … … 571 569 struct pjmedia_frame *output) 572 570 { 573 struct gsm_data *gsm_data = codec->codec_data;571 struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data; 574 572 575 573 pj_assert(gsm_data != NULL); -
pjproject/trunk/pjmedia/src/pjmedia-codec/ilbc.c
r1169 r1266 320 320 PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); 321 321 322 codec = pj_pool_zalloc(pool, sizeof(struct ilbc_codec));322 codec = PJ_POOL_ZALLOC_T(pool, struct ilbc_codec); 323 323 codec->base.op = &ilbc_op; 324 324 codec->base.factory = factory; … … 531 531 532 532 is_silence = pjmedia_silence_det_detect(ilbc_codec->vad, 533 input->buf,533 (const pj_int16_t*)input->buf, 534 534 (input->size >> 1), 535 535 NULL); … … 586 586 587 587 /* Decode to temporary buffer */ 588 iLBC_decode(ilbc_codec->dec_block, input->buf,588 iLBC_decode(ilbc_codec->dec_block, (unsigned char*) input->buf, 589 589 &ilbc_codec->dec, 1); 590 590 -
pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c
r974 r1266 429 429 if (pj_list_empty(&l16_factory.codec_list)) { 430 430 431 codec = pj_pool_alloc(l16_factory.pool, sizeof(pjmedia_codec));431 codec = PJ_POOL_ALLOC_T(l16_factory.pool, pjmedia_codec); 432 432 codec->codec_data = pj_pool_alloc(l16_factory.pool, 433 433 sizeof(struct l16_data)); … … 442 442 /* Init private data */ 443 443 ptime = GET_PTIME(id->clock_rate); 444 data = codec->codec_data;444 data = (struct l16_data*) codec->codec_data; 445 445 data->frame_size = ptime * id->clock_rate * id->channel_cnt * 2 / 1000; 446 446 -
pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
r974 r1266 482 482 pj_list_erase(codec); 483 483 } else { 484 codec = pj_pool_zalloc(spx_factory.pool, 485 sizeof(pjmedia_codec)); 484 codec = PJ_POOL_ZALLOC_T(spx_factory.pool, pjmedia_codec); 486 485 PJ_ASSERT_RETURN(codec != NULL, PJ_ENOMEM); 487 486 codec->op = &spx_op; … … 737 736 738 737 /* Encode the frame */ 739 tx = speex_encode_int(spx->enc, input->buf, &spx->enc_bits); 738 tx = speex_encode_int(spx->enc, (spx_int16_t*)input->buf, 739 &spx->enc_bits); 740 740 741 741 /* Check if we need not to transmit the frame (DTX) */ … … 754 754 /* Copy the bits to an array of char that can be written */ 755 755 output->size = speex_bits_write(&spx->enc_bits, 756 output->buf, output_buf_len);756 (char*)output->buf, output_buf_len); 757 757 output->type = PJMEDIA_FRAME_TYPE_AUDIO; 758 758 output->timestamp = input->timestamp; … … 782 782 783 783 /* Copy the data into the bit-stream struct */ 784 speex_bits_read_from(&spx->dec_bits, input->buf, input->size);784 speex_bits_read_from(&spx->dec_bits, (char*)input->buf, input->size); 785 785 786 786 /* Decode the data */ 787 speex_decode_int(spx->dec, &spx->dec_bits, output->buf);787 speex_decode_int(spx->dec, &spx->dec_bits, (spx_int16_t*)output->buf); 788 788 789 789 output->type = PJMEDIA_FRAME_TYPE_AUDIO; 790 790 output->size = speex_bits_nbytes(&spx->dec_bits); 791 pj_assert(output->size <= ( int)output_buf_len);791 pj_assert(output->size <= (unsigned)output_buf_len); 792 792 output->timestamp.u64 = input->timestamp.u64; 793 793 … … 815 815 816 816 /* Recover packet loss */ 817 speex_decode_int(spx->dec, NULL, output->buf);817 speex_decode_int(spx->dec, NULL, (spx_int16_t*) output->buf); 818 818 819 819 output->size = count * 2; -
pjproject/trunk/pjmedia/src/pjmedia/clock_thread.c
r974 r1266 67 67 PJ_EINVAL); 68 68 69 clock = pj_pool_alloc(pool, sizeof(pjmedia_clock));69 clock = PJ_POOL_ALLOC_T(pool, pjmedia_clock); 70 70 71 71 … … 198 198 { 199 199 pj_timestamp now; 200 pjmedia_clock *clock = arg;200 pjmedia_clock *clock = (pjmedia_clock*) arg; 201 201 202 202 /* Get the first tick */ -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r1171 r1266 240 240 241 241 /* Create port. */ 242 conf_port = pj_pool_zalloc(pool, sizeof(struct conf_port));242 conf_port = PJ_POOL_ZALLOC_T(pool, struct conf_port); 243 243 PJ_ASSERT_RETURN(conf_port, PJ_ENOMEM); 244 244 … … 255 255 256 256 /* Create transmit flag array */ 257 conf_port->listener_slots = pj_pool_zalloc(pool, 257 conf_port->listener_slots = (SLOT_TYPE*) 258 pj_pool_zalloc(pool, 258 259 conf->max_ports * sizeof(SLOT_TYPE)); 259 260 PJ_ASSERT_RETURN(conf_port->listener_slots, PJ_ENOMEM); … … 336 337 conf->clock_rate); 337 338 conf_port->rx_buf_count = 0; 338 conf_port->rx_buf = pj_pool_alloc(pool, conf_port->rx_buf_cap * 339 conf_port->rx_buf = (pj_int16_t*) 340 pj_pool_alloc(pool, conf_port->rx_buf_cap * 339 341 sizeof(conf_port->rx_buf[0])); 340 342 PJ_ASSERT_RETURN(conf_port->rx_buf, PJ_ENOMEM); … … 343 345 conf_port->tx_buf_cap = conf_port->rx_buf_cap; 344 346 conf_port->tx_buf_count = 0; 345 conf_port->tx_buf = pj_pool_alloc(pool, conf_port->tx_buf_cap * 347 conf_port->tx_buf = (pj_int16_t*) 348 pj_pool_alloc(pool, conf_port->tx_buf_cap * 346 349 sizeof(conf_port->tx_buf[0])); 347 350 PJ_ASSERT_RETURN(conf_port->tx_buf, PJ_ENOMEM); … … 350 353 351 354 /* Create mix buffer. */ 352 conf_port->mix_buf = pj_pool_zalloc(pool, conf->samples_per_frame * 355 conf_port->mix_buf = (pj_uint32_t*) 356 pj_pool_zalloc(pool, conf->samples_per_frame * 353 357 sizeof(conf_port->mix_buf[0])); 354 358 PJ_ASSERT_RETURN(conf_port->mix_buf, PJ_ENOMEM); … … 381 385 /* Passive port has rx buffers. */ 382 386 for (i=0; i<RX_BUF_COUNT; ++i) { 383 conf_port->snd_buf[i] = pj_pool_zalloc(pool, conf->samples_per_frame * 387 conf_port->snd_buf[i] = (pj_int16_t*) 388 pj_pool_zalloc(pool, conf->samples_per_frame * 384 389 sizeof(conf_port->snd_buf[0][0])); 385 390 if (conf_port->snd_buf[i] == NULL) { … … 487 492 488 493 /* Create and init conf structure. */ 489 conf = pj_pool_zalloc(pool, sizeof(pjmedia_conf));494 conf = PJ_POOL_ZALLOC_T(pool, pjmedia_conf); 490 495 PJ_ASSERT_RETURN(conf, PJ_ENOMEM); 491 496 492 conf->ports = pj_pool_zalloc(pool, max_ports*sizeof(void*)); 497 conf->ports = (struct conf_port**) 498 pj_pool_zalloc(pool, max_ports*sizeof(void*)); 493 499 PJ_ASSERT_RETURN(conf->ports, PJ_ENOMEM); 494 500 … … 502 508 503 509 /* Create and initialize the master port interface. */ 504 conf->master_port = pj_pool_zalloc(pool, sizeof(pjmedia_port));510 conf->master_port = PJ_POOL_ZALLOC_T(pool, pjmedia_port); 505 511 PJ_ASSERT_RETURN(conf->master_port, PJ_ENOMEM); 506 512 … … 523 529 524 530 /* Create temporary buffer. */ 525 conf->uns_buf = pj_pool_zalloc(pool, samples_per_frame * 531 conf->uns_buf = (pj_uint16_t*) 532 pj_pool_zalloc(pool, samples_per_frame * 526 533 sizeof(conf->uns_buf[0])); 527 534 … … 598 605 static pj_status_t destroy_port(pjmedia_port *this_port) 599 606 { 600 pjmedia_conf *conf = this_port->port_data.pdata;607 pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata; 601 608 return pjmedia_conf_destroy(conf); 602 609 } … … 626 633 const pj_str_t *name) 627 634 { 628 intlen;635 unsigned len; 629 636 630 637 /* Sanity check. */ … … 764 771 name = &tmp; 765 772 766 tmp.ptr = pj_pool_alloc(pool, 32);773 tmp.ptr = (char*) pj_pool_alloc(pool, 32); 767 774 tmp.slen = pj_ansi_snprintf(tmp.ptr, 32, "ConfPort#%d", index); 768 775 } 769 776 770 777 /* Create and initialize the media port structure. */ 771 port = pj_pool_zalloc(pool, sizeof(pjmedia_port));778 port = PJ_POOL_ZALLOC_T(pool, pjmedia_port); 772 779 PJ_ASSERT_RETURN(port, PJ_ENOMEM); 773 780 … … 1601 1608 pjmedia_frame *frame) 1602 1609 { 1603 pjmedia_conf *conf = this_port->port_data.pdata;1610 pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata; 1604 1611 pjmedia_frame_type speaker_frame_type = PJMEDIA_FRAME_TYPE_NONE; 1605 1612 unsigned ci, cj, i, j; … … 1677 1684 1678 1685 snd_buf = conf_port->snd_buf[conf_port->snd_read_pos]; 1679 pjmedia_copy_samples(frame->buf, snd_buf, conf->samples_per_frame); 1686 pjmedia_copy_samples((pj_int16_t*)frame->buf, snd_buf, 1687 conf->samples_per_frame); 1680 1688 conf_port->snd_read_pos = (conf_port->snd_read_pos+1) % RX_BUF_COUNT; 1681 1689 … … 1685 1693 pjmedia_frame_type frame_type; 1686 1694 1687 status = read_port(conf, conf_port, frame->buf,1695 status = read_port(conf, conf_port, (pj_int16_t*)frame->buf, 1688 1696 conf->samples_per_frame, &frame_type); 1689 1697 … … 1711 1719 */ 1712 1720 if (conf_port->rx_adj_level != NORMAL_LEVEL) { 1713 pj_int16_t *input = frame->buf;1721 pj_int16_t *input = (pj_int16_t*) frame->buf; 1714 1722 pj_int32_t adj = conf_port->rx_adj_level; 1715 1723 … … 1739 1747 1740 1748 } else { 1741 level = pjmedia_calc_avg_signal( frame->buf,1749 level = pjmedia_calc_avg_signal((pj_int16_t*) frame->buf, 1742 1750 conf->samples_per_frame); 1743 1751 } … … 1800 1808 if (listener->transmitter_cnt == 1) { 1801 1809 pjmedia_copy_samples((pj_int16_t*)mix_buf, 1802 frame->buf, conf->samples_per_frame); 1810 (const pj_int16_t*)frame->buf, 1811 conf->samples_per_frame); 1803 1812 listener->src_level = level; 1804 1813 } else { … … 1857 1866 conf->samples_per_frame)); 1858 1867 1859 pjmedia_copy_samples( frame->buf, (pj_int16_t*)conf->ports[0]->mix_buf, 1868 pjmedia_copy_samples( (pj_int16_t*)frame->buf, 1869 (const pj_int16_t*)conf->ports[0]->mix_buf, 1860 1870 conf->samples_per_frame); 1861 1871 } else { 1862 pjmedia_zero_samples( frame->buf, conf->samples_per_frame);1872 pjmedia_zero_samples((pj_int16_t*)frame->buf, conf->samples_per_frame); 1863 1873 } 1864 1874 … … 1898 1908 const pjmedia_frame *frame) 1899 1909 { 1900 pjmedia_conf *conf = this_port->port_data.pdata;1910 pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata; 1901 1911 struct conf_port *port = conf->ports[this_port->port_data.ldata]; 1902 const pj_int16_t *input = frame->buf;1912 const pj_int16_t *input = (const pj_int16_t*) frame->buf; 1903 1913 pj_int16_t *target_snd_buf; 1904 1914 -
pjproject/trunk/pjmedia/src/pjmedia/echo_common.c
r974 r1266 146 146 #endif 147 147 148 ec = pj_pool_zalloc(pool, sizeof(struct pjmedia_echo_state));148 ec = PJ_POOL_ZALLOC_T(pool, struct pjmedia_echo_state); 149 149 150 150 if (options & PJMEDIA_ECHO_SIMPLE) { -
pjproject/trunk/pjmedia/src/pjmedia/echo_port.c
r974 r1266 60 60 61 61 /* Create the port and the AEC itself */ 62 ec = pj_pool_zalloc(pool, sizeof(struct ec));62 ec = PJ_POOL_ZALLOC_T(pool, struct ec); 63 63 64 64 pjmedia_port_info_init(&ec->base.info, &AEC, SIGNATURE, … … 101 101 PJ_EINVAL); 102 102 103 pjmedia_echo_capture(ec->ec, frame->buf, 0);103 pjmedia_echo_capture(ec->ec, (pj_int16_t*)frame->buf, 0); 104 104 105 105 return pjmedia_port_put_frame(ec->dn_port, frame); … … 117 117 status = pjmedia_port_get_frame(ec->dn_port, frame); 118 118 if (status!=PJ_SUCCESS || frame->type!=PJMEDIA_FRAME_TYPE_AUDIO) { 119 pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame); 119 pjmedia_zero_samples((pj_int16_t*)frame->buf, 120 this_port->info.samples_per_frame); 120 121 } 121 122 122 pjmedia_echo_playback(ec->ec, frame->buf);123 pjmedia_echo_playback(ec->ec, (pj_int16_t*)frame->buf); 123 124 124 125 return status; -
pjproject/trunk/pjmedia/src/pjmedia/echo_speex.c
r974 r1266 78 78 unsigned i; 79 79 80 fq = pj_pool_zalloc(pool, sizeof(pjmedia_frame_queue));80 fq = PJ_POOL_ZALLOC_T(pool, pjmedia_frame_queue); 81 81 82 82 pj_ansi_snprintf(fq->obj_name, sizeof(fq->obj_name), name, fq); … … 94 94 struct fq_frame *f; 95 95 96 f = pj_pool_zalloc(pool, sizeof(struct fq_frame));96 f = PJ_POOL_ZALLOC_T(pool, struct fq_frame); 97 97 f->buf = pj_pool_alloc(pool, frame_size); 98 98 … … 295 295 *p_echo = NULL; 296 296 297 echo = pj_pool_zalloc(pool, sizeof(speex_ec));297 echo = PJ_POOL_ZALLOC_T(pool, speex_ec); 298 298 PJ_ASSERT_RETURN(echo != NULL, PJ_ENOMEM); 299 299 … … 356 356 357 357 /* Create temporary frame for echo cancellation */ 358 echo->tmp_frame = pj_pool_zalloc(pool, 2 * samples_per_frame);358 echo->tmp_frame = (pj_int16_t*) pj_pool_zalloc(pool, 2 * samples_per_frame); 359 359 PJ_ASSERT_RETURN(echo->tmp_frame != NULL, PJ_ENOMEM); 360 360 361 361 /* Create temporary frame to receive residue */ 362 echo->residue = pj_pool_zalloc(pool, sizeof(spx_int32_t) * 362 echo->residue = (spx_int32_t*) 363 pj_pool_zalloc(pool, sizeof(spx_int32_t) * 363 364 (samples_per_frame+1)); 364 365 PJ_ASSERT_RETURN(echo->residue != NULL, PJ_ENOMEM); … … 392 393 PJ_DEF(pj_status_t) speex_aec_destroy(void *state ) 393 394 { 394 speex_ec *echo = state;395 speex_ec *echo = (speex_ec*) state; 395 396 396 397 PJ_ASSERT_RETURN(echo && echo->state, PJ_EINVAL); … … 424 425 pj_int16_t *play_frm ) 425 426 { 426 speex_ec *echo = state;427 speex_ec *echo = (speex_ec*) state; 427 428 428 429 /* Sanity checks */ … … 482 483 unsigned options ) 483 484 { 484 speex_ec *echo = state;485 speex_ec *echo = (speex_ec*) state; 485 486 pj_status_t status = PJ_SUCCESS; 486 487 … … 552 553 void *reserved ) 553 554 { 554 speex_ec *echo = state;555 speex_ec *echo = (speex_ec*) state; 555 556 556 557 /* Sanity checks */ -
pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c
r974 r1266 86 86 PJ_UNUSED_ARG(latency_ms); 87 87 88 ec = pj_pool_zalloc(pool, sizeof(struct echo_supp));88 ec = PJ_POOL_ZALLOC_T(pool, struct echo_supp); 89 89 ec->samples_per_frame = samples_per_frame; 90 90 ec->tail_ms = tail_ms; … … 120 120 pj_int16_t *play_frm ) 121 121 { 122 echo_supp *ec = state;122 echo_supp *ec = (echo_supp*) state; 123 123 pj_bool_t silence; 124 124 pj_bool_t last_suppressing = ec->suppressing; … … 150 150 unsigned options ) 151 151 { 152 echo_supp *ec = state;152 echo_supp *ec = (echo_supp*) state; 153 153 pj_time_val now; 154 154 unsigned delay_ms; … … 186 186 void *reserved ) 187 187 { 188 echo_supp *ec = state;188 echo_supp *ec = (echo_supp*) state; 189 189 pj_bool_t silence; 190 190 -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r1103 r1266 127 127 return PJ_ENOMEM; 128 128 129 endpt = pj_pool_zalloc(pool, sizeof(struct pjmedia_endpt));129 endpt = PJ_POOL_ZALLOC_T(pool, struct pjmedia_endpt); 130 130 endpt->pool = pool; 131 131 endpt->pf = pf; … … 247 247 static int PJ_THREAD_FUNC worker_proc(void *arg) 248 248 { 249 pjmedia_endpt *endpt = arg;249 pjmedia_endpt *endpt = (pjmedia_endpt*) arg; 250 250 251 251 while (!endpt->quit_flag) { … … 294 294 295 295 /* Create and initialize basic SDP session */ 296 sdp = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_session));296 sdp = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session); 297 297 298 298 pj_gettimeofday(&tv); … … 308 308 * SDP connection line in the session level. 309 309 */ 310 sdp->conn = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_conn));310 sdp->conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn); 311 311 sdp->conn->net_type = STR_IN; 312 312 sdp->conn->addr_type = STR_IP4; … … 322 322 323 323 sdp->media_count = 1; 324 m = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_media));324 m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); 325 325 sdp->media[0] = m; 326 326 … … 338 338 #if defined(PJMEDIA_HAS_RTCP_IN_SDP) && PJMEDIA_HAS_RTCP_IN_SDP!=0 339 339 if (sock_info->rtcp_addr_name.sin_family != 0) { 340 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));340 attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr); 341 341 attr->name = pj_str("rtcp"); 342 attr->value.ptr = pj_pool_alloc(pool, 80);342 attr->value.ptr = (char*) pj_pool_alloc(pool, 80); 343 343 attr->value.slen = 344 344 pj_ansi_snprintf(attr->value.ptr, 80, … … 368 368 fmt = &m->desc.fmt[m->desc.fmt_count++]; 369 369 370 fmt->ptr = pj_pool_alloc(pool, 8);370 fmt->ptr = (char*) pj_pool_alloc(pool, 8); 371 371 fmt->slen = pj_utoa(codec_info->pt, fmt->ptr); 372 372 … … 400 400 if (codec_param.setting.dec_fmtp_mode != 0) { 401 401 const pj_str_t fmtp = { "fmtp", 4 }; 402 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));402 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 403 403 404 404 attr->name = fmtp; 405 attr->value.ptr = pj_pool_alloc(pool, 32);405 attr->value.ptr = (char*) pj_pool_alloc(pool, 32); 406 406 attr->value.slen = 407 407 pj_ansi_snprintf( attr->value.ptr, 32, … … 414 414 415 415 /* Add sendrecv attribute. */ 416 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));416 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 417 417 attr->name = STR_SENDRECV; 418 418 m->attr[m->attr_count++] = attr; … … 428 428 429 429 /* Add rtpmap. */ 430 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));430 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 431 431 attr->name = pj_str("rtpmap"); 432 432 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR … … 435 435 436 436 /* Add fmtp */ 437 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));437 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 438 438 attr->name = pj_str("fmtp"); 439 439 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15"); -
pjproject/trunk/pjmedia/src/pjmedia/g711.c
r1242 r1266 320 320 struct g711_private *codec_priv; 321 321 322 codec = pj_pool_alloc(g711_factory.pool, sizeof(pjmedia_codec)); 323 codec_priv = pj_pool_zalloc(g711_factory.pool, 324 sizeof(struct g711_private)); 322 codec = PJ_POOL_ALLOC_T(g711_factory.pool, pjmedia_codec); 323 codec_priv = PJ_POOL_ZALLOC_T(g711_factory.pool, struct g711_private); 325 324 if (!codec || !codec_priv) { 326 325 pj_mutex_unlock(g711_factory.mutex); … … 372 371 pjmedia_codec *codec ) 373 372 { 374 struct g711_private *priv = codec->codec_data;373 struct g711_private *priv = (struct g711_private*) codec->codec_data; 375 374 int i = 0; 376 375 … … 421 420 pjmedia_codec_param *attr ) 422 421 { 423 struct g711_private *priv = codec->codec_data;422 struct g711_private *priv = (struct g711_private*) codec->codec_data; 424 423 priv->pt = attr->info.pt; 425 424 #if !PLC_DISABLED … … 440 439 const pjmedia_codec_param *attr ) 441 440 { 442 struct g711_private *priv = codec->codec_data;441 struct g711_private *priv = (struct g711_private*) codec->codec_data; 443 442 444 443 if (attr->info.pt != priv->pt) … … 488 487 { 489 488 pj_int16_t *samples = (pj_int16_t*) input->buf; 490 struct g711_private *priv = codec->codec_data;489 struct g711_private *priv = (struct g711_private*) codec->codec_data; 491 490 492 491 /* Check output buffer length */ … … 502 501 &input->timestamp); 503 502 504 is_silence = pjmedia_silence_det_detect(priv->vad, input->buf, 503 is_silence = pjmedia_silence_det_detect(priv->vad, 504 (const pj_int16_t*) input->buf, 505 505 (input->size >> 1), NULL); 506 506 if (is_silence && … … 521 521 if (priv->pt == PJMEDIA_RTP_PT_PCMA) { 522 522 unsigned i, n; 523 pj_uint8_t *dst = output->buf;523 pj_uint8_t *dst = (pj_uint8_t*) output->buf; 524 524 525 525 n = (input->size >> 1); … … 529 529 } else if (priv->pt == PJMEDIA_RTP_PT_PCMU) { 530 530 unsigned i, n; 531 pj_uint8_t *dst = output->buf;531 pj_uint8_t *dst = (pj_uint8_t*) output->buf; 532 532 533 533 n = (input->size >> 1); … … 551 551 struct pjmedia_frame *output) 552 552 { 553 struct g711_private *priv = codec->codec_data;553 struct g711_private *priv = (struct g711_private*) codec->codec_data; 554 554 555 555 /* Check output buffer length */ … … 564 564 if (priv->pt == PJMEDIA_RTP_PT_PCMA) { 565 565 unsigned i; 566 pj_uint8_t *src = input->buf;567 pj_uint16_t *dst = output->buf;566 pj_uint8_t *src = (pj_uint8_t*) input->buf; 567 pj_uint16_t *dst = (pj_uint16_t*) output->buf; 568 568 569 569 for (i=0; i!=input->size; ++i) { … … 572 572 } else if (priv->pt == PJMEDIA_RTP_PT_PCMU) { 573 573 unsigned i; 574 pj_uint8_t *src = input->buf;575 pj_uint16_t *dst = output->buf;574 pj_uint8_t *src = (pj_uint8_t*) input->buf; 575 pj_uint16_t *dst = (pj_uint16_t*) output->buf; 576 576 577 577 for (i=0; i!=input->size; ++i) { -
pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
r974 r1266 31 31 32 32 33 struct jb_framelist33 typedef struct jb_framelist_t 34 34 { 35 35 char *flist_buffer; … … 41 41 unsigned flist_tail; 42 42 unsigned flist_origin; 43 }; 44 45 46 typedef struct jb_framelist jb_framelist; 43 } jb_framelist_t; 44 47 45 48 46 struct pjmedia_jbuf 49 47 { 50 48 pj_str_t name; // jitter buffer name 51 jb_framelist 49 jb_framelist_t jb_framelist; 52 50 pj_size_t jb_frame_size; // frame size 53 51 unsigned jb_frame_ptime; // frame duration. … … 93 91 94 92 static pj_status_t jb_framelist_init( pj_pool_t *pool, 95 jb_framelist *framelist,93 jb_framelist_t *framelist, 96 94 unsigned frame_size, 97 95 unsigned max_count) … … 99 97 PJ_ASSERT_RETURN(pool && framelist, PJ_EINVAL); 100 98 101 pj_bzero(framelist, sizeof(jb_framelist ));99 pj_bzero(framelist, sizeof(jb_framelist_t)); 102 100 103 101 framelist->flist_frame_size = frame_size; 104 102 framelist->flist_max_count = max_count; 105 framelist->flist_buffer = pj_pool_zalloc(pool, 103 framelist->flist_buffer = (char*) 104 pj_pool_zalloc(pool, 106 105 framelist->flist_frame_size * 107 106 framelist->flist_max_count); 108 107 109 framelist->flist_frame_type = 108 framelist->flist_frame_type = (int*) 110 109 pj_pool_zalloc(pool, sizeof(framelist->flist_frame_type[0]) * 111 110 framelist->flist_max_count); … … 117 116 } 118 117 119 static pj_status_t jb_framelist_destroy(jb_framelist *framelist)118 static pj_status_t jb_framelist_destroy(jb_framelist_t *framelist) 120 119 { 121 120 PJ_UNUSED_ARG(framelist); … … 124 123 125 124 126 static unsigned jb_framelist_size(jb_framelist *framelist)125 static unsigned jb_framelist_size(jb_framelist_t *framelist) 127 126 { 128 127 if (framelist->flist_tail == framelist->flist_head) { … … 135 134 136 135 137 static pj_bool_t jb_framelist_get(jb_framelist *framelist,136 static pj_bool_t jb_framelist_get(jb_framelist_t *framelist, 138 137 void *frame, 139 138 pjmedia_jb_frame_type *p_type) … … 168 167 169 168 170 static void jb_framelist_remove_head( jb_framelist *framelist,169 static void jb_framelist_remove_head( jb_framelist_t *framelist, 171 170 unsigned count) 172 171 { … … 215 214 216 215 217 static pj_bool_t jb_framelist_put_at(jb_framelist *framelist,216 static pj_bool_t jb_framelist_put_at(jb_framelist_t *framelist, 218 217 unsigned index, 219 218 const void *frame, … … 283 282 pj_status_t status; 284 283 285 jb = pj_pool_zalloc(pool, sizeof(pjmedia_jbuf));284 jb = PJ_POOL_ZALLOC_T(pool, pjmedia_jbuf); 286 285 287 286 status = jb_framelist_init(pool, &jb->jb_framelist, frame_size, max_count); -
pjproject/trunk/pjmedia/src/pjmedia/master_port.c
r974 r1266 85 85 86 86 /* Create the master port instance */ 87 m = pj_pool_zalloc(pool, sizeof(pjmedia_master_port));87 m = PJ_POOL_ZALLOC_T(pool, pjmedia_master_port); 88 88 m->options = options; 89 89 m->u_port = u_port; … … 145 145 static void clock_callback(const pj_timestamp *ts, void *user_data) 146 146 { 147 pjmedia_master_port *m = user_data;147 pjmedia_master_port *m = (pjmedia_master_port*) user_data; 148 148 pjmedia_frame frame; 149 149 pj_status_t status; -
pjproject/trunk/pjmedia/src/pjmedia/mem_capture.c
r974 r1266 74 74 75 75 76 rec = pj_pool_zalloc(pool, sizeof(struct mem_rec));76 rec = PJ_POOL_ZALLOC_T(pool, struct mem_rec); 77 77 PJ_ASSERT_RETURN(rec != NULL, PJ_ENOMEM); 78 78 -
pjproject/trunk/pjmedia/src/pjmedia/mem_player.c
r974 r1266 76 76 77 77 78 port = pj_pool_zalloc(pool, sizeof(struct mem_player));78 port = PJ_POOL_ZALLOC_T(pool, struct mem_player); 79 79 PJ_ASSERT_RETURN(port != NULL, PJ_ENOMEM); 80 80 -
pjproject/trunk/pjmedia/src/pjmedia/null_port.c
r974 r1266 45 45 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 46 46 47 port = pj_pool_zalloc(pool, sizeof(pjmedia_port));47 port = PJ_POOL_ZALLOC_T(pool, pjmedia_port); 48 48 PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); 49 49 … … 84 84 frame->size = this_port->info.samples_per_frame * 2; 85 85 frame->timestamp.u32.lo += this_port->info.samples_per_frame; 86 pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame); 86 pjmedia_zero_samples((pj_int16_t*)frame->buf, 87 this_port->info.samples_per_frame); 87 88 88 89 return PJ_SUCCESS; -
pjproject/trunk/pjmedia/src/pjmedia/pasound.c
r1247 r1266 85 85 void *userData ) 86 86 { 87 pjmedia_snd_stream *stream = userData;87 pjmedia_snd_stream *stream = (pjmedia_snd_stream*) userData; 88 88 pj_status_t status; 89 89 … … 131 131 void *userData ) 132 132 { 133 pjmedia_snd_stream *stream = userData;133 pjmedia_snd_stream *stream = (pjmedia_snd_stream*) userData; 134 134 pj_status_t status; 135 135 unsigned size = frameCount * stream->bytes_per_sample * … … 389 389 return PJ_ENOMEM; 390 390 391 stream = pj_pool_zalloc(pool, sizeof(*stream));391 stream = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_stream); 392 392 stream->pool = pool; 393 393 pj_strdup2_with_null(pool, &stream->name, paDevInfo->name); … … 485 485 return PJ_ENOMEM; 486 486 487 stream = pj_pool_calloc(pool, 1, sizeof(*stream));487 stream = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_stream); 488 488 stream->pool = pool; 489 489 pj_strdup2_with_null(pool, &stream->name, paDevInfo->name); … … 605 605 return PJ_ENOMEM; 606 606 607 stream = pj_pool_zalloc(pool, sizeof(*stream));607 stream = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_stream); 608 608 stream->pool = pool; 609 609 pj_strdup2_with_null(pool, &stream->name, paRecDevInfo->name); -
pjproject/trunk/pjmedia/src/pjmedia/plc_common.c
r974 r1266 87 87 PJ_UNUSED_ARG(options); 88 88 89 plc = pj_pool_zalloc(pool, sizeof(pjmedia_plc));89 plc = PJ_POOL_ZALLOC_T(pool, pjmedia_plc); 90 90 91 91 if (0) … … 151 151 PJ_UNUSED_ARG(clock_rate); 152 152 153 o = pj_pool_alloc(pool, sizeof(struct replay_plc));153 o = PJ_POOL_ALLOC_T(pool, struct replay_plc); 154 154 o->size = samples_per_frame * 2; 155 155 o->replay_cnt = 0; 156 o->frame = pj_pool_zalloc(pool, o->size);156 o->frame = (pj_int16_t*) pj_pool_zalloc(pool, o->size); 157 157 158 158 return o; … … 161 161 static void plc_replay_save(void *plc, pj_int16_t *frame) 162 162 { 163 struct replay_plc *o = plc;163 struct replay_plc *o = (struct replay_plc*) plc; 164 164 165 165 pj_memcpy(o->frame, frame, o->size); … … 169 169 static void plc_replay_generate(void *plc, pj_int16_t *frame) 170 170 { 171 struct replay_plc *o = plc;171 struct replay_plc *o = (struct replay_plc*) plc; 172 172 unsigned i, count; 173 173 pj_int16_t *samp; -
pjproject/trunk/pjmedia/src/pjmedia/resample_port.c
r1171 r1266 70 70 71 71 /* Create and initialize port. */ 72 rport = pj_pool_zalloc(pool, sizeof(struct resample_port));72 rport = PJ_POOL_ZALLOC_T(pool, struct resample_port); 73 73 PJ_ASSERT_RETURN(rport != NULL, PJ_ENOMEM); 74 74 … … 85 85 * both functions may run simultaneously. 86 86 */ 87 rport->get_buf = pj_pool_alloc(pool, dn_port->info.bytes_per_frame); 87 rport->get_buf = (pj_int16_t*) 88 pj_pool_alloc(pool, dn_port->info.bytes_per_frame); 88 89 PJ_ASSERT_RETURN(rport->get_buf != NULL, PJ_ENOMEM); 89 90 90 rport->put_buf = pj_pool_alloc(pool, dn_port->info.bytes_per_frame); 91 rport->put_buf = (pj_int16_t*) 92 pj_pool_alloc(pool, dn_port->info.bytes_per_frame); 91 93 PJ_ASSERT_RETURN(rport->put_buf != NULL, PJ_ENOMEM); 92 94 … … 140 142 141 143 if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) { 142 pjmedia_resample_run( rport->resample_put, frame->buf, 144 pjmedia_resample_run( rport->resample_put, 145 (const pj_int16_t*) frame->buf, 143 146 rport->put_buf); 144 147 … … 189 192 } 190 193 191 pjmedia_resample_run( rport->resample_get, tmp_frame.buf, frame->buf); 194 pjmedia_resample_run( rport->resample_get, 195 (const pj_int16_t*) tmp_frame.buf, 196 (pj_int16_t*) frame->buf); 192 197 193 198 frame->size = rport->base.info.bytes_per_frame; -
pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c
r1242 r1266 59 59 rate_out && samples_per_frame, PJ_EINVAL); 60 60 61 resample = pj_pool_alloc(pool, sizeof(pjmedia_resample));61 resample = PJ_POOL_ALLOC_T(pool, pjmedia_resample); 62 62 PJ_ASSERT_RETURN(resample, PJ_ENOMEM); 63 63 … … 89 89 90 90 size = (samples_per_frame + 2*resample->xoff) * sizeof(pj_int16_t); 91 resample->buffer = pj_pool_alloc(pool, size);91 resample->buffer = (pj_int16_t*) pj_pool_alloc(pool, size); 92 92 PJ_ASSERT_RETURN(resample->buffer, PJ_ENOMEM); 93 93 -
pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
r974 r1266 141 141 142 142 /* Name */ 143 sess->name = name ? name : THIS_FILE,143 sess->name = name ? name : (char*)THIS_FILE, 144 144 145 145 /* Set clock rate */ … … 333 333 pj_size_t size) 334 334 { 335 const pjmedia_rtcp_common *common =pkt;335 pjmedia_rtcp_common *common = (pjmedia_rtcp_common*) pkt; 336 336 const pjmedia_rtcp_rr *rr = NULL; 337 337 const pjmedia_rtcp_sr *sr = NULL; -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r1240 r1266 461 461 rtpmap->param.ptr); 462 462 463 if (len < 1 || len > sizeof(tempbuf))463 if (len < 1 || len > (int)sizeof(tempbuf)) 464 464 return PJMEDIA_SDP_ERTPMAPTOOLONG; 465 465 -
pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
r1240 r1266 57 57 PJ_DEF(const char*) pjmedia_sdp_neg_state_str(pjmedia_sdp_neg_state state) 58 58 { 59 if (state >=0 && state < PJ_ARRAY_SIZE(state_str))59 if (state >=0 && state < (pjmedia_sdp_neg_state)PJ_ARRAY_SIZE(state_str)) 60 60 return state_str[state]; 61 61 -
pjproject/trunk/pjmedia/src/pjmedia/session.c
r1109 r1266 422 422 423 423 /* Now that we have codec info, get the codec param. */ 424 si->param = pj_pool_alloc(pool, sizeof(*si->param));424 si->param = PJ_POOL_ALLOC_T(pool, pjmedia_codec_param); 425 425 status = pjmedia_codec_mgr_get_default_param(mgr, &si->fmt, si->param); 426 426 if (status != PJ_SUCCESS) … … 533 533 PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); 534 534 535 session = pj_pool_zalloc(pool, sizeof(pjmedia_session));535 session = PJ_POOL_ZALLOC_T(pool, pjmedia_session); 536 536 session->pool = pool; 537 537 session->endpt = endpt; -
pjproject/trunk/pjmedia/src/pjmedia/silencedet.c
r974 r1266 69 69 PJ_ASSERT_RETURN(pool && p_sd, PJ_EINVAL); 70 70 71 sd = pj_pool_zalloc(pool, sizeof(struct pjmedia_silence_det));71 sd = PJ_POOL_ZALLOC_T(pool, pjmedia_silence_det); 72 72 73 73 pj_ansi_strncpy(sd->objname, THIS_FILE, PJ_MAX_OBJ_NAME); -
pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
r1202 r1266 74 74 /* out */ unsigned size) 75 75 { 76 pjmedia_snd_port *snd_port = user_data;76 pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data; 77 77 pjmedia_port *port; 78 78 pjmedia_frame frame; … … 112 112 113 113 if (snd_port->plc) 114 pjmedia_plc_save(snd_port->plc, output);114 pjmedia_plc_save(snd_port->plc, (pj_int16_t*) output); 115 115 116 116 if (snd_port->ec_state) { … … 121 121 } 122 122 snd_port->ec_suspend_count = 0; 123 pjmedia_echo_playback(snd_port->ec_state, output);123 pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)output); 124 124 } 125 125 … … 137 137 if (snd_port->ec_state) { 138 138 /* To maintain correct delay in EC */ 139 pjmedia_echo_playback(snd_port->ec_state, output);139 pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)output); 140 140 } 141 141 } … … 144 144 if (snd_port->plc) { 145 145 146 pjmedia_plc_generate(snd_port->plc, output);146 pjmedia_plc_generate(snd_port->plc, (pj_int16_t*) output); 147 147 #ifdef SIMULATE_LOST_PCT 148 148 PJ_LOG(4,(THIS_FILE, "Lost frame generated")); … … 166 166 /* in*/ unsigned size) 167 167 { 168 pjmedia_snd_port *snd_port = user_data;168 pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data; 169 169 pjmedia_port *port; 170 170 pjmedia_frame frame; … … 182 182 /* Cancel echo */ 183 183 if (snd_port->ec_state && !snd_port->ec_suspended) { 184 pjmedia_echo_capture(snd_port->ec_state, input, 0);184 pjmedia_echo_capture(snd_port->ec_state, (pj_int16_t*) input, 0); 185 185 } 186 186 … … 327 327 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 328 328 329 snd_port = pj_pool_zalloc(pool, sizeof(pjmedia_snd_port));329 snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port); 330 330 PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM); 331 331 … … 366 366 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 367 367 368 snd_port = pj_pool_zalloc(pool, sizeof(pjmedia_snd_port));368 snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port); 369 369 PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM); 370 370 … … 403 403 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 404 404 405 snd_port = pj_pool_zalloc(pool, sizeof(pjmedia_snd_port));405 snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port); 406 406 PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM); 407 407 -
pjproject/trunk/pjmedia/src/pjmedia/splitcomb.c
r974 r1266 59 59 pjmedia_port *port; 60 60 pj_bool_t reversed; 61 } *port_desc;61 } port_desc[64]; 62 62 63 63 /* Temporary buffers needed to extract mono frame from … … 144 144 145 145 /* Create the splitter/combiner structure */ 146 sc = pj_pool_zalloc(pool, sizeof(struct splitcomb));146 sc = PJ_POOL_ZALLOC_T(pool, struct splitcomb); 147 147 PJ_ASSERT_RETURN(sc != NULL, PJ_ENOMEM); 148 148 149 149 /* Create temporary buffers */ 150 sc->get_buf = pj_pool_alloc(pool, samples_per_frame * 150 sc->get_buf = (TMP_SAMP_TYPE*) 151 pj_pool_alloc(pool, samples_per_frame * 151 152 sizeof(TMP_SAMP_TYPE) / 152 153 channel_count); 153 154 PJ_ASSERT_RETURN(sc->get_buf, PJ_ENOMEM); 154 155 155 sc->put_buf = pj_pool_alloc(pool, samples_per_frame * 156 sc->put_buf = (TMP_SAMP_TYPE*) 157 pj_pool_alloc(pool, samples_per_frame * 156 158 sizeof(TMP_SAMP_TYPE) / 157 159 channel_count); … … 171 173 172 174 /* Init ports array */ 175 /* 173 176 sc->port_desc = pj_pool_zalloc(pool, channel_count*sizeof(*sc->port_desc)); 177 */ 178 pj_bzero(sc->port_desc, sizeof(sc->port_desc)); 174 179 175 180 /* Done for now */ … … 238 243 239 244 /* Create the port */ 240 rport = pj_pool_zalloc(pool, sizeof(struct reverse_port));245 rport = PJ_POOL_ZALLOC_T(pool, struct reverse_port); 241 246 rport->parent = sc; 242 247 rport->ch_num = ch_num; … … 262 267 /* Create put buffers */ 263 268 for (i=0; i<rport->buf_cnt; ++i) { 264 rport->dnstream_buf[i] = pj_pool_zalloc(pool, port->info.bytes_per_frame); 269 rport->dnstream_buf[i]=(pj_int16_t*) 270 pj_pool_zalloc(pool, port->info.bytes_per_frame); 265 271 PJ_ASSERT_RETURN(rport->dnstream_buf[i], PJ_ENOMEM); 266 272 } … … 269 275 /* Create get buffers */ 270 276 for (i=0; i<rport->buf_cnt; ++i) { 271 rport->upstream_buf[i] = pj_pool_zalloc(pool, 277 rport->upstream_buf[i] = (pj_int16_t*) 278 pj_pool_zalloc(pool, 272 279 port->info.bytes_per_frame); 273 280 PJ_ASSERT_RETURN(rport->upstream_buf[i], PJ_ENOMEM); … … 367 374 368 375 /* Extract the mono frame */ 369 extract_mono_frame( frame->buf, sc->put_buf, ch,376 extract_mono_frame((const pj_int16_t*)frame->buf, sc->put_buf, ch, 370 377 this_port->info.channel_count, 371 378 frame->size * 8 / … … 405 412 406 413 /* Extract mono-frame and put it in downstream buffer */ 407 extract_mono_frame( frame->buf,414 extract_mono_frame((const pj_int16_t*)frame->buf, 408 415 rport->dnstream_buf[rport->dn_write_pos], 409 416 ch, this_port->info.channel_count, … … 434 441 435 442 /* Clear output frame */ 436 pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame); 443 pjmedia_zero_samples((pj_int16_t*)frame->buf, 444 this_port->info.samples_per_frame); 437 445 438 446 /* Read frame from each port */ … … 460 468 461 469 /* Combine the mono frame into multichannel frame */ 462 store_mono_frame(mono_frame.buf, frame->buf, ch, 470 store_mono_frame((const pj_int16_t*)mono_frame.buf, 471 (pj_int16_t*)frame->buf, ch, 463 472 this_port->info.channel_count, 464 473 mono_frame.size * 8 / … … 495 504 496 505 /* Combine the mono frame into multichannel frame */ 497 store_mono_frame( rport->upstream_buf[rport->up_read_pos],498 frame->buf, ch,506 store_mono_frame((const pj_int16_t*)rport->upstream_buf[rport->up_read_pos], 507 (pj_int16_t*)frame->buf, ch, 499 508 this_port->info.channel_count, 500 509 port->info.samples_per_frame); … … 580 589 581 590 pjmedia_copy_samples(rport->upstream_buf[rport->up_write_pos], 582 frame->buf, count);591 (const pj_int16_t*) frame->buf, count); 583 592 rport->up_write_pos = (rport->up_write_pos+1) % rport->buf_cnt; 584 593 … … 622 631 623 632 /* Get the samples from the circular buffer */ 624 pjmedia_copy_samples( frame->buf,633 pjmedia_copy_samples((pj_int16_t*)frame->buf, 625 634 rport->dnstream_buf[rport->dn_read_pos], 626 635 count); -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r1048 r1266 167 167 static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) 168 168 { 169 pjmedia_stream *stream = port->port_data.pdata;169 pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 170 170 pjmedia_channel *channel = stream->dec; 171 171 unsigned samples_count, samples_per_frame, samples_required; … … 192 192 stream->codec_param.info.channel_cnt / 193 193 1000; 194 p_out_samp = frame->buf;194 p_out_samp = (pj_int16_t*) frame->buf; 195 195 196 196 for (samples_count=0; samples_count < samples_required; … … 383 383 pj_assert(sizeof(pjmedia_rtp_dtmf_event) == 4); 384 384 385 event = frame_out->buf;385 event = (pjmedia_rtp_dtmf_event*) frame_out->buf; 386 386 cur_ts = pj_ntohl(stream->enc->rtp.out_hdr.ts); 387 387 duration = cur_ts - digit->start_ts; … … 515 515 const pjmedia_frame *frame ) 516 516 { 517 pjmedia_stream *stream = port->port_data.pdata;517 pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 518 518 pjmedia_channel *channel = stream->enc; 519 519 pj_status_t status = 0; … … 666 666 /* Set RTP marker bit if currently not streaming */ 667 667 if (stream->is_streaming == PJ_FALSE) { 668 pjmedia_rtp_hdr *rtp = channel->out_pkt;668 pjmedia_rtp_hdr *rtp = (pjmedia_rtp_hdr*) channel->out_pkt; 669 669 670 670 rtp->m = 1; … … 698 698 const pjmedia_frame *frame ) 699 699 { 700 pjmedia_stream *stream = port->port_data.pdata;700 pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 701 701 pjmedia_frame tmp_zero_frame; 702 702 unsigned samples_per_frame; … … 831 831 const void *payload, unsigned payloadlen) 832 832 { 833 const pjmedia_rtp_dtmf_event *event =payload;833 pjmedia_rtp_dtmf_event *event = (pjmedia_rtp_dtmf_event*) payload; 834 834 835 835 /* Check compiler packing. */ … … 903 903 904 904 { 905 pjmedia_stream *stream = data;905 pjmedia_stream *stream = (pjmedia_stream*) data; 906 906 pjmedia_channel *channel = stream->dec; 907 907 const pjmedia_rtp_hdr *hdr; … … 919 919 920 920 /* Ignore keep-alive packets */ 921 if (bytes_read < sizeof(pjmedia_rtp_hdr))921 if (bytes_read < (pj_ssize_t) sizeof(pjmedia_rtp_hdr)) 922 922 return; 923 923 … … 1053 1053 pj_ssize_t bytes_read) 1054 1054 { 1055 pjmedia_stream *stream = data;1055 pjmedia_stream *stream = (pjmedia_stream*) data; 1056 1056 1057 1057 /* Check for errors */ … … 1081 1081 /* Allocate memory for channel descriptor */ 1082 1082 1083 channel = pj_pool_zalloc(pool, sizeof(pjmedia_channel));1083 channel = PJ_POOL_ZALLOC_T(pool, pjmedia_channel); 1084 1084 PJ_ASSERT_RETURN(channel != NULL, PJ_ENOMEM); 1085 1085 … … 1147 1147 /* Allocate the media stream: */ 1148 1148 1149 stream = pj_pool_zalloc(pool, sizeof(pjmedia_stream));1149 stream = PJ_POOL_ZALLOC_T(pool, pjmedia_stream); 1150 1150 PJ_ASSERT_RETURN(stream != NULL, PJ_ENOMEM); 1151 1151 1152 1152 /* Init stream/port name */ 1153 name.ptr = pj_pool_alloc(pool, M);1153 name.ptr = (char*) pj_pool_alloc(pool, M); 1154 1154 name.slen = pj_ansi_snprintf(name.ptr, M, "strm%p", stream); 1155 1155 … … 1263 1263 /* Allocate buffer */ 1264 1264 stream->enc_buf_size = stream->port.info.clock_rate * ptime / 1000; 1265 stream->enc_buf = pj_pool_alloc(pool, stream->enc_buf_size * 2); 1265 stream->enc_buf = (pj_int16_t*) 1266 pj_pool_alloc(pool, stream->enc_buf_size * 2); 1266 1267 1267 1268 } else { … … 1536 1537 1537 1538 if (stream->tx_dtmf_count+digit_char->slen >= 1538 PJ_ARRAY_SIZE(stream->tx_dtmf_buf))1539 (long)PJ_ARRAY_SIZE(stream->tx_dtmf_buf)) 1539 1540 { 1540 1541 status = PJ_ETOOMANY; -
pjproject/trunk/pjmedia/src/pjmedia/tonegen.c
r1009 r1266 306 306 307 307 /* Create and initialize port */ 308 tonegen = pj_pool_zalloc(pool, sizeof(struct tonegen));308 tonegen = PJ_POOL_ZALLOC_T(pool, struct tonegen); 309 309 if (name == NULL || name->slen == 0) name = &STR_TONE_GEN; 310 310 status = pjmedia_port_info_init(&tonegen->base.info, name, … … 422 422 } 423 423 424 dst = frame->buf;424 dst = (short*) frame->buf; 425 425 end = dst + port->info.samples_per_frame; 426 426 -
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r1162 r1266 250 250 unsigned i, cand_cnt; 251 251 252 buffer = pj_pool_alloc(pool, MAXLEN);252 buffer = (char*) pj_pool_alloc(pool, MAXLEN); 253 253 254 254 /* Create ice-ufrag attribute */ -
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r1248 r1266 235 235 return PJ_ENOMEM; 236 236 237 tp = pj_pool_zalloc(pool, sizeof(struct transport_udp));237 tp = PJ_POOL_ZALLOC_T(pool, struct transport_udp); 238 238 tp->pool = pool; 239 239 tp->options = options; … … 379 379 PJ_UNUSED_ARG(op_key); 380 380 381 udp = pj_ioqueue_get_user_data(key);381 udp = (struct transport_udp*) pj_ioqueue_get_user_data(key); 382 382 383 383 do { … … 480 480 PJ_UNUSED_ARG(op_key); 481 481 482 udp = pj_ioqueue_get_user_data(key);482 udp = (struct transport_udp*) pj_ioqueue_get_user_data(key); 483 483 484 484 do { … … 568 568 569 569 /* Copy remote RTP address, if one is specified. */ 570 rtcp_addr = rem_rtcp;570 rtcp_addr = (const pj_sockaddr_in*) rem_rtcp; 571 571 if (rtcp_addr && rtcp_addr->sin_addr.s_addr != 0) { 572 572 pj_memcpy(&udp->rem_rtcp_addr, rem_rtcp, sizeof(pj_sockaddr_in)); -
pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
r974 r1266 80 80 struct file_port *port; 81 81 82 port = pj_pool_zalloc(pool, sizeof(struct file_port));82 port = PJ_POOL_ZALLOC_T(pool, struct file_port); 83 83 if (!port) 84 84 return NULL; … … 350 350 351 351 /* Create buffer. */ 352 fport->buf = pj_pool_alloc(pool, fport->bufsize);352 fport->buf = (char*) pj_pool_alloc(pool, fport->bufsize); 353 353 if (!fport->buf) { 354 354 pj_file_close(fport->fd); -
pjproject/trunk/pjmedia/src/pjmedia/wav_playlist.c
r919 r1266 85 85 struct playlist_port *port; 86 86 87 port = pj_pool_zalloc(pool, sizeof(struct playlist_port));87 port = PJ_POOL_ZALLOC_T(pool, struct playlist_port); 88 88 if (!port) 89 89 return NULL; … … 276 276 277 277 /* Create file descriptor list */ 278 fport->fd_list = pj_pool_zalloc(pool, sizeof(pj_oshandle_t)*file_count); 278 fport->fd_list = (pj_oshandle_t*) 279 pj_pool_zalloc(pool, sizeof(pj_oshandle_t)*file_count); 279 280 if (!fport->fd_list) { 280 281 return PJ_ENOMEM; … … 282 283 283 284 /* Create file size list */ 284 fport->fsize_list = pj_pool_alloc(pool, sizeof(pj_off_t)*file_count); 285 fport->fsize_list = (pj_off_t*) 286 pj_pool_alloc(pool, sizeof(pj_off_t)*file_count); 285 287 if (!fport->fsize_list) { 286 288 return PJ_ENOMEM; … … 288 290 289 291 /* Create start of WAVE data list */ 290 fport->start_data_list = pj_pool_alloc(pool, sizeof(unsigned)*file_count); 292 fport->start_data_list = (unsigned*) 293 pj_pool_alloc(pool, sizeof(unsigned)*file_count); 291 294 if (!fport->start_data_list) { 292 295 return PJ_ENOMEM; … … 294 297 295 298 /* Create file position list */ 296 fport->fpos_list = pj_pool_alloc(pool, sizeof(pj_off_t)*file_count); 299 fport->fpos_list = (pj_off_t*) 300 pj_pool_alloc(pool, sizeof(pj_off_t)*file_count); 297 301 if (!fport->fpos_list) { 298 302 return PJ_ENOMEM; … … 306 310 307 311 /* Create buffer. */ 308 fport->buf = pj_pool_alloc(pool, fport->bufsize);312 fport->buf = (char*) pj_pool_alloc(pool, fport->bufsize); 309 313 if (!fport->buf) { 310 314 return PJ_ENOMEM; -
pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c
r974 r1266 84 84 85 85 /* Create file port instance. */ 86 fport = pj_pool_zalloc(pool, sizeof(struct file_port));86 fport = PJ_POOL_ZALLOC_T(pool, struct file_port); 87 87 PJ_ASSERT_RETURN(fport != NULL, PJ_ENOMEM); 88 88 … … 150 150 151 151 /* Allocate buffer and set initial write position */ 152 fport->buf = pj_pool_alloc(pool, fport->bufsize);152 fport->buf = (char*) pj_pool_alloc(pool, fport->bufsize); 153 153 if (fport->buf == NULL) { 154 154 pj_file_close(fport->fd); -
pjproject/trunk/pjnath/src/pjnath/stun_msg.c
r1265 r1266 18 18 */ 19 19 #include <pjnath/stun_msg.h> 20 #include <pjnath/stun_auth.h> 20 21 #include <pjnath/errno.h> 21 22 #include <pjlib-util/crc32.h> -
pjproject/trunk/pjnath/src/pjstun-client/client_main.c
r1210 r1266 28 28 #define REQ_TRANSPORT -1 /* 0: udp, 1: tcp, -1: disable */ 29 29 #define REQ_PORT_PROPS -1 /* -1 to disable */ 30 #define REQ_IP NULL/* IP address string */30 #define REQ_IP 0 /* IP address string */ 31 31 32 32 //#define OPTIONS PJ_STUN_NO_AUTHENTICATE … … 355 355 } 356 356 357 if (REQ_IP != NULL) {357 if (REQ_IP) { 358 358 pj_sockaddr_in addr; 359 359 pj_str_t tmp; -
pjproject/trunk/pjnath/src/pjstun-srv-test/server.c
r1091 r1266 88 88 89 89 srv->si.thread_cnt = thread_cnt; 90 srv->threads = pj_pool_calloc(pool, thread_cnt, sizeof(pj_thread_t*)); 90 srv->threads = (pj_thread_t**) 91 pj_pool_calloc(pool, thread_cnt, sizeof(pj_thread_t*)); 91 92 for (i=0; i<thread_cnt; ++i) { 92 93 status = pj_thread_create(pool, "worker%p", &worker_thread, -
pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
r1091 r1266 286 286 287 287 if (client) { 288 status = pj_stun_msg_check( pkt, pkt_size, flags);288 status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size, flags); 289 289 290 290 if (status == PJ_SUCCESS) { … … 1355 1355 PJ_UNUSED_ARG(op_key); 1356 1356 1357 client = pj_ioqueue_get_user_data(key);1357 client = (struct turn_client*) pj_ioqueue_get_user_data(key); 1358 1358 1359 1359 /* Lock client */ -
pjproject/trunk/pjnath/src/pjstun-srv-test/usage.c
r1054 r1266 100 100 101 101 usage->worker_cnt = si->thread_cnt; 102 usage->worker = pj_pool_calloc(pool, si->thread_cnt,103 sizeof(struct worker));102 usage->worker = (struct worker*) pj_pool_calloc(pool, si->thread_cnt, 103 sizeof(struct worker)); 104 104 for (i=0; i<si->thread_cnt; ++i) { 105 105 pj_ioqueue_op_key_init(&usage->worker[i].read_key, … … 109 109 110 110 usage->send_count = usage->worker_cnt * 2; 111 usage->send_key = pj_pool_calloc(pool, usage->send_count, 111 usage->send_key = (pj_ioqueue_op_key_t*) 112 pj_pool_calloc(pool, usage->send_count, 112 113 sizeof(pj_ioqueue_op_key_t)); 113 114 for (i=0; i<usage->send_count; ++i) { … … 241 242 { 242 243 enum { MAX_LOOP = 10 }; 243 pj_stun_usage *usage = pj_ioqueue_get_user_data(key);244 pj_stun_usage *usage = (pj_stun_usage*) pj_ioqueue_get_user_data(key); 244 245 struct worker *worker = (struct worker*) op_key; 245 246 unsigned count; -
pjproject/trunk/pjsip/build/Makefile
r1202 r1266 90 90 tsx_uas_test.o txdata_test.o uri_test.o 91 91 export TEST_CFLAGS += $(_CFLAGS) 92 export TEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) 92 export TEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS) 93 93 export TEST_EXE := ../bin/pjsip-test-$(TARGET_NAME)$(HOST_EXE) 94 94 -
pjproject/trunk/pjsip/src/pjsip-simple/presence.c
r1241 r1266 58 58 * Presence message body type. 59 59 */ 60 typedef enum content_type 60 typedef enum content_type_e 61 61 { 62 62 CONTENT_TYPE_NONE, 63 63 CONTENT_TYPE_PIDF, 64 64 CONTENT_TYPE_XPIDF, 65 } content_type ;65 } content_type_e; 66 66 67 67 /* … … 72 72 pjsip_evsub *sub; /**< Event subscribtion record. */ 73 73 pjsip_dialog *dlg; /**< The dialog. */ 74 content_type content_type; /**< Content-Type. */74 content_type_e content_type; /**< Content-Type. */ 75 75 pjsip_pres_status status; /**< Presence status. */ 76 76 pjsip_pres_status tmp_status; /**< Temp, before NOTIFY is answred.*/ … … 227 227 pjsip_expires_hdr *expires_hdr; 228 228 unsigned expires; 229 content_type content_type = CONTENT_TYPE_NONE;229 content_type_e content_type = CONTENT_TYPE_NONE; 230 230 pjsip_evsub *sub; 231 231 pjsip_pres *pres; -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r1242 r1266 230 230 return PJ_FALSE; 231 231 232 inv = dlg->mod_data[mod_inv.mod.id];232 inv = (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id]; 233 233 234 234 /* Report to dialog that we handle INVITE, CANCEL, BYE, ACK. … … 412 412 PJ_DEF(pjsip_inv_session*) pjsip_dlg_get_inv_session(pjsip_dialog *dlg) 413 413 { 414 return dlg->mod_data[mod_inv.mod.id];414 return (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id]; 415 415 } 416 416 … … 453 453 454 454 /* Create the session */ 455 inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));455 inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session); 456 456 pj_assert(inv != NULL); 457 457 … … 578 578 579 579 /* Parse and validate SDP */ 580 status = pjmedia_sdp_parse(rdata->tp_info.pool, body->data, body->len,581 &sdp);580 status = pjmedia_sdp_parse(rdata->tp_info.pool, 581 (char*)body->data, body->len, &sdp); 582 582 if (status == PJ_SUCCESS) 583 583 status = pjmedia_sdp_validate(sdp); … … 651 651 * implicitly by sending this INVITE. 652 652 */ 653 allow = pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL);653 allow = (pjsip_allow_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL); 654 654 if (allow) { 655 655 unsigned i; … … 669 669 670 670 /* Check Supported header */ 671 sup_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL); 671 sup_hdr = (pjsip_supported_hdr*) 672 pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL); 672 673 if (sup_hdr) { 673 674 unsigned i; … … 684 685 685 686 /* Check Require header */ 686 req_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL); 687 req_hdr = (pjsip_require_hdr*) 688 pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL); 687 689 if (req_hdr) { 688 690 unsigned i; … … 743 745 pj_assert(h); 744 746 if (h) { 745 sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h); 747 sup_hdr = (pjsip_supported_hdr*) 748 pjsip_hdr_clone(rdata->tp_info.pool, h); 746 749 pj_list_push_back(&res_hdr_list, sup_hdr); 747 750 } … … 783 786 pj_assert(h); 784 787 if (h) { 785 sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h); 788 sup_hdr = (pjsip_supported_hdr*) 789 pjsip_hdr_clone(rdata->tp_info.pool, h); 786 790 pj_list_push_back(&res_hdr_list, sup_hdr); 787 791 } … … 815 819 pjsip_hdr *cloned; 816 820 817 cloned = pjsip_hdr_clone(tdata->pool, h);821 cloned = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, h); 818 822 PJ_ASSERT_RETURN(cloned, PJ_ENOMEM); 819 823 … … 875 879 876 880 /* Create the session */ 877 inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));881 inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session); 878 882 pj_assert(inv != NULL); 879 883 … … 894 898 895 899 /* Parse and validate SDP */ 896 status = pjmedia_sdp_parse(inv->pool, body->data, body->len,900 status = pjmedia_sdp_parse(inv->pool, (char*)body->data, body->len, 897 901 &rem_sdp); 898 902 if (status == PJ_SUCCESS) … … 936 940 937 941 /* Attach our data to the transaction. */ 938 tsx_inv_data = pj_pool_zalloc(inv->invite_tsx->pool, 939 sizeof(struct tsx_inv_data)); 942 tsx_inv_data = PJ_POOL_ZALLOC_T(inv->invite_tsx->pool, struct tsx_inv_data); 940 943 tsx_inv_data->inv = inv; 941 944 inv->invite_tsx->mod_data[mod_inv.mod.id] = tsx_inv_data; … … 998 1001 { 999 1002 PJ_UNUSED_ARG(len); 1000 return pjmedia_sdp_session_clone(pool, data);1003 return pjmedia_sdp_session_clone(pool, (const pjmedia_sdp_session*)data); 1001 1004 } 1002 1005 1003 1006 static int print_sdp(pjsip_msg_body *body, char *buf, pj_size_t len) 1004 1007 { 1005 return pjmedia_sdp_print( body->data, buf, len);1008 return pjmedia_sdp_print((const pjmedia_sdp_session*)body->data, buf, len); 1006 1009 } 1007 1010 … … 1015 1018 pjsip_msg_body *body; 1016 1019 1017 body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));1020 body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); 1018 1021 PJ_ASSERT_RETURN(body != NULL, PJ_ENOMEM); 1019 1022 … … 1083 1086 1084 1087 while (hdr != &inv->dlg->inv_hdr) { 1085 pjsip_msg_add_hdr(tdata->msg, 1088 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1086 1089 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1087 1090 hdr = hdr->next; … … 1118 1121 hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_ALLOW, NULL); 1119 1122 if (hdr) { 1120 pjsip_msg_add_hdr(tdata->msg, 1123 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1121 1124 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1122 1125 } … … 1125 1128 hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL); 1126 1129 if (hdr) { 1127 pjsip_msg_add_hdr(tdata->msg, 1130 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 1128 1131 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1129 1132 } … … 1178 1181 1179 1182 /* Get/attach invite session's transaction data */ 1180 tsx_inv_data = tsx->mod_data[mod_inv.mod.id];1183 tsx_inv_data = (struct tsx_inv_data*) tsx->mod_data[mod_inv.mod.id]; 1181 1184 if (tsx_inv_data == NULL) { 1182 tsx_inv_data = pj_pool_zalloc(tsx->pool, sizeof(struct tsx_inv_data));1185 tsx_inv_data = PJ_POOL_ZALLOC_T(tsx->pool, struct tsx_inv_data); 1183 1186 tsx_inv_data->inv = inv; 1184 1187 tsx->mod_data[mod_inv.mod.id] = tsx_inv_data; … … 1208 1211 /* Parse the SDP body. */ 1209 1212 1210 status = pjmedia_sdp_parse(rdata->tp_info.pool, msg->body->data, 1213 status = pjmedia_sdp_parse(rdata->tp_info.pool, 1214 (char*)msg->body->data, 1211 1215 msg->body->len, &sdp); 1212 1216 if (status != PJ_SUCCESS) { … … 1588 1592 1589 1593 pj_strdup_with_null(inv->dlg->pool, &tmp, new_contact); 1590 contact_hdr = pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT, 1594 contact_hdr = (pjsip_contact_hdr*) 1595 pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT, 1591 1596 tmp.ptr, tmp.slen, NULL); 1592 1597 if (!contact_hdr) { … … 1685 1690 pjsip_dlg_inc_lock(inv->dlg); 1686 1691 1687 tsx_inv_data = pj_pool_zalloc(inv->pool, sizeof(struct tsx_inv_data));1692 tsx_inv_data = PJ_POOL_ZALLOC_T(inv->pool, struct tsx_inv_data); 1688 1693 tsx_inv_data->inv = inv; 1689 1694 … … 1701 1706 * request. 1702 1707 */ 1703 PJ_ASSERT_RETURN((cseq= pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL1708 PJ_ASSERT_RETURN((cseq=(pjsip_cseq_hdr*)pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL 1704 1709 && (cseq->cseq == inv->invite_tsx->cseq), 1705 1710 PJ_EINVALIDOP); … … 2416 2421 NULL); 2417 2422 if (accept) { 2418 pjsip_msg_add_hdr(tdata->msg, 2423 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) 2419 2424 pjsip_hdr_clone(tdata->pool, accept)); 2420 2425 } -
pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
r974 r1266 104 104 PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); 105 105 106 regc = pj_pool_zalloc(pool, sizeof(struct pjsip_regc));106 regc = PJ_POOL_ZALLOC_T(pool, pjsip_regc); 107 107 108 108 regc->pool = pool; … … 110 110 regc->token = token; 111 111 regc->cb = cb; 112 regc->contact_buf = pj_pool_alloc(pool, PJSIP_REGC_CONTACT_BUF_SIZE);112 regc->contact_buf = (char*)pj_pool_alloc(pool, PJSIP_REGC_CONTACT_BUF_SIZE); 113 113 regc->expires = PJSIP_REGC_EXPIRATION_NOT_SPECIFIED; 114 114 … … 387 387 const pjsip_route_hdr *route; 388 388 389 route_pos = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 389 route_pos = (pjsip_hdr*) 390 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 390 391 if (!route_pos) 391 392 route_pos = &tdata->msg->hdr; … … 393 394 route = regc->route_set.next; 394 395 while (route != ®c->route_set) { 395 pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, route); 396 pjsip_hdr *new_hdr = (pjsip_hdr*) 397 pjsip_hdr_shallow_clone(tdata->pool, route); 396 398 pj_list_insert_after(route_pos, new_hdr); 397 399 route_pos = new_hdr; … … 406 408 hdr = regc->hdr_list.next; 407 409 while (hdr != ®c->hdr_list) { 408 pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, hdr); 410 pjsip_hdr *new_hdr = (pjsip_hdr*) 411 pjsip_hdr_shallow_clone(tdata->pool, hdr); 409 412 pjsip_msg_add_hdr(tdata->msg, new_hdr); 410 413 hdr = hdr->next; … … 433 436 /* Add Contact header. */ 434 437 msg = tdata->msg; 435 pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool, 438 pjsip_msg_add_hdr(msg, (pjsip_hdr*) 439 pjsip_hdr_shallow_clone(tdata->pool, 436 440 regc->contact_hdr)); 437 441 if (regc->expires_hdr) 438 pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool, 442 pjsip_msg_add_hdr(msg, (pjsip_hdr*) 443 pjsip_hdr_shallow_clone(tdata->pool, 439 444 regc->expires_hdr)); 440 445 … … 471 476 472 477 msg = tdata->msg; 473 pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool, 478 pjsip_msg_add_hdr(msg, (pjsip_hdr*) 479 pjsip_hdr_shallow_clone(tdata->pool, 474 480 regc->contact_hdr)); 475 481 pjsip_msg_add_hdr( msg, (pjsip_hdr*)regc->unreg_expires_hdr); … … 554 560 struct pj_timer_entry *entry) 555 561 { 556 pjsip_regc *regc = entry->user_data;562 pjsip_regc *regc = (pjsip_regc*) entry->user_data; 557 563 pjsip_tx_data *tdata; 558 564 pj_status_t status; … … 588 594 { 589 595 pj_status_t status; 590 pjsip_regc *regc = token;596 pjsip_regc *regc = (pjsip_regc*) token; 591 597 pjsip_transaction *tsx = event->body.tsx_state.tsx; 592 598 … … 654 660 rdata = event->body.tsx_state.src.rdata; 655 661 msg = rdata->msg_info.msg; 656 hdr = pjsip_msg_find_hdr( msg, PJSIP_H_CONTACT, NULL); 662 hdr = (pjsip_contact_hdr*) 663 pjsip_msg_find_hdr( msg, PJSIP_H_CONTACT, NULL); 657 664 while (hdr) { 658 665 contact[contact_cnt++] = hdr; … … 660 667 if (hdr == (void*)&msg->hdr) 661 668 break; 662 hdr = pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, hdr); 669 hdr = (pjsip_contact_hdr*) 670 pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, hdr); 663 671 } 664 672 665 expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 673 expires = (pjsip_expires_hdr*) 674 pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 666 675 667 676 if (expires) … … 741 750 /* Increment CSeq */ 742 751 cseq = ++regc->cseq_hdr->cseq; 743 cseq_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL); 752 cseq_hdr = (pjsip_cseq_hdr*) 753 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL); 744 754 cseq_hdr->cseq = cseq; 745 755 -
pjproject/trunk/pjsip/src/pjsip-ua/sip_replaces.c
r974 r1266 53 53 PJ_DEF(pjsip_replaces_hdr*) pjsip_replaces_hdr_create(pj_pool_t *pool) 54 54 { 55 pjsip_replaces_hdr *hdr = pj_pool_zalloc(pool, sizeof(*hdr));55 pjsip_replaces_hdr *hdr = PJ_POOL_ZALLOC_T(pool, pjsip_replaces_hdr); 56 56 hdr->type = PJSIP_H_OTHER; 57 57 hdr->name.ptr = "Replaces"; … … 109 109 const pjsip_replaces_hdr *rhs ) 110 110 { 111 pjsip_replaces_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));111 pjsip_replaces_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_replaces_hdr); 112 112 pj_memcpy(hdr, rhs, sizeof(*hdr)); 113 113 pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); … … 145 145 hdr->early_only = PJ_TRUE; 146 146 } else { 147 pjsip_param *param = pj_pool_alloc(ctx->pool, sizeof(pjsip_param));147 pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param); 148 148 param->name = pname; 149 149 param->value = pvalue; … … 319 319 pjsip_hdr *cloned; 320 320 321 cloned = pjsip_hdr_clone(tdata->pool, h);321 cloned = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, h); 322 322 PJ_ASSERT_RETURN(cloned, PJ_ENOMEM); 323 323 -
pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c
r1242 r1266 180 180 181 181 /* Create xfer session */ 182 xfer = pj_pool_zalloc(dlg->pool, sizeof(pjsip_xfer));182 xfer = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_xfer); 183 183 xfer->dlg = dlg; 184 184 xfer->sub = sub; … … 249 249 250 250 /* Create server xfer subscription */ 251 xfer = pj_pool_zalloc(dlg->pool, sizeof(pjsip_xfer));251 xfer = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_xfer); 252 252 xfer->dlg = dlg; 253 253 xfer->sub = sub; … … 287 287 288 288 /* Get the xfer object. */ 289 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);289 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 290 290 PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION); 291 291 … … 374 374 375 375 /* Get the xfer object. */ 376 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);376 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 377 377 PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION); 378 378 … … 399 399 400 400 /* Create sipfrag content. */ 401 body = pj_pool_alloc(tdata->pool, 128);401 body = (char*) pj_pool_alloc(tdata->pool, 128); 402 402 bodylen = pj_ansi_snprintf(body, 128, "SIP/2.0 %u %.*s", 403 403 xfer_st_code, … … 410 410 411 411 /* Create SIP message body. */ 412 msg_body = pj_pool_zalloc(tdata->pool, sizeof(pjsip_msg_body));412 msg_body = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_msg_body); 413 413 msg_body->content_type.type = STR_MESSAGE; 414 414 msg_body->content_type.subtype = STR_SIPFRAG; … … 448 448 449 449 /* Get the xfer object. */ 450 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);450 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 451 451 PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION); 452 452 … … 481 481 pjsip_xfer *xfer; 482 482 483 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);483 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 484 484 PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;}); 485 485 … … 497 497 pjsip_xfer *xfer; 498 498 499 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);499 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 500 500 PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;}); 501 501 … … 516 516 pjsip_xfer *xfer; 517 517 518 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);518 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 519 519 PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;}); 520 520 … … 557 557 pjsip_xfer *xfer; 558 558 559 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);559 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 560 560 PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;}); 561 561 … … 572 572 pjsip_xfer *xfer; 573 573 574 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);574 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 575 575 PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;}); 576 576 … … 595 595 pjsip_xfer *xfer; 596 596 597 xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);597 xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id); 598 598 PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;}); 599 599 -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r1240 r1266 168 168 pj_status_t status = PJ_SUCCESS; 169 169 pjsip_module *m; 170 inti;170 unsigned i; 171 171 172 172 pj_rwmutex_lock_write(endpt->mod_mutex); … … 248 248 249 249 /* Make sure the module exists in the array. */ 250 PJ_ASSERT_ON_FAIL( mod->id>=0 && mod->id<PJ_ARRAY_SIZE(endpt->modules) && 250 PJ_ASSERT_ON_FAIL( mod->id>=0 && 251 mod->id<(int)PJ_ARRAY_SIZE(endpt->modules) && 251 252 endpt->modules[mod->id] == mod, 252 253 {status = PJ_ENOTFOUND; goto on_return;}); … … 1080 1081 1081 1082 len = pj_ansi_strlen(format); 1082 if (len < sizeof(newformat)-30) {1083 if (len < (int)sizeof(newformat)-30) { 1083 1084 pj_str_t errstr; 1084 1085 -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r1240 r1266 98 98 static int init_status_phrase() 99 99 { 100 inti;100 unsigned i; 101 101 pj_str_t default_reason_phrase = { "Default status message", 22}; 102 102 … … 195 195 pj_str_t *str) 196 196 { 197 inti;197 unsigned i; 198 198 for (i=0; i<PJ_ARRAY_SIZE(method_names); ++i) { 199 199 if (pj_memcmp(str->ptr, method_names[i]->ptr, str->slen)==0 || … … 516 516 } 517 517 518 return (code>=100 && code<(sizeof(status_phrase)/sizeof(status_phrase[0]))) ? 518 return (code>=100 && 519 code<(int)(sizeof(status_phrase)/sizeof(status_phrase[0]))) ? 519 520 &status_phrase[code] : &status_phrase[0]; 520 521 } -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r1248 r1266 98 98 * Transport names. 99 99 */ 100 struct 100 struct transport_names_t 101 101 { 102 102 pjsip_transport_type_e type; … … 217 217 218 218 /* Check that argument is valid. */ 219 PJ_ASSERT_RETURN( type < PJ_ARRAY_SIZE(transport_names), 0);219 PJ_ASSERT_RETURN((unsigned)type < PJ_ARRAY_SIZE(transport_names), 0); 220 220 221 221 /* Return transport flag. */ … … 236 236 237 237 /* Check that argument is valid. */ 238 PJ_ASSERT_RETURN( type < PJ_ARRAY_SIZE(transport_names), 5060);238 PJ_ASSERT_RETURN((unsigned)type < PJ_ARRAY_SIZE(transport_names), 5060); 239 239 240 240 /* Return the port. */ … … 254 254 255 255 /* Check that argument is valid. */ 256 PJ_ASSERT_RETURN( type <PJ_ARRAY_SIZE(transport_names), "Unknown");256 PJ_ASSERT_RETURN((unsigned)type<PJ_ARRAY_SIZE(transport_names), "Unknown"); 257 257 258 258 /* Return the port. */ … … 415 415 } 416 416 417 if (len < 1 || len >= sizeof(info_buf)) {417 if (len < 1 || len >= (int)sizeof(info_buf)) { 418 418 return (char*)obj_name; 419 419 } -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c
r1088 r1266 260 260 { 261 261 enum { M = 48 }; 262 host_port->host.ptr = pj_pool_alloc(pool, M);262 host_port->host.ptr = (char*)pj_pool_alloc(pool, M); 263 263 host_port->host.slen = pj_ansi_snprintf( host_port->host.ptr, M, "%s", 264 264 pj_inet_ntoa(addr->sin_addr)); … … 270 270 static int password_cb(char *buf, int num, int rwflag, void *user_data) 271 271 { 272 struct tls_listener *lis = user_data;272 struct tls_listener *lis = (struct tls_listener*) user_data; 273 273 274 274 PJ_UNUSED_ARG(rwflag); … … 905 905 906 906 907 listener = pj_pool_zalloc(pool, sizeof(struct tls_listener));907 listener = PJ_POOL_ZALLOC_T(pool, struct tls_listener); 908 908 listener->factory.pool = pool; 909 909 listener->factory.type = PJSIP_TRANSPORT_TLS; … … 1037 1037 } 1038 1038 1039 listener->accept_op[i] = pj_pool_zalloc(pool, 1040 sizeof(struct pending_accept)); 1039 listener->accept_op[i] = PJ_POOL_ZALLOC_T(pool, struct pending_accept); 1041 1040 pj_ioqueue_op_key_init(&listener->accept_op[i]->op_key, 1042 1041 sizeof(listener->accept_op[i]->op_key)); … … 1192 1191 * Create and initialize basic transport structure. 1193 1192 */ 1194 tls = pj_pool_zalloc(pool, sizeof(*tls));1193 tls = PJ_POOL_ZALLOC_T(pool, struct tls_transport); 1195 1194 tls->sock = sock; 1196 1195 tls->is_server = is_server; … … 1218 1217 tls->base.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); 1219 1218 1220 tls->base.info = pj_pool_alloc(pool, 64);1219 tls->base.info = (char*) pj_pool_alloc(pool, 64); 1221 1220 pj_ansi_snprintf(tls->base.info, 64, "TLS to %s:%d", 1222 1221 pj_inet_ntoa(remote->sin_addr), … … 1636 1635 int err_cnt = 0; 1637 1636 1638 listener = pj_ioqueue_get_user_data(key);1637 listener = (struct tls_listener*) pj_ioqueue_get_user_data(key); 1639 1638 accept_op = (struct pending_accept*) op_key; 1640 1639 … … 1695 1694 pool = pjsip_endpt_create_pool(listener->endpt, "tlss%p", 1696 1695 POOL_TP_INIT, POOL_TP_INC); 1697 new_op = pj_pool_zalloc(pool, sizeof(struct pending_accept));1696 new_op = PJ_POOL_ZALLOC_T(pool, struct pending_accept); 1698 1697 new_op->pool = pool; 1699 1698 new_op->listener = listener; … … 1757 1756 pj_ssize_t bytes_sent) 1758 1757 { 1759 struct tls_transport *tls = pj_ioqueue_get_user_data(key);1758 struct tls_transport *tls; 1760 1759 pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key; 1761 1760 1761 tls = (struct tls_transport*) pj_ioqueue_get_user_data(key); 1762 1762 tdata_op_key->tdata = NULL; 1763 1763 … … 1790 1790 struct delayed_tdata *delayed_tdata; 1791 1791 1792 delayed_tdata = pj_pool_alloc(tdata->pool, 1793 sizeof(*delayed_tdata)); 1792 delayed_tdata = PJ_POOL_ALLOC_T(tdata->pool, struct delayed_tdata); 1794 1793 delayed_tdata->tdata_op_key = &tdata->op_key; 1795 1794 pj_list_push_back(&tls->delayed_list, delayed_tdata); … … 2098 2097 int addrlen; 2099 2098 2100 tls = pj_ioqueue_get_user_data(key);2099 tls = (struct tls_transport*) pj_ioqueue_get_user_data(key); 2101 2100 2102 2101 /* Check connect() status */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r1242 r1266 38 38 PJ_DEF(pj_bool_t) pjsua_acc_is_valid(pjsua_acc_id acc_id) 39 39 { 40 return acc_id>=0 && acc_id< PJ_ARRAY_SIZE(pjsua_var.acc) &&40 return acc_id>=0 && acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc) && 41 41 pjsua_var.acc[acc_id].valid; 42 42 } … … 186 186 pj_strdup_with_null(pjsua_var.pool, &tmp, 187 187 &pjsua_var.ua_cfg.outbound_proxy[i]); 188 r = pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL); 188 r = (pjsip_route_hdr*) 189 pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL); 189 190 if (r == NULL) { 190 191 pjsua_perror(THIS_FILE, "Invalid outbound proxy URI", … … 201 202 202 203 pj_strdup_with_null(pjsua_var.pool, &tmp, &acc_cfg->proxy[i]); 203 r = pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL); 204 r = (pjsip_route_hdr*) 205 pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL); 204 206 if (r == NULL) { 205 207 pjsua_perror(THIS_FILE, "Invalid URI in account route set", … … 323 325 324 326 /* ID must be valid */ 325 PJ_ASSERT_RETURN(tid>=0 && tid<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL); 327 PJ_ASSERT_RETURN(tid>=0 && tid<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 328 PJ_EINVAL); 326 329 327 330 /* Transport must be valid */ … … 434 437 { 435 438 436 pjsua_acc *acc = param->token;439 pjsua_acc *acc = (pjsua_acc*) param->token; 437 440 438 441 PJSUA_LOCK(); … … 817 820 } 818 821 819 sip_uri = pjsip_uri_get_uri(uri);822 sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(uri); 820 823 821 824 /* Find matching domain AND port */ … … 955 958 r = acc->route_set.next; 956 959 while (r != &acc->route_set) { 957 pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, r)); 960 pjsip_msg_add_hdr(tdata->msg, 961 (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, r)); 958 962 r = r->next; 959 963 } … … 1037 1041 1038 1042 /* Create the contact header */ 1039 contact->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);1043 contact->ptr = (char*)pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 1040 1044 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, 1041 1045 "%.*s%s<%s:%.*s%s%.*s:%d;transport=%s>", … … 1098 1102 1099 1103 /* Otherwise URI is Contact URI */ 1100 h_contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1104 h_contact = (pjsip_contact_hdr*) 1105 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1101 1106 NULL); 1102 1107 if (h_contact) 1103 uri = pjsip_uri_get_uri(h_contact->uri);1108 uri = (pjsip_uri*) pjsip_uri_get_uri(h_contact->uri); 1104 1109 1105 1110 … … 1108 1113 */ 1109 1114 if (uri == NULL) 1110 uri = pjsip_uri_get_uri(rdata->msg_info.from->uri);1115 uri = (pjsip_uri*) pjsip_uri_get_uri(rdata->msg_info.from->uri); 1111 1116 1112 1117 … … 1143 1148 1144 1149 /* Create the contact header */ 1145 contact->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);1150 contact->ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 1146 1151 contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE, 1147 1152 "%.*s%s<%s:%.*s%s%.*s:%d;transport=%s>", … … 1170 1175 acc = &pjsua_var.acc[acc_id]; 1171 1176 1172 PJ_ASSERT_RETURN(tp_id >= 0 && tp_id < PJ_ARRAY_SIZE(pjsua_var.tpdata),1177 PJ_ASSERT_RETURN(tp_id >= 0 && tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 1173 1178 PJ_EINVAL); 1174 1179 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r1264 r1266 204 204 pjsua_acc *acc; 205 205 pjsua_call *call; 206 unsigned call_id;206 int call_id = -1; 207 207 pj_str_t contact; 208 208 pjsip_tx_data *tdata; … … 211 211 212 212 /* Check that account is valid */ 213 PJ_ASSERT_RETURN(acc_id>=0 || acc_id< PJ_ARRAY_SIZE(pjsua_var.acc),213 PJ_ASSERT_RETURN(acc_id>=0 || acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc), 214 214 PJ_EINVAL); 215 215 … … 231 231 232 232 /* Find free call slot. */ 233 for (call_id=0; call_id< pjsua_var.ua_cfg.max_calls; ++call_id) {233 for (call_id=0; call_id<(int)pjsua_var.ua_cfg.max_calls; ++call_id) { 234 234 if (pjsua_var.calls[call_id].inv == NULL) 235 235 break; 236 236 } 237 237 238 if (call_id == pjsua_var.ua_cfg.max_calls) {238 if (call_id == (int)pjsua_var.ua_cfg.max_calls) { 239 239 pjsua_perror(THIS_FILE, "Error making file", PJ_ETOOMANY); 240 240 PJSUA_UNLOCK(); … … 508 508 509 509 /* Get the replaced call instance */ 510 replaced_call = replaced_dlg->mod_data[pjsua_var.mod.id];510 replaced_call = (pjsua_call*) replaced_dlg->mod_data[pjsua_var.mod.id]; 511 511 512 512 /* Notify application */ … … 691 691 692 692 /* Get the replaced call instance */ 693 replaced_call = replaced_dlg->mod_data[pjsua_var.mod.id];693 replaced_call = (pjsua_call*) replaced_dlg->mod_data[pjsua_var.mod.id]; 694 694 695 695 /* Notify application */ … … 1378 1378 dest_dlg->remote.info->tag.slen + 1379 1379 dest_dlg->local.info->tag.slen + 32 1380 < sizeof(str_dest_buf), PJSIP_EURITOOLONG);1380 < (long)sizeof(str_dest_buf), PJSIP_EURITOOLONG); 1381 1381 1382 1382 /* Print URI */ … … 1384 1384 str_dest.slen = 1; 1385 1385 1386 uri = pjsip_uri_get_uri(dest_dlg->remote.info->uri);1386 uri = (pjsip_uri*) pjsip_uri_get_uri(dest_dlg->remote.info->uri); 1387 1387 len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, uri, 1388 1388 str_dest_buf+1, sizeof(str_dest_buf)-1); … … 1510 1510 1511 1511 /* Create IM data and attach to the request. */ 1512 im_data = pj_pool_zalloc(tdata->pool, sizeof(*im_data));1512 im_data = PJ_POOL_ZALLOC_T(tdata->pool, pjsua_im_data); 1513 1513 im_data->acc_id = call->acc_id; 1514 1514 im_data->call_id = call_id; … … 1935 1935 PJSUA_LOCK(); 1936 1936 1937 call = inv->dlg->mod_data[pjsua_var.mod.id];1937 call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 1938 1938 1939 1939 if (!call) { … … 2105 2105 PJSUA_LOCK(); 2106 2106 2107 call = inv->dlg->mod_data[pjsua_var.mod.id];2107 call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 2108 2108 2109 2109 if (status != PJ_SUCCESS) { … … 2232 2232 PJSUA_LOCK(); 2233 2233 2234 call = inv->dlg->mod_data[pjsua_var.mod.id];2234 call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 2235 2235 2236 2236 /* … … 2315 2315 pjsua_call *call; 2316 2316 2317 call = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);2317 call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 2318 2318 2319 2319 /* Must be receipt of response message */ … … 2378 2378 pj_status_t status; 2379 2379 2380 call = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);2380 call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 2381 2381 2382 2382 /* When subscription is terminated, clear the xfer_sub member of … … 2422 2422 2423 2423 /* Try to parse the content */ 2424 status = pjsip_parse_status_line( body->data, body->len,2424 status = pjsip_parse_status_line((char*)body->data, body->len, 2425 2425 &status_line); 2426 2426 if (status != PJ_SUCCESS) { … … 2467 2467 pjsua_call *call; 2468 2468 2469 call = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);2469 call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 2470 2470 if (!call) 2471 2471 return; … … 2502 2502 pjsip_evsub *sub; 2503 2503 2504 existing_call = inv->dlg->mod_data[pjsua_var.mod.id];2504 existing_call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 2505 2505 2506 2506 /* Find the Refer-To header */ … … 2529 2529 * request. 2530 2530 */ 2531 ref_by_hdr = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_ref_by, 2531 ref_by_hdr = (pjsip_hdr*) 2532 pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_ref_by, 2532 2533 NULL); 2533 2534 … … 2656 2657 */ 2657 2658 if (ref_by_hdr != NULL) { 2658 pjsip_hdr *dup = pjsip_hdr_clone(rdata->tp_info.pool, ref_by_hdr); 2659 pjsip_hdr *dup = (pjsip_hdr*) 2660 pjsip_hdr_clone(rdata->tp_info.pool, ref_by_hdr); 2659 2661 pj_list_push_back(&msg_data.hdr_list, dup); 2660 2662 } … … 2711 2713 pjsip_event *e) 2712 2714 { 2713 pjsua_call *call = inv->dlg->mod_data[pjsua_var.mod.id];2715 pjsua_call *call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 2714 2716 2715 2717 PJSUA_LOCK(); … … 2773 2775 pjsua_im_data *im_data; 2774 2776 2775 im_data = tsx->mod_data[pjsua_var.mod.id];2777 im_data = (pjsua_im_data*) tsx->mod_data[pjsua_var.mod.id]; 2776 2778 /* im_data can be NULL if this is typing indication */ 2777 2779 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r1248 r1266 165 165 cap_hdr = pjsip_endpt_get_capability(pjsua_var.endpt, PJSIP_H_ALLOW, NULL); 166 166 if (cap_hdr) { 167 pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr)); 167 pjsip_msg_add_hdr(tdata->msg, 168 (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr)); 168 169 } 169 170 … … 171 172 cap_hdr = pjsip_endpt_get_capability(pjsua_var.endpt, PJSIP_H_ACCEPT, NULL); 172 173 if (cap_hdr) { 173 pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr)); 174 pjsip_msg_add_hdr(tdata->msg, 175 (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr)); 174 176 } 175 177 … … 177 179 cap_hdr = pjsip_endpt_get_capability(pjsua_var.endpt, PJSIP_H_SUPPORTED, NULL); 178 180 if (cap_hdr) { 179 pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr)); 181 pjsip_msg_add_hdr(tdata->msg, 182 (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr)); 180 183 } 181 184 … … 183 186 cap_hdr = pjsip_evsub_get_allow_events_hdr(NULL); 184 187 if (cap_hdr) { 185 pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr)); 188 pjsip_msg_add_hdr(tdata->msg, 189 (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr)); 186 190 } 187 191 … … 1456 1460 1457 1461 /* Make sure id is in range. */ 1458 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL); 1462 PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 1463 PJ_EINVAL); 1459 1464 1460 1465 /* Make sure that transport exists */ … … 1524 1529 { 1525 1530 /* Make sure id is in range. */ 1526 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL); 1531 PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 1532 PJ_EINVAL); 1527 1533 1528 1534 /* Make sure that transport exists */ … … 1547 1553 1548 1554 /* Make sure id is in range. */ 1549 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL); 1555 PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 1556 PJ_EINVAL); 1550 1557 1551 1558 /* Make sure that transport exists */ … … 1640 1647 pjsip_hdr *new_hdr; 1641 1648 1642 new_hdr = pjsip_hdr_clone(tdata->pool, hdr);1649 new_hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr); 1643 1650 pjsip_msg_add_hdr(tdata->msg, new_hdr); 1644 1651 … … 1672 1679 pjsip_route_hdr *new_r; 1673 1680 1674 new_r = pjsip_hdr_clone(tdata->pool, r);1681 new_r = (pjsip_route_hdr*) pjsip_hdr_clone(tdata->pool, r); 1675 1682 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)new_r); 1676 1683 … … 1719 1726 return; 1720 1727 1721 pj_assert(tp_id >= 0 && tp_id < PJ_ARRAY_SIZE(pjsua_var.tpdata));1728 pj_assert(tp_id >= 0 && tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata)); 1722 1729 tpdata = &pjsua_var.tpdata[tp_id]; 1723 1730 … … 1749 1756 if (!pool) return -1; 1750 1757 1751 url = pj_pool_alloc(pool, len+1);1758 url = (char*) pj_pool_alloc(pool, len+1); 1752 1759 pj_ansi_strcpy(url, c_url); 1753 1760 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
r1242 r1266 113 113 * "text/plain". 114 114 */ 115 ctype = pjsip_msg_find_hdr(msg, PJSIP_H_CONTENT_TYPE, NULL); 115 ctype = (pjsip_ctype_hdr*) 116 pjsip_msg_find_hdr(msg, PJSIP_H_CONTENT_TYPE, NULL); 116 117 if (msg->body == NULL || ctype == NULL || 117 118 !acceptable_message(&ctype->media)) … … 143 144 144 145 /* Build remote contact */ 145 contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 146 contact_hdr = (pjsip_contact_hdr*) 147 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 146 148 NULL); 147 149 if (contact_hdr) { 148 contact.ptr = pj_pool_alloc(rdata->tp_info.pool,149 PJSIP_MAX_URL_SIZE);150 contact.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, 151 PJSIP_MAX_URL_SIZE); 150 152 contact.slen = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, 151 153 contact_hdr->uri, contact.ptr, … … 163 165 164 166 /* Save text body */ 165 text_body.ptr = rdata->msg_info.msg->body->data;167 text_body.ptr = (char*) rdata->msg_info.msg->body->data; 166 168 text_body.slen = rdata->msg_info.msg->body->len; 167 169 … … 176 178 pj_bool_t is_typing; 177 179 178 status = pjsip_iscomposing_parse( rdata->tp_info.pool,body->data,179 180 180 status = pjsip_iscomposing_parse(rdata->tp_info.pool, (char*)body->data, 181 body->len, &is_typing, NULL, NULL, 182 NULL ); 181 183 if (status != PJ_SUCCESS) { 182 184 pjsua_perror(THIS_FILE, "Invalid MESSAGE body", status); … … 241 243 * not available, then use From header. 242 244 */ 243 from.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE); 244 contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, 245 from.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE); 246 contact_hdr = (pjsip_contact_hdr*) 247 pjsip_msg_find_hdr(rdata->msg_info.msg, 245 248 PJSIP_H_CONTACT, NULL); 246 249 if (contact_hdr) { … … 258 261 259 262 /* Build the To text. */ 260 to.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);263 to.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE); 261 264 to.slen = pjsip_uri_print( PJSIP_URI_IN_FROMTO_HDR, 262 265 rdata->msg_info.to->uri, … … 276 279 static void im_callback(void *token, pjsip_event *e) 277 280 { 278 pjsua_im_data *im_data = token;281 pjsua_im_data *im_data = (pjsua_im_data*) token; 279 282 280 283 if (e->type == PJSIP_EVENT_TSX_STATE) { … … 353 356 static void typing_callback(void *token, pjsip_event *e) 354 357 { 355 pjsua_im_data *im_data = token;358 pjsua_im_data *im_data = (pjsua_im_data*) token; 356 359 357 360 if (e->type == PJSIP_EVENT_TSX_STATE) { … … 464 467 * application on the callback 465 468 */ 466 im_data = pj_pool_zalloc(tdata->pool, sizeof(*im_data));469 im_data = PJ_POOL_ZALLOC_T(tdata->pool, pjsua_im_data); 467 470 im_data->acc_id = acc_id; 468 471 im_data->call_id = PJSUA_INVALID_ID; … … 571 574 572 575 /* Create data to reauthenticate */ 573 im_data = pj_pool_zalloc(tdata->pool, sizeof(*im_data));576 im_data = PJ_POOL_ZALLOC_T(tdata->pool, pjsua_im_data); 574 577 im_data->acc_id = acc_id; 575 578 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1262 r1266 1238 1238 PJ_DEF(pjsua_conf_port_id) pjsua_player_get_conf_port(pjsua_player_id id) 1239 1239 { 1240 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);1240 PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL); 1241 1241 PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL); 1242 1242 … … 1250 1250 pjmedia_port **p_port) 1251 1251 { 1252 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);1252 PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL); 1253 1253 PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL); 1254 1254 PJ_ASSERT_RETURN(p_port != NULL, PJ_EINVAL); … … 1265 1265 pj_uint32_t samples) 1266 1266 { 1267 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);1267 PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL); 1268 1268 PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL); 1269 1269 PJ_ASSERT_RETURN(pjsua_var.player[id].type == 0, PJ_EINVAL); … … 1279 1279 PJ_DEF(pj_status_t) pjsua_player_destroy(pjsua_player_id id) 1280 1280 { 1281 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);1281 PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL); 1282 1282 PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL); 1283 1283 … … 1415 1415 PJ_DEF(pjsua_conf_port_id) pjsua_recorder_get_conf_port(pjsua_recorder_id id) 1416 1416 { 1417 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.recorder), PJ_EINVAL); 1417 PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.recorder), 1418 PJ_EINVAL); 1418 1419 PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL); 1419 1420 … … 1427 1428 pjmedia_port **p_port) 1428 1429 { 1429 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.recorder), PJ_EINVAL); 1430 PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.recorder), 1431 PJ_EINVAL); 1430 1432 PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL); 1431 1433 PJ_ASSERT_RETURN(p_port != NULL, PJ_EINVAL); … … 1440 1442 PJ_DEF(pj_status_t) pjsua_recorder_destroy(pjsua_recorder_id id) 1441 1443 { 1442 PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.recorder), PJ_EINVAL); 1444 PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.recorder), 1445 PJ_EINVAL); 1443 1446 PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL); 1444 1447 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r1087 r1266 38 38 PJ_DEF(pj_bool_t) pjsua_buddy_is_valid(pjsua_buddy_id buddy_id) 39 39 { 40 return buddy_id>=0 && buddy_id< PJ_ARRAY_SIZE(pjsua_var.buddy) &&40 return buddy_id>=0 && buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy) && 41 41 pjsua_var.buddy[buddy_id].uri.slen != 0; 42 42 } … … 153 153 154 154 /* Find empty slot */ 155 for (index=0; index< PJ_ARRAY_SIZE(pjsua_var.buddy); ++index) {155 for (index=0; index<(int)PJ_ARRAY_SIZE(pjsua_var.buddy); ++index) { 156 156 if (pjsua_var.buddy[index].uri.slen == 0) 157 157 break; … … 424 424 PJSUA_LOCK(); 425 425 426 uapres = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);426 uapres = (pjsua_srv_pres*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 427 427 if (uapres) { 428 428 PJ_LOG(3,(THIS_FILE, "Server subscription to %s is %s", … … 517 517 518 518 /* Attach our data to the subscription: */ 519 uapres = pj_pool_alloc(dlg->pool, sizeof(pjsua_srv_pres));519 uapres = PJ_POOL_ALLOC_T(dlg->pool, pjsua_srv_pres); 520 520 uapres->sub = sub; 521 uapres->remote = pj_pool_alloc(dlg->pool, PJSIP_MAX_URL_SIZE);521 uapres->remote = (char*) pj_pool_alloc(dlg->pool, PJSIP_MAX_URL_SIZE); 522 522 status = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, dlg->remote.info->uri, 523 523 uapres->remote, PJSIP_MAX_URL_SIZE); … … 586 586 static void publish_cb(struct pjsip_publishc_cbparam *param) 587 587 { 588 pjsua_acc *acc = param->token;588 pjsua_acc *acc = (pjsua_acc*) param->token; 589 589 590 590 if (param->code/100 != 2 || param->status != PJ_SUCCESS) { … … 856 856 PJSUA_LOCK(); 857 857 858 buddy = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);858 buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 859 859 if (buddy) { 860 860 PJ_LOG(3,(THIS_FILE, … … 889 889 PJSUA_LOCK(); 890 890 891 buddy = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);891 buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 892 892 if (!buddy) { 893 893 PJSUA_UNLOCK(); … … 915 915 916 916 /* Find contact header. */ 917 contact_hdr = pjsip_msg_find_hdr(event->body.rx_msg.rdata->msg_info.msg, 917 contact_hdr = (pjsip_contact_hdr*) 918 pjsip_msg_find_hdr(event->body.rx_msg.rdata->msg_info.msg, 918 919 PJSIP_H_CONTACT, NULL); 919 920 if (!contact_hdr) { … … 922 923 } 923 924 924 buddy->contact.ptr = pj_pool_alloc(pjsua_var.pool, PJSIP_MAX_URL_SIZE); 925 buddy->contact.ptr = (char*) 926 pj_pool_alloc(pjsua_var.pool, PJSIP_MAX_URL_SIZE); 925 927 buddy->contact.slen = pjsip_uri_print( PJSIP_URI_IN_CONTACT_HDR, 926 928 contact_hdr->uri, … … 946 948 PJSUA_LOCK(); 947 949 948 buddy = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);950 buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 949 951 if (buddy) { 950 952 /* Update our info. */ -
pjproject/trunk/pjsip/src/test-pjsip/dns_test.c
r1035 r1266 36 36 const struct pjsip_server_addresses *addr) 37 37 { 38 struct result *result = token;38 struct result *result = (struct result*) token; 39 39 40 40 result->status = status; -
pjproject/trunk/pjsip/src/test-pjsip/msg_test.c
r1236 r1266 187 187 188 188 /* Create buffer for comparison. */ 189 str1.ptr = pj_pool_alloc(pool, BUFLEN);190 str2.ptr = pj_pool_alloc(pool, BUFLEN);189 str1.ptr = (char*)pj_pool_alloc(pool, BUFLEN); 190 str2.ptr = (char*)pj_pool_alloc(pool, BUFLEN); 191 191 192 192 /* Compare message type. */ … … 661 661 662 662 // Body 663 body = pj_pool_zalloc(pool, sizeof(*body));663 body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); 664 664 msg->body = body; 665 665 body->content_type.type = pj_str("application"); 666 666 body->content_type.subtype = pj_str("sdp"); 667 body->data = 667 body->data = (void*) 668 668 "v=0\r\n" 669 669 "o=alice 53655765 2353687637 IN IP4 pc33.atlanta.com\r\n" … … 673 673 "m=audio 3456 RTP/AVP 0 1 3 99\r\n" 674 674 "a=rtpmap:0 PCMU/8000\r\n"; 675 body->len = pj_native_strlen( body->data);675 body->len = pj_native_strlen((const char*) body->data); 676 676 body->print_body = &pjsip_print_text_body; 677 677 … … 716 716 717 717 for (loop=0; loop<LOOP; ++loop) { 718 for (i=0; i< PJ_ARRAY_SIZE(test_array); ++i) {718 for (i=0; i<(int)PJ_ARRAY_SIZE(test_array); ++i) { 719 719 pool = pjsip_endpt_create_pool(endpt, NULL, POOL_SIZE, POOL_SIZE); 720 720 status = test_entry( pool, &test_array[i] ); … … 1454 1454 hname = pj_str(test->hname); 1455 1455 len = strlen(test->hcontent); 1456 parsed_hdr1 = pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len); 1456 parsed_hdr1 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, 1457 test->hcontent, len, 1458 &parsed_len); 1457 1459 if (parsed_hdr1 == NULL) { 1458 1460 if (test->flags & HDR_FLAG_PARSE_FAIL) { … … 1476 1478 hname = pj_str(test->hshort_name); 1477 1479 len = strlen(test->hcontent); 1478 parsed_hdr2 = pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len);1480 parsed_hdr2 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len); 1479 1481 if (parsed_hdr2 == NULL) { 1480 1482 PJ_LOG(3,(THIS_FILE, " error parsing header %s: %s", test->hshort_name, test->hcontent)); … … 1490 1492 1491 1493 /* Print the original header */ 1492 input = pj_pool_alloc(pool, 1024);1494 input = (char*) pj_pool_alloc(pool, 1024); 1493 1495 len = pj_ansi_snprintf(input, 1024, "%s: %s", test->hname, test->hcontent); 1494 1496 if (len < 1 || len >= 1024) … … 1496 1498 1497 1499 /* Print the parsed header*/ 1498 output = pj_pool_alloc(pool, 1024);1500 output = (char*) pj_pool_alloc(pool, 1024); 1499 1501 len = pjsip_hdr_print_on(parsed_hdr1, output, 1024); 1500 1502 if (len < 1 || len >= 1024) { -
pjproject/trunk/pjsip/src/test-pjsip/transport_test.c
r974 r1266 561 561 562 562 /* Generate Call-ID for each thread. */ 563 rt_test_data[i].call_id.ptr = pj_pool_alloc(pool, rt_call_id.slen+1);563 rt_test_data[i].call_id.ptr = (char*) pj_pool_alloc(pool, rt_call_id.slen+1); 564 564 pj_strcpy(&rt_test_data[i].call_id, &rt_call_id); 565 565 buf[0] = '0' + i; -
pjproject/trunk/pjsip/src/test-pjsip/tsx_bench.c
r974 r1266 54 54 55 55 /* Create transaction array */ 56 tsx = pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));56 tsx = (pjsip_transaction**) pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*)); 57 57 58 58 pj_bzero(&mod_tsx_user, sizeof(mod_tsx_user)); … … 131 131 rdata.tp_info.pool = request->pool; 132 132 rdata.msg_info.msg = request->msg; 133 rdata.msg_info.from = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);134 rdata.msg_info.to = pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL);135 rdata.msg_info.cseq = pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL);136 rdata.msg_info.cid = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);133 rdata.msg_info.from = (pjsip_from_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL); 134 rdata.msg_info.to = (pjsip_to_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL); 135 rdata.msg_info.cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL); 136 rdata.msg_info.cid = (pjsip_cid_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL); 137 137 rdata.msg_info.via = via; 138 138 … … 148 148 149 149 /* Create transaction array */ 150 tsx = pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));150 tsx = (pjsip_transaction**) pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*)); 151 151 152 152 pj_bzero(&mod_tsx_user, sizeof(mod_tsx_user)); -
pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c
r974 r1266 365 365 PJ_LOG(3,(THIS_FILE, 366 366 " error: prev state is %s instead of %s", 367 pjsip_tsx_state_str( e->body.tsx_state.prev_state),367 pjsip_tsx_state_str((pjsip_tsx_state_e)e->body.tsx_state.prev_state), 368 368 pjsip_tsx_state_str(PJSIP_TSX_STATE_PROCEEDING))); 369 369 test_complete = -739; … … 548 548 struct pj_timer_entry *entry) 549 549 { 550 struct response *r = entry->user_data;550 struct response *r = (struct response*) entry->user_data; 551 551 pjsip_transport *tp = r->res_addr.transport; 552 552 … … 760 760 761 761 /* Schedule sending final response in couple of of secs. */ 762 r = pj_pool_alloc(tdata->pool, sizeof(*r));762 r = PJ_POOL_ALLOC_T(tdata->pool, struct response); 763 763 r->res_addr = res_addr; 764 764 r->tdata = tdata; … … 881 881 882 882 /* Schedule sending final response in couple of of secs. */ 883 r = pj_pool_alloc(tdata->pool, sizeof(*r));883 r = PJ_POOL_ALLOC_T(tdata->pool, struct response); 884 884 r->res_addr = res_addr; 885 885 r->tdata = tdata; … … 969 969 970 970 /* Set the branch param for test 1. */ 971 via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);971 via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 972 972 via->branch_param = pj_str(branch_param); 973 973 … … 1098 1098 enabled = msg_logger_set_enabled(0); 1099 1099 1100 for (i=0; i< PJ_ARRAY_SIZE(sub_test); ++i) {1100 for (i=0; i<(int)PJ_ARRAY_SIZE(sub_test); ++i) { 1101 1101 1102 1102 PJ_LOG(3,(THIS_FILE, … … 1232 1232 1233 1233 1234 for (i=0; i< PJ_ARRAY_SIZE(delay); ++i) {1234 for (i=0; i<(int)PJ_ARRAY_SIZE(delay); ++i) { 1235 1235 1236 1236 PJ_LOG(3,(THIS_FILE, … … 1303 1303 1304 1304 /* Do the test. */ 1305 for (i=0; i< PJ_ARRAY_SIZE(delay); ++i) {1305 for (i=0; i<(int)PJ_ARRAY_SIZE(delay); ++i) { 1306 1306 1307 1307 if (test_param->type == PJSIP_TRANSPORT_LOOP_DGRAM) { … … 1344 1344 1345 1345 /* Get transport flag */ 1346 tp_flag = pjsip_transport_get_flag_from_type( test_param->type);1346 tp_flag = pjsip_transport_get_flag_from_type((pjsip_transport_type_e)test_param->type); 1347 1347 1348 1348 pj_ansi_sprintf(TARGET_URI, "sip:bob@127.0.0.1:%d;transport=%s", -
pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c
r974 r1266 209 209 { 210 210 pjsip_transaction *tsx; 211 struct response *r = entry->user_data;211 struct response *r = (struct response*) entry->user_data; 212 212 pj_status_t status; 213 213 … … 277 277 } 278 278 279 r = pj_pool_alloc(tdata->pool, sizeof(*r));279 r = PJ_POOL_ALLOC_T(tdata->pool, struct response); 280 280 pj_strdup(tdata->pool, &r->tsx_key, tsx_key); 281 281 r->tdata = tdata; … … 285 285 pj_time_val_normalize(&delay); 286 286 287 t = pj_pool_zalloc(tdata->pool, sizeof(*t));287 t = PJ_POOL_ZALLOC_T(tdata->pool, pj_timer_entry); 288 288 t->user_data = r; 289 289 t->cb = &send_response_timer; … … 1097 1097 uri->transport_param = pj_str("loop-dgram"); 1098 1098 1099 via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);1099 via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 1100 1100 via->branch_param = pj_str(TEST9_BRANCH_ID); 1101 1101 … … 1198 1198 1199 1199 /* Set the branch param for test 1. */ 1200 via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);1200 via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 1201 1201 via->branch_param = pj_str(branch_param); 1202 1202 … … 1472 1472 int i, status; 1473 1473 1474 for (i=0; i< PJ_ARRAY_SIZE(tests); ++i) {1474 for (i=0; i<(int)PJ_ARRAY_SIZE(tests); ++i) { 1475 1475 pj_time_val fail_time, end_test, now; 1476 1476 … … 1533 1533 1534 1534 test_param = param; 1535 tp_flag = pjsip_transport_get_flag_from_type( param->type);1535 tp_flag = pjsip_transport_get_flag_from_type((pjsip_transport_type_e)param->type); 1536 1536 1537 1537 pj_ansi_sprintf(TARGET_URI, "sip:bob@127.0.0.1:%d;transport=%s", -
pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c
r974 r1266 445 445 446 446 /* Fill up the Via header to prevent syntax error on parsing */ 447 via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);447 via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 448 448 via->transport = pj_str("TCP"); 449 449 via->sent_by.host = pj_str("127.0.0.1"); … … 708 708 via->branch_param = pj_str("012345678901234567890123456789"); 709 709 via->recvd_param = pj_str("192.168.0.7"); 710 pjsip_msg_insert_first_hdr(request->msg, pjsip_hdr_clone(request->pool, via));711 pjsip_msg_insert_first_hdr(request->msg, pjsip_hdr_clone(request->pool, via));710 pjsip_msg_insert_first_hdr(request->msg, (pjsip_hdr*) pjsip_hdr_clone(request->pool, via)); 711 pjsip_msg_insert_first_hdr(request->msg, (pjsip_hdr*) pjsip_hdr_clone(request->pool, via)); 712 712 pjsip_msg_insert_first_hdr(request->msg, (pjsip_hdr*)via); 713 713 … … 717 717 rdata.tp_info.pool = request->pool; 718 718 rdata.msg_info.msg = request->msg; 719 rdata.msg_info.from = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);720 rdata.msg_info.to = pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL);721 rdata.msg_info.cseq = pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL);722 rdata.msg_info.cid = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);719 rdata.msg_info.from = (pjsip_from_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL); 720 rdata.msg_info.to = (pjsip_to_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL); 721 rdata.msg_info.cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL); 722 rdata.msg_info.cid = (pjsip_cid_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL); 723 723 rdata.msg_info.via = via; 724 724 -
pjproject/trunk/pjsip/src/test-pjsip/uri_test.c
r1231 r1266 383 383 do { \ 384 384 pjsip_param *param; \ 385 param= pj_pool_alloc(pool, sizeof(pjsip_param)); \385 param=PJ_POOL_ALLOC_T(pool, pjsip_param); \ 386 386 param->name = pj_str(pname); \ 387 387 param->value = pj_str(pvalue); \ … … 663 663 uri->number = pj_str("911"); 664 664 665 p = pj_pool_alloc(pool, sizeof(*p));665 p = PJ_POOL_ALLOC_T(pool, pjsip_param); 666 666 p->name = p->value = pj_str("p1"); 667 667 pj_list_insert_before(&uri->other_param, p); … … 726 726 727 727 /* Print both URI. */ 728 s1.ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);729 s2.ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);728 s1.ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 729 s2.ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 730 730 731 731 pj_get_timestamp(&t1);
Note: See TracChangeset
for help on using the changeset viewer.