fixes ptr to cstring warnings[backport] (#20848)
* fix =#13790 ptr char (+friends) should not implicitly convert to cstring * Apply suggestions from code review * first round; compiles on windows * nimPreviewSlimSystem * conversion is unsafe, cast needed * fixes more tests * fixes asyncnet * another try another error * last one * true * one more * why bugs didn't show at once * add `nimPreviewCstringConversion` switch * typo * fixes ptr to cstring warnings[backport] * add fixes Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
This commit is contained in:
parent
3d692d08f7
commit
06cd15663d
25 changed files with 50 additions and 50 deletions
|
|
@ -58,7 +58,7 @@ proc launchSwarm(name: ptr SockAddr) {.async.} =
|
|||
16384, cast[ptr SockAddr](addr saddr),
|
||||
addr slen)
|
||||
size = 0
|
||||
var grammString = $cstring(addr buffer)
|
||||
var grammString = $cast[cstring](addr buffer)
|
||||
if grammString == message:
|
||||
saveSendingPort(sockport)
|
||||
inc(recvCount)
|
||||
|
|
@ -80,7 +80,7 @@ proc readMessages(server: AsyncFD) {.async.} =
|
|||
16384, cast[ptr SockAddr](addr(saddr)),
|
||||
addr(slen))
|
||||
size = 0
|
||||
var grammString = $cstring(addr buffer)
|
||||
var grammString = $cast[cstring](addr buffer)
|
||||
if grammString.startsWith("Message ") and
|
||||
saddr.sin_addr.s_addr == nativesockets.ntohl(INADDR_LOOPBACK.uint32):
|
||||
await sendTo(server, addr grammString[0], len(grammString),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue