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
|
|
@ -467,7 +467,7 @@ proc readLine*(f: File, line: var string): bool {.tags: [ReadIOEffect],
|
|||
while true:
|
||||
# fixes #9634; this pattern may need to be abstracted as a template if reused;
|
||||
# likely other io procs need this for correctness.
|
||||
fgetsSuccess = c_fgets(addr line[pos], sp.cint, f) != nil
|
||||
fgetsSuccess = c_fgets(cast[cstring](addr line[pos]), sp.cint, f) != nil
|
||||
if fgetsSuccess: break
|
||||
when not defined(nimscript):
|
||||
if errno == EINTR:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue