Merge branch 'master' of github.com:Araq/Nimrod

This commit is contained in:
Araq 2012-05-31 01:35:32 +02:00
commit 073323af48
2 changed files with 6 additions and 5 deletions

View file

@ -479,7 +479,8 @@ proc setBiggestFloat*(x: TAny, y: biggestFloat) =
proc getString*(x: TAny): string = proc getString*(x: TAny): string =
## retrieve the string value out of `x`. `x` needs to represent a string. ## retrieve the string value out of `x`. `x` needs to represent a string.
assert x.rawtype.kind == tyString assert x.rawtype.kind == tyString
result = cast[ptr string](x.value)[] if not isNil(cast[ptr pointer](x.value)[]):
result = cast[ptr string](x.value)[]
proc setString*(x: TAny, y: string) = proc setString*(x: TAny, y: string) =
## sets the string value of `x`. `x` needs to represent a string. ## sets the string value of `x`. `x` needs to represent a string.

View file

@ -26,8 +26,8 @@ type
dMon, dTue, dWed, dThu, dFri, dSat, dSun dMon, dTue, dWed, dThu, dFri, dSat, dSun
var var
timezone* {.importc, header: "<time.h>".}: int timezone {.importc, header: "<time.h>".}: int
tzname* {.importc, header: "<time.h>" .}: array[0..1, cstring] tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
when defined(posix): when defined(posix):
type type
@ -580,11 +580,11 @@ proc format*(info: TTimeInfo, f: string): string =
result.add('0') result.add('0')
result.add($info.minute) result.add($info.minute)
of "M": of "M":
result.add($(int(info.month))) result.add($(int(info.month)+1))
of "MM": of "MM":
if int(info.month) < 10: if int(info.month) < 10:
result.add('0') result.add('0')
result.add($(int(info.month))) result.add($(int(info.month)+1))
of "MMM": of "MMM":
result.add(($info.month)[0..2]) result.add(($info.month)[0..2])
of "MMMM": of "MMMM":