Changeset 1246 for pjproject/trunk/pjlib/src/pj/sock_symbian.cpp
- Timestamp:
- May 3, 2007 1:31:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/sock_symbian.cpp
r1244 r1246 211 211 PJ_DEF(pj_uint16_t) pj_ntohs(pj_uint16_t netshort) 212 212 { 213 /* There's no difference in host/network byte order in Symbian */ 213 #if PJ_IS_LITTLE_ENDIAN 214 return pj_swap16(netshort); 215 #else 214 216 return netshort; 217 #endif 215 218 } 216 219 … … 220 223 PJ_DEF(pj_uint16_t) pj_htons(pj_uint16_t hostshort) 221 224 { 222 /* There's no difference in host/network byte order in Symbian */ 225 #if PJ_IS_LITTLE_ENDIAN 226 return pj_swap16(hostshort); 227 #else 223 228 return hostshort; 229 #endif 224 230 } 225 231 … … 229 235 PJ_DEF(pj_uint32_t) pj_ntohl(pj_uint32_t netlong) 230 236 { 231 /* There's no difference in host/network byte order in Symbian */ 237 #if PJ_IS_LITTLE_ENDIAN 238 return pj_swap32(netlong); 239 #else 232 240 return netlong; 241 #endif 233 242 } 234 243 … … 238 247 PJ_DEF(pj_uint32_t) pj_htonl(pj_uint32_t hostlong) 239 248 { 240 /* There's no difference in host/network byte order in Symbian */ 241 return hostlong; 249 #if PJ_IS_LITTLE_ENDIAN 250 return pj_swap32(hostlong); 251 #else 252 return netlong; 253 #endif 242 254 } 243 255 … … 251 263 static char str8[20]; 252 264 253 TInetAddr temp_addr((TUint32)inaddr.s_addr, (TUint)0); 265 /* (Symbian IP address is in host byte order) */ 266 TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); 254 267 temp_addr.Output(str16); 255 268 … … 295 308 addr.Init(KAfInet); 296 309 if (addr.Input(ip_addr) == KErrNone) { 297 /* Success */298 inp->s_addr = addr.Address();310 /* Success (Symbian IP address is in host byte order) */ 311 inp->s_addr = pj_htonl(addr.Address()); 299 312 return 1; 300 313 } else { … … 498 511 PJ_CHECK_STACK(); 499 512 500 pj_ memset(&addr, 0, sizeof(addr));513 pj_bzero(&addr, sizeof(addr)); 501 514 addr.sin_family = PJ_AF_INET; 502 515 addr.sin_addr.s_addr = pj_htonl(addr32);
Note: See TracChangeset
for help on using the changeset viewer.