From: Stefan Csomor Date: Sun, 18 Apr 2004 16:30:50 +0000 (+0000) Subject: byte ordering changed to network ordering X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f925e7b4f3d017b33749bd23a64592c1985e8f98 byte ordering changed to network ordering git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/gsocket.c b/src/mac/carbon/gsocket.c index 9e3ba3079a..e88784d0bc 100644 --- a/src/mac/carbon/gsocket.c +++ b/src/mac/carbon/gsocket.c @@ -1328,7 +1328,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address, CHECK_ADDRESS(address, INET, GSOCK_INVADDR); - address->m_host = hostaddr ; + address->m_host = htonl(hostaddr) ; return GSOCK_NOERROR; } @@ -1409,7 +1409,7 @@ unsigned long GAddress_INET_GetHostAddress(GAddress *address) assert(address != NULL); CHECK_ADDRESS(address, INET, 0); - return address->m_host; + return ntohl(address->m_host); } unsigned short GAddress_INET_GetPort(GAddress *address) diff --git a/src/msw/gsocket.c b/src/msw/gsocket.c index 50121a0900..86cfc7b913 100644 --- a/src/msw/gsocket.c +++ b/src/msw/gsocket.c @@ -1361,7 +1361,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address, CHECK_ADDRESS(address, INET); addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr); - addr->s_addr = hostaddr; + addr->s_addr = htonl(hostaddr);; return GSOCK_NOERROR; } @@ -1450,7 +1450,7 @@ unsigned long GAddress_INET_GetHostAddress(GAddress *address) addr = (struct sockaddr_in *)address->m_addr; - return addr->sin_addr.s_addr; + return ntohl(addr->sin_addr.s_addr); } unsigned short GAddress_INET_GetPort(GAddress *address) diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index eae3b541aa..3852eebd13 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -1653,7 +1653,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address, CHECK_ADDRESS(address, INET); addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr); - addr->s_addr = hostaddr; + addr->s_addr = htonl(hostaddr); return GSOCK_NOERROR; } @@ -1744,7 +1744,7 @@ unsigned long GAddress_INET_GetHostAddress(GAddress *address) addr = (struct sockaddr_in *)address->m_addr; - return addr->sin_addr.s_addr; + return ntohl(addr->sin_addr.s_addr); } unsigned short GAddress_INET_GetPort(GAddress *address)