mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
Fix compilation for 16 bit targets (#5286)
This commit is contained in:
committed by
Andreas Rumpf
parent
536015ee7b
commit
7f30d04d6a
@@ -67,7 +67,7 @@ type
|
||||
rawTypePtr: pointer
|
||||
|
||||
ppointer = ptr pointer
|
||||
pbyteArray = ptr array[0.. 0xffff, int8]
|
||||
pbyteArray = ptr array[0xffff, int8]
|
||||
|
||||
TGenericSeq {.importc.} = object
|
||||
len, space: int
|
||||
|
||||
@@ -211,14 +211,14 @@ proc genericReset(dest: pointer, mt: PNimType) =
|
||||
zeroMem(dest, mt.size) # set raw bits to zero
|
||||
|
||||
proc selectBranch(discVal, L: int,
|
||||
a: ptr array[0..0x7fff, ptr TNimNode]): ptr TNimNode =
|
||||
a: ptr array[0x7fff, ptr TNimNode]): ptr TNimNode =
|
||||
result = a[L] # a[L] contains the ``else`` part (but may be nil)
|
||||
if discVal <% L:
|
||||
var x = a[discVal]
|
||||
if x != nil: result = x
|
||||
|
||||
proc FieldDiscriminantCheck(oldDiscVal, newDiscVal: int,
|
||||
a: ptr array[0..0x7fff, ptr TNimNode],
|
||||
a: ptr array[0x7fff, ptr TNimNode],
|
||||
L: int) {.compilerProc.} =
|
||||
var oldBranch = selectBranch(oldDiscVal, L, a)
|
||||
var newBranch = selectBranch(newDiscVal, L, a)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
type
|
||||
PtrTable = ptr object
|
||||
counter, max: int
|
||||
data: array[0..0xff_ffff, (pointer, pointer)]
|
||||
data: array[0xff_ffff, (pointer, pointer)]
|
||||
|
||||
template hashPtr(key: pointer): int = cast[int](key) shr 8
|
||||
template allocPtrTable: untyped =
|
||||
|
||||
@@ -70,7 +70,7 @@ type
|
||||
typ: ptr TNimType
|
||||
name: cstring
|
||||
len: int
|
||||
sons: ptr array[0..0x7fff, ptr TNimNode]
|
||||
sons: ptr array[0x7fff, ptr TNimNode]
|
||||
|
||||
TNimTypeFlag = enum
|
||||
ntfNoRefs = 0, # type contains no tyRef, tySequence, tyString
|
||||
|
||||
@@ -89,7 +89,7 @@ proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} =
|
||||
result = $e & " (invalid data!)"
|
||||
|
||||
type
|
||||
PByteArray = ptr array[0.. 0xffff, int8]
|
||||
PByteArray = ptr array[0xffff, int8]
|
||||
|
||||
proc addSetElem(result: var string, elem: int, typ: PNimType) {.benign.} =
|
||||
case typ.kind
|
||||
|
||||
Reference in New Issue
Block a user