[Lazarus] Errors in win32winapi.inc and elsewhere spotted by compiler

Juha Manninen juha.manninen62 at gmail.com
Tue Mar 24 19:06:49 CET 2015


Hi

I fixed lots of uninitialized variables based on compiler warnings in
r48476 - r484782.
I also added some ToDo items for things I could not fix.
I would need help for the ToDo items especially in LCL-Win32 code. I
know there are people here who know that code.
In win32winapi.inc there are 3 ToDos :

In function TWin32WidgetSet.Frame3D
there is :
  // ToDo: Fix Result and the loop. "I" is not used for anything.
  for I := 0 to FrameWidth - 1 do
    Result := Boolean(DrawEdge(DC, ARect, Edge[Style], BF_RECT or BF_ADJUST));

In function TWin32WidgetSet.StretchMaskBlt
there is :
  // check if the Src has an alpha channel
  Bmp := Windows.GetCurrentObject(SrcDC, OBJ_BITMAP);
  // get info
  // ToDo: WinBmp is not initialized at all. Should it be initialized from Bmp?
  HasAlpha := (Windows.GetObject(bmp, SizeOf(WinBmp), @WinBmp) <> 0)
          and (WinBmp.bmBitsPixel = 32)
          and CreatePremultipliedBitmap(WinBmp, Bmp, AlphaBmp);

and later:
    // ToDo: Initialize AlphaDC, AlphaObj and Blend.

Other fixes are welcome, too.

Regards,
Juha




More information about the Lazarus mailing list