make some system modules compile again

This commit is contained in:
Andreas Rumpf 2017-10-29 19:42:33 +01:00
commit c0433b0b6c
2 changed files with 19 additions and 19 deletions

View file

@ -127,7 +127,7 @@ proc fileMatches(c, bp: cstring): bool =
proc canonFilename*(filename: cstring): cstring =
## returns 'nil' if the filename cannot be found.
for i in 0 ..< dbgFilenameLen:
for i in 0 .. dbgFilenameLen-1:
result = dbgFilenames[i]
if fileMatches(result, filename): return result
result = nil

View file

@ -50,7 +50,7 @@ proc reprChar(x: char): string {.compilerRtl.} =
proc reprStrAux(result: var string, s: cstring, len: int) =
add(result, "\"")
for i in 0 ..< len:
for i in 0 .. len-1:
let c = s[i]
case c
of '"': add(result, "\\\"")
@ -149,7 +149,7 @@ proc reprArray(a: pointer, typ: PNimType,
{. emit: "`len` = `a`.length;\n" .}
var dereffed: pointer = a
for i in 0 ..< len:
for i in 0 .. len-1:
if i > 0 :
add(result, ", ")
# advance pointer and point to element at index
@ -192,7 +192,7 @@ proc reprRecordAux(result: var string, o: pointer, typ: PNimType, cl: var ReprCl
reprAux(result, val, typ.node.typ, cl)
else:
# if the object has more than one field, sons is not nil and contains the fields.
for i in 0 ..< typ.node.len:
for i in 0 .. typ.node.len-1:
if first: first = false
else: add(result, ",\n")