summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-29 00:51:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-29 00:51:40 +0000
commit9fe88af9ef088445a334e782eb063879aab333aa (patch)
tree5233f7db253845cc0c1a7cd8e0c219fe9f37adeb /win32
parent4659b00b9a9c0ef818847186782babc43e09772f (diff)
* win32/win32.c (rb_w32_inet_ntop): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 966688286e..3ab696d59b 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -6130,17 +6130,18 @@ signbit(double x)
/* License: Ruby's */
char * WSAAPI
-rb_w32_inet_ntop(int af, void *addr, char *numaddr, size_t numaddr_len)
+rb_w32_inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
{
typedef char *(WSAAPI inet_ntop_t)(int, void *, char *, size_t);
inet_ntop_t *pInetNtop;
pInetNtop = (inet_ntop_t *)get_proc_address("ws2_32", "inet_ntop", NULL);
- if(pInetNtop){
- return pInetNtop(af,addr,numaddr,numaddr_len);
- }else{
- struct in_addr in;
- memcpy(&in.s_addr, addr, sizeof(in.s_addr));
- snprintf(numaddr, numaddr_len, "%s", inet_ntoa(in));
+ if (pInetNtop) {
+ return pInetNtop(af, (void *)addr, numaddr, numaddr_len);
+ }
+ else {
+ struct in_addr in;
+ memcpy(&in.s_addr, addr, sizeof(in.s_addr));
+ snprintf(numaddr, numaddr_len, "%s", inet_ntoa(in));
}
return numaddr;
}