fix several typos in documentation and comments (#12553)

This commit is contained in:
Nindaleth 2019-10-30 09:08:45 +01:00 • committed by Miran
commit 34dbc5699e
29 changed files with 37 additions and 37 deletions

View file

@ -173,7 +173,7 @@ proc fastlog2Nim(x: uint64): int {.inline, noSideEffect.} =
result = lookup[(v * 0x03F6EAF2CD271461'u64) shr 58].int
# sets.nim cannot import bitops, but bitops can use include
# system/sets to eleminate code duplication. sets.nim defines defines
# system/sets to eliminate code duplication. sets.nim defines
# countBits32 and countBits64.
include system/sets

View file

@ -1361,7 +1361,7 @@ when isMainModule:
doAssert foo1(openArray[int]([identity(1), identity(2)])) == @[10, 20]
doAssert counter == 2
# Corner cases (openArray litterals should not be common)
# Corner cases (openArray literals should not be common)
template foo2(x: openArray[int]): seq[int] = x.mapIt(it * 10)
counter = 0
doAssert foo2(openArray[int]([identity(1), identity(2)])) == @[10, 20]

View file

@ -904,7 +904,7 @@ proc `$`*[A](s: OrderedSet[A]): string =
iterator items*[A](s: OrderedSet[A]): A =
## Iterates over keys in the ordered set `s` in insertion order.
##
## If you need a sequence with the elelments you can use `sequtils.toSeq
## If you need a sequence with the elements you can use `sequtils.toSeq
## template <sequtils.html#toSeq.t,untyped>`_.
##
## .. code-block::

View file

@ -49,7 +49,7 @@ proc satMinus(a, b: int): int {.inline.} =
proc `+`*(a, b: Color): Color =
## Adds two colors.
##
## This uses saturated artithmetic, so that each color
## This uses saturated arithmetic, so that each color
## component cannot overflow (255 is used as a maximum).
##
runnableExamples:
@ -63,7 +63,7 @@ proc `+`*(a, b: Color): Color =
proc `-`*(a, b: Color): Color =
## Subtracts two colors.
##
## This uses saturated artithmetic, so that each color
## This uses saturated arithmetic, so that each color
## component cannot underflow (0 is used as a minimum).
##
runnableExamples:

View file

@ -468,7 +468,7 @@ proc convert*(s: string, destEncoding = "UTF-8",
srcEncoding = "CP1252"): string =
## converts `s` to `destEncoding`. It assumed that `s` is in `srcEncoding`.
## This opens a converter, uses it and closes it again and is thus more
## convienent but also likely less efficient than re-using a converter.
## convenient but also likely less efficient than re-using a converter.
## utf-16BE, utf-32 conversions not supported on windows
var c = open(destEncoding, srcEncoding)
try:

View file

@ -99,7 +99,7 @@
## Unmarshalling
## -------------
##
## In addition to reading dynamic data, Nim can also unmarshall JSON directly
## In addition to reading dynamic data, Nim can also unmarshal JSON directly
## into a type with the ``to`` macro.
##
## .. code-block:: Nim

View file

@ -43,7 +43,7 @@
## * `rationals module<rationals.html>`_ for rational numbers and their
## mathematical operations
## * `fenv module<fenv.html>`_ for handling of floating-point rounding
## and exceptions (overflow, zero-devide, etc.)
## and exceptions (overflow, zero-divide, etc.)
## * `random module<random.html>`_ for fast and tiny random number generator
## * `mersenne module<mersenne.html>`_ for Mersenne twister random number generator
## * `stats module<stats.html>`_ for statistical analysis

View file

@ -3025,7 +3025,7 @@ proc getFileInfo*(handle: FileHandle): FileInfo {.noNimScript.} =
when defined(Windows):
var rawInfo: BY_HANDLE_FILE_INFORMATION
# We have to use the super special '_get_osfhandle' call (wrapped above)
# To transform the C file descripter to a native file handle.
# To transform the C file descriptor to a native file handle.
var realHandle = get_osfhandle(handle)
if getFileInformationByHandle(realHandle, addr rawInfo) == 0:
raiseOSError(osLastError())