make some system modules compile again
This commit is contained in:
parent
29c075299d
commit
c0433b0b6c
2 changed files with 19 additions and 19 deletions
|
|
@ -127,7 +127,7 @@ proc fileMatches(c, bp: cstring): bool =
|
||||||
|
|
||||||
proc canonFilename*(filename: cstring): cstring =
|
proc canonFilename*(filename: cstring): cstring =
|
||||||
## returns 'nil' if the filename cannot be found.
|
## returns 'nil' if the filename cannot be found.
|
||||||
for i in 0 ..< dbgFilenameLen:
|
for i in 0 .. dbgFilenameLen-1:
|
||||||
result = dbgFilenames[i]
|
result = dbgFilenames[i]
|
||||||
if fileMatches(result, filename): return result
|
if fileMatches(result, filename): return result
|
||||||
result = nil
|
result = nil
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ proc reprChar(x: char): string {.compilerRtl.} =
|
||||||
|
|
||||||
proc reprStrAux(result: var string, s: cstring, len: int) =
|
proc reprStrAux(result: var string, s: cstring, len: int) =
|
||||||
add(result, "\"")
|
add(result, "\"")
|
||||||
for i in 0 ..< len:
|
for i in 0 .. len-1:
|
||||||
let c = s[i]
|
let c = s[i]
|
||||||
case c
|
case c
|
||||||
of '"': add(result, "\\\"")
|
of '"': add(result, "\\\"")
|
||||||
|
|
@ -149,7 +149,7 @@ proc reprArray(a: pointer, typ: PNimType,
|
||||||
|
|
||||||
{. emit: "`len` = `a`.length;\n" .}
|
{. emit: "`len` = `a`.length;\n" .}
|
||||||
var dereffed: pointer = a
|
var dereffed: pointer = a
|
||||||
for i in 0 ..< len:
|
for i in 0 .. len-1:
|
||||||
if i > 0 :
|
if i > 0 :
|
||||||
add(result, ", ")
|
add(result, ", ")
|
||||||
# advance pointer and point to element at index
|
# 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)
|
reprAux(result, val, typ.node.typ, cl)
|
||||||
else:
|
else:
|
||||||
# if the object has more than one field, sons is not nil and contains the fields.
|
# 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
|
if first: first = false
|
||||||
else: add(result, ",\n")
|
else: add(result, ",\n")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue