Remove dead code
This commit is contained in:
parent
9aa845c6b6
commit
c34a68d76f
1 changed files with 1 additions and 11 deletions
|
|
@ -263,24 +263,14 @@ proc parseBiggestUInt*(s: string, number: var uint64, start = 0): int {.
|
||||||
result = rawParseUInt(s, res, start)
|
result = rawParseUInt(s, res, start)
|
||||||
number = res
|
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 {.
|
proc parseUInt*(s: string, number: var uint, start = 0): int {.
|
||||||
rtl, extern: "npuParseUInt", noSideEffect.} =
|
rtl, extern: "npuParseUInt", noSideEffect.} =
|
||||||
## parses an unsigned integer starting at `start` and stores the value into `number`.
|
## 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.
|
## Result is the number of processed chars or 0 if there is no integer or overflow detected.
|
||||||
var res: uint64
|
var res: uint64
|
||||||
result = parseBiggestUInt(s, res, start)
|
result = parseBiggestUInt(s, res, start)
|
||||||
if (sizeof(uint) <= 4) and
|
if (sizeof(uint) <= 4) and
|
||||||
(res > highUInt()):
|
(res > 0xFFFF_FFFF'u64):
|
||||||
raise newException(OverflowError, "overflow")
|
raise newException(OverflowError, "overflow")
|
||||||
elif result != 0:
|
elif result != 0:
|
||||||
number = uint(res)
|
number = uint(res)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue