Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-09

LCL Controls.pp needs 'inline'

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

AlexeyT

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

Reply by email

Juha Manninen
to AlexeyT

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

Reply by email

Florian Klämpfl
to Juha Manninen
Juha Manninen wrote
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".

Reply by email