changed integer promotion rules; added math.fmod

This commit is contained in:
Araq 2012-06-28 08:33:25 +02:00
commit 2900ceae35
13 changed files with 83 additions and 71 deletions

View file

@ -199,8 +199,8 @@ proc Open(f: var TFile, filename: string,
var p: pointer = fopen(filename, FormatOpen[mode])
result = (p != nil)
f = cast[TFile](p)
if bufSize > 0:
if setvbuf(f, nil, IOFBF, bufSize) != 0'i32:
if bufSize > 0 and bufSize <= high(cint):
if setvbuf(f, nil, IOFBF, bufSize.cint) != 0'i32:
raise newException(EOutOfMemory, "out of memory")
elif bufSize == 0:
discard setvbuf(f, nil, IONBF, 0)