* longint2cardinal fixes merged

This commit is contained in:
Tomas Hajny 2003-10-14 21:15:20 +00:00
parent 9bd5572f72
commit a183b11a5f

View File

@ -58,13 +58,13 @@ type
DateLastWrite, {Date of last modification of file.} DateLastWrite, {Date of last modification of file.}
TimeLastWrite: word; {Time of last modification of file.} TimeLastWrite: word; {Time of last modification of file.}
FileSize, {Size of file.} FileSize, {Size of file.}
FileAlloc: longint; {Amount of space the file really FileAlloc: cardinal; {Amount of space the file really
occupies on disk.} occupies on disk.}
end; end;
PFileStatus0 = ^TFileStatus0; PFileStatus0 = ^TFileStatus0;
TFileStatus3 = object (TFileStatus) TFileStatus3 = object (TFileStatus)
NextEntryOffset: longint; {Offset of next entry} NextEntryOffset: cardinal; {Offset of next entry}
DateCreation, {Date of file creation.} DateCreation, {Date of file creation.}
TimeCreation, {Time of file creation.} TimeCreation, {Time of file creation.}
DateLastAccess, {Date of last access to file.} DateLastAccess, {Date of last access to file.}
@ -72,9 +72,9 @@ type
DateLastWrite, {Date of last modification of file.} DateLastWrite, {Date of last modification of file.}
TimeLastWrite: word; {Time of last modification of file.} TimeLastWrite: word; {Time of last modification of file.}
FileSize, {Size of file.} FileSize, {Size of file.}
FileAlloc: longint; {Amount of space the file really FileAlloc: cardinal; {Amount of space the file really
occupies on disk.} occupies on disk.}
AttrFile: longint; {Attributes of file.} AttrFile: cardinal; {Attributes of file.}
end; end;
PFileStatus3 = ^TFileStatus3; PFileStatus3 = ^TFileStatus3;
@ -91,7 +91,7 @@ type
(File_Sys_ID, (File_Sys_ID,
Sectors_Per_Cluster, Sectors_Per_Cluster,
Total_Clusters, Total_Clusters,
Free_Clusters: longint; Free_Clusters: cardinal;
Bytes_Per_Sector: word); Bytes_Per_Sector: word);
2: {For date/time description, 2: {For date/time description,
see file searching realted see file searching realted
@ -106,18 +106,18 @@ type
PFSInfo = ^TFSInfo; PFSInfo = ^TFSInfo;
TCountryCode=record TCountryCode=record
Country, {Country to query info about (0=current).} Country, {Country to query info about (0=current).}
CodePage: longint; {Code page to query info about (0=current).} CodePage: cardinal; {Code page to query info about (0=current).}
end; end;
PCountryCode=^TCountryCode; PCountryCode=^TCountryCode;
TTimeFmt = (Clock12, Clock24); TTimeFmt = (Clock12, Clock24);
TCountryInfo=record TCountryInfo=record
Country, CodePage: longint; {Country and codepage requested.} Country, CodePage: cardinal; {Country and codepage requested.}
case byte of case byte of
0: 0:
(DateFormat: longint; {1=ddmmyy 2=yymmdd 3=mmddyy} (DateFormat: cardinal; {1=ddmmyy 2=yymmdd 3=mmddyy}
CurrencyUnit: array [0..4] of char; CurrencyUnit: array [0..4] of char;
ThousandSeparator: char; {Thousands separator.} ThousandSeparator: char; {Thousands separator.}
Zero1: byte; {Always zero.} Zero1: byte; {Always zero.}
@ -143,7 +143,7 @@ type
Zero5: byte; Zero5: byte;
Reserve2: array [0..4] of word); Reserve2: array [0..4] of word);
1: 1:
(fsDateFmt: longint; {1=ddmmyy 2=yymmdd 3=mmddyy} (fsDateFmt: cardinal; {1=ddmmyy 2=yymmdd 3=mmddyy}
szCurrency: array [0..4] of char; szCurrency: array [0..4] of char;
{null terminated currency symbol} {null terminated currency symbol}
szThousandsSeparator: array [0..1] of char; szThousandsSeparator: array [0..1] of char;
@ -181,37 +181,37 @@ const
{This is the correct way to call external assembler procedures.} {This is the correct way to call external assembler procedures.}
procedure syscall;external name '___SYSCALL'; procedure syscall;external name '___SYSCALL';
function DosSetFileInfo (Handle, InfoLevel: longint; AFileStatus: PFileStatus; function DosSetFileInfo (Handle: longint; InfoLevel: cardinal; AFileStatus: PFileStatus;
FileStatusLen: longint): longint; cdecl; external 'DOSCALLS' index 218; FileStatusLen: cardinal): cardinal; cdecl; external 'DOSCALLS' index 218;
function DosQueryFSInfo (DiskNum, InfoLevel: longint; var Buffer: TFSInfo; function DosQueryFSInfo (DiskNum, InfoLevel: cardinal; var Buffer: TFSInfo;
BufLen: longint): longint; cdecl; external 'DOSCALLS' index 278; BufLen: cardinal): cardinal; cdecl; external 'DOSCALLS' index 278;
function DosQueryFileInfo (Handle, InfoLevel: longint; function DosQueryFileInfo (Handle: longint; InfoLevel: cardinal;
AFileStatus: PFileStatus; FileStatusLen: longint): longint; cdecl; AFileStatus: PFileStatus; FileStatusLen: cardinal): cardinal; cdecl;
external 'DOSCALLS' index 279; external 'DOSCALLS' index 279;
function DosScanEnv (Name: PChar; var Value: PChar): longint; cdecl; function DosScanEnv (Name: PChar; var Value: PChar): cardinal; cdecl;
external 'DOSCALLS' index 227; external 'DOSCALLS' index 227;
function DosFindFirst (FileMask: PChar; var Handle: longint; Attrib: longint; function DosFindFirst (FileMask: PChar; var Handle: longint; Attrib: cardinal;
AFileStatus: PFileStatus; FileStatusLen: cardinal; AFileStatus: PFileStatus; FileStatusLen: cardinal;
var Count: cardinal; InfoLevel: cardinal): longint; cdecl; var Count: cardinal; InfoLevel: cardinal): cardinal; cdecl;
external 'DOSCALLS' index 264; external 'DOSCALLS' index 264;
function DosFindNext (Handle: longint; AFileStatus: PFileStatus; function DosFindNext (Handle: longint; AFileStatus: PFileStatus;
FileStatusLen: cardinal; var Count: cardinal): longint; cdecl; FileStatusLen: cardinal; var Count: cardinal): cardinal; cdecl;
external 'DOSCALLS' index 265; external 'DOSCALLS' index 265;
function DosFindClose (Handle: longint): longint; cdecl; function DosFindClose (Handle: longint): cardinal; cdecl;
external 'DOSCALLS' index 263; external 'DOSCALLS' index 263;
function DosQueryCtryInfo (Size: longint; var Country: TCountryCode; function DosQueryCtryInfo (Size: cardinal; var Country: TCountryCode;
var Res: TCountryInfo; var ActualSize: longint): longint; cdecl; var Res: TCountryInfo; var ActualSize: cardinal): cardinal; cdecl;
external 'NLS' index 5; external 'NLS' index 5;
function DosMapCase (Size: longint; var Country: TCountryCode; function DosMapCase (Size: cardinal; var Country: TCountryCode;
AString: PChar): longint; cdecl; external 'NLS' index 7; AString: PChar): cardinal; cdecl; external 'NLS' index 7;
{**************************************************************************** {****************************************************************************
@ -430,29 +430,29 @@ function FindFirst (const Path: string; Attr: longint; var Rslt: TSearchRec): lo
var SR: PSearchRec; var SR: PSearchRec;
FStat: PFileFindBuf3; FStat: PFileFindBuf3;
Count: cardinal; Count: cardinal;
Err: longint; Err: cardinal;
begin begin
if os_mode = osOS2 then if os_mode = osOS2 then
begin begin
New (FStat); New (FStat);
Rslt.FindHandle := $FFFFFFFF; Rslt.FindHandle := $FFFFFFFF;
Count := 1; Count := 1;
Err := DosFindFirst (PChar (Path), Rslt.FindHandle, Err := DosFindFirst (PChar (Path), Rslt.FindHandle,
Attr and FindResvdMask, FStat, SizeOf (FStat^), Count, Attr and FindResvdMask, FStat, SizeOf (FStat^), Count,
ilStandard); ilStandard);
if (Err = 0) and (Count = 0) then Err := 18; if (Err = 0) and (Count = 0) then Err := 18;
FindFirst := -Err; FindFirst := -Err;
if Err = 0 then if Err = 0 then
begin begin
Rslt.Name := FStat^.Name; Rslt.Name := FStat^.Name;
Rslt.Size := FStat^.FileSize; Rslt.Size := FStat^.FileSize;
Rslt.Attr := FStat^.AttrFile; Rslt.Attr := FStat^.AttrFile;
Rslt.ExcludeAttr := 0; Rslt.ExcludeAttr := 0;
TRec (Rslt.Time).T := FStat^.TimeLastWrite; TRec (Rslt.Time).T := FStat^.TimeLastWrite;
TRec (Rslt.Time).D := FStat^.DateLastWrite; TRec (Rslt.Time).D := FStat^.DateLastWrite;
end; end;
Dispose (FStat); Dispose (FStat);
end end
else else
begin begin
@ -479,11 +479,11 @@ function FindNext (var Rslt: TSearchRec): longint;
var SR: PSearchRec; var SR: PSearchRec;
FStat: PFileFindBuf3; FStat: PFileFindBuf3;
Count: cardinal; Count: cardinal;
Err: longint; Err: cardinal;
begin begin
if os_mode = osOS2 then if os_mode = osOS2 then
begin begin
New (FStat); New (FStat);
Count := 1; Count := 1;
Err := DosFindNext (Rslt.FindHandle, FStat, SizeOf (FStat^), Err := DosFindNext (Rslt.FindHandle, FStat, SizeOf (FStat^),
@ -528,7 +528,7 @@ var SR: PSearchRec;
begin begin
if os_mode = osOS2 then if os_mode = osOS2 then
begin begin
DosFindClose (F.FindHandle); DosFindClose (F.FindHandle);
end end
else else
begin begin
@ -555,10 +555,10 @@ end ['eax', 'ebx', 'ecx', 'edx'];
function FileSetDate (Handle, Age: longint): longint; function FileSetDate (Handle, Age: longint): longint;
var FStat: PFileStatus0; var FStat: PFileStatus0;
RC: longint; RC: cardinal;
begin begin
if os_mode = osOS2 then if os_mode = osOS2 then
begin begin
New (FStat); New (FStat);
RC := DosQueryFileInfo (Handle, ilStandard, FStat, RC := DosQueryFileInfo (Handle, ilStandard, FStat,
SizeOf (FStat^)); SizeOf (FStat^));
@ -729,7 +729,7 @@ end;
function DiskFree (Drive: byte): int64; function DiskFree (Drive: byte): int64;
var FI: TFSinfo; var FI: TFSinfo;
RC: longint; RC: cardinal;
begin begin
if (os_mode = osDOS) or (os_mode = osDPMI) then if (os_mode = osDOS) or (os_mode = osDPMI) then
@ -764,13 +764,13 @@ begin
int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector) int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector)
else else
DiskFree := -1; DiskFree := -1;
end; end;
end; end;
function DiskSize (Drive: byte): int64; function DiskSize (Drive: byte): int64;
var FI: TFSinfo; var FI: TFSinfo;
RC: longint; RC: cardinal;
begin begin
if (os_mode = osDOS) or (os_mode = osDPMI) then if (os_mode = osDOS) or (os_mode = osDPMI) then
@ -806,7 +806,7 @@ begin
int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector) int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector)
else else
DiskSize := -1; DiskSize := -1;
end; end;
end; end;
@ -949,8 +949,8 @@ end;
procedure InitInternational; procedure InitInternational;
var Country: TCountryCode; var Country: TCountryCode;
CtryInfo: TCountryInfo; CtryInfo: TCountryInfo;
Size: longint; Size: cardinal;
RC: longint; RC: cardinal;
begin begin
Size := 0; Size := 0;
FillChar (Country, SizeOf (Country), 0); FillChar (Country, SizeOf (Country), 0);
@ -1013,7 +1013,10 @@ end.
{ {
$Log$ $Log$
Revision 1.10 2003-10-07 21:33:24 hajny Revision 1.11 2003-10-14 21:15:20 hajny
* longint2cardinal fixes merged
Revision 1.10 2003/10/07 21:33:24 hajny
* stdcall fixes and asm routines cleanup * stdcall fixes and asm routines cleanup
Revision 1.9 2003/10/04 17:53:08 hajny Revision 1.9 2003/10/04 17:53:08 hajny