Declare out parameters as out, no var
Original Reporter info from Mantis: Milsa
-
Reporter name: Miloš
Original Reporter info from Mantis: Milsa
- Reporter name: Miloš
Description:
This is declaration of BlockWrite:
Procedure BlockWrite(var f:File;const Buf;Count:Int64;var Result:Int64);
IMHO, correct declaration is:
Procedure BlockWrite(var f:File;const Buf;Count:Int64;out Result:Int64);
Is any reason for this declaration?
There are more declaration as this in FPC.
Problem of this declaration is this:
mainform.pp(201,54) Hint: Local variable "FindData" does not seem to be initialized
This message is from declaration IShellLinkA.GetPath:
function GetPath(pszFile:LPSTR; cch:longint;var pfd:WIN32_FIND_DATA; fFlags:DWORD):HRESULT;StdCall;
I think that correct is:
function GetPath(pszFile:LPSTR; cch:longint;out pfd:WIN32_FIND_DATA; fFlags:DWORD):HRESULT;StdCall;
Mantis conversion info:
- Mantis ID: 32369
- OS: all
- Version: 1.8RC3