diff options
author | Anatoly Galiulin <galiulin.anatoly@gmail.com> | 2016-03-31 10:51:40 +0600 |
---|---|---|
committer | Anatoly Galiulin <galiulin.anatoly@gmail.com> | 2016-03-31 10:51:40 +0600 |
commit | c34a68d76f7f552b235592da7634acc333275df9 (patch) | |
tree | aaefd477432426663e43edb358608bbeb39195a3 | |
parent | 9aa845c6b677dc1a01533dcf02e29acb971a13ee (diff) | |
download | Nim-c34a68d76f7f552b235592da7634acc333275df9.tar.gz |
Remove dead code
-rw-r--r-- | lib/pure/parseutils.nim | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/pure/parseutils.nim b/lib/pure/parseutils.nim index 66bdadb29..3e25eba22 100644 --- a/lib/pure/parseutils.nim +++ b/lib/pure/parseutils.nim @@ -263,24 +263,14 @@ proc parseBiggestUInt*(s: string, number: var uint64, start = 0): int {. result = rawParseUInt(s, res, start) number = res -# Workaround for high(uint) -proc highUInt(): uint64 = - when sizeof(uint) == 4: - 0xFFFFFFFF'u64 - elif sizeof(uint) == 8: - 0xFFFFFFFFFFFFFFFF'u64 - else: - {.fatal: "Unknoun uint size: " & $sizeof(uint).} - proc parseUInt*(s: string, number: var uint, start = 0): int {. rtl, extern: "npuParseUInt", noSideEffect.} = ## parses an unsigned integer starting at `start` and stores the value into `number`. - ## Result is the number of processed chars or 0 if there is no integer. ## Result is the number of processed chars or 0 if there is no integer or overflow detected. var res: uint64 result = parseBiggestUInt(s, res, start) if (sizeof(uint) <= 4) and - (res > highUInt()): + (res > 0xFFFF_FFFF'u64): raise newException(OverflowError, "overflow") elif result != 0: number = uint(res) |