mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-21 00:40:20 +01:00
* is_signed() only returns true for orddef's whose low value is < 0
(and not for all s8bit..s64bit types, since subrange types may
be marked like that but not have a lower bound < 0).
This is needed for bitpacking negative values, because e.g.
both 0..7 and -3..3 can be stored in 3 bits, but 0..7 must be
zero-extended when extracted (so must be unsigned) and -3..3 must
be sign-extended when extracted (so must be considered signed)
git-svn-id: trunk@6682 -
This commit is contained in:
parent
ef9ef2ceaa
commit
7925bed48d
@ -437,7 +437,7 @@ implementation
|
||||
begin
|
||||
case def.typ of
|
||||
orddef :
|
||||
result:=(torddef(def).ordtype in [s8bit,s16bit,s32bit,s64bit,scurrency]);
|
||||
result:=torddef(def).low < 0;
|
||||
enumdef :
|
||||
result:=tenumdef(def).min < 0;
|
||||
arraydef :
|
||||
|
||||
Loading…
Reference in New Issue
Block a user