fix types of ansi_c/sysio to more closely match C ABI

also fixes some instances of using C library functions when there are
nim alternatives available
This commit is contained in:
Jacek Sieka 2016-06-05 12:03:20 +08:00
commit 64b0485207
15 changed files with 173 additions and 203 deletions

View file

@ -329,13 +329,13 @@ proc dbgStackFrame(s: cstring, start: int, currFrame: PFrame) =
proc readLine(f: File, line: var StaticStr): bool =
while true:
var c = fgetc(f)
var c = c_fgetc(f)
if c < 0'i32:
if line.len > 0: break
else: return false
if c == 10'i32: break # LF
if c == 13'i32: # CR
c = fgetc(f) # is the next char LF?
c = c_fgetc(f) # is the next char LF?
if c != 10'i32: ungetc(c, f) # no, put the character back
break
add line, chr(int(c))