[lazarus] Patch win32: 'as' usage

Micha Nelissen M.Nelissen at student.tue.nl
Sun Aug 31 09:47:33 EDT 2003


Hi,

Attached patch greatly reduces the usage of the 'as' operator. Goal was 
to keep current functionality: only changes are made to those statements 
where the type was already verified before, either by 'is' or another 'as'.

Question: what assumptions can we make about function entry? Then we can 
further reduce usage of as.
1) Can we assume Sender parameter is of type as FCompStyle indicates? 
Ie. csButton is a TButton?
2) Can we assume basic class like TWinControl? Some function seem to 
assume it by starting with an 'as' right at the beginning of the 
function. It may be an idea to change 'Sender: TObject' to 'Sender: 
TWinControl' if this is the case.

HTH,

Micha.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00064.bin
Type: application/octet-stream
Size: 3975 bytes
Desc: "as.patch.gz"
Url : http://localhost/pipermail/lazarus/attachments/20030831/f91cd73b/bin00064.bin


More information about the Lazarus mailing list