Changeset 789
- Timestamp:
- Oct 29, 2006 6:13:13 PM (18 years ago)
- Location:
- pjproject/branches/symbian
- Files:
-
- 7 added
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/symbian/pjlib-util/src/pjlib-util/errno.c
r330 r789 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pjlib-util /errno.h>19 #include <pjlib-util.h> 20 20 #include <pj/string.h> 21 21 -
pjproject/branches/symbian/pjlib-util/src/pjlib-util/string.c
r67 r789 32 32 return *src_str; 33 33 34 dst = dst_str.ptr = pj_pool_alloc(pool, src_str->slen);34 dst = dst_str.ptr = (char*) pj_pool_alloc(pool, src_str->slen); 35 35 36 36 while (src != end) { -
pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun.c
r217 r789 36 36 37 37 38 hdr = pj_pool_calloc(pool, 1, sizeof(pj_stun_msg_hdr));38 hdr = (pj_stun_msg_hdr*) pj_pool_calloc(pool, 1, sizeof(pj_stun_msg_hdr)); 39 39 if (!hdr) 40 40 return PJ_ENOMEM; -
pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun_client.c
r217 r789 42 42 int i, j, send_cnt = 0; 43 43 pj_pool_t *pool; 44 struct {44 struct stun_rec { 45 45 struct { 46 46 pj_uint32_t mapped_addr; … … 62 62 63 63 /* Allocate client records */ 64 rec = pj_pool_calloc(pool, sock_cnt, sizeof(*rec));64 rec = (struct stun_rec*) pj_pool_calloc(pool, sock_cnt, sizeof(*rec)); 65 65 if (!rec) { 66 66 status = PJ_ENOMEM; … … 98 98 for (i=0; i<sock_cnt && status==PJ_SUCCESS; ++i) { 99 99 for (j=0; j<2 && status==PJ_SUCCESS; ++j) { 100 pj_stun_msg_hdr *msg_hdr = out_msg;100 pj_stun_msg_hdr *msg_hdr = (pj_stun_msg_hdr*) out_msg; 101 101 pj_ssize_t sent_len; 102 102 … … 195 195 } 196 196 197 attr = ( void*)pj_stun_msg_find_attr(&msg, PJ_STUN_ATTR_MAPPED_ADDR);197 attr = (pj_stun_mapped_addr_attr *)pj_stun_msg_find_attr(&msg, PJ_STUN_ATTR_MAPPED_ADDR); 198 198 if (!attr) { 199 199 status = PJLIB_UTIL_ESTUNNOMAP; -
pjproject/branches/symbian/pjlib-util/src/pjlib-util/xml.c
r200 r789 38 38 pj_xml_node *node; 39 39 40 node = pj_pool_zalloc(pool, sizeof(pj_xml_node));40 node = (pj_xml_node*) pj_pool_zalloc(pool, sizeof(pj_xml_node)); 41 41 pj_list_init( &node->attr_head ); 42 42 pj_list_init( &node->node_head ); … … 47 47 static pj_xml_attr *alloc_attr( pj_pool_t *pool ) 48 48 { 49 return pj_pool_zalloc(pool, sizeof(pj_xml_attr));49 return (pj_xml_attr*) pj_pool_zalloc(pool, sizeof(pj_xml_attr)); 50 50 } 51 51 … … 394 394 pj_bool_t (*match)(pj_xml_node *, const void*)) 395 395 { 396 pj_xml_node *head = (void*)&parent->node_head, *node = head->next; 396 pj_xml_node *head = (pj_xml_node *) &parent->node_head, 397 *node = head->next; 397 398 398 399 while (node != (void*)head) { -
pjproject/branches/symbian/pjlib/include/pj/compat/os_symbian.h
r692 r789 103 103 */ 104 104 105 #define NULL 0 105 #ifndef NULL 106 # define NULL 0 107 #endif 108 109 110 /* Doesn't seem to allow more than this */ 111 #define PJ_IOQUEUE_MAX_HANDLES 8 106 112 107 113 /* … … 109 115 */ 110 116 #define PJ_HAS_FLOATING_POINT 1 111 #define PJ_HAS_MALLOC 1117 #define PJ_HAS_MALLOC 0 112 118 #define PJ_HAS_SEMAPHORE 1 113 119 #define PJ_HAS_EVENT_OBJ 0 -
pjproject/branches/symbian/pjlib/include/pj/compat/socket.h
r182 r789 82 82 # define OSERR_EINPROGRESS WSAEINPROGRESS 83 83 # define OSERR_ECONNRESET WSAECONNRESET 84 #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 85 # define OSERR_EWOULDBLOCK -1 86 # define OSERR_EINPROGRESS -1 87 # define OSERR_ECONNRESET -1 84 88 #else 85 89 # define OSERR_EWOULDBLOCK EWOULDBLOCK -
pjproject/branches/symbian/pjlib/include/pj/list_i.h
r192 r789 125 125 while (node != list) { 126 126 ++count; 127 node = node->next;127 node = (pj_list*)node->next; 128 128 } 129 129 -
pjproject/branches/symbian/pjlib/src/pj/array.c
r65 r789 56 56 { 57 57 unsigned i; 58 const char *char_array = array;58 const char *char_array = (const char*) array; 59 59 for (i=0; i<count; ++i) { 60 60 if ( (*matching)(char_array) == PJ_SUCCESS) { -
pjproject/branches/symbian/pjlib/src/pj/errno.c
r788 r789 24 24 * in separate file. 25 25 */ 26 extern int platform_strerror( pj_os_err_type code, 27 char *buf, pj_size_t bufsize ); 26 PJ_BEGIN_DECL 27 PJ_DECL(int) platform_strerror(pj_os_err_type code, 28 char *buf, pj_size_t bufsize ); 29 PJ_END_DECL 28 30 29 31 #define PJLIB_MAX_ERR_MSG_HANDLER 8 -
pjproject/branches/symbian/pjlib/src/pj/fifobuf.c
r66 r789 35 35 fifobuf, buffer, size)); 36 36 37 fifobuf->first = buffer;37 fifobuf->first = (char*) buffer; 38 38 fifobuf->last = fifobuf->first + size; 39 39 fifobuf->ubegin = fifobuf->uend = fifobuf->first; … … 119 119 pj_fifobuf_unalloc (pj_fifobuf_t *fifobuf, void *buf) 120 120 { 121 char *ptr = buf;121 char *ptr = (char*) buf; 122 122 char *endptr; 123 123 unsigned sz; … … 150 150 pj_fifobuf_free (pj_fifobuf_t *fifobuf, void *buf) 151 151 { 152 char *ptr = buf;152 char *ptr = (char*) buf; 153 153 char *end; 154 154 unsigned sz; -
pjproject/branches/symbian/pjlib/src/pj/guid.c
r66 r789 22 22 PJ_DEF(void) pj_create_unique_string(pj_pool_t *pool, pj_str_t *str) 23 23 { 24 str->ptr = pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH);24 str->ptr = (char*) pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH); 25 25 pj_generate_unique_string(str); 26 26 } -
pjproject/branches/symbian/pjlib/src/pj/hash.c
r433 r789 56 56 57 57 if (keylen==PJ_HASH_KEY_STRING) { 58 const unsigned char *p = key;58 const unsigned char *p = (const unsigned char*) key; 59 59 for ( ; *p; ++p ) { 60 60 hash = (hash * PJ_HASH_MULTIPLIER) + *p; 61 61 } 62 62 } else { 63 const unsigned char *p = key,63 const unsigned char *p = (const unsigned char*) key, 64 64 *end = p + keylen; 65 65 for ( ; p!=end; ++p) { … … 93 93 PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL); 94 94 95 h = pj_pool_alloc(pool, sizeof(pj_hash_table_t));95 h = (pj_hash_table_t*) pj_pool_alloc(pool, sizeof(pj_hash_table_t)); 96 96 h->count = 0; 97 97 … … 109 109 110 110 h->rows = table_size; 111 h->table = pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*));111 h->table = (pj_hash_entry**) pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*)); 112 112 return h; 113 113 } … … 129 129 hash=0; 130 130 if (keylen==PJ_HASH_KEY_STRING) { 131 const unsigned char *p = key;131 const unsigned char *p = (const unsigned char*)key; 132 132 for ( ; *p; ++p ) { 133 133 hash = hash * PJ_HASH_MULTIPLIER + *p; … … 135 135 keylen = p - (const unsigned char*)key; 136 136 } else { 137 const unsigned char *p = key,137 const unsigned char *p = (const unsigned char*) key, 138 138 *end = p + keylen; 139 139 for ( ; p!=end; ++p) { … … 166 166 */ 167 167 if (entry_buf) { 168 entry = entry_buf;168 entry = (pj_hash_entry*) entry_buf; 169 169 } else { 170 170 /* Pool must be specified! */ 171 171 PJ_ASSERT_RETURN(pool != NULL, NULL); 172 172 173 entry = pj_pool_alloc(pool, sizeof(pj_hash_entry));173 entry = (pj_hash_entry*) pj_pool_alloc(pool, sizeof(pj_hash_entry)); 174 174 PJ_LOG(6, ("hashtbl", 175 175 "%p: New p_entry %p created, pool used=%u, cap=%u", -
pjproject/branches/symbian/pjlib/src/pj/ioqueue_symbian.cpp
r788 r789 45 45 { 46 46 public: 47 CIoqueueCallback(pj_ioqueue_t *ioqueue, 48 pj_ioqueue_key_t *key, pj_sock_t sock, 49 const pj_ioqueue_callback *cb, void *user_data) 50 : CActive(CActive::EPriorityStandard), 51 ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), cb_(cb), 52 user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE) 53 { 54 CActiveScheduler::Add(this); 55 } 47 static CIoqueueCallback* NewL(pj_ioqueue_t *ioqueue, 48 pj_ioqueue_key_t *key, 49 pj_sock_t sock, 50 const pj_ioqueue_callback *cb, 51 void *user_data); 56 52 57 53 // … … 60 56 pj_status_t StartRead(pj_ioqueue_op_key_t *op_key, 61 57 void *buf, pj_ssize_t *size, unsigned flags, 62 pj_sockaddr_t *addr, int *addrlen) 63 { 64 PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); 65 PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); 66 67 pending_data_.read_.op_key_ = op_key; 68 pending_data_.read_.addr_ = addr; 69 pending_data_.read_.addrlen_ = addrlen; 70 71 aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size); 72 73 type_ = TYPE_READ; 74 SetActive(); 75 sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus); 76 77 return PJ_EPENDING; 78 } 79 58 pj_sockaddr_t *addr, int *addrlen); 80 59 81 60 // … … 86 65 pj_sockaddr_t *local, 87 66 pj_sockaddr_t *remote, 88 int *addrlen ) 89 { 90 PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); 91 PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); 92 93 pending_data_.accept_.op_key_ = op_key; 94 pending_data_.accept_.new_sock_ = new_sock; 95 pending_data_.accept_.local_ = local; 96 pending_data_.accept_.remote_ = remote; 97 pending_data_.accept_.addrlen_ = addrlen; 98 99 // Create blank socket 100 blank_sock_.Open(PjSymbianOS::Instance()->SocketServ()); 101 102 type_ = TYPE_ACCEPT; 103 SetActive(); 104 sock_->Socket().Accept(blank_sock_, iStatus); 105 106 return PJ_EPENDING; 107 } 108 67 int *addrlen ); 109 68 110 69 // 111 70 // Completion callback. 112 71 // 113 void RunL() 114 { 115 Type cur_type = type_; 116 117 type_ = TYPE_NONE; 118 119 if (cur_type == TYPE_READ) { 120 // 121 // Completion of asynchronous RecvFrom() 122 // 123 124 /* Clear op_key (save it to temp variable first!) */ 125 pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; 126 pending_data_.read_.op_key_ = NULL; 127 128 // Handle failure condition 129 if (iStatus != KErrNone) { 130 cb_->on_read_complete(key_, op_key, -PJ_RETURN_OS_ERROR(iStatus.Int())); 131 return; 132 } 133 134 if (pending_data_.read_.addr_) { 135 PjSymbianOS::Addr2pj(aAddress_, 136 *(pj_sockaddr_in*)pending_data_.read_.addr_); 137 pending_data_.read_.addr_ = NULL; 138 } 139 if (pending_data_.read_.addrlen_) { 140 *pending_data_.read_.addrlen_ = sizeof(pj_sockaddr_in); 141 pending_data_.read_.addrlen_ = NULL; 142 } 143 144 /* Call callback */ 145 cb_->on_read_complete(key_, op_key, aBufferPtr_.Length()); 146 147 } else if (cur_type == TYPE_ACCEPT) { 148 // 149 // Completion of asynchronous Accept() 150 // 151 152 /* Clear op_key (save it to temp variable first!) */ 153 pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; 154 pending_data_.read_.op_key_ = NULL; 155 156 // Handle failure condition 157 if (iStatus != KErrNone) { 158 if (pending_data_.accept_.new_sock_) 159 *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; 160 161 cb_->on_accept_complete(key_, op_key, PJ_INVALID_SOCKET, 162 -PJ_RETURN_OS_ERROR(iStatus.Int())); 163 return; 164 } 165 166 CPjSocket *pjNewSock = new CPjSocket(blank_sock_); 167 168 if (pending_data_.accept_.new_sock_) { 169 *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock; 170 pending_data_.accept_.new_sock_ = NULL; 171 } 172 173 if (pending_data_.accept_.local_) { 174 TInetAddr aAddr; 175 blank_sock_.LocalName(aAddr); 176 PjSymbianOS::Addr2pj(aAddr, *(pj_sockaddr_in*)pending_data_.accept_.local_); 177 pending_data_.accept_.local_ = NULL; 178 } 179 180 if (pending_data_.accept_.remote_) { 181 TInetAddr aAddr; 182 blank_sock_.RemoteName(aAddr); 183 PjSymbianOS::Addr2pj(aAddr, *(pj_sockaddr_in*)pending_data_.accept_.remote_); 184 pending_data_.accept_.remote_ = NULL; 185 } 186 187 if (pending_data_.accept_.addrlen_) { 188 *pending_data_.accept_.addrlen_ = sizeof(pj_sockaddr_in); 189 pending_data_.accept_.addrlen_ = NULL; 190 } 191 192 // Call callback. 193 cb_->on_accept_complete(key_, op_key, (pj_sock_t)pjNewSock, PJ_SUCCESS); 194 } 195 196 ioqueue_->eventCount++; 197 } 72 void RunL(); 198 73 199 74 // 200 75 // CActive's DoCancel() 201 76 // 202 void DoCancel() 203 { 204 if (type_ == TYPE_READ) 205 sock_->Socket().CancelRecv(); 206 else if (type_ == TYPE_ACCEPT) 207 sock_->Socket().CancelAccept(); 208 209 type_ = TYPE_NONE; 210 } 77 void DoCancel(); 211 78 212 79 // 213 80 // Cancel operation and call callback. 214 81 // 215 void CancelOperation(pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_status) 216 { 217 Type cur_type = type_; 218 219 Cancel(); 220 221 if (cur_type == TYPE_READ) 222 cb_->on_read_complete(key_, op_key, bytes_status); 223 else if (cur_type == TYPE_ACCEPT) 224 ; 225 } 82 void CancelOperation(pj_ioqueue_op_key_t *op_key, 83 pj_ssize_t bytes_status); 226 84 227 85 // … … 293 151 union Pending_Data pending_data_; 294 152 RSocket blank_sock_; 153 154 CIoqueueCallback(pj_ioqueue_t *ioqueue, 155 pj_ioqueue_key_t *key, pj_sock_t sock, 156 const pj_ioqueue_callback *cb, void *user_data) 157 : CActive(CActive::EPriorityStandard), 158 ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), cb_(cb), 159 user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE) 160 { 161 } 162 163 164 void ConstructL() 165 { 166 CActiveScheduler::Add(this); 167 } 295 168 }; 296 169 297 170 298 299 171 CIoqueueCallback* CIoqueueCallback::NewL(pj_ioqueue_t *ioqueue, 172 pj_ioqueue_key_t *key, 173 pj_sock_t sock, 174 const pj_ioqueue_callback *cb, 175 void *user_data) 176 { 177 CIoqueueCallback *self = new CIoqueueCallback(ioqueue, key, sock, 178 cb, user_data); 179 CleanupStack::PushL(self); 180 self->ConstructL(); 181 CleanupStack::Pop(self); 182 183 return self; 184 } 185 186 187 // 188 // Start asynchronous recv() operation 189 // 190 pj_status_t CIoqueueCallback::StartRead(pj_ioqueue_op_key_t *op_key, 191 void *buf, pj_ssize_t *size, 192 unsigned flags, 193 pj_sockaddr_t *addr, int *addrlen) 194 { 195 PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); 196 PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); 197 198 flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; 199 200 pending_data_.read_.op_key_ = op_key; 201 pending_data_.read_.addr_ = addr; 202 pending_data_.read_.addrlen_ = addrlen; 203 204 aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size); 205 206 type_ = TYPE_READ; 207 if (addr && addrlen) { 208 sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus); 209 } else { 210 aAddress_.SetAddress(0); 211 aAddress_.SetPort(0); 212 sock_->Socket().Recv(aBufferPtr_, flags, iStatus); 213 } 214 215 if (iStatus==KRequestPending) { 216 SetActive(); 217 return PJ_EPENDING; 218 } else { 219 return PJ_RETURN_OS_ERROR(iStatus.Int()); 220 } 221 } 222 223 224 // 225 // Start asynchronous accept() operation. 226 // 227 pj_status_t CIoqueueCallback::StartAccept(pj_ioqueue_op_key_t *op_key, 228 pj_sock_t *new_sock, 229 pj_sockaddr_t *local, 230 pj_sockaddr_t *remote, 231 int *addrlen ) 232 { 233 PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); 234 PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); 235 236 pending_data_.accept_.op_key_ = op_key; 237 pending_data_.accept_.new_sock_ = new_sock; 238 pending_data_.accept_.local_ = local; 239 pending_data_.accept_.remote_ = remote; 240 pending_data_.accept_.addrlen_ = addrlen; 241 242 // Create blank socket 243 blank_sock_.Open(PjSymbianOS::Instance()->SocketServ()); 244 245 type_ = TYPE_ACCEPT; 246 sock_->Socket().Accept(blank_sock_, iStatus); 247 248 if (iStatus==KRequestPending) { 249 SetActive(); 250 return PJ_EPENDING; 251 } else { 252 return PJ_RETURN_OS_ERROR(iStatus.Int()); 253 } 254 } 255 256 257 // 258 // Completion callback. 259 // 260 void CIoqueueCallback::RunL() 261 { 262 Type cur_type = type_; 263 264 type_ = TYPE_NONE; 265 266 if (cur_type == TYPE_READ) { 267 // 268 // Completion of asynchronous RecvFrom() 269 // 270 271 /* Clear op_key (save it to temp variable first!) */ 272 pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; 273 pending_data_.read_.op_key_ = NULL; 274 275 // Handle failure condition 276 if (iStatus != KErrNone) { 277 cb_->on_read_complete(key_, op_key, 278 -PJ_RETURN_OS_ERROR(iStatus.Int())); 279 return; 280 } 281 282 if (pending_data_.read_.addr_) { 283 PjSymbianOS::Addr2pj(aAddress_, 284 *(pj_sockaddr_in*)pending_data_.read_.addr_); 285 pending_data_.read_.addr_ = NULL; 286 } 287 if (pending_data_.read_.addrlen_) { 288 *pending_data_.read_.addrlen_ = sizeof(pj_sockaddr_in); 289 pending_data_.read_.addrlen_ = NULL; 290 } 291 292 /* Call callback */ 293 cb_->on_read_complete(key_, op_key, aBufferPtr_.Length()); 294 295 } else if (cur_type == TYPE_ACCEPT) { 296 // 297 // Completion of asynchronous Accept() 298 // 299 300 /* Clear op_key (save it to temp variable first!) */ 301 pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; 302 pending_data_.read_.op_key_ = NULL; 303 304 // Handle failure condition 305 if (iStatus != KErrNone) { 306 if (pending_data_.accept_.new_sock_) 307 *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; 308 309 cb_->on_accept_complete(key_, op_key, PJ_INVALID_SOCKET, 310 -PJ_RETURN_OS_ERROR(iStatus.Int())); 311 return; 312 } 313 314 CPjSocket *pjNewSock = new CPjSocket(blank_sock_); 315 316 if (pending_data_.accept_.new_sock_) { 317 *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock; 318 pending_data_.accept_.new_sock_ = NULL; 319 } 320 321 if (pending_data_.accept_.local_) { 322 TInetAddr aAddr; 323 pj_sockaddr_in *ptr_sockaddr; 324 325 blank_sock_.LocalName(aAddr); 326 ptr_sockaddr = (pj_sockaddr_in*)pending_data_.accept_.local_; 327 PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr); 328 pending_data_.accept_.local_ = NULL; 329 } 330 331 if (pending_data_.accept_.remote_) { 332 TInetAddr aAddr; 333 pj_sockaddr_in *ptr_sockaddr; 334 335 blank_sock_.RemoteName(aAddr); 336 ptr_sockaddr = (pj_sockaddr_in*)pending_data_.accept_.remote_; 337 PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr); 338 pending_data_.accept_.remote_ = NULL; 339 } 340 341 if (pending_data_.accept_.addrlen_) { 342 *pending_data_.accept_.addrlen_ = sizeof(pj_sockaddr_in); 343 pending_data_.accept_.addrlen_ = NULL; 344 } 345 346 // Call callback. 347 cb_->on_accept_complete(key_, op_key, (pj_sock_t)pjNewSock, 348 PJ_SUCCESS); 349 } 350 351 ioqueue_->eventCount++; 352 } 353 354 // 355 // CActive's DoCancel() 356 // 357 void CIoqueueCallback::DoCancel() 358 { 359 if (type_ == TYPE_READ) 360 sock_->Socket().CancelRecv(); 361 else if (type_ == TYPE_ACCEPT) 362 sock_->Socket().CancelAccept(); 363 364 type_ = TYPE_NONE; 365 } 366 367 // 368 // Cancel operation and call callback. 369 // 370 void CIoqueueCallback::CancelOperation(pj_ioqueue_op_key_t *op_key, 371 pj_ssize_t bytes_status) 372 { 373 Type cur_type = type_; 374 375 Cancel(); 376 377 if (cur_type == TYPE_READ) 378 cb_->on_read_complete(key_, op_key, bytes_status); 379 else if (cur_type == TYPE_ACCEPT) 380 ; 381 } 382 383 384 ///////////////////////////////////////////////////////////////////////////// 300 385 /* 301 386 * IO Queue key structure. … … 376 461 pj_ioqueue_key_t *key; 377 462 378 key = (pj_ioqueue_key_t*) pj_pool_ alloc(pool, sizeof(pj_ioqueue_key_t));379 key->cbObj = new CIoqueueCallback(ioq, key, sock, cb, user_data);463 key = (pj_ioqueue_key_t*) pj_pool_zalloc(pool, sizeof(pj_ioqueue_key_t)); 464 key->cbObj = CIoqueueCallback::NewL(ioq, key, sock, cb, user_data); 380 465 381 466 *p_key = key; … … 390 475 if (key == NULL || key->cbObj == NULL) 391 476 return PJ_SUCCESS; 477 478 // Cancel pending async object 479 if (key->cbObj && key->cbObj->IsActive()) { 480 key->cbObj->Cancel(); 481 } 392 482 393 483 // Close socket. … … 395 485 delete key->cbObj->get_pj_socket(); 396 486 397 // Delete async object 398 delete key->cbObj; 399 key->cbObj = NULL; 487 // Delete async object. 488 if (key->cbObj) { 489 delete key->cbObj; 490 key->cbObj = NULL; 491 } 400 492 401 493 return PJ_SUCCESS; … … 519 611 520 612 if (timeout) { 521 if (!ioq->timeoutTimer->IsActive()) 613 //if (!ioq->timeoutTimer->IsActive()) 614 if (0) 522 615 timer = ioq->timeoutTimer; 523 616 else … … 534 627 do { 535 628 PjSymbianOS::Instance()->WaitForActiveObjects(); 536 } while (ioq->eventCount == 0 && !timer->HasTimedOut());537 538 if ( !timer->HasTimedOut())629 } while (ioq->eventCount == 0 && (!timer || (timer && !timer->HasTimedOut()))); 630 631 if (timer && !timer->HasTimedOut()) 539 632 timer->Cancel(); 540 633 541 if (timer != ioq->timeoutTimer)634 if (timer && timer != ioq->timeoutTimer) 542 635 delete timer; 543 636 … … 555 648 pj_uint32_t flags ) 556 649 { 557 return pj_ioqueue_recvfrom(key, op_key, buffer, length, flags, NULL, NULL); 650 // Clear flag 651 flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; 652 return key->cbObj->StartRead(op_key, buffer, length, flags, NULL, NULL); 558 653 } 559 654 … … 575 670 return PJ_EBUSY; 576 671 672 // Clear flag 673 flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; 577 674 return key->cbObj->StartRead(op_key, buffer, length, flags, addr, addrlen); 578 675 } … … 597 694 PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); 598 695 696 // Clear flag 697 flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; 698 599 699 key->cbObj->get_pj_socket()->Socket().Send(aBuffer, flags, reqStatus, aLen); 600 700 User::WaitForRequest(reqStatus); … … 603 703 return PJ_RETURN_OS_ERROR(reqStatus.Int()); 604 704 605 *length = aLen.Length(); 705 //At least in UIQ Emulator, aLen.Length() reports incorrect length 706 //for UDP (some newlc.com users seem to have reported this too). 707 //*length = aLen.Length(); 606 708 return PJ_SUCCESS; 607 709 } … … 632 734 PJ_ASSERT_RETURN(addrlen == sizeof(pj_sockaddr_in), PJ_EINVAL); 633 735 736 // Clear flag 737 flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; 738 634 739 aBuffer.Set((const TUint8*)data, (TInt)*length); 635 740 PjSymbianOS::pj2Addr(*(const pj_sockaddr_in*)addr, inetAddr); 636 741 CPjSocket *pjSock = key->cbObj->get_pj_socket(); 637 742 638 pjSock->Socket().Send (aBuffer, flags, reqStatus, aLen);743 pjSock->Socket().SendTo(aBuffer, inetAddr, flags, reqStatus, aLen); 639 744 User::WaitForRequest(reqStatus); 640 745 … … 642 747 return PJ_RETURN_OS_ERROR(reqStatus.Int()); 643 748 644 *length = aLen.Length(); 645 return PJ_SUCCESS; 646 } 647 749 //At least in UIQ Emulator, aLen.Length() reports incorrect length 750 //for UDP (some newlc.com users seem to have reported this too). 751 //*length = aLen.Length(); 752 return PJ_SUCCESS; 753 } 754 -
pjproject/branches/symbian/pjlib/src/pj/lock.c
r66 r789 64 64 PJ_ASSERT_RETURN(pool && lock, PJ_EINVAL); 65 65 66 p_lock = pj_pool_alloc(pool, sizeof(pj_lock_t));66 p_lock = (pj_lock_t*) pj_pool_alloc(pool, sizeof(pj_lock_t)); 67 67 if (!p_lock) 68 68 return PJ_ENOMEM; … … 150 150 PJ_ASSERT_RETURN(pool && lock, PJ_EINVAL); 151 151 152 p_lock = pj_pool_alloc(pool, sizeof(pj_lock_t));152 p_lock = (pj_lock_t*) pj_pool_alloc(pool, sizeof(pj_lock_t)); 153 153 if (!p_lock) 154 154 return PJ_ENOMEM; -
pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp
r788 r789 47 47 void *tls_values[PJ_MAX_TLS]; 48 48 49 #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 50 pj_uint32_t stk_size; 51 pj_uint32_t stk_max_usage; 52 char *stk_start; 53 const char *caller_file; 54 int caller_line; 55 #endif 56 49 57 } main_thread; 50 58 … … 54 62 }; 55 63 64 struct pj_sem_t 65 { 66 int value; 67 int max; 68 }; 56 69 57 70 /* Flags to indicate which TLS variables have been used */ … … 67 80 68 81 CPjTimeoutTimer::CPjTimeoutTimer() 69 : CActive(EPriorityNormal), hasTimedOut_( false)82 : CActive(EPriorityNormal), hasTimedOut_(PJ_FALSE) 70 83 { 71 84 } … … 80 93 void CPjTimeoutTimer::ConstructL() 81 94 { 95 hasTimedOut_ = PJ_FALSE; 82 96 timer_.CreateLocal(); 83 97 CActiveScheduler::Add(this); … … 86 100 CPjTimeoutTimer *CPjTimeoutTimer::NewL() 87 101 { 88 CPjTimeoutTimer *self = new (ELeave)CPjTimeoutTimer;102 CPjTimeoutTimer *self = new CPjTimeoutTimer; 89 103 CleanupStack::PushL(self); 90 104 … … 101 115 Cancel(); 102 116 103 hasTimedOut_ = false;117 hasTimedOut_ = PJ_FALSE; 104 118 timer_.After(iStatus, miliSeconds * 1000); 105 119 SetActive(); 120 121 pj_assert(iStatus==KRequestPending); 106 122 } 107 123 108 124 bool CPjTimeoutTimer::HasTimedOut() const 109 125 { 110 return hasTimedOut_ ;126 return hasTimedOut_ != 0; 111 127 } 112 128 113 129 void CPjTimeoutTimer::RunL() 114 130 { 115 hasTimedOut_ = true;131 hasTimedOut_ = PJ_TRUE; 116 132 } 117 133 … … 252 268 { 253 269 pj_ansi_strcpy(main_thread.obj_name, "pjthread"); 270 271 // Init main thread 272 pj_memset(&main_thread, 0, sizeof(main_thread)); 254 273 255 274 // Initialize PjSymbianOS instance … … 365 384 PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec) 366 385 { 386 //Not a good idea, as we don't want network events to 387 //arrive while we're not polling them: 388 //PjSymbianOS::Instance()->WaitForActiveObjects(); 389 390 //.. so rather use this, which won't wake up Active Objects: 367 391 User::After(msec*1000); 392 368 393 return PJ_SUCCESS; 369 394 } … … 642 667 unsigned initial, 643 668 unsigned max, 644 pj_sem_t **sem) 645 { 646 PJ_UNUSED_ARG(pool); 669 pj_sem_t **p_sem) 670 { 671 pj_sem_t *sem; 672 647 673 PJ_UNUSED_ARG(name); 648 PJ_UNUSED_ARG(initial); 649 PJ_UNUSED_ARG(max); 674 675 sem = (pj_sem_t*) pj_pool_zalloc(pool, sizeof(pj_sem_t)); 676 sem->value = initial; 677 sem->max = max; 678 679 *p_sem = sem; 680 681 return PJ_SUCCESS; 682 } 683 684 685 /* 686 * Wait for semaphore. 687 */ 688 PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem) 689 { 690 if (sem->value > 0) { 691 sem->value--; 692 return PJ_SUCCESS; 693 } else { 694 pj_assert(!"Unexpected!"); 695 return PJ_EINVALIDOP; 696 } 697 } 698 699 700 /* 701 * Try wait for semaphore. 702 */ 703 PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem) 704 { 705 if (sem->value > 0) { 706 sem->value--; 707 return PJ_SUCCESS; 708 } else { 709 pj_assert(!"Unexpected!"); 710 return PJ_EINVALIDOP; 711 } 712 } 713 714 715 /* 716 * Release semaphore. 717 */ 718 PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem) 719 { 720 sem->value++; 721 return PJ_SUCCESS; 722 } 723 724 725 /* 726 * Destroy semaphore. 727 */ 728 PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem) 729 { 650 730 PJ_UNUSED_ARG(sem); 651 652 /* Unsupported */ 653 return PJ_ENOTSUP; 654 } 655 656 657 /* 658 * Wait for semaphore. 659 */ 660 PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem) 661 { 662 PJ_UNUSED_ARG(sem); 663 return PJ_EINVALIDOP; 664 } 665 666 667 /* 668 * Try wait for semaphore. 669 */ 670 PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem) 671 { 672 PJ_UNUSED_ARG(sem); 673 return PJ_EINVALIDOP; 674 } 675 676 677 /* 678 * Release semaphore. 679 */ 680 PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem) 681 { 682 PJ_UNUSED_ARG(sem); 683 return PJ_EINVALIDOP; 684 } 685 686 687 /* 688 * Destroy semaphore. 689 */ 690 PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem) 691 { 692 PJ_UNUSED_ARG(sem); 693 return PJ_EINVALIDOP; 694 } 695 696 731 return PJ_SUCCESS; 732 } 733 734 735 #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0 736 /* 737 * The implementation of stack checking. 738 */ 739 PJ_DEF(void) pj_thread_check_stack(const char *file, int line) 740 { 741 char stk_ptr; 742 pj_uint32_t usage; 743 pj_thread_t *thread = pj_thread_this(); 744 745 pj_assert(thread); 746 747 /* Calculate current usage. */ 748 usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start : 749 thread->stk_start - &stk_ptr; 750 751 /* Assert if stack usage is dangerously high. */ 752 pj_assert("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128)); 753 754 /* Keep statistic. */ 755 if (usage > thread->stk_max_usage) { 756 thread->stk_max_usage = usage; 757 thread->caller_file = file; 758 thread->caller_line = line; 759 } 760 } 761 762 /* 763 * Get maximum stack usage statistic. 764 */ 765 PJ_DEF(pj_uint32_t) pj_thread_get_stack_max_usage(pj_thread_t *thread) 766 { 767 return thread->stk_max_usage; 768 } 769 770 /* 771 * Dump thread stack status. 772 */ 773 PJ_DEF(pj_status_t) pj_thread_get_stack_info(pj_thread_t *thread, 774 const char **file, 775 int *line) 776 { 777 pj_assert(thread); 778 779 *file = thread->caller_file; 780 *line = thread->caller_line; 781 return 0; 782 } 783 784 #endif /* PJ_OS_HAS_CHECK_STACK */ -
pjproject/branches/symbian/pjlib/src/pj/os_error_symbian.cpp
r788 r789 117 117 } 118 118 119 extern "C" int platform_strerror( pj_os_err_type os_errcode, 120 char *buf, pj_size_t bufsize); 119 extern "C" 120 { 121 PJ_DECL(int) platform_strerror( pj_os_err_type os_errcode, 122 char *buf, pj_size_t bufsize); 123 } 121 124 122 125 /* … … 126 129 * in errno.c 127 130 */ 128 intplatform_strerror( pj_os_err_type os_errcode,129 131 PJ_DEF(int) platform_strerror( pj_os_err_type os_errcode, 132 char *buf, pj_size_t bufsize) 130 133 { 131 134 int len = 0; -
pjproject/branches/symbian/pjlib/src/pj/os_symbian.h
r788 r789 167 167 168 168 private: 169 RTimer 170 boolhasTimedOut_;169 RTimer timer_; 170 pj_bool_t hasTimedOut_; 171 171 172 172 CPjTimeoutTimer(); … … 279 279 { 280 280 TInt aError; 281 User::WaitForAnyRequest(); 281 282 CActiveScheduler::RunIfReady(aError, aPriority); 282 283 } … … 295 296 private: 296 297 PjSymbianOS(); 297 298 298 }; 299 299 -
pjproject/branches/symbian/pjlib/src/pj/pool.c
r788 r789 178 178 179 179 /* Allocate initial block */ 180 buffer = ( *f->policy.block_alloc)(f, initial_size);180 buffer = (unsigned char*) (*f->policy.block_alloc)(f, initial_size); 181 181 if (!buffer) 182 182 return NULL; -
pjproject/branches/symbian/pjlib/src/pj/pool_caching.c
r364 r789 74 74 /* Delete all pool in free list */ 75 75 for (i=0; i < PJ_CACHING_POOL_ARRAY_SIZE; ++i) { 76 pj_pool_t *pool = cp->free_list[i].next;76 pj_pool_t *pool = (pj_pool_t*)cp->free_list[i].next; 77 77 pj_pool_t *next; 78 78 for (; pool != (void*)&cp->free_list[i]; pool = next) { … … 84 84 85 85 /* Delete all pools in used list */ 86 pool = cp->used_list.next;86 pool = (pj_pool_t*)cp->used_list.next; 87 87 while (pool != (pj_pool_t*) &cp->used_list) { 88 88 pj_pool_t *next = pool->next; … … 141 141 } else { 142 142 /* Get one pool from the list. */ 143 pool = cp->free_list[idx].next;143 pool = (pj_pool_t*) cp->free_list[idx].next; 144 144 pj_list_erase(pool); 145 145 … … 230 230 cp->capacity, cp->max_capacity, cp->used_count)); 231 231 if (detail) { 232 pj_pool_t *pool = cp->used_list.next;232 pj_pool_t *pool = (pj_pool_t*) cp->used_list.next; 233 233 pj_uint32_t total_used = 0, total_capacity = 0; 234 234 PJ_LOG(3,("cachpool", " Dumping all active pools:")); -
pjproject/branches/symbian/pjlib/src/pj/sock_symbian.cpp
r788 r789 567 567 RSocket &rSock = pjSock->Socket(); 568 568 569 // Socket must be connected.570 PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP);571 572 569 TInetAddr inetAddr; 573 570 rSock.LocalName(inetAddr); -
pjproject/branches/symbian/pjlib/src/pj/timer.c
r251 r789 245 245 pj_timer_entry **new_heap = 0; 246 246 247 new_heap = pj_pool_alloc(ht->pool, sizeof(pj_timer_entry*) * new_size);247 new_heap = (pj_timer_entry **) pj_pool_alloc(ht->pool, sizeof(pj_timer_entry*) * new_size); 248 248 memcpy(new_heap, ht->heap, ht->max_size * sizeof(pj_timer_entry*)); 249 249 //delete [] this->heap_; … … 253 253 254 254 new_timer_ids = 0; 255 new_timer_ids = pj_pool_alloc(ht->pool, new_size * sizeof(pj_timer_id_t));255 new_timer_ids = (pj_timer_id_t*) pj_pool_alloc(ht->pool, new_size * sizeof(pj_timer_id_t)); 256 256 257 257 memcpy( new_timer_ids, ht->timer_ids, ht->max_size * sizeof(pj_timer_id_t)); … … 360 360 361 361 /* Allocate timer heap data structure from the pool */ 362 ht = pj_pool_alloc(pool, sizeof(pj_timer_heap_t));362 ht = (pj_timer_heap_t*) pj_pool_alloc(pool, sizeof(pj_timer_heap_t)); 363 363 if (!ht) 364 364 return PJ_ENOMEM; … … 376 376 377 377 // Create the heap array. 378 ht->heap = pj_pool_alloc(pool, sizeof(pj_timer_entry*) * size);378 ht->heap = (pj_timer_entry **) pj_pool_alloc(pool, sizeof(pj_timer_entry*) * size); 379 379 if (!ht->heap) 380 380 return PJ_ENOMEM; 381 381 382 382 // Create the parallel 383 ht->timer_ids = pj_pool_alloc( pool, sizeof(pj_timer_id_t) * size);383 ht->timer_ids = (pj_timer_id_t*) pj_pool_alloc( pool, sizeof(pj_timer_id_t) * size); 384 384 if (!ht->timer_ids) 385 385 return PJ_ENOMEM; -
pjproject/branches/symbian/pjlib/src/pjlib-test/atomic.c
r788 r789 19 19 #include "test.h" 20 20 #include <pj/os.h> 21 #include <pj/pool.h> 21 22 22 23 /** -
pjproject/branches/symbian/pjlib/src/pjlib-test/ioq_tcp.c
r788 r789 18 18 */ 19 19 #include "test.h" 20 #include <pj/os.h> 20 21 21 22 /** … … 414 415 pj_pool_release(pool); 415 416 return status; 416 417 } 417 } 418 418 419 419 420 /* -
pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp
r788 r789 52 52 // add your program code here, example code below 53 53 // 54 test_main(); 54 int rc = test_main(); 55 56 console->Printf(_L(" [press any key]\n")); 57 console->Getch(); 58 55 59 CActiveScheduler::Stop(); 56 60 } … … 142 146 143 147 CActiveScheduler::Start(); 144 145 // Delete active scheduler146 //CActiveScheduler::Install(NULL);147 scheduler->Stop();148 //delete scheduler;149 148 } 150 149 -
pjproject/branches/symbian/pjlib/src/pjlib-test/string_test.c
r788 r789 236 236 } 237 237 238 if (c2 == 0) c2 = 1; 238 239 PJ_LOG(3, ("", " time: stricmp=%u, stricmp_alnum=%u (speedup=%d.%02dx)", 239 240 c1, c2, -
pjproject/branches/symbian/pjlib/src/pjlib-test/test.c
r788 r789 44 44 const char *param_echo_server = ECHO_SERVER_ADDRESS; 45 45 int param_echo_port = ECHO_SERVER_START_PORT; 46 int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | 47 PJ_LOG_HAS_MICRO_SEC; 46 int param_log_decor = PJ_LOG_HAS_NEWLINE; 48 47 49 48 int null_func() … … 186 185 pj_caching_pool_destroy( &caching_pool ); 187 186 188 PJ_LOG(3,("test", " "));187 PJ_LOG(3,("test", " ")); 189 188 190 189 pj_thread_get_stack_info(pj_thread_this(), &filename, &line); -
pjproject/branches/symbian/pjlib/src/pjlib-test/test.h
r788 r789 22 22 #include <pj/types.h> 23 23 24 #define GROUP_LIBC 025 #define GROUP_OS 026 #define GROUP_DATA_STRUCTURE 024 #define GROUP_LIBC 1 25 #define GROUP_OS 1 26 #define GROUP_DATA_STRUCTURE 1 27 27 #define GROUP_NETWORK 1 28 28 #define GROUP_FILE 0 … … 34 34 #define INCLUDE_LIST_TEST GROUP_DATA_STRUCTURE 35 35 #define INCLUDE_POOL_TEST GROUP_LIBC 36 #define INCLUDE_POOL_PERF_TEST 0 //(PJ_HAS_MALLOC && GROUP_LIBC)37 #define INCLUDE_STRING_TEST 0 //GROUP_DATA_STRUCTURE38 #define INCLUDE_FIFOBUF_TEST 0 //GROUP_DATA_STRUCTURE36 #define INCLUDE_POOL_PERF_TEST (PJ_HAS_MALLOC && GROUP_LIBC) 37 #define INCLUDE_STRING_TEST GROUP_DATA_STRUCTURE 38 #define INCLUDE_FIFOBUF_TEST GROUP_DATA_STRUCTURE 39 39 #define INCLUDE_RBTREE_TEST GROUP_DATA_STRUCTURE 40 40 #define INCLUDE_TIMER_TEST GROUP_DATA_STRUCTURE … … 43 43 #define INCLUDE_SLEEP_TEST GROUP_OS 44 44 #define INCLUDE_THREAD_TEST (PJ_HAS_THREADS && GROUP_OS) 45 #define INCLUDE_SOCK_TEST 0 //GROUP_NETWORK46 #define INCLUDE_SOCK_PERF_TEST 0 //GROUP_NETWORK47 #define INCLUDE_SELECT_TEST 0 //GROUP_NETWORK45 #define INCLUDE_SOCK_TEST GROUP_NETWORK 46 #define INCLUDE_SOCK_PERF_TEST GROUP_NETWORK 47 #define INCLUDE_SELECT_TEST GROUP_NETWORK 48 48 #define INCLUDE_UDP_IOQUEUE_TEST GROUP_NETWORK 49 49 #define INCLUDE_TCP_IOQUEUE_TEST GROUP_NETWORK 50 #define INCLUDE_IOQUEUE_PERF_TEST GROUP_NETWORK50 #define INCLUDE_IOQUEUE_PERF_TEST (PJ_HAS_THREADS && GROUP_NETWORK) 51 51 #define INCLUDE_IOQUEUE_UNREG_TEST 0 // GROUP_NETWORK 52 52 #define INCLUDE_FILE_TEST GROUP_FILE -
pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
r788 r789 19 19 #include <pj/errno.h> 20 20 #include <pj/ioqueue.h> 21 #include <pj/os.h> 21 22 #include <pj/pool.h> 22 23 #include <pj/sock.h> 24 #include <pj/string.h> 23 25 #include "test.h" 24 26 -
pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_sync.c
r788 r789 20 20 #include <pj/errno.h> 21 21 #include <pj/ioqueue.h> 22 #include <pj/log.h> 22 23 #include <pj/os.h> 23 24 #include <pj/pool.h> -
pjproject/branches/symbian/pjmedia/include/pjmedia/config.h
r445 r789 37 37 # if defined(PJ_WIN32) && PJ_WIN32!=0 38 38 # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_WIN32_DIRECT_SOUND 39 # elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 40 # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND 39 41 # else 40 42 # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_PORTAUDIO_SOUND -
pjproject/branches/symbian/pjmedia/src/pjmedia/errno.c
r438 r789 20 20 #include <pjmedia/types.h> 21 21 #include <pj/string.h> 22 #include <portaudio.h> 22 23 #if PJMEDIA_SOUND_IMPLEMENTATION==PJMEDIA_SOUND_PORTAUDIO_SOUND 24 # include <portaudio.h> 25 #endif 23 26 24 27 -
pjproject/branches/symbian/pjmedia/src/pjmedia/sdp.c
r366 r789 93 93 PJ_ASSERT_RETURN(pool && name, NULL); 94 94 95 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));95 attr = (pjmedia_sdp_attr*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr)); 96 96 pj_strdup2(pool, &attr->name, name); 97 97 … … 113 113 PJ_ASSERT_RETURN(pool && rhs, NULL); 114 114 115 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));115 attr = (pjmedia_sdp_attr*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr)); 116 116 117 117 pj_strdup(pool, &attr->name, &rhs->name); … … 365 365 PJ_ASSERT_RETURN(pool && attr && p_rtpmap, PJ_EINVAL); 366 366 367 *p_rtpmap = pj_pool_alloc(pool, sizeof(pjmedia_sdp_rtpmap));367 *p_rtpmap = (pjmedia_sdp_rtpmap*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_rtpmap)); 368 368 PJ_ASSERT_RETURN(*p_rtpmap, PJ_ENOMEM); 369 369 … … 394 394 } 395 395 396 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));396 attr = (pjmedia_sdp_attr*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr)); 397 397 PJ_ASSERT_RETURN(attr != NULL, PJ_ENOMEM); 398 398 … … 431 431 432 432 attr->value.slen = p-tempbuf; 433 attr->value.ptr = pj_pool_alloc(pool, attr->value.slen);433 attr->value.ptr = (char*)pj_pool_alloc(pool, attr->value.slen); 434 434 pj_memcpy(attr->value.ptr, tempbuf, attr->value.slen); 435 435 … … 465 465 const pjmedia_sdp_conn *rhs) 466 466 { 467 pjmedia_sdp_conn *c = pj_pool_alloc (pool, sizeof(pjmedia_sdp_conn));467 pjmedia_sdp_conn *c = (pjmedia_sdp_conn*) pj_pool_alloc (pool, sizeof(pjmedia_sdp_conn)); 468 468 if (!c) return NULL; 469 469 … … 559 559 { 560 560 unsigned int i; 561 pjmedia_sdp_media *m = pj_pool_alloc (pool, sizeof(pjmedia_sdp_media));561 pjmedia_sdp_media *m = (pjmedia_sdp_media*) pj_pool_alloc (pool, sizeof(pjmedia_sdp_media)); 562 562 PJ_ASSERT_RETURN(m != NULL, NULL); 563 563 … … 896 896 ctx->last_error = PJMEDIA_SDP_EINATTR; 897 897 898 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));898 attr = (pjmedia_sdp_attr*)pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr)); 899 899 900 900 /* skip a= */ … … 928 928 pjmedia_sdp_session *session; 929 929 pjmedia_sdp_media *media = NULL; 930 void*attr;930 pjmedia_sdp_attr *attr; 931 931 pjmedia_sdp_conn *conn; 932 932 pj_str_t dummy; … … 940 940 941 941 pj_scan_init(&scanner, buf, len, 0, &on_scanner_error); 942 session = pj_pool_calloc(pool, 1, sizeof(pjmedia_sdp_session));942 session = (pjmedia_sdp_session*)pj_pool_calloc(pool, 1, sizeof(pjmedia_sdp_session)); 943 943 PJ_ASSERT_RETURN(session != NULL, PJ_ENOMEM); 944 944 … … 964 964 break; 965 965 case 'c': 966 conn = pj_pool_calloc(pool, 1, sizeof(*conn));966 conn = (pjmedia_sdp_conn*) pj_pool_calloc(pool, 1, sizeof(*conn)); 967 967 parse_connection_info(&scanner, conn, &ctx); 968 968 if (media) { … … 976 976 break; 977 977 case 'm': 978 media = pj_pool_calloc(pool, 1, sizeof(*media));978 media = (pjmedia_sdp_media*) pj_pool_calloc(pool, 1, sizeof(*media)); 979 979 parse_media(&scanner, media, &ctx); 980 980 session->media[ session->media_count++ ] = media; … … 992 992 993 993 } 994 PJ_CATCH (SYNTAX_ERROR){994 PJ_CATCH_ANY { 995 995 996 996 char errmsg[PJ_ERR_MSG_SIZE]; … … 1034 1034 PJ_ASSERT_RETURN(pool && rhs, NULL); 1035 1035 1036 sess = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_session));1036 sess = (pjmedia_sdp_session*)pj_pool_zalloc(pool, sizeof(pjmedia_sdp_session)); 1037 1037 PJ_ASSERT_RETURN(sess != NULL, NULL); 1038 1038 -
pjproject/branches/symbian/pjmedia/src/pjmedia/sdp_neg.c
r280 r789 82 82 83 83 /* Create and initialize negotiator. */ 84 neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));84 neg = (pjmedia_sdp_neg*) pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg)); 85 85 PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM); 86 86 … … 116 116 117 117 /* Create and initialize negotiator. */ 118 neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));118 neg = (pjmedia_sdp_neg*) pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg)); 119 119 PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM); 120 120 … … 634 634 */ 635 635 const pjmedia_sdp_attr *a; 636 pjmedia_sdp_rtpmap or ;636 pjmedia_sdp_rtpmap ormt; 637 637 pj_bool_t is_codec; 638 638 … … 644 644 return PJ_FALSE; 645 645 } 646 pjmedia_sdp_attr_get_rtpmap(a, &or );647 648 if (!pj_strcmp2(&or .enc_name, "telephone-event")) {646 pjmedia_sdp_attr_get_rtpmap(a, &ormt); 647 648 if (!pj_strcmp2(&ormt.enc_name, "telephone-event")) { 649 649 offer_has_telephone_event = 1; 650 650 if (found_matching_telephone_event) … … 669 669 670 670 /* See if encoding name and clock rate match */ 671 if (!pj_strcmp(&or .enc_name, &lr.enc_name) &&672 or .clock_rate == lr.clock_rate)671 if (!pj_strcmp(&ormt.enc_name, &lr.enc_name) && 672 ormt.clock_rate == lr.clock_rate) 673 673 { 674 674 /* Match! */ -
pjproject/branches/symbian/pjsip-apps/src/samples/sipstateless.c
r448 r789 32 32 #include <pjlib-util.h> 33 33 #include <pjlib.h> 34 #include "../../../pjlib/src/pj/os_symbian.h" 34 35 35 36 … … 62 63 63 64 65 extern "C" 66 { 67 int pj_app_main(int argc, char *argv[]); 68 } 69 70 71 static void app_perror(pj_status_t status) 72 { 73 char errmsg[PJ_ERR_MSG_SIZE]; 74 pj_strerror(status, errmsg, sizeof(errmsg)); 75 PJ_LOG(1,("main", "Error: %s", errmsg)); 76 } 77 78 64 79 /* 65 * main()80 * pj_app_main() 66 81 * 67 82 */ 68 int main()83 int pj_app_main(int argc, char *argv[]) 69 84 { 70 85 pj_caching_pool cp; … … 93 108 PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 94 109 95 96 110 /* Then init PJLIB-UTIL: */ 97 111 status = pjlib_util_init(); … … 99 113 100 114 /* Must create a pool factory before we can allocate any memory. */ 101 pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, 0);115 pj_caching_pool_init(&cp, pj_pool_factory_get_default_policy(), 0); 102 116 103 117 … … 135 149 status = pjsip_udp_transport_start( sip_endpt, &addr, NULL, 1, NULL); 136 150 if (status != PJ_SUCCESS) { 151 char errmsg[PJ_ERR_MSG_SIZE]; 152 153 pj_strerror(status, errmsg, sizeof(errmsg)); 137 154 PJ_LOG(3,(THIS_FILE, 138 "Error starting UDP transport (port in use?)"));155 "Error starting UDP transport: %s", errmsg)); 139 156 return 1; 140 157 } -
pjproject/branches/symbian/pjsip/include/pjsip-ua/sip_inv.h
r324 r789 27 27 28 28 29 typedef enum pjsip_inv_state pjsip_inv_state;30 29 typedef struct pjsip_inv_session pjsip_inv_session; 31 30 typedef struct pjsip_inv_callback pjsip_inv_callback; … … 34 33 * This enumeration describes invite session state. 35 34 */ 36 enum pjsip_inv_state35 typedef enum pjsip_inv_state 37 36 { 38 37 PJSIP_INV_STATE_NULL, /**< Before INVITE is sent or received */ … … 43 42 PJSIP_INV_STATE_CONFIRMED, /**< After ACK is sent/received. */ 44 43 PJSIP_INV_STATE_DISCONNECTED, /**< Session is terminated. */ 45 } ;44 } pjsip_inv_state; 46 45 47 46 /** -
pjproject/branches/symbian/pjsip/include/pjsip/print_util.h
r167 r789 106 106 PJ_INLINE(void) init_hdr(void *hptr, pjsip_hdr_e htype, void *vptr) 107 107 { 108 pjsip_hdr *hdr = hptr;108 pjsip_hdr *hdr = (pjsip_hdr*) hptr; 109 109 hdr->type = htype; 110 110 hdr->name = hdr->sname = pjsip_hdr_names[htype]; 111 hdr->vptr = vptr;111 hdr->vptr = (pjsip_hdr_vptr*) vptr; 112 112 pj_list_init(hdr); 113 113 } -
pjproject/branches/symbian/pjsip/include/pjsip/sip_dialog.h
r376 r789 53 53 * Dialog state. 54 54 */ 55 enum pjsip_dialog_state55 typedef enum pjsip_dialog_state 56 56 { 57 57 PJSIP_DIALOG_STATE_NULL, 58 58 PJSIP_DIALOG_STATE_ESTABLISHED, 59 } ;59 } pjsip_dialog_state; 60 60 61 61 /** -
pjproject/branches/symbian/pjsip/include/pjsip/sip_types.h
r197 r789 140 140 141 141 /** 142 * Dialog state (sip_dialog.h).143 */144 typedef enum pjsip_dialog_state pjsip_dialog_state;145 146 /**147 142 * Transaction role. 148 143 */ -
pjproject/branches/symbian/pjsip/src/pjsip-simple/evsub_msg.c
r197 r789 22 22 #include <pj/pool.h> 23 23 #include <pj/string.h> 24 #include <pj/except.h>25 24 26 25 /* -
pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_client.c
r401 r789 213 213 214 214 /* Allocate memory. */ 215 cred->response.ptr = pj_pool_alloc(pool, PJSIP_MD5STRLEN);215 cred->response.ptr = (char*)pj_pool_alloc(pool, PJSIP_MD5STRLEN); 216 216 cred->response.slen = PJSIP_MD5STRLEN; 217 217 … … 228 228 */ 229 229 cred->qop = pjsip_AUTH_STR; 230 cred->nc.ptr = pj_pool_alloc(pool, 16);230 cred->nc.ptr = (char*)pj_pool_alloc(pool, 16); 231 231 pj_ansi_snprintf(cred->nc.ptr, 16, "%06u", nc); 232 232 … … 266 266 if (cached_auth->cnonce.slen == 0) { 267 267 /* Save the whole challenge */ 268 cached_auth->last_chal = pjsip_hdr_clone(ses_pool, hdr); 268 cached_auth->last_chal = (pjsip_www_authenticate_hdr*) 269 pjsip_hdr_clone(ses_pool, hdr); 269 270 270 271 /* Create cnonce */ … … 366 367 sess->endpt = (pjsip_endpoint*)rhs->endpt; 367 368 sess->cred_cnt = rhs->cred_cnt; 368 sess->cred_info = pj_pool_alloc(pool,369 sess->cred_info = (pjsip_cred_info*) pj_pool_alloc(pool, 369 370 sess->cred_cnt*sizeof(pjsip_cred_info)); 370 371 for (i=0; i<rhs->cred_cnt; ++i) { … … 401 402 } else { 402 403 int i; 403 sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c)); 404 sess->cred_info = (pjsip_cred_info*) 405 pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c)); 404 406 for (i=0; i<cred_cnt; ++i) { 405 407 sess->cred_info[i].data_type = c[i].data_type; … … 527 529 cached_hdr->hdr = hauth; 528 530 } else { 529 cached_hdr = pj_pool_alloc(pool, sizeof(*cached_hdr)); 531 cached_hdr = (pjsip_cached_auth_hdr*) 532 pj_pool_alloc(pool, sizeof(*cached_hdr)); 530 533 pjsip_method_copy( pool, &cached_hdr->method, method); 531 534 cached_hdr->hdr = hauth; … … 536 539 # if defined(PJSIP_AUTH_AUTO_SEND_NEXT) && PJSIP_AUTH_AUTO_SEND_NEXT!=0 537 540 if (hdr != cached_auth->last_chal) { 538 cached_auth->last_chal = pjsip_hdr_clone(sess_pool, hdr); 541 cached_auth->last_chal = (pjsip_www_authenticate_hdr*) 542 pjsip_hdr_clone(sess_pool, hdr); 539 543 } 540 544 # endif … … 609 613 if (pjsip_method_cmp(&entry->method, method)==0) { 610 614 pjsip_authorization_hdr *hauth; 611 hauth = pjsip_hdr_shallow_clone(tdata->pool, entry->hdr); 615 hauth=(pjsip_authorization_hdr*) 616 pjsip_hdr_shallow_clone(tdata->pool, entry->hdr); 612 617 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)hauth); 613 618 } else { … … 795 800 cached_auth = find_cached_auth(sess, &hchal->challenge.common.realm ); 796 801 if (!cached_auth) { 797 cached_auth = pj_pool_zalloc( sess->pool, sizeof(*cached_auth)); 802 cached_auth = (pjsip_cached_auth *) 803 pj_pool_zalloc( sess->pool, sizeof(*cached_auth)); 798 804 pj_strdup( sess->pool, &cached_auth->realm, &hchal->challenge.common.realm); 799 805 cached_auth->is_proxy = (hchal->type == PJSIP_H_PROXY_AUTHENTICATE); … … 823 829 824 830 /* Remove branch param in Via header. */ 825 via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 831 via = (pjsip_via_hdr*) 832 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); 826 833 via->branch_param.slen = 0; 827 834 -
pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_msg.c
r82 r789 47 47 PJ_DEF(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool) 48 48 { 49 pjsip_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 49 pjsip_authorization_hdr *hdr = (pjsip_authorization_hdr *) 50 pj_pool_calloc(pool, 1, sizeof(*hdr)); 50 51 init_hdr(hdr, PJSIP_H_AUTHORIZATION, &authorization_hdr_vptr); 51 52 pj_list_init(&hdr->credential.common.other_param); … … 55 56 PJ_DEF(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_pool_t *pool) 56 57 { 57 pjsip_proxy_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 58 pjsip_proxy_authorization_hdr *hdr = (pjsip_proxy_authorization_hdr *) 59 pj_pool_calloc(pool, 1, sizeof(*hdr)); 58 60 init_hdr(hdr, PJSIP_H_PROXY_AUTHORIZATION, &authorization_hdr_vptr); 59 61 pj_list_init(&hdr->credential.common.other_param); … … 173 175 { 174 176 /* This function also serves Proxy-Authorization header. */ 175 pjsip_authorization_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 177 pjsip_authorization_hdr *hdr = (pjsip_authorization_hdr *) 178 pj_pool_alloc(pool, sizeof(*hdr)); 176 179 pj_memcpy(hdr, rhs, sizeof(*hdr)); 177 180 pjsip_param_shallow_clone(pool, &hdr->credential.common.other_param, … … 202 205 PJ_DEF(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t *pool) 203 206 { 204 pjsip_www_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 207 pjsip_www_authenticate_hdr *hdr = (pjsip_www_authenticate_hdr *) 208 pj_pool_calloc(pool, 1, sizeof(*hdr)); 205 209 init_hdr(hdr, PJSIP_H_WWW_AUTHENTICATE, &www_authenticate_hdr_vptr); 206 210 pj_list_init(&hdr->challenge.common.other_param); … … 211 215 PJ_DEF(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool) 212 216 { 213 pjsip_proxy_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 217 pjsip_proxy_authenticate_hdr *hdr = (pjsip_proxy_authenticate_hdr *) 218 pj_pool_calloc(pool, 1, sizeof(*hdr)); 214 219 init_hdr(hdr, PJSIP_H_PROXY_AUTHENTICATE, &www_authenticate_hdr_vptr); 215 220 pj_list_init(&hdr->challenge.common.other_param); … … 323 328 { 324 329 /* This function also serves Proxy-Authenticate header. */ 325 pjsip_www_authenticate_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 330 pjsip_www_authenticate_hdr *hdr = (pjsip_www_authenticate_hdr *) 331 pj_pool_alloc(pool, sizeof(*hdr)); 326 332 pj_memcpy(hdr, rhs, sizeof(*hdr)); 327 333 pjsip_param_shallow_clone(pool, &hdr->challenge.common.other_param, -
pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_parser.c
r65 r789 107 107 108 108 } else { 109 pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 109 pjsip_param *p = (pjsip_param *) 110 pj_pool_alloc(pool, sizeof(pjsip_param)); 110 111 p->name = name; 111 112 p->value = value; … … 169 170 170 171 } else { 171 pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 172 pjsip_param *p = (pjsip_param *) 173 pj_pool_alloc(pool, sizeof(pjsip_param)); 172 174 p->name = name; 173 175 p->value = value; -
pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_server.c
r123 r789 115 115 pjsip_authorization_hdr *h_auth; 116 116 pjsip_msg *msg = rdata->msg_info.msg; 117 inthtype;117 pjsip_hdr_e htype; 118 118 pj_str_t acc_name; 119 119 pjsip_cred_info cred_info; -
pjproject/branches/symbian/pjsip/src/pjsip/sip_dialog.c
r446 r789 70 70 return PJ_ENOMEM; 71 71 72 dlg = pj_pool_zalloc(pool, sizeof(pjsip_dialog));72 dlg = (pjsip_dialog*)pj_pool_zalloc(pool, sizeof(pjsip_dialog)); 73 73 PJ_ASSERT_RETURN(dlg != NULL, PJ_ENOMEM); 74 74 … … 145 145 pjsip_hdr *hdr; 146 146 147 hdr = pjsip_parse_hdr(dlg->pool, ¶m->name, param->value.ptr, 147 hdr = (pjsip_hdr *) 148 pjsip_parse_hdr(dlg->pool, ¶m->name, param->value.ptr, 148 149 param->value.slen, NULL); 149 150 if (hdr == NULL) { … … 290 291 * both local and remote URI. 291 292 */ 292 tmp.ptr = pj_pool_alloc(rdata->tp_info.pool, TMP_LEN);293 tmp.ptr = (char*)pj_pool_alloc(rdata->tp_info.pool, TMP_LEN); 293 294 294 295 /* Init local info from the To header. */ 295 dlg->local.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.to); 296 dlg->local.info = (pjsip_to_hdr*) 297 pjsip_hdr_clone(dlg->pool, rdata->msg_info.to); 296 298 pjsip_fromto_hdr_set_from(dlg->local.info); 297 299 … … 348 350 349 351 /* Init remote info from the From header. */ 350 dlg->remote.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.from); 352 dlg->remote.info = (pjsip_from_hdr*) 353 pjsip_hdr_clone(dlg->pool, rdata->msg_info.from); 351 354 pjsip_fromto_hdr_set_to(dlg->remote.info); 352 355 … … 365 368 366 369 /* Init remote's contact from Contact header. */ 367 contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 370 contact_hdr = (pjsip_hdr*) 371 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 368 372 NULL); 369 373 if (!contact_hdr) { … … 371 375 goto on_error; 372 376 } 373 dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact_hdr); 377 dlg->remote.contact = (pjsip_contact_hdr*) 378 pjsip_hdr_clone(dlg->pool, contact_hdr); 374 379 375 380 /* Init remote's CSeq from CSeq header */ … … 391 396 392 397 /* Call-ID */ 393 dlg->call_id = pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid); 398 dlg->call_id = (pjsip_cid_hdr*) 399 pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid); 394 400 395 401 /* Route set. … … 406 412 407 413 /* Clone the Record-Route, change the type to Route header. */ 408 route = pjsip_hdr_clone(dlg->pool, rr);414 route = (pjsip_route_hdr*)pjsip_hdr_clone(dlg->pool, rr); 409 415 pjsip_routing_hdr_set_route(route); 410 416 … … 416 422 if (rr == (pjsip_rr_hdr*)&rdata->msg_info.msg->hdr) 417 423 break; 418 rr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_RECORD_ROUTE, rr); 424 rr = (pjsip_route_hdr*) 425 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_RECORD_ROUTE, rr); 419 426 } 420 427 … … 501 508 502 509 /* Clone remote target. */ 503 dlg->target = pjsip_uri_clone(dlg->pool, first_dlg->target);510 dlg->target = (pjsip_uri*) pjsip_uri_clone(dlg->pool, first_dlg->target); 504 511 505 512 /* Clone local info. */ 506 dlg->local.info = pjsip_hdr_clone(dlg->pool, first_dlg->local.info); 513 dlg->local.info = (pjsip_fromto_hdr*) 514 pjsip_hdr_clone(dlg->pool, first_dlg->local.info); 507 515 508 516 /* Clone local tag. */ … … 515 523 516 524 /* Clone local Contact. */ 517 dlg->local.contact = pjsip_hdr_clone(dlg->pool, first_dlg->local.contact); 525 dlg->local.contact = (pjsip_contact_hdr*) 526 pjsip_hdr_clone(dlg->pool, first_dlg->local.contact); 518 527 519 528 /* Clone remote info. */ 520 dlg->remote.info = pjsip_hdr_clone(dlg->pool, first_dlg->remote.info); 529 dlg->remote.info = (pjsip_fromto_hdr*) 530 pjsip_hdr_clone(dlg->pool, first_dlg->remote.info); 521 531 522 532 /* Set remote tag from the response. */ … … 542 552 543 553 /* Clone Call-ID header. */ 544 dlg->call_id = pjsip_hdr_clone(dlg->pool, first_dlg->call_id); 554 dlg->call_id = (pjsip_cid_hdr*) 555 pjsip_hdr_clone(dlg->pool, first_dlg->call_id); 545 556 546 557 /* Duplicate Route-Set. */ … … 550 561 pjsip_route_hdr *h; 551 562 552 h = pjsip_hdr_clone(dlg->pool, r);563 h = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r); 553 564 pj_list_push_back(&dlg->route_set, h); 554 565 … … 653 664 pjsip_route_hdr *new_r; 654 665 655 new_r = pjsip_hdr_clone(dlg->pool, r);666 new_r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r); 656 667 pj_list_push_back(&dlg->route_set, new_r); 657 668 … … 860 871 for (; route != end_list; route = route->next ) { 861 872 pjsip_route_hdr *r; 862 r = pjsip_hdr_shallow_clone( tdata->pool, route );873 r = (pjsip_route_hdr*) pjsip_hdr_shallow_clone( tdata->pool, route ); 863 874 pjsip_routing_hdr_set_route(r); 864 875 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)r); … … 1041 1052 /* Add contact header only if one is not present. */ 1042 1053 if (pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL) == 0) { 1043 hdr = pjsip_hdr_clone(tdata->pool, dlg->local.contact); 1054 hdr = (pjsip_hdr*) 1055 pjsip_hdr_clone(tdata->pool, dlg->local.contact); 1044 1056 pjsip_msg_add_hdr(tdata->msg, hdr); 1045 1057 } … … 1053 1065 PJSIP_H_ALLOW, NULL); 1054 1066 if (c_hdr) { 1055 hdr = pjsip_hdr_clone(tdata->pool, c_hdr);1067 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr); 1056 1068 pjsip_msg_add_hdr(tdata->msg, hdr); 1057 1069 } … … 1065 1077 PJSIP_H_SUPPORTED, NULL); 1066 1078 if (c_hdr) { 1067 hdr = pjsip_hdr_clone(tdata->pool, c_hdr);1079 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr); 1068 1080 pjsip_msg_add_hdr(tdata->msg, hdr); 1069 1081 } … … 1238 1250 while (hdr != hdr_list) { 1239 1251 pjsip_msg_add_hdr(tdata->msg, 1240 pjsip_hdr_clone(tdata->pool, hdr));1252 (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr)); 1241 1253 hdr = hdr->next; 1242 1254 } … … 1387 1399 if (hdr->type == PJSIP_H_RECORD_ROUTE) { 1388 1400 pjsip_route_hdr *r; 1389 r = pjsip_hdr_clone(dlg->pool, hdr);1401 r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, hdr); 1390 1402 pjsip_routing_hdr_set_route(r); 1391 1403 pj_list_push_back(&dlg->route_set, r); … … 1396 1408 * field of the response. 1397 1409 */ 1398 contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1410 contact = (pjsip_contact_hdr*) 1411 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1399 1412 NULL); 1400 1413 if (contact) { 1401 dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact); 1414 dlg->remote.contact = (pjsip_contact_hdr*) 1415 pjsip_hdr_clone(dlg->pool, contact); 1402 1416 dlg->target = dlg->remote.contact->uri; 1403 1417 } … … 1414 1428 pjsip_contact_hdr *contact; 1415 1429 1416 contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1430 contact = (pjsip_contact_hdr*) 1431 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1417 1432 NULL); 1418 1433 if (contact) { 1419 dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact); 1434 dlg->remote.contact = (pjsip_contact_hdr*) 1435 pjsip_hdr_clone(dlg->pool, contact); 1420 1436 dlg->target = dlg->remote.contact->uri; 1421 1437 } -
pjproject/branches/symbian/pjsip/src/pjsip/sip_endpoint.c
r448 r789 144 144 static int cmp_mod_name(void *name, const void *mod) 145 145 { 146 return pj_stricmp(name, &((pjsip_module*)mod)->name); 146 return pj_stricmp((pj_str_t*)name, 147 (const pj_str_t*)&((pjsip_module*)mod)->name); 147 148 } 148 149 … … 401 402 402 403 /* Create endpoint. */ 403 endpt = pj_pool_zalloc(pool, sizeof(*endpt));404 endpt = (pjsip_endpoint*) pj_pool_zalloc(pool, sizeof(*endpt)); 404 405 endpt->pool = pool; 405 406 endpt->pf = pf; … … 591 592 /* timeout is 'out' var. This just to make compiler happy. */ 592 593 pj_time_val timeout = { 0, 0}; 594 pj_time_val *p_timeout; 593 595 594 596 PJ_LOG(6, (THIS_FILE, "pjsip_endpt_handle_events()")); … … 612 614 } 613 615 616 /* Timer heap may return PJ_MAXINT32 when it has no entries */ 617 if (timeout.sec == PJ_MAXINT32 || timeout.msec == PJ_MAXINT32) 618 p_timeout = NULL; 619 else 620 p_timeout = &timeout; 621 614 622 /* Poll ioqueue. */ 615 if (pj_ioqueue_poll( endpt->ioqueue, &timeout) < 0) {623 if (pj_ioqueue_poll( endpt->ioqueue, p_timeout) < 0) { 616 624 pj_thread_sleep(1); 617 625 return pj_get_netos_error(); … … 676 684 pj_bool_t mismatch = PJ_FALSE; 677 685 if (port == 0) { 678 inttype;679 type = rdata->tp_info.transport->key.type;686 pjsip_transport_type_e type; 687 type = (pjsip_transport_type_e) rdata->tp_info.transport->key.type; 680 688 port = pjsip_transport_get_default_port_for_type(type); 681 689 } -
pjproject/branches/symbian/pjsip/src/pjsip/sip_msg.c
r453 r789 238 238 PJ_DEF(pjsip_msg*) pjsip_msg_create( pj_pool_t *pool, pjsip_msg_type_e type) 239 239 { 240 pjsip_msg *msg = pj_pool_alloc(pool, sizeof(pjsip_msg));240 pjsip_msg *msg = (pjsip_msg *) pj_pool_alloc(pool, sizeof(pjsip_msg)); 241 241 pj_list_init(&msg->hdr); 242 242 msg->type = type; … … 248 248 pjsip_hdr_e hdr_type, const void *start) 249 249 { 250 const pjsip_hdr *hdr= start, *end=&msg->hdr;250 const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr; 251 251 252 252 if (hdr == NULL) { … … 264 264 const void *start) 265 265 { 266 const pjsip_hdr *hdr= start, *end=&msg->hdr;266 const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr; 267 267 268 268 if (hdr == NULL) { … … 284 284 pjsip_hdr_e hdr_type, void *start) 285 285 { 286 pjsip_hdr *hdr = pjsip_msg_find_hdr(msg, hdr_type, start);286 pjsip_hdr *hdr = (pjsip_hdr *)pjsip_msg_find_hdr(msg, hdr_type, start); 287 287 if (hdr) { 288 288 pj_list_erase(hdr); … … 316 316 317 317 /* Add URI */ 318 uri = pjsip_uri_get_uri(msg->line.req.uri);318 uri = (pjsip_uri*) pjsip_uri_get_uri(msg->line.req.uri); 319 319 len = pjsip_uri_print( PJSIP_URI_IN_REQ_URI, uri, p, end-p); 320 320 if (len < 1) … … 448 448 PJ_DEF(void*) pjsip_hdr_clone( pj_pool_t *pool, const void *hdr_ptr ) 449 449 { 450 const pjsip_hdr *hdr = hdr_ptr;450 const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr; 451 451 return (*hdr->vptr->clone)(pool, hdr_ptr); 452 452 } … … 455 455 PJ_DEF(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr_ptr ) 456 456 { 457 const pjsip_hdr *hdr = hdr_ptr;457 const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr; 458 458 return (*hdr->vptr->shallow_clone)(pool, hdr_ptr); 459 459 } … … 461 461 PJ_DEF(int) pjsip_hdr_print_on( void *hdr_ptr, char *buf, pj_size_t len) 462 462 { 463 pjsip_hdr *hdr = hdr_ptr;463 pjsip_hdr *hdr = (pjsip_hdr *)hdr_ptr; 464 464 return (*hdr->vptr->print_on)(hdr_ptr, buf, len); 465 465 } … … 507 507 const pj_str_t *hvalue) 508 508 { 509 pjsip_generic_string_hdr *hdr = mem;509 pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr *)mem; 510 510 511 511 init_hdr(hdr, PJSIP_H_OTHER, &generic_hdr_vptr); … … 567 567 const pjsip_generic_string_hdr *rhs ) 568 568 { 569 pjsip_generic_string_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 569 pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr *) 570 pj_pool_alloc(pool, sizeof(*hdr)); 570 571 pj_memcpy(hdr, rhs, sizeof(*hdr)); 571 572 return hdr; … … 596 597 int value) 597 598 { 598 pjsip_generic_int_hdr *hdr = mem;599 pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) mem; 599 600 600 601 init_hdr(hdr, PJSIP_H_OTHER, &generic_int_hdr_vptr); … … 636 637 const pjsip_generic_int_hdr *rhs) 637 638 { 638 pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 639 pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) 640 pj_pool_alloc(pool, sizeof(*hdr)); 639 641 pj_memcpy(hdr, rhs, sizeof(*hdr)); 640 642 return hdr; … … 644 646 const pjsip_generic_int_hdr *rhs ) 645 647 { 646 pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 648 pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) 649 pj_pool_alloc(pool, sizeof(*hdr)); 647 650 pj_memcpy(hdr, rhs, sizeof(*hdr)); 648 651 return hdr; … … 671 674 const pj_str_t *hnames) 672 675 { 673 pjsip_generic_array_hdr *hdr = mem;676 pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) mem; 674 677 675 678 init_hdr(hdr, PJSIP_H_OTHER, &generic_array_hdr_vptr); … … 715 718 { 716 719 unsigned i; 717 pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 720 pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) 721 pj_pool_alloc(pool, sizeof(*hdr)); 718 722 719 723 pj_memcpy(hdr, rhs, sizeof(*hdr)); … … 729 733 const pjsip_generic_array_hdr *rhs) 730 734 { 731 pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 735 pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) 736 pj_pool_alloc(pool, sizeof(*hdr)); 732 737 pj_memcpy(hdr, rhs, sizeof(*hdr)); 733 738 return hdr; … … 741 746 void *mem ) 742 747 { 743 pjsip_accept_hdr *hdr = mem;748 pjsip_accept_hdr *hdr = (pjsip_accept_hdr *) mem; 744 749 745 750 PJ_UNUSED_ARG(pool); … … 765 770 void *mem ) 766 771 { 767 pjsip_allow_hdr *hdr = mem;772 pjsip_allow_hdr *hdr = (pjsip_allow_hdr *) mem; 768 773 769 774 PJ_UNUSED_ARG(pool); … … 788 793 void *mem ) 789 794 { 790 pjsip_cid_hdr *hdr = mem;795 pjsip_cid_hdr *hdr = (pjsip_cid_hdr *) mem; 791 796 792 797 PJ_UNUSED_ARG(pool); … … 822 827 void *mem ) 823 828 { 824 pjsip_clen_hdr *hdr = mem;829 pjsip_clen_hdr *hdr = (pjsip_clen_hdr *) mem; 825 830 826 831 PJ_UNUSED_ARG(pool); … … 884 889 void *mem ) 885 890 { 886 pjsip_cseq_hdr *hdr = mem;891 pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr *) mem; 887 892 888 893 PJ_UNUSED_ARG(pool); … … 939 944 const pjsip_cseq_hdr *rhs ) 940 945 { 941 pjsip_cseq_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 946 pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr *) 947 pj_pool_alloc(pool, sizeof(*hdr)); 942 948 pj_memcpy(hdr, rhs, sizeof(*hdr)); 943 949 return hdr; … … 963 969 void *mem ) 964 970 { 965 pjsip_contact_hdr *hdr = mem;971 pjsip_contact_hdr *hdr = (pjsip_contact_hdr *) mem; 966 972 967 973 PJ_UNUSED_ARG(pool); … … 1055 1061 return hdr; 1056 1062 1057 hdr->uri = pjsip_uri_clone(pool, rhs->uri);1063 hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri); 1058 1064 hdr->q1000 = rhs->q1000; 1059 1065 hdr->expires = rhs->expires; … … 1066 1072 const pjsip_contact_hdr *rhs) 1067 1073 { 1068 pjsip_contact_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 1074 pjsip_contact_hdr *hdr = (pjsip_contact_hdr *) 1075 pj_pool_alloc(pool, sizeof(*hdr)); 1069 1076 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1070 1077 pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); … … 1092 1099 void *mem ) 1093 1100 { 1094 pjsip_ctype_hdr *hdr = mem;1101 pjsip_ctype_hdr *hdr = (pjsip_ctype_hdr *) mem; 1095 1102 1096 1103 PJ_UNUSED_ARG(pool); … … 1169 1176 int value) 1170 1177 { 1171 pjsip_expires_hdr *hdr = mem;1178 pjsip_expires_hdr *hdr = (pjsip_expires_hdr *) mem; 1172 1179 1173 1180 PJ_UNUSED_ARG(pool); … … 1208 1215 void *mem ) 1209 1216 { 1210 pjsip_from_hdr *hdr = mem;1217 pjsip_from_hdr *hdr = (pjsip_from_hdr *) mem; 1211 1218 1212 1219 PJ_UNUSED_ARG(pool); … … 1227 1234 void *mem ) 1228 1235 { 1229 pjsip_to_hdr *hdr = mem;1236 pjsip_to_hdr *hdr = (pjsip_to_hdr *) mem; 1230 1237 1231 1238 PJ_UNUSED_ARG(pool); … … 1296 1303 hdr->name = rhs->name; 1297 1304 hdr->sname = rhs->sname; 1298 hdr->uri = pjsip_uri_clone(pool, rhs->uri);1305 hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri); 1299 1306 pj_strdup( pool, &hdr->tag, &rhs->tag); 1300 1307 pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param); … … 1307 1314 const pjsip_fromto_hdr *rhs) 1308 1315 { 1309 pjsip_fromto_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 1316 pjsip_fromto_hdr *hdr = (pjsip_fromto_hdr *) 1317 pj_pool_alloc(pool, sizeof(*hdr)); 1310 1318 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1311 1319 pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); … … 1322 1330 int value) 1323 1331 { 1324 pjsip_max_fwd_hdr *hdr = mem;1332 pjsip_max_fwd_hdr *hdr = (pjsip_max_fwd_hdr *) mem; 1325 1333 1326 1334 PJ_UNUSED_ARG(pool); … … 1348 1356 int value ) 1349 1357 { 1350 pjsip_min_expires_hdr *hdr = mem;1358 pjsip_min_expires_hdr *hdr = (pjsip_min_expires_hdr *) mem; 1351 1359 1352 1360 PJ_UNUSED_ARG(pool); … … 1382 1390 void *mem ) 1383 1391 { 1384 pjsip_rr_hdr *hdr = mem;1392 pjsip_rr_hdr *hdr = (pjsip_rr_hdr *) mem; 1385 1393 1386 1394 PJ_UNUSED_ARG(pool); … … 1402 1410 void *mem ) 1403 1411 { 1404 pjsip_route_hdr *hdr = mem;1412 pjsip_route_hdr *hdr = (pjsip_route_hdr *) mem; 1405 1413 1406 1414 PJ_UNUSED_ARG(pool); … … 1462 1470 const pjsip_routing_hdr *rhs ) 1463 1471 { 1464 pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 1472 pjsip_routing_hdr *hdr = (pjsip_routing_hdr *) 1473 pj_pool_alloc(pool, sizeof(*hdr)); 1465 1474 1466 1475 init_hdr(hdr, rhs->type, rhs->vptr); … … 1474 1483 const pjsip_routing_hdr *rhs ) 1475 1484 { 1476 pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 1485 pjsip_routing_hdr *hdr = (pjsip_routing_hdr *) 1486 pj_pool_alloc(pool, sizeof(*hdr)); 1477 1487 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1478 1488 pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); … … 1488 1498 void *mem ) 1489 1499 { 1490 pjsip_require_hdr *hdr = mem;1500 pjsip_require_hdr *hdr = (pjsip_require_hdr *) mem; 1491 1501 1492 1502 PJ_UNUSED_ARG(pool); … … 1511 1521 int value ) 1512 1522 { 1513 pjsip_retry_after_hdr *hdr = mem;1523 pjsip_retry_after_hdr *hdr = (pjsip_retry_after_hdr *) mem; 1514 1524 1515 1525 PJ_UNUSED_ARG(pool); … … 1535 1545 void *mem ) 1536 1546 { 1537 pjsip_supported_hdr *hdr = mem;1547 pjsip_supported_hdr *hdr = (pjsip_supported_hdr *) mem; 1538 1548 1539 1549 PJ_UNUSED_ARG(pool); … … 1557 1567 void *mem ) 1558 1568 { 1559 pjsip_unsupported_hdr *hdr = mem;1569 pjsip_unsupported_hdr *hdr = (pjsip_unsupported_hdr *) mem; 1560 1570 1561 1571 PJ_UNUSED_ARG(pool); … … 1590 1600 void *mem ) 1591 1601 { 1592 pjsip_via_hdr *hdr = mem;1602 pjsip_via_hdr *hdr = (pjsip_via_hdr *) mem; 1593 1603 1594 1604 PJ_UNUSED_ARG(pool); … … 1697 1707 const pjsip_via_hdr *rhs ) 1698 1708 { 1699 pjsip_via_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));1709 pjsip_via_hdr *hdr = (pjsip_via_hdr *) pj_pool_alloc(pool, sizeof(*hdr)); 1700 1710 pj_memcpy(hdr, rhs, sizeof(*hdr)); 1701 1711 pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); … … 1715 1725 pj_str_t hvalue; 1716 1726 1717 hvalue.ptr = pj_pool_alloc(pool, 10 + /* code */ 1727 hvalue.ptr = (char*) 1728 pj_pool_alloc(pool, 10 + /* code */ 1718 1729 host->slen + 2 + /* host */ 1719 1730 text->slen + 2); /* text */ … … 1755 1766 1756 1767 if (len) { 1757 newdata = pj_pool_alloc(pool, len);1768 newdata = (char*) pj_pool_alloc(pool, len); 1758 1769 pj_memcpy(newdata, data, len); 1759 1770 } … … 1797 1808 pj_status_t status; 1798 1809 1799 new_body = pj_pool_alloc(pool, sizeof(pjsip_msg_body));1810 new_body = (pjsip_msg_body*) pj_pool_alloc(pool, sizeof(pjsip_msg_body)); 1800 1811 PJ_ASSERT_RETURN(new_body, NULL); 1801 1812 … … 1815 1826 PJ_ASSERT_RETURN(pool && type && subtype && text, NULL); 1816 1827 1817 body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));1828 body = (pjsip_msg_body*) pj_pool_zalloc(pool, sizeof(pjsip_msg_body)); 1818 1829 PJ_ASSERT_RETURN(body != NULL, NULL); 1819 1830 -
pjproject/branches/symbian/pjsip/src/pjsip/sip_parser.c
r184 r789 221 221 222 222 len = param->slen + pname->slen + pvalue->slen + 3; 223 p = new_param = pj_pool_alloc(pool, len);223 p = new_param = (char*) pj_pool_alloc(pool, len); 224 224 225 225 if (param->slen) { … … 887 887 */ 888 888 if (ctype_hdr && scanner->curptr!=scanner->end) { 889 pjsip_msg_body *body = pj_pool_alloc(pool, sizeof(pjsip_msg_body)); 889 pjsip_msg_body *body = (pjsip_msg_body *) 890 pj_pool_alloc(pool, sizeof(pjsip_msg_body)); 890 891 body->content_type.type = ctype_hdr->media.type; 891 892 body->content_type.subtype = ctype_hdr->media.subtype; … … 907 908 pjsip_parser_err_report *err_info; 908 909 909 err_info = pj_pool_alloc(pool, sizeof(*err_info)); 910 err_info = (pjsip_parser_err_report *) 911 pj_pool_alloc(pool, sizeof(*err_info)); 910 912 err_info->except_code = PJ_GET_EXCEPTION(); 911 913 err_info->line = scanner->line; … … 1096 1098 } 1097 1099 1098 uri = (*func)( scanner, pool, 1100 uri = (pjsip_uri*) 1101 (*func)( scanner, pool, 1099 1102 (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)== 0); 1100 1103 … … 1217 1220 1218 1221 } else { 1219 pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 1222 pjsip_param *p = (pjsip_param *) 1223 pj_pool_alloc(pool, sizeof(pjsip_param)); 1220 1224 p->name = pname; 1221 1225 p->value = pvalue; … … 1229 1233 do { 1230 1234 pjsip_param *param; 1231 param = pj_pool_alloc(pool, sizeof(pjsip_param));1235 param = (pjsip_param *) pj_pool_alloc(pool, sizeof(pjsip_param)); 1232 1236 int_parse_hparam(scanner, pool, ¶m->name, ¶m->value); 1233 1237 pj_list_insert_before(&url->header_param, param); … … 1417 1421 int_parse_param( scanner, pool, &pname, &pvalue); 1418 1422 if (!parser_stricmp(pname, pjsip_Q_STR) && pvalue.slen) { 1419 char *dot_pos = memchr(pvalue.ptr, '.', pvalue.slen);1423 char *dot_pos = (char *) memchr(pvalue.ptr, '.', pvalue.slen); 1420 1424 if (!dot_pos) { 1421 1425 hdr->q1000 = pj_strtoul(&pvalue); … … 1429 1433 1430 1434 } else { 1431 pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 1435 pjsip_param *p = (pjsip_param *) 1436 pj_pool_alloc(pool, sizeof(pjsip_param)); 1432 1437 p->name = pname; 1433 1438 p->value = pvalue; … … 1567 1572 1568 1573 } else { 1569 pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 1574 pjsip_param *p = (pjsip_param *) 1575 pj_pool_alloc(pool, sizeof(pjsip_param)); 1570 1576 p->name = pname; 1571 1577 p->value = pvalue; … … 1665 1671 hdr->rport_param = 0; 1666 1672 } else { 1667 pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 1673 pjsip_param *p = (pjsip_param *) 1674 pj_pool_alloc(pool, sizeof(pjsip_param)); 1668 1675 p->name = pname; 1669 1676 p->value = pvalue; … … 1705 1712 1706 1713 while (*scanner->curptr == ';') { 1707 pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 1714 pjsip_param *p = (pjsip_param *) 1715 pj_pool_alloc(pool, sizeof(pjsip_param)); 1708 1716 int_parse_param(scanner, pool, &p->name, &p->value); 1709 1717 pj_list_insert_before(&hdr->other_param, p); -
pjproject/branches/symbian/pjsip/src/pjsip/sip_tel_uri.c
r145 r789 74 74 pj_bool_t parse_params); 75 75 76 #ifdef __GNUC__ 77 # define HAPPY_FLAG (void*) 78 #else 79 # define HAPPY_FLAG 80 #endif 76 77 typedef const pj_str_t* (*FGETSCHEME)(const void *uri); 78 typedef void* (*FGETURI)(void *uri); 79 typedef pj_ssize_t (*FPRINT)(pjsip_uri_context_e context, 80 const void *uri, 81 char *buf, pj_size_t size); 82 typedef pj_status_t (*FCOMPARE)(pjsip_uri_context_e context, 83 const void *uri1, const void *uri2); 84 typedef void *(*FCLONE)(pj_pool_t *pool, const void *uri); 85 81 86 82 87 static pjsip_uri_vptr tel_uri_vptr = 83 88 { 84 HAPPY_FLAG&tel_uri_get_scheme,85 HAPPY_FLAG&tel_uri_get_uri,86 HAPPY_FLAG&tel_uri_print,87 HAPPY_FLAG&tel_uri_cmp,88 HAPPY_FLAG&tel_uri_clone89 (FGETSCHEME) &tel_uri_get_scheme, 90 (FGETURI) &tel_uri_get_uri, 91 (FPRINT) &tel_uri_print, 92 (FCOMPARE) &tel_uri_cmp, 93 (FCLONE) &tel_uri_clone 89 94 }; 90 95 … … 92 97 PJ_DEF(pjsip_tel_uri*) pjsip_tel_uri_create(pj_pool_t *pool) 93 98 { 94 pjsip_tel_uri *uri = pj_pool_zalloc(pool, sizeof(pjsip_tel_uri)); 99 pjsip_tel_uri *uri = (pjsip_tel_uri *) 100 pj_pool_zalloc(pool, sizeof(pjsip_tel_uri)); 95 101 uri->vptr = &tel_uri_vptr; 96 102 pj_list_init(&uri->other_param); … … 404 410 uri->context = pvalue; 405 411 } else { 406 pjsip_param *param = pj_pool_alloc(pool, sizeof(pjsip_param)); 412 pjsip_param *param = (pjsip_param *) 413 pj_pool_alloc(pool, sizeof(pjsip_param)); 407 414 param->name = pname; 408 415 param->value = pvalue; -
pjproject/branches/symbian/pjsip/src/pjsip/sip_transaction.c
r448 r789 280 280 9 + /* Via port. */ 281 281 16; /* Separator+Allowance. */ 282 key = p = pj_pool_alloc(pool, len_required);282 key = p = (char*) pj_pool_alloc(pool, len_required); 283 283 end = p + len_required; 284 284 … … 347 347 PJ_ASSERT_RETURN(pool && key && method && branch, PJ_EINVAL); 348 348 349 p = key->ptr = pj_pool_alloc(pool, branch->slen + method->name.slen + 4 ); 349 p = key->ptr = (char*) 350 pj_pool_alloc(pool, branch->slen + method->name.slen + 4 ); 350 351 351 352 /* Add role. */ … … 581 582 582 583 pj_mutex_lock(mod_tsx_layer.mutex); 583 tsx = pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, &hval ); 584 tsx = (pjsip_transaction*) 585 pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, &hval ); 584 586 pj_mutex_unlock(mod_tsx_layer.mutex); 585 587 … … 632 634 it = pj_hash_first(mod_tsx_layer.htable, &it_buf); 633 635 while (it) { 634 pjsip_transaction *tsx = pj_hash_this(mod_tsx_layer.htable, it); 636 pjsip_transaction *tsx = (pjsip_transaction *) 637 pj_hash_this(mod_tsx_layer.htable, it); 635 638 pj_hash_iterator_t *next = pj_hash_next(mod_tsx_layer.htable, it); 636 639 if (tsx) … … 679 682 pj_mutex_lock( mod_tsx_layer.mutex ); 680 683 681 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 684 tsx = (pjsip_transaction *) 685 pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 682 686 683 687 … … 727 731 pj_mutex_lock( mod_tsx_layer.mutex ); 728 732 729 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 733 tsx = (pjsip_transaction *) 734 pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 730 735 731 736 … … 765 770 PJ_DEF(pjsip_transaction*) pjsip_rdata_get_tsx( pjsip_rx_data *rdata ) 766 771 { 767 return rdata->endpt_info.mod_data[mod_tsx_layer.mod.id]; 772 return (pjsip_transaction *) 773 rdata->endpt_info.mod_data[mod_tsx_layer.mod.id]; 768 774 } 769 775 … … 790 796 } else { 791 797 while (it != NULL) { 792 pjsip_transaction *tsx = pj_hash_this(mod_tsx_layer.htable,it); 798 pjsip_transaction *tsx = (pjsip_transaction *) 799 pj_hash_this(mod_tsx_layer.htable,it); 793 800 794 801 PJ_LOG(3, (THIS_FILE, " %s %s|%d|%s", … … 868 875 return PJ_ENOMEM; 869 876 870 tsx = pj_pool_zalloc(pool, sizeof(pjsip_transaction));877 tsx = (pjsip_transaction*) pj_pool_zalloc(pool, sizeof(pjsip_transaction)); 871 878 tsx->pool = pool; 872 879 tsx->tsx_user = tsx_user; … … 934 941 935 942 /* Clear TLS, so that mutex will not be unlocked */ 936 lck = pj_thread_local_get(pjsip_tsx_lock_tls_id);943 lck = (struct tsx_lock_data *) pj_thread_local_get(pjsip_tsx_lock_tls_id); 937 944 while (lck) { 938 945 if (lck->tsx == tsx) { … … 956 963 { 957 964 pjsip_event event; 958 pjsip_transaction *tsx = entry->user_data;965 pjsip_transaction *tsx = (pjsip_transaction *) entry->user_data; 959 966 struct tsx_lock_data lck; 960 967 … … 1006 1013 */ 1007 1014 if (event_src_type==PJSIP_EVENT_RX_MSG && tsx->tsx_user) { 1008 pjsip_rx_data *rdata = event_src;1015 pjsip_rx_data *rdata = (pjsip_rx_data *) event_src; 1009 1016 1010 1017 pj_assert(rdata != NULL); … … 1087 1094 1088 1095 /* Make sure CSeq header is present. */ 1089 cseq = pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);1096 cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL); 1090 1097 if (!cseq) { 1091 1098 pj_assert(!"CSeq header not present in outgoing message!"); … … 1113 1120 1114 1121 /* Generate Via header if it doesn't exist. */ 1115 via = pjsip_msg_find_hdr(msg, PJSIP_H_VIA, NULL);1122 via = (pjsip_via_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_VIA, NULL); 1116 1123 if (via == NULL) { 1117 1124 via = pjsip_via_hdr_create(tdata->pool); … … 1122 1129 if (via->branch_param.slen == 0) { 1123 1130 pj_str_t tmp; 1124 via->branch_param.ptr = pj_pool_alloc(tsx->pool, PJSIP_MAX_BRANCH_LEN); 1131 via->branch_param.ptr = (char*) 1132 pj_pool_alloc(tsx->pool, PJSIP_MAX_BRANCH_LEN); 1125 1133 via->branch_param.slen = PJSIP_MAX_BRANCH_LEN; 1126 1134 pj_memcpy(via->branch_param.ptr, PJSIP_RFC3261_BRANCH_ID, … … 1418 1426 pj_ssize_t sent, pj_bool_t *cont ) 1419 1427 { 1420 pjsip_transaction *tsx = send_state->token;1428 pjsip_transaction *tsx = (pjsip_transaction *) send_state->token; 1421 1429 struct tsx_lock_data lck; 1422 1430 … … 1535 1543 { 1536 1544 if (sent < 0) { 1537 pjsip_transaction *tsx = token;1545 pjsip_transaction *tsx = (pjsip_transaction *) token; 1538 1546 struct tsx_lock_data lck; 1539 1547 char errmsg[PJ_ERR_MSG_SIZE]; … … 2117 2125 */ 2118 2126 if (!tsx->is_reliable) { 2119 pjsip_cseq_hdr *cseq = pjsip_msg_find_hdr( msg, PJSIP_H_CSEQ, 2127 pjsip_cseq_hdr *cseq = (pjsip_cseq_hdr *) 2128 pjsip_msg_find_hdr( msg, PJSIP_H_CSEQ, 2120 2129 NULL); 2121 2130 if (cseq->method.id == PJSIP_INVITE_METHOD) { -
pjproject/branches/symbian/pjsip/src/pjsip/sip_transport.c
r367 r789 233 233 return PJ_ENOMEM; 234 234 235 tdata = pj_pool_zalloc(pool, sizeof(pjsip_tx_data));235 tdata = (pjsip_tx_data*) pj_pool_zalloc(pool, sizeof(pjsip_tx_data)); 236 236 tdata->pool = pool; 237 237 tdata->mgr = mgr; … … 314 314 int len; 315 315 316 cseq = pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);316 cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL); 317 317 PJ_ASSERT_RETURN(cseq != NULL, "INVALID MSG"); 318 318 … … 336 336 } 337 337 338 info = pj_pool_alloc(pool, len+1);338 info = (char*) pj_pool_alloc(pool, len+1); 339 339 pj_memcpy(info, info_buf, len+1); 340 340 … … 392 392 pj_ssize_t size) 393 393 { 394 pjsip_tx_data *tdata = token;394 pjsip_tx_data *tdata = (pjsip_tx_data *) token; 395 395 396 396 PJ_UNUSED_ARG(transport); … … 417 417 /* Allocate buffer if necessary. */ 418 418 if (tdata->buf.start == NULL) { 419 tdata->buf.start = pj_pool_alloc( tdata->pool, PJSIP_MAX_PKT_LEN);419 tdata->buf.start = (char*)pj_pool_alloc( tdata->pool, PJSIP_MAX_PKT_LEN); 420 420 tdata->buf.cur = tdata->buf.start; 421 421 tdata->buf.end = tdata->buf.start + PJSIP_MAX_PKT_LEN; … … 510 510 struct pj_timer_entry *entry) 511 511 { 512 pjsip_transport *tp = entry->user_data;512 pjsip_transport *tp = (pjsip_transport *) entry->user_data; 513 513 pj_assert(tp != NULL); 514 514 … … 725 725 726 726 /* Create and initialize transport manager. */ 727 mgr = pj_pool_zalloc(pool, sizeof(*mgr));727 mgr = (pjsip_tpmgr *) pj_pool_zalloc(pool, sizeof(*mgr)); 728 728 mgr->endpt = endpt; 729 729 mgr->on_rx_msg = rx_cb; … … 771 771 pjsip_transport *transport; 772 772 773 transport = pj_hash_this(mgr->table, itr);773 transport = (pjsip_transport*) pj_hash_this(mgr->table, itr); 774 774 775 775 next = pj_hash_next(mgr->table, itr); … … 909 909 hdr = (pjsip_hdr*)rdata->msg_info.via->next; 910 910 if (hdr != &msg->hdr) { 911 hdr = pjsip_msg_find_hdr(msg, PJSIP_H_VIA, hdr);911 hdr = (pjsip_hdr*)pjsip_msg_find_hdr(msg, PJSIP_H_VIA, hdr); 912 912 if (hdr) { 913 913 mgr->on_rx_msg(mgr->endpt, PJSIP_EMULTIPLEVIA, rdata); … … 964 964 pj_memcpy(&key.addr, remote, addr_len); 965 965 966 transport = pj_hash_get(mgr->table, &key, key_len, NULL);966 transport = (pjsip_transport*)pj_hash_get(mgr->table, &key, key_len, NULL); 967 967 if (transport == NULL) { 968 968 unsigned flag = pjsip_transport_get_flag_from_type(type); … … 977 977 pj_memset(addr, 0, sizeof(pj_sockaddr_in)); 978 978 key_len = sizeof(key.type) + sizeof(pj_sockaddr_in); 979 transport = pj_hash_get(mgr->table, &key, key_len, NULL); 979 transport = (pjsip_transport*) 980 pj_hash_get(mgr->table, &key, key_len, NULL); 980 981 } 981 982 /* For datagram INET transports, try lookup with zero address. … … 990 991 991 992 key_len = sizeof(key.type) + sizeof(pj_sockaddr_in); 992 transport = pj_hash_get(mgr->table, &key, key_len, NULL); 993 transport = (pjsip_transport*) 994 pj_hash_get(mgr->table, &key, key_len, NULL); 993 995 } 994 996 } … … 1023 1025 /* Request factory to create transport. */ 1024 1026 status = factory->create_transport(factory, mgr, mgr->endpt, 1025 remote, addr_len, tp); 1027 (const pj_sockaddr *)remote, 1028 addr_len, tp); 1026 1029 if (status == PJ_SUCCESS) { 1027 1030 PJ_ASSERT_ON_FAIL(tp!=NULL, … … 1054 1057 1055 1058 do { 1056 pjsip_transport *t = pj_hash_this(mgr->table, itr);1059 pjsip_transport *t = (pjsip_transport *) pj_hash_this(mgr->table, itr); 1057 1060 1058 1061 PJ_LOG(3, (THIS_FILE, " %s %s (refcnt=%d)", -
pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_loop.c
r315 r789 78 78 return NULL; 79 79 80 pkt = pj_pool_zalloc(pool, sizeof(struct recv_list));80 pkt = (struct recv_list *) pj_pool_zalloc(pool, sizeof(struct recv_list)); 81 81 82 82 /* Initialize rdata. */ … … 120 120 pjsip_tx_data_add_ref(tdata); 121 121 pj_lock_acquire(tdata->lock); 122 sent_status = pj_pool_alloc(tdata->pool, sizeof(struct send_list)); 122 sent_status = (struct send_list *) 123 pj_pool_alloc(tdata->pool, sizeof(struct send_list)); 123 124 pj_lock_release(tdata->lock); 124 125 … … 253 254 static int loop_transport_worker_thread(void *arg) 254 255 { 255 struct loop_transport *loop = arg;256 struct loop_transport *loop = (struct loop_transport *) arg; 256 257 struct recv_list r; 257 258 struct send_list s; … … 356 357 357 358 /* Create the loop structure. */ 358 loop = pj_pool_zalloc(pool, sizeof(struct loop_transport)); 359 loop = (struct loop_transport*) 360 pj_pool_zalloc(pool, sizeof(struct loop_transport)); 359 361 360 362 /* Initialize transport properties. */ -
pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_udp.c
r377 r789 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pjsip/sip_transport .h>19 #include <pjsip/sip_transport_udp.h> 20 20 #include <pjsip/sip_endpoint.h> 21 21 #include <pjsip/sip_errno.h> … … 82 82 pj_pool_reset(pool); 83 83 84 rdata = pj_pool_zalloc(pool, sizeof(pjsip_rx_data));84 rdata = (pjsip_rx_data*) pj_pool_zalloc(pool, sizeof(pjsip_rx_data)); 85 85 86 86 /* Init tp_info part. */ … … 261 261 pj_ssize_t bytes_sent) 262 262 { 263 struct udp_transport *tp = pj_ioqueue_get_user_data(key);263 struct udp_transport *tp = (struct udp_transport *) pj_ioqueue_get_user_data(key); 264 264 pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key; 265 265 … … 337 337 338 338 /* Unregister from ioqueue. */ 339 if (tp->key) 339 if (tp->key) { 340 340 pj_ioqueue_unregister(tp->key); 341 tp->sock = PJ_INVALID_SOCKET; 342 } 341 343 342 344 /* Close socket. */ … … 425 427 426 428 /* Create the UDP transport object. */ 427 tp = pj_pool_zalloc(pool, sizeof(struct udp_transport)); 429 tp = (struct udp_transport*) 430 pj_pool_zalloc(pool, sizeof(struct udp_transport)); 428 431 429 432 /* Save pool. */ … … 474 477 475 478 /* Transport info. */ 476 tp->base.info = pj_pool_alloc(pool, 80);479 tp->base.info = (char*) pj_pool_alloc(pool, 80); 477 480 pj_ansi_sprintf( 478 481 tp->base.info, "udp %s:%d [published as %s:%d]", … … 519 522 /* Create rdata and put it in the array. */ 520 523 tp->rdata_cnt = 0; 521 tp->rdata = pj_pool_calloc(tp->base.pool, async_cnt, 524 tp->rdata = (pjsip_rx_data**) 525 pj_pool_calloc(tp->base.pool, async_cnt, 522 526 sizeof(pjsip_rx_data*)); 523 527 for (i=0; i<async_cnt; ++i) { … … 553 557 } else if (status != PJ_EPENDING) { 554 558 /* Error! */ 559 pj_atomic_dec(tp->base.ref_cnt); 555 560 pjsip_transport_unregister(tp->base.tpmgr, &tp->base); 556 561 return status; -
pjproject/branches/symbian/pjsip/src/pjsip/sip_ua_layer.c
r416 r789 166 166 167 167 /* Get the dialog where this transaction belongs. */ 168 dlg = tsx->mod_data[mod_ua.mod.id];168 dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id]; 169 169 170 170 /* If dialog instance has gone, it could mean that the dialog … … 245 245 246 246 set_key->slen = call_id->slen + local_tag->slen + 1; 247 set_key->ptr = pj_pool_alloc(pool, set_key->slen);247 set_key->ptr = (char*) pj_pool_alloc(pool, set_key->slen); 248 248 pj_assert(set_key->ptr != NULL); 249 249 … … 268 268 return set; 269 269 } else { 270 set = pj_pool_alloc(mod_ua.pool, sizeof(struct dlg_set)); 270 set = (struct dlg_set *) 271 pj_pool_alloc(mod_ua.pool, sizeof(struct dlg_set)); 271 272 return set; 272 273 } … … 299 300 struct dlg_set *dlg_set; 300 301 301 dlg_set = pj_hash_get( mod_ua.dlg_table, dlg->local.info->tag.ptr, 302 dlg_set = (struct dlg_set *) 303 pj_hash_get( mod_ua.dlg_table, dlg->local.info->tag.ptr, 302 304 dlg->local.info->tag.slen, 303 305 &dlg->local.tag_hval); … … 367 369 368 370 /* Find this dialog from the dialog set. */ 369 dlg_set = dlg->dlg_set;371 dlg_set = (struct dlg_set *) dlg->dlg_set; 370 372 d = dlg_set->dlg_list.next; 371 373 while (d != (pjsip_dialog*)&dlg_set->dlg_list && d != dlg) { … … 401 403 PJ_DEF(pjsip_dialog*) pjsip_rdata_get_dlg( pjsip_rx_data *rdata ) 402 404 { 403 return rdata->endpt_info.mod_data[mod_ua.mod.id];405 return (pjsip_dialog*) rdata->endpt_info.mod_data[mod_ua.mod.id]; 404 406 } 405 407 406 408 PJ_DEF(pjsip_dialog*) pjsip_tsx_get_dlg( pjsip_transaction *tsx ) 407 409 { 408 return tsx->mod_data[mod_ua.mod.id];410 return (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id]; 409 411 } 410 412 … … 442 444 /* We should find the dialog attached to the INVITE transaction */ 443 445 if (tsx) { 444 dlg = tsx->mod_data[mod_ua.mod.id];446 dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id]; 445 447 pj_mutex_unlock(tsx->mutex); 446 448 … … 448 450 * (e.g. during debugging where initially there is a dialog) 449 451 */ 450 return dlg ? dlg->dlg_set : NULL;452 return dlg ? (struct dlg_set *)dlg->dlg_set : NULL; 451 453 452 454 } else { … … 465 467 466 468 /* Lookup the dialog set. */ 467 dlg_set = pj_hash_get(mod_ua.dlg_table, tag->ptr, tag->slen, NULL); 469 dlg_set = (struct dlg_set *) 470 pj_hash_get(mod_ua.dlg_table, tag->ptr, tag->slen, NULL); 468 471 return dlg_set; 469 472 } … … 594 597 595 598 /* Get the dialog set. */ 596 dlg_set = dlg->dlg_set;599 dlg_set = (struct dlg_set *)dlg->dlg_set; 597 600 598 601 /* Even if transaction is found and (candidate) dialog has been … … 622 625 623 626 /* Get the dialog set. */ 624 dlg_set = pj_hash_get(mod_ua.dlg_table, 627 dlg_set = (struct dlg_set *) 628 pj_hash_get(mod_ua.dlg_table, 625 629 rdata->msg_info.from->tag.ptr, 626 630 rdata->msg_info.from->tag.slen, … … 801 805 const char *title; 802 806 803 dlg_set = pj_hash_this(mod_ua.dlg_table, it);807 dlg_set = (struct dlg_set *) pj_hash_this(mod_ua.dlg_table, it); 804 808 if (!dlg_set || pj_list_empty(&dlg_set->dlg_list)) continue; 805 809 -
pjproject/branches/symbian/pjsip/src/pjsip/sip_uri.c
r127 r789 61 61 pj_list_init(dst_list); 62 62 while (p != src_list) { 63 pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param)); 63 pjsip_param *new_param = (pjsip_param *) 64 pj_pool_alloc(pool, sizeof(pjsip_param)); 64 65 pj_strdup(pool, &new_param->name, &p->name); 65 66 pj_strdup(pool, &new_param->value, &p->value); … … 78 79 pj_list_init(dst_list); 79 80 while (p != src_list) { 80 pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param)); 81 pjsip_param *new_param = (pjsip_param *) 82 pj_pool_alloc(pool, sizeof(pjsip_param)); 81 83 new_param->name = p->name; 82 84 new_param->value = p->value; … … 156 158 const pjsip_sip_uri *rhs); 157 159 160 typedef const pj_str_t* (*FGETSCHEME)(const void *uri); 161 typedef void* (*FGETURI)(void *uri); 162 typedef pj_ssize_t (*FPRINT)(pjsip_uri_context_e context, 163 const void *uri, 164 char *buf, pj_size_t size); 165 typedef pj_status_t (*FCOMPARE)(pjsip_uri_context_e context, 166 const void *uri1, const void *uri2); 167 typedef void *(*FCLONE)(pj_pool_t *pool, const void *uri); 168 169 158 170 static pjsip_uri_vptr sip_url_vptr = 159 171 { 160 HAPPY_FLAG&pjsip_url_get_scheme,161 HAPPY_FLAG&pjsip_get_uri,162 HAPPY_FLAG&pjsip_url_print,163 HAPPY_FLAG&pjsip_url_compare,164 HAPPY_FLAG&pjsip_url_clone172 (FGETSCHEME)&pjsip_url_get_scheme, 173 (FGETURI) &pjsip_get_uri, 174 (FPRINT) &pjsip_url_print, 175 (FCOMPARE) &pjsip_url_compare, 176 (FCLONE) &pjsip_url_clone 165 177 }; 166 178 167 179 static pjsip_uri_vptr sips_url_vptr = 168 180 { 169 HAPPY_FLAG&pjsips_url_get_scheme,170 HAPPY_FLAG&pjsip_get_uri,171 HAPPY_FLAG&pjsip_url_print,172 HAPPY_FLAG&pjsip_url_compare,173 HAPPY_FLAG&pjsip_url_clone181 (FGETSCHEME)&pjsips_url_get_scheme, 182 (FGETURI) &pjsip_get_uri, 183 (FPRINT) &pjsip_url_print, 184 (FCOMPARE) &pjsip_url_compare, 185 (FCLONE) &pjsip_url_clone 174 186 }; 175 187 176 188 static pjsip_uri_vptr name_addr_vptr = 177 189 { 178 HAPPY_FLAG&pjsip_name_addr_get_scheme,179 HAPPY_FLAG&pjsip_name_addr_get_uri,180 HAPPY_FLAG&pjsip_name_addr_print,181 HAPPY_FLAG&pjsip_name_addr_compare,182 HAPPY_FLAG&pjsip_name_addr_clone190 (FGETSCHEME)&pjsip_name_addr_get_scheme, 191 (FGETURI) &pjsip_name_addr_get_uri, 192 (FPRINT) &pjsip_name_addr_print, 193 (FCOMPARE) &pjsip_name_addr_compare, 194 (FCLONE) &pjsip_name_addr_clone 183 195 }; 184 196 … … 216 228 PJ_DEF(pjsip_sip_uri*) pjsip_sip_uri_create( pj_pool_t *pool, int secure ) 217 229 { 218 pjsip_sip_uri *url = pj_pool_alloc(pool, sizeof(pjsip_sip_uri));230 pjsip_sip_uri *url = (pjsip_sip_uri *)pj_pool_alloc(pool, sizeof(pjsip_sip_uri)); 219 231 pjsip_sip_uri_init(url, secure); 220 232 return url; … … 485 497 static pjsip_sip_uri* pjsip_url_clone(pj_pool_t *pool, const pjsip_sip_uri *rhs) 486 498 { 487 pjsip_sip_uri *url = pj_pool_alloc(pool, sizeof(pjsip_sip_uri));499 pjsip_sip_uri *url = (pjsip_sip_uri *)pj_pool_alloc(pool, sizeof(pjsip_sip_uri)); 488 500 if (!url) 489 501 return NULL; … … 509 521 PJ_DEF(pjsip_name_addr*) pjsip_name_addr_create(pj_pool_t *pool) 510 522 { 511 pjsip_name_addr *name_addr = pj_pool_alloc(pool, sizeof(pjsip_name_addr));523 pjsip_name_addr *name_addr = (pjsip_name_addr *)pj_pool_alloc(pool, sizeof(pjsip_name_addr)); 512 524 pjsip_name_addr_init(name_addr); 513 525 return name_addr; … … 552 564 { 553 565 pj_strdup( pool, &dst->display, &src->display); 554 dst->uri = pjsip_uri_clone(pool, src->uri);566 dst->uri = (pjsip_uri*)pjsip_uri_clone(pool, src->uri); 555 567 } 556 568 … … 558 570 const pjsip_name_addr *rhs) 559 571 { 560 pjsip_name_addr *addr = pj_pool_alloc(pool, sizeof(pjsip_name_addr));572 pjsip_name_addr *addr = (pjsip_name_addr *)pj_pool_alloc(pool, sizeof(pjsip_name_addr)); 561 573 if (!addr) 562 574 return NULL; -
pjproject/branches/symbian/pjsip/src/pjsip/sip_util.c
r448 r789 85 85 endpt_hdr = pjsip_endpt_get_request_headers(endpt)->next; 86 86 while (endpt_hdr != pjsip_endpt_get_request_headers(endpt)) { 87 pjsip_hdr *hdr = pjsip_hdr_shallow_clone(tdata->pool, endpt_hdr);87 pjsip_hdr *hdr = (pjsip_hdr *)pjsip_hdr_shallow_clone(tdata->pool, endpt_hdr); 88 88 pjsip_msg_add_hdr( tdata->msg, hdr ); 89 89 endpt_hdr = endpt_hdr->next; … … 93 93 if (param_from->tag.slen == 0) 94 94 pj_create_unique_string(tdata->pool, ¶m_from->tag); 95 pjsip_msg_add_hdr(msg, ( void*)param_from);95 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_from); 96 96 97 97 /* Add To header. */ 98 pjsip_msg_add_hdr(msg, ( void*)param_to);98 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_to); 99 99 100 100 /* Add Contact header. */ 101 101 if (param_contact) { 102 pjsip_msg_add_hdr(msg, ( void*)param_contact);102 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_contact); 103 103 } 104 104 105 105 /* Add Call-ID header. */ 106 pjsip_msg_add_hdr(msg, ( void*)param_call_id);106 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_call_id); 107 107 108 108 /* Add CSeq header. */ 109 pjsip_msg_add_hdr(msg, ( void*)param_cseq);109 pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_cseq); 110 110 111 111 /* Add a blank Via header in the front of the message. */ 112 112 via = pjsip_via_hdr_create(tdata->pool); 113 113 via->rport_param = 0; 114 pjsip_msg_insert_first_hdr(msg, ( void*)via);114 pjsip_msg_insert_first_hdr(msg, (pjsip_hdr*)via); 115 115 116 116 /* Add header params as request headers */ … … 135 135 /* Create message body. */ 136 136 if (param_text) { 137 body = pj_pool_calloc(tdata->pool, 1, sizeof(pjsip_msg_body));137 body = (pjsip_msg_body*) pj_pool_calloc(tdata->pool, 1, sizeof(pjsip_msg_body)); 138 138 body->content_type.type = str_TEXT; 139 139 body->content_type.subtype = str_PLAIN; … … 297 297 PJ_TRY { 298 298 /* Duplicate target URI and headers. */ 299 target = pjsip_uri_clone(tdata->pool, param_target);300 from = pjsip_hdr_clone(tdata->pool, param_from);299 target = (pjsip_uri*) pjsip_uri_clone(tdata->pool, param_target); 300 from = (pjsip_fromto_hdr*) pjsip_hdr_clone(tdata->pool, param_from); 301 301 pjsip_fromto_hdr_set_from(from); 302 to = pjsip_hdr_clone(tdata->pool, param_to);302 to = (pjsip_fromto_hdr*)pjsip_hdr_clone(tdata->pool, param_to); 303 303 pjsip_fromto_hdr_set_to(to); 304 304 if (param_contact) 305 contact = pjsip_hdr_clone(tdata->pool, param_contact);305 contact = (pjsip_contact_hdr*) pjsip_hdr_clone(tdata->pool, param_contact); 306 306 else 307 307 contact = NULL; 308 call_id = pjsip_hdr_clone(tdata->pool, param_call_id);308 call_id = (pjsip_cid_hdr*) pjsip_hdr_clone(tdata->pool, param_call_id); 309 309 cseq = pjsip_cseq_hdr_create(tdata->pool); 310 310 if (param_cseq >= 0) … … 386 386 via = rdata->msg_info.via; 387 387 while (via) { 388 pjsip_msg_add_hdr( msg, pjsip_hdr_clone(tdata->pool, via));388 pjsip_msg_add_hdr( msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, via)); 389 389 via = via->next; 390 390 if (via != (void*)&req_msg->hdr) 391 via = pjsip_msg_find_hdr(req_msg, PJSIP_H_VIA, via);391 via = (pjsip_via_hdr*) pjsip_msg_find_hdr(req_msg, PJSIP_H_VIA, via); 392 392 else 393 393 break; … … 395 395 396 396 /* Copy all Record-Route headers, in order. */ 397 rr = pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, NULL);397 rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, NULL); 398 398 while (rr) { 399 pjsip_msg_add_hdr(msg, pjsip_hdr_clone(tdata->pool, rr));399 pjsip_msg_add_hdr(msg, (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rr)); 400 400 rr = rr->next; 401 401 if (rr != (void*)&req_msg->hdr) 402 rr = pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, rr);402 rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, rr); 403 403 else 404 404 break; … … 406 406 407 407 /* Copy Call-ID header. */ 408 hdr = pjsip_msg_find_hdr( req_msg, PJSIP_H_CALL_ID, NULL);409 pjsip_msg_add_hdr(msg, pjsip_hdr_clone(tdata->pool, hdr));408 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( req_msg, PJSIP_H_CALL_ID, NULL); 409 pjsip_msg_add_hdr(msg, (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr)); 410 410 411 411 /* Copy From header. */ 412 hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.from);412 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.from); 413 413 pjsip_msg_add_hdr( msg, hdr); 414 414 415 415 /* Copy To header. */ 416 hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.to);416 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.to); 417 417 pjsip_msg_add_hdr( msg, hdr); 418 418 419 419 /* Copy CSeq header. */ 420 hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.cseq);420 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.cseq); 421 421 pjsip_msg_add_hdr( msg, hdr); 422 422 … … 495 495 496 496 /* Clear Via headers in the new request. */ 497 while ((via= pjsip_msg_find_hdr(ack->msg, PJSIP_H_VIA, NULL)) != NULL)497 while ((via=(pjsip_hdr*)pjsip_msg_find_hdr(ack->msg, PJSIP_H_VIA, NULL)) != NULL) 498 498 pj_list_erase(via); 499 499 500 500 /* Must contain single Via, just as the original INVITE. */ 501 hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_VIA, NULL);502 pjsip_msg_insert_first_hdr( ack->msg, pjsip_hdr_clone(ack->pool,hdr) );501 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_VIA, NULL); 502 pjsip_msg_insert_first_hdr( ack->msg, (pjsip_hdr*) pjsip_hdr_clone(ack->pool,hdr) ); 503 503 504 504 /* If the original INVITE has Route headers, those header fields MUST 505 505 * appear in the ACK. 506 506 */ 507 hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, NULL);507 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, NULL); 508 508 while (hdr != NULL) { 509 pjsip_msg_add_hdr( ack->msg, pjsip_hdr_clone(ack->pool, hdr) );509 pjsip_msg_add_hdr( ack->msg, (pjsip_hdr*) pjsip_hdr_clone(ack->pool, hdr) ); 510 510 hdr = hdr->next; 511 511 if (hdr == &invite_msg->hdr) 512 512 break; 513 hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, hdr);513 hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, hdr); 514 514 } 515 515 … … 579 579 580 580 /* Clear Via headers in the new request. */ 581 while ((via= pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_VIA, NULL)) != NULL)581 while ((via=(pjsip_hdr*)pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_VIA, NULL)) != NULL) 582 582 pj_list_erase(via); 583 583 … … 586 586 * request being cancelled. 587 587 */ 588 hdr = pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_VIA, NULL);588 hdr = (pjsip_hdr*) pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_VIA, NULL); 589 589 if (hdr) { 590 590 pjsip_msg_insert_first_hdr(cancel_tdata->msg, 591 pjsip_hdr_clone(cancel_tdata->pool, hdr));591 (pjsip_hdr*) pjsip_hdr_clone(cancel_tdata->pool, hdr)); 592 592 } 593 593 … … 596 596 * Copy "Route" header from the request. 597 597 */ 598 hdr = pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_ROUTE, NULL);598 hdr = (pjsip_hdr*) pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_ROUTE, NULL); 599 599 while (hdr != NULL) { 600 600 pjsip_msg_add_hdr(cancel_tdata->msg, 601 pjsip_hdr_clone(cancel_tdata->pool, hdr));601 (pjsip_hdr*) pjsip_hdr_clone(cancel_tdata->pool, hdr)); 602 602 hdr = hdr->next; 603 603 if (hdr != &cancel_tdata->msg->hdr) 604 hdr = pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_ROUTE, hdr);604 hdr = (pjsip_hdr*) pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_ROUTE, hdr); 605 605 else 606 606 break; … … 642 642 */ 643 643 last_route_hdr = first_route_hdr = 644 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, NULL);644 (pjsip_route_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, NULL); 645 645 if (first_route_hdr) { 646 646 topmost_route_uri = &first_route_hdr->name_addr; 647 647 while (last_route_hdr->next != (void*)&tdata->msg->hdr) { 648 648 pjsip_route_hdr *hdr; 649 hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, 649 hdr = (pjsip_route_hdr*) 650 pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, 650 651 last_route_hdr->next); 651 652 if (!hdr) … … 672 673 PJSIP_URI_SCHEME_IS_SIPS(topmost_route_uri)) 673 674 { 674 const pjsip_sip_uri *url = 675 const pjsip_sip_uri *url = (const pjsip_sip_uri *) 675 676 pjsip_uri_get_uri((void*)topmost_route_uri); 676 677 has_lr_param = url->lr_param; … … 691 692 */ 692 693 } else { 693 new_request_uri = pjsip_uri_get_uri((void*)topmost_route_uri); 694 new_request_uri = (const pjsip_uri *) 695 pjsip_uri_get_uri((void*)topmost_route_uri); 694 696 pj_list_erase(first_route_hdr); 695 697 if (first_route_hdr == last_route_hdr) … … 758 760 pj_ssize_t sent ) 759 761 { 760 pjsip_send_state *stateless_data = token;762 pjsip_send_state *stateless_data = (pjsip_send_state *) token; 761 763 762 764 PJ_UNUSED_ARG(tdata); … … 858 860 if (via->branch_param.slen == 0) { 859 861 pj_str_t tmp; 860 via->branch_param.ptr = pj_pool_alloc(tdata->pool, 862 via->branch_param.ptr = (char*) 863 pj_pool_alloc(tdata->pool, 861 864 PJSIP_MAX_BRANCH_LEN); 862 865 via->branch_param.slen = PJSIP_MAX_BRANCH_LEN; … … 902 905 const struct pjsip_server_addresses *addr) 903 906 { 904 pjsip_send_state *stateless_data = token;907 pjsip_send_state *stateless_data = (pjsip_send_state *) token; 905 908 906 909 /* Fail on server resolution. */ … … 950 953 951 954 /* Keep stateless data. */ 952 stateless_data = pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state)); 955 stateless_data = (pjsip_send_state *) 956 pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state)); 953 957 stateless_data->token = token; 954 958 stateless_data->endpt = endpt; … … 1073 1077 pj_ssize_t sent) 1074 1078 { 1075 pjsip_send_state *send_state = token;1079 pjsip_send_state *send_state = (pjsip_send_state *) token; 1076 1080 pj_bool_t cont = PJ_FALSE; 1077 1081 … … 1093 1097 const pjsip_server_addresses *addr ) 1094 1098 { 1095 pjsip_send_state *send_state = token;1099 pjsip_send_state *send_state = (pjsip_send_state *) token; 1096 1100 1097 1101 if (status != PJ_SUCCESS) { … … 1161 1165 1162 1166 /* Create structure to keep the sending state. */ 1163 send_state = pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state)); 1167 send_state = (pjsip_send_state *) 1168 pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state)); 1164 1169 send_state->endpt = endpt; 1165 1170 send_state->tdata = tdata; … … 1229 1234 const pjsip_hdr *hdr = hdr_list->next; 1230 1235 while (hdr != hdr_list) { 1231 pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) );1236 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr) ); 1232 1237 hdr = hdr->next; 1233 1238 } -
pjproject/branches/symbian/pjsip/src/pjsip/sip_util_statefull.c
r448 r789 60 60 return; 61 61 62 tsx_data = tsx->mod_data[mod_stateful_util.id];62 tsx_data = (struct tsx_data *) tsx->mod_data[mod_stateful_util.id]; 63 63 if (tsx_data == NULL) 64 64 return; … … 100 100 } 101 101 102 tsx_data = pj_pool_alloc(tsx->pool, sizeof(struct tsx_data)); 102 tsx_data = (struct tsx_data *) 103 pj_pool_alloc(tsx->pool, sizeof(struct tsx_data)); 103 104 tsx_data->token = token; 104 105 tsx_data->cb = cb; … … 142 143 const pjsip_hdr *hdr = hdr_list->next; 143 144 while (hdr != hdr_list) { 144 pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) );145 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr) ); 145 146 hdr = hdr->next; 146 147 } -
pjproject/branches/symbian/symbian/bld.inf
r788 r789 1 1 prj_mmpfiles 2 2 pjlib.mmp 3 pjlib_util.mmp 4 pjsip.mmp 5 pjsip_simple.mmp 6 pjsdp.mmp 7 pjsip_ua.mmp 3 8 pjlib_test.mmp 9 sipstateless.mmp -
pjproject/branches/symbian/symbian/pjlib.mmp
r788 r789 5 5 6 6 SOURCEPATH ..\pjlib\src\pj 7 8 OPTION CW -lang c++ 7 9 8 10 MACRO PJ_M_I386=1 … … 56 58 57 59 SYSTEMINCLUDE ..\pjlib\include 60 58 61 SYSTEMINCLUDE \epoc32\include 59 62 SYSTEMINCLUDE \epoc32\include\libc 63 -
pjproject/branches/symbian/symbian/pjlib_test.mmp
r788 r789 10 10 MACRO PJ_IMPORTING 11 11 12 OPTION CW -lang c++ 12 13 13 14 // Test files … … 48 49 49 50 SYSTEMINCLUDE ..\pjlib\include 51 50 52 SYSTEMINCLUDE \epoc32\include 51 53 SYSTEMINCLUDE \epoc32\include\libc
Note: See TracChangeset
for help on using the changeset viewer.