get rid of the warnings during bootstrapping (#18741)

* fix bootstrapping hints and warnings

* revert removals in ccgtypes
This commit is contained in:
Miran
2021-08-24 17:15:26 +02:00
committed by GitHub
parent 9674ff4361
commit 24178bf8aa
4 changed files with 5 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ proc fillBuffer(L: var TBaseLexer) =
oldBufLen = L.bufLen
L.bufLen = L.bufLen * 2
L.bufStorage.setLen(L.bufLen)
L.buf = L.bufStorage
L.buf = L.bufStorage.cstring
assert(L.bufLen - oldBufLen == oldBufLen)
charsRead = llStreamRead(L.stream, addr(L.buf[oldBufLen]),
oldBufLen)
@@ -147,7 +147,7 @@ proc openBaseLexer(L: var TBaseLexer, inputstream: PLLStream, bufLen = 8192) =
L.bufpos = 0
L.offsetBase = 0
L.bufStorage = newString(bufLen)
L.buf = L.bufStorage
L.buf = L.bufStorage.cstring
L.bufLen = bufLen
L.sentinel = bufLen - 1
L.lineStart = 0

View File

@@ -144,7 +144,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode; idgen: IdGenerator; g: ModuleGraph): P
if a.typ.kind == tyString:
result = newIntNodeT(toInt128(a.strVal.len), n, idgen, g)
elif a.typ.kind == tyCstring:
result = newIntNodeT(toInt128(nimCStrLen(a.strVal)), n, idgen, g)
result = newIntNodeT(toInt128(nimCStrLen(a.strVal.cstring)), n, idgen, g)
else:
result = newIntNodeT(toInt128(a.len), n, idgen, g)
of mUnaryPlusI, mUnaryPlusF64: result = a # throw `+` away

View File

@@ -18,7 +18,7 @@ proc `&=`(c: var MD5Context, ch: char) =
# XXX suspicious code here; relies on ch being zero terminated?
md5Update(c, unsafeAddr ch, 1)
proc `&=`(c: var MD5Context, r: Rope) =
for l in leaves(r): md5Update(c, l, l.len)
for l in leaves(r): md5Update(c, l.cstring, l.len)
proc `&=`(c: var MD5Context, i: BiggestInt) =
md5Update(c, cast[cstring](unsafeAddr i), sizeof(i))
proc `&=`(c: var MD5Context, f: BiggestFloat) =

View File

@@ -32,7 +32,7 @@
# included from sigmatch.nim
import algorithm, sets, prefixmatches, lineinfos, parseutils, linter, tables
import algorithm, sets, prefixmatches, parseutils, tables
from wordrecg import wDeprecated, wError, wAddr, wYield
when defined(nimsuggest):