mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 13:49:29 +02:00
* Explicitly typecast (-longint) to longint, otherwise it becomes an int64 on 64-bit targets, causing wrong result of sign(longint). Mantis #29649.
git-svn-id: trunk@33096 -
This commit is contained in:
parent
41751bc5b4
commit
161f812113
@ -641,8 +641,8 @@ function Sign(const AValue: Integer): TValueSign;inline;
|
||||
|
||||
begin
|
||||
result:=TValueSign(
|
||||
SarLongint(AValue,sizeof(AValue)*8-1) or { gives -1 for negative values, 0 otherwise }
|
||||
(-AValue shr (sizeof(AValue)*8-1)) { gives 1 for positive values, 0 otherwise }
|
||||
SarLongint(AValue,sizeof(AValue)*8-1) or { gives -1 for negative values, 0 otherwise }
|
||||
(longint(-AValue) shr (sizeof(AValue)*8-1)) { gives 1 for positive values, 0 otherwise }
|
||||
);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user