mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-22 00:41:28 +00:00
fixes strictdefs warnings continue (#24520)
This commit is contained in:
@@ -2690,7 +2690,7 @@ proc locals*(): RootObj {.magic: "Plugin", noSideEffect.} =
|
||||
|
||||
when hasAlloc and notJSnotNims:
|
||||
# XXX how to implement 'deepCopy' is an open problem.
|
||||
proc deepCopy*[T](x: var T, y: T) {.noSideEffect, magic: "DeepCopy".} =
|
||||
proc deepCopy*[T](x: out T, y: T) {.noSideEffect, magic: "DeepCopy".} =
|
||||
## Performs a deep copy of `y` and copies it into `x`.
|
||||
##
|
||||
## This is also used by the code generator
|
||||
|
||||
@@ -73,30 +73,35 @@ proc chckIndx(i, a, b: int): int =
|
||||
if i >= a and i <= b:
|
||||
return i
|
||||
else:
|
||||
result = 0
|
||||
raiseIndexError3(i, a, b)
|
||||
|
||||
proc chckRange(i, a, b: int): int =
|
||||
if i >= a and i <= b:
|
||||
return i
|
||||
else:
|
||||
result = 0
|
||||
raiseRangeError(i)
|
||||
|
||||
proc chckRange64(i, a, b: int64): int64 {.compilerproc.} =
|
||||
if i >= a and i <= b:
|
||||
return i
|
||||
else:
|
||||
result = 0
|
||||
raiseRangeError(i)
|
||||
|
||||
proc chckRangeU(i, a, b: uint64): uint64 {.compilerproc.} =
|
||||
if i >= a and i <= b:
|
||||
return i
|
||||
else:
|
||||
result = 0
|
||||
sysFatal(RangeDefect, "value out of range")
|
||||
|
||||
proc chckRangeF(x, a, b: float): float =
|
||||
if x >= a and x <= b:
|
||||
return x
|
||||
else:
|
||||
result = 0.0
|
||||
when hostOS == "standalone":
|
||||
sysFatal(RangeDefect, "value out of range")
|
||||
else:
|
||||
|
||||
@@ -203,7 +203,7 @@ proc staticExec*(command: string, input = "", cache = ""): string {.
|
||||
## ```
|
||||
|
||||
proc gorgeEx*(command: string, input = "", cache = ""): tuple[output: string,
|
||||
exitCode: int] =
|
||||
exitCode: int] {.noinit.} =
|
||||
## Similar to `gorge <#gorge,string,string,string>`_ but also returns the
|
||||
## precious exit code.
|
||||
discard
|
||||
|
||||
@@ -140,6 +140,8 @@ proc repr*[T: tuple|object](x: T): string {.noSideEffect, raises: [].} =
|
||||
## ```
|
||||
when T is object:
|
||||
result = $typeof(x)
|
||||
else:
|
||||
result = ""
|
||||
reprObject(result, x)
|
||||
|
||||
proc repr*[T](x: ref T | ptr T): string {.noSideEffect, raises: [].} =
|
||||
|
||||
Reference in New Issue
Block a user