mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-16 10:09:34 +02:00
Use explicit typecast to INTEGER mode for constants to avoid range check error when INTEGER is only 16-bit signed
This commit is contained in:
parent
602761fe44
commit
aed26f7aed
@ -515,10 +515,12 @@ VAR
|
||||
BEGIN
|
||||
FillChar (Rec, RECORDSIZE, 0);
|
||||
StrLCopy (TH.Name, PAnsiChar (DirRec.Name), NAMSIZ);
|
||||
{ INTEGER type can be 16-bit wide, for instance on msdos OS,
|
||||
add explicit typecast to avoid range check error in such cases }
|
||||
CASE DirRec.FileType OF
|
||||
ftNormal, ftLink : Mode := $08000;
|
||||
ftSymbolicLink : Mode := $0A000;
|
||||
ftDirectory : Mode := $04000;
|
||||
ftNormal, ftLink : Mode := INTEGER($08000);
|
||||
ftSymbolicLink : Mode := INTEGER($0A000);
|
||||
ftDirectory : Mode := INTEGER($04000);
|
||||
ELSE Mode := 0;
|
||||
END;
|
||||
IF tmSaveText IN DirRec.Mode THEN Mode := Mode OR $0200;
|
||||
|
Loading…
Reference in New Issue
Block a user