Przeglądaj źródła

Resolving compiler warning by inlining function that is called only once since c42123f5

Source commit: 38375a652737afd2263277f1e3a10ac9d7492bdd
Martin Prikryl 11 miesięcy temu
rodzic
commit
f97dc3d402
1 zmienionych plików z 5 dodań i 11 usunięć
  1. 5 11
      source/windows/VCLCommon.cpp

+ 5 - 11
source/windows/VCLCommon.cpp

@@ -852,21 +852,21 @@ static void __fastcall AfterMonitorDpiChanged(void * AData, TObject * Sender, in
   }
 }
 //---------------------------------------------------------------------------
-inline void __fastcall DoFormWindowProc(TCustomForm * Form, TWndMethod WndProc,
-  TMessage & Message)
+static void __fastcall FormWindowProc(void * Data, TMessage & Message)
 {
-  TForm * AForm = dynamic_cast<TForm *>(Form);
+  TForm * AForm = static_cast<TForm *>(Data);
   DebugAssert(AForm != NULL);
+  TWndMethod WndProc = ControlWndProc(AForm);
   if (Message.Msg == WM_SYSCOMMAND)
   {
     if (Message.WParam == SC_CONTEXTHELP)
     {
-      FormHelp(Form);
+      FormHelp(AForm);
       Message.Result = 1;
     }
     else if (Message.WParam == SC_MINIMIZE)
     {
-      GetFormCustomizationComponent(AForm)->WindowStateBeforeMimimize = Form->WindowState;
+      GetFormCustomizationComponent(AForm)->WindowStateBeforeMimimize = AForm->WindowState;
       WndProc(Message);
     }
     else
@@ -914,12 +914,6 @@ inline void __fastcall DoFormWindowProc(TCustomForm * Form, TWndMethod WndProc,
   }
 }
 //---------------------------------------------------------------------------
-static void __fastcall FormWindowProc(void * Data, TMessage & Message)
-{
-  TCustomForm * Form = static_cast<TCustomForm *>(Data);
-  DoFormWindowProc(Form, ControlWndProc(Form), Message);
-}
-//---------------------------------------------------------------------------
 void __fastcall InitializeSystemSettings()
 {
 }