Fixed sizeOf to sizeof (#12347)
This commit is contained in:
parent
73c8391fd3
commit
678775601a
3 changed files with 4 additions and 4 deletions
|
|
@ -3546,7 +3546,7 @@ Nonoverloadable builtins
|
||||||
The following builtin procs cannot be overloaded for reasons of implementation
|
The following builtin procs cannot be overloaded for reasons of implementation
|
||||||
simplicity (they require specialized semantic checking)::
|
simplicity (they require specialized semantic checking)::
|
||||||
|
|
||||||
declared, defined, definedInScope, compiles, sizeOf,
|
declared, defined, definedInScope, compiles, sizeof,
|
||||||
is, shallowCopy, getAst, astToStr, spawn, procCall
|
is, shallowCopy, getAst, astToStr, spawn, procCall
|
||||||
|
|
||||||
Thus they act more like keywords than like ordinary identifiers; unlike a
|
Thus they act more like keywords than like ordinary identifiers; unlike a
|
||||||
|
|
|
||||||
|
|
@ -955,10 +955,10 @@ proc toHex*(x: BiggestInt, len: Positive): string {.noSideEffect,
|
||||||
if n == 0 and x < 0: n = -1
|
if n == 0 and x < 0: n = -1
|
||||||
|
|
||||||
proc toHex*[T: SomeInteger](x: T): string =
|
proc toHex*[T: SomeInteger](x: T): string =
|
||||||
## Shortcut for ``toHex(x, T.sizeOf * 2)``
|
## Shortcut for ``toHex(x, T.sizeof * 2)``
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
doAssert toHex(1984'i64) == "00000000000007C0"
|
doAssert toHex(1984'i64) == "00000000000007C0"
|
||||||
toHex(BiggestInt(x), T.sizeOf * 2)
|
toHex(BiggestInt(x), T.sizeof * 2)
|
||||||
|
|
||||||
proc toHex*(s: string): string {.noSideEffect, rtl.} =
|
proc toHex*(s: string): string {.noSideEffect, rtl.} =
|
||||||
## Converts a bytes string to its hexadecimal representation.
|
## Converts a bytes string to its hexadecimal representation.
|
||||||
|
|
|
||||||
|
|
@ -570,7 +570,7 @@ type
|
||||||
|
|
||||||
proc payloadCheck() =
|
proc payloadCheck() =
|
||||||
doAssert offsetOf(Payload, vals) == 4
|
doAssert offsetOf(Payload, vals) == 4
|
||||||
doAssert sizeOf(Payload) == 4
|
doAssert sizeof(Payload) == 4
|
||||||
|
|
||||||
payloadCheck()
|
payloadCheck()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue