Skip to content

Commit

Permalink
change 'iff' to 'if' to stop "corrections" once and for all (#14182)
Browse files Browse the repository at this point in the history
  • Loading branch information
narimiran authored May 1, 2020
1 parent 9b01c6c commit 9c33bca
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions lib/posix/posix_haiku.nim
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,11 @@ when hasSpawnH:

# <sys/wait.h>
proc WEXITSTATUS*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Exit code, iff WIFEXITED(s)
## Exit code, if WIFEXITED(s)
proc WTERMSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Termination signal, iff WIFSIGNALED(s)
## Termination signal, if WIFSIGNALED(s)
proc WSTOPSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Stop signal, iff WIFSTOPPED(s)
## Stop signal, if WIFSTOPPED(s)
proc WIFEXITED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
## True if child exited normally.
proc WIFSIGNALED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
Expand Down
6 changes: 3 additions & 3 deletions lib/posix/posix_macos_amd64.nim
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,11 @@ when hasSpawnH:

# <sys/wait.h>
proc WEXITSTATUS*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Exit code, iff WIFEXITED(s)
## Exit code, if WIFEXITED(s)
proc WTERMSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Termination signal, iff WIFSIGNALED(s)
## Termination signal, if WIFSIGNALED(s)
proc WSTOPSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Stop signal, iff WIFSTOPPED(s)
## Stop signal, if WIFSTOPPED(s)
proc WIFEXITED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
## True if child exited normally.
proc WIFSIGNALED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
Expand Down
6 changes: 3 additions & 3 deletions lib/posix/posix_openbsd_amd64.nim
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,11 @@ when hasSpawnH:

# <sys/wait.h>
proc WEXITSTATUS*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Exit code, iff WIFEXITED(s)
## Exit code, if WIFEXITED(s)
proc WTERMSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Termination signal, iff WIFSIGNALED(s)
## Termination signal, if WIFSIGNALED(s)
proc WSTOPSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Stop signal, iff WIFSTOPPED(s)
## Stop signal, if WIFSTOPPED(s)
proc WIFEXITED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
## True if child exited normally.
proc WIFSIGNALED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
Expand Down
6 changes: 3 additions & 3 deletions lib/posix/posix_other.nim
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,11 @@ when hasSpawnH:

# <sys/wait.h>
proc WEXITSTATUS*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Exit code, iff WIFEXITED(s)
## Exit code, if WIFEXITED(s)
proc WTERMSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Termination signal, iff WIFSIGNALED(s)
## Termination signal, if WIFSIGNALED(s)
proc WSTOPSIG*(s: cint): cint {.importc, header: "<sys/wait.h>".}
## Stop signal, iff WIFSTOPPED(s)
## Stop signal, if WIFSTOPPED(s)
proc WIFEXITED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
## True if child exited normally.
proc WIFSIGNALED*(s: cint): bool {.importc, header: "<sys/wait.h>".}
Expand Down
8 changes: 4 additions & 4 deletions lib/pure/collections/critbits.nim
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ proc rawGet[T](c: CritBitTree[T], key: string): Node[T] =
return if it.key == key: it else: nil

proc contains*[T](c: CritBitTree[T], key: string): bool {.inline.} =
## Returns true iff `c` contains the given `key`.
## Returns true if `c` contains the given `key`.
runnableExamples:
var c: CritBitTree[void]
incl(c, "key")
Expand Down Expand Up @@ -156,7 +156,7 @@ proc excl*[T](c: var CritBitTree[T], key: string) =
discard exclImpl(c, key)

proc missingOrExcl*[T](c: var CritBitTree[T], key: string): bool =
## Returns true iff `c` does not contain the given `key`. If the key
## Returns true if `c` does not contain the given `key`. If the key
## does exist, c.excl(key) is performed.
##
## See also:
Expand All @@ -178,7 +178,7 @@ proc missingOrExcl*[T](c: var CritBitTree[T], key: string): bool =
result = c.count == oldCount

proc containsOrIncl*[T](c: var CritBitTree[T], key: string, val: T): bool =
## Returns true iff `c` contains the given `key`. If the key does not exist
## Returns true if `c` contains the given `key`. If the key does not exist
## ``c[key] = val`` is performed.
##
## See also:
Expand All @@ -204,7 +204,7 @@ proc containsOrIncl*[T](c: var CritBitTree[T], key: string, val: T): bool =
if not result: n.val = val

proc containsOrIncl*(c: var CritBitTree[void], key: string): bool =
## Returns true iff `c` contains the given `key`. If the key does not exist
## Returns true if `c` contains the given `key`. If the key does not exist
## it is inserted into `c`.
##
## See also:
Expand Down
2 changes: 1 addition & 1 deletion lib/pure/collections/sharedtables.nim
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ proc mgetOrPut*[A, B](t: var SharedTable[A, B], key: A, val: B): var B =
mgetOrPutImpl(enlarge)

proc hasKeyOrPut*[A, B](t: var SharedTable[A, B], key: A, val: B): bool =
## returns true iff `key` is in the table, otherwise inserts `value`.
## returns true if `key` is in the table, otherwise inserts `value`.
withLock t:
hasKeyOrPutImpl(enlarge)

Expand Down
16 changes: 8 additions & 8 deletions lib/pure/cstrutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ when defined(js):
else:
proc startsWith*(s, prefix: cstring): bool {.noSideEffect,
rtl, extern: "csuStartsWith".} =
## Returns true iff ``s`` starts with ``prefix``.
## Returns true if ``s`` starts with ``prefix``.
##
## If ``prefix == ""`` true is returned.
##
Expand All @@ -44,7 +44,7 @@ else:

proc endsWith*(s, suffix: cstring): bool {.noSideEffect,
rtl, extern: "csuEndsWith".} =
## Returns true iff ``s`` ends with ``suffix``.
## Returns true if ``s`` ends with ``suffix``.
##
## If ``suffix == ""`` true is returned.
##
Expand All @@ -64,9 +64,9 @@ proc cmpIgnoreStyle*(a, b: cstring): int {.noSideEffect,
## NOT be used to compare Nim identifier names. use `macros.eqIdent`
## for that. Returns:
##
## | 0 iff a == b
## | < 0 iff a < b
## | > 0 iff a > b
## | 0 if a == b
## | < 0 if a < b
## | > 0 if a > b
##
## Not supported for JS backend, use `strutils.cmpIgnoreStyle
## <https://nim-lang.org/docs/strutils.html#cmpIgnoreStyle%2Cstring%2Cstring>`_ instead.
Expand All @@ -86,9 +86,9 @@ proc cmpIgnoreCase*(a, b: cstring): int {.noSideEffect,
rtl, extern: "csuCmpIgnoreCase".} =
## Compares two strings in a case insensitive manner. Returns:
##
## | 0 iff a == b
## | < 0 iff a < b
## | > 0 iff a > b
## | 0 if a == b
## | < 0 if a < b
## | > 0 if a > b
##
## Not supported for JS backend, use `strutils.cmpIgnoreCase
## <https://nim-lang.org/docs/strutils.html#cmpIgnoreCase%2Cstring%2Cstring>`_ instead.
Expand Down
10 changes: 5 additions & 5 deletions lib/pure/os.nim
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,9 @@ proc cmpPaths*(pathA, pathB: string): int {.
## On a case-sensitive filesystem this is done
## case-sensitively otherwise case-insensitively. Returns:
##
## | 0 iff pathA == pathB
## | < 0 iff pathA < pathB
## | > 0 iff pathA > pathB
## | 0 if pathA == pathB
## | < 0 if pathA < pathB
## | > 0 if pathA > pathB
runnableExamples:
when defined(macosx):
assert cmpPaths("foo", "Foo") == 0
Expand Down Expand Up @@ -1108,7 +1108,7 @@ proc existsFile*(filename: string): bool {.rtl, extern: "nos$1",

proc existsDir*(dir: string): bool {.rtl, extern: "nos$1", tags: [ReadDirEffect],
noNimScript.} =
## Returns true iff the directory `dir` exists. If `dir` is a file, false
## Returns true if the directory `dir` exists. If `dir` is a file, false
## is returned. Follows symlinks.
##
## See also:
Expand All @@ -1128,7 +1128,7 @@ proc existsDir*(dir: string): bool {.rtl, extern: "nos$1", tags: [ReadDirEffect]
proc symlinkExists*(link: string): bool {.rtl, extern: "nos$1",
tags: [ReadDirEffect],
noNimScript.} =
## Returns true iff the symlink `link` exists. Will return true
## Returns true if the symlink `link` exists. Will return true
## regardless of whether the link points to a directory or file.
##
## See also:
Expand Down
2 changes: 1 addition & 1 deletion lib/pure/osproc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ proc kill*(p: Process) {.rtl, extern: "nosp$1", tags: [].}
## * `terminate proc <#terminate,Process>`_

proc running*(p: Process): bool {.rtl, extern: "nosp$1", tags: [].}
## Returns true iff the process `p` is still running. Returns immediately.
## Returns true if the process `p` is still running. Returns immediately.

proc processID*(p: Process): int {.rtl, extern: "nosp$1".} =
## Returns `p`'s process ID.
Expand Down
2 changes: 1 addition & 1 deletion lib/pure/typetraits.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ proc stripGenericParams*(t: typedesc): typedesc {.magic: "TypeTrait".}
## them unmodified.

proc supportsCopyMem*(t: typedesc): bool {.magic: "TypeTrait".}
## This trait returns true iff the type ``t`` is safe to use for
## This trait returns true if the type ``t`` is safe to use for
## `copyMem`:idx:.
##
## Other languages name a type like these `blob`:idx:.
Expand Down
2 changes: 1 addition & 1 deletion lib/system/channels.nim
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ proc close*[TMsg](c: var Channel[TMsg]) =
deinitRawChannel(addr(c))

proc ready*[TMsg](c: var Channel[TMsg]): bool =
## Returns true iff some thread is waiting on the channel `c` for
## Returns true if some thread is waiting on the channel `c` for
## new messages.
var q = cast[PRawChannel](addr(c))
result = q.ready
8 changes: 4 additions & 4 deletions lib/system/io.nim
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ proc rawFileSize(file: File): int64 =
discard c_fseek(file, oldPos, 0)

proc endOfFile*(f: File): bool {.tags: [], benign.} =
## Returns true iff `f` is at the end.
## Returns true if `f` is at the end.
var c = c_fgetc(f)
discard c_ungetc(c, f)
return c < 0'i32
Expand Down Expand Up @@ -598,7 +598,7 @@ proc open*(f: var File, filename: string,
bufSize: int = -1): bool {.tags: [], raises: [], benign.} =
## Opens a file named `filename` with given `mode`.
##
## Default mode is readonly. Returns true iff the file could be opened.
## Default mode is readonly. Returns true if the file could be opened.
## This throws no exception if the file could not be opened.
##
## The file handle associated with the resulting ``File`` is not inheritable.
Expand Down Expand Up @@ -632,7 +632,7 @@ proc reopen*(f: File, filename: string, mode: FileMode = fmRead): bool {.
## is often used to redirect the `stdin`, `stdout` or `stderr`
## file variables.
##
## Default mode is readonly. Returns true iff the file could be reopened.
## Default mode is readonly. Returns true if the file could be reopened.
##
## The file handle associated with `f` won't be inheritable.
if freopen(filename, FormatOpen[mode], f) != nil:
Expand All @@ -647,7 +647,7 @@ proc open*(f: var File, filehandle: FileHandle,
mode: FileMode = fmRead): bool {.tags: [], raises: [], benign.} =
## Creates a ``File`` from a `filehandle` with given `mode`.
##
## Default mode is readonly. Returns true iff the file could be opened.
## Default mode is readonly. Returns true if the file could be opened.
##
## The passed file handle will no longer be inheritable.
when not defined(nimInheritHandles) and declared(setInheritable):
Expand Down

0 comments on commit 9c33bca

Please sign in to comment.