@@ -481,13 +481,13 @@ when not useNimNetLite:
481481 result = newString (addrLen)
482482 let addr6 = addr cast [ptr Sockaddr_in6](sockAddr).sin6_addr
483483 when not useWinVersion:
484- if posix.inet_ntop (posix.AF_INET6 , addr6, addr result [0 ],
484+ if posix.inet_ntop (posix.AF_INET6 , addr6, cast [ cstring ]( addr result [0 ]) ,
485485 result .len.int32 ) == nil :
486486 raiseOSError (osLastError ())
487487 if posix.IN6_IS_ADDR_V4MAPPED (addr6) != 0 :
488488 result .setSlice (" ::ffff:" .len..< addrLen)
489489 else :
490- if winlean.inet_ntop (winlean.AF_INET6 , addr6, addr result [0 ],
490+ if winlean.inet_ntop (winlean.AF_INET6 , addr6, cast [ cstring ]( addr result [0 ]) ,
491491 result .len.int32 ) == nil :
492492 raiseOSError (osLastError ())
493493 setLen (result , len (cstring (result )))
@@ -509,23 +509,23 @@ when not useNimNetLite:
509509 if sockAddr.sa_family.cint == nativeAfInet:
510510 let addr4 = addr cast [ptr Sockaddr_in](sockAddr).sin_addr
511511 when not useWinVersion:
512- if posix.inet_ntop (posix.AF_INET , addr4, addr strAddress[0 ],
512+ if posix.inet_ntop (posix.AF_INET , addr4, cast [ cstring ]( addr strAddress[0 ]) ,
513513 strAddress.len.int32 ) == nil :
514514 raiseOSError (osLastError ())
515515 else :
516- if winlean.inet_ntop (winlean.AF_INET , addr4, addr strAddress[0 ],
516+ if winlean.inet_ntop (winlean.AF_INET , addr4, cast [ cstring ]( addr strAddress[0 ]) ,
517517 strAddress.len.int32 ) == nil :
518518 raiseOSError (osLastError ())
519519 elif sockAddr.sa_family.cint == nativeAfInet6:
520520 let addr6 = addr cast [ptr Sockaddr_in6](sockAddr).sin6_addr
521521 when not useWinVersion:
522- if posix.inet_ntop (posix.AF_INET6 , addr6, addr strAddress[0 ],
522+ if posix.inet_ntop (posix.AF_INET6 , addr6, cast [ cstring ]( addr strAddress[0 ]) ,
523523 strAddress.len.int32 ) == nil :
524524 raiseOSError (osLastError ())
525525 if posix.IN6_IS_ADDR_V4MAPPED (addr6) != 0 :
526526 strAddress.setSlice (" ::ffff:" .len..< length)
527527 else :
528- if winlean.inet_ntop (winlean.AF_INET6 , addr6, addr strAddress[0 ],
528+ if winlean.inet_ntop (winlean.AF_INET6 , addr6, cast [ cstring ]( addr strAddress[0 ]) ,
529529 strAddress.len.int32 ) == nil :
530530 raiseOSError (osLastError ())
531531 else :
@@ -584,7 +584,7 @@ when not useNimNetLite:
584584 # Cannot use INET6_ADDRSTRLEN here, because it's a C define.
585585 result [0 ] = newString (64 )
586586 if inet_ntop (name.sin6_family.cint ,
587- addr name.sin6_addr, addr result [0 ][0 ], (result [0 ].len+ 1 ).int32 ).isNil:
587+ addr name.sin6_addr, cast [ cstring ]( addr result [0 ][0 ]) , (result [0 ].len+ 1 ).int32 ).isNil:
588588 raiseOSError (osLastError ())
589589 setLen (result [0 ], result [0 ].cstring .len)
590590 result [1 ] = Port (nativesockets.ntohs (name.sin6_port))
@@ -621,7 +621,7 @@ when not useNimNetLite:
621621 # Cannot use INET6_ADDRSTRLEN here, because it's a C define.
622622 result [0 ] = newString (64 )
623623 if inet_ntop (name.sin6_family.cint ,
624- addr name.sin6_addr, addr result [0 ][0 ], (result [0 ].len+ 1 ).int32 ).isNil:
624+ addr name.sin6_addr, cast [ cstring ]( addr result [0 ][0 ]) , (result [0 ].len+ 1 ).int32 ).isNil:
625625 raiseOSError (osLastError ())
626626 setLen (result [0 ], result [0 ].cstring .len)
627627 result [1 ] = Port (nativesockets.ntohs (name.sin6_port))
0 commit comments