[Lazarus] LCL Controls.pp needs 'inline'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] LCL Controls.pp needs 'inline'

Free Pascal - Lazarus mailing list
Hi; these are one liners.

procedure AdjustBorderSpace(var RemainingClientRect, CurBorderSpace: TRect;
   const Space: TRect);
begin
AdjustBorderSpace(RemainingClientRect,CurBorderSpace,Space.Left,Space.Top,
                     Space.Right,Space.Bottom);
end;

procedure ChangeBiDiModeAlignment(var Alignment: TAlignment);
begin
   case Alignment of
     taLeftJustify: Alignment := taRightJustify;
     taRightJustify: Alignment := taLeftJustify;
   end;
end;

function GetModalResultStr(ModalResult: TModalResult): ShortString;
begin
   Result := UITypes.ModalResultStr[ModalResult];
end;

function SendAppMessage(Msg: Cardinal; WParam: WParam; LParam: LParam):
Longint;
begin
   Result:=LCLProc.SendApplicationMessage(Msg,WParam,LParam);
end;

procedure MoveWindowOrg(dc: hdc; X, Y: Integer);
begin
   MoveWindowOrgEx(DC,X,Y);
end;

function FindDragTarget(const Position: TPoint; AllowDisabled: Boolean):
TControl;
begin
   Result := FindControlAtPosition(Position, AllowDisabled);
end;

function CursorToIdent(Cursor: Longint; var Ident: string): Boolean;
begin
   Result := IntToIdent(Cursor, Ident, CursorIdents);
end;

function IdentToCursor(const Ident: string; var Cursor: Longint): Boolean;
begin
   Result := IdentToInt(Ident, Cursor, CursorIdents);
end;

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LCL Controls.pp needs 'inline'

Free Pascal - Lazarus mailing list
I inlined the non-deprecated one liners in r62000.
BTW, ChangeBiDiModeAlignment is not a one liner. You must be careful
with "inline". The effect may become negative if the function has more
code.

Juha
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LCL Controls.pp needs 'inline'

Free Pascal - Lazarus mailing list
Am 06.10.19 um 10:45 schrieb Juha Manninen via lazarus:
> I inlined the non-deprecated one liners in r62000.
> BTW, ChangeBiDiModeAlignment is not a one liner. You must be careful
> with "inline". The effect may become negative if the function has more
> code.

For the record: FPC has also -Ooautoinline. IMO it is much better to use
(and tune) this one instead of adding manually "inline".
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus