Delphi XE2 Update2: DCC Warning in TeCanvas.pas

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Tom
Newbie
Newbie
Posts: 4
Joined: Wed Oct 05, 2011 12:00 am

Delphi XE2 Update2: DCC Warning in TeCanvas.pas

Post by Tom » Wed Nov 23, 2011 11:20 am

Hello

When compiling the new version (2011.04.41118) in Win32-bit mode I get a warning in TeCanvas.pas
Could you remove this warning in the next release?

Best regards
Tom

Code: Select all

[DCC Warning] VCLTee.TeCanvas.pas(7623): W1036 Variable 'tmpRes' might not have been initialized
It is on the line 'Assert(tmpRes,'Error transferring internal Bitmap using BitBlt');' in this code:

Code: Select all

Procedure TTeeCanvas3D.TransferBitmap(ALeft,ATop:Integer; ACanvas:TCanvas);
{$IFNDEF FMX}
{$IFOPT C+}
var tmpRes : LongBool;
{$ENDIF}
{$ENDIF}
begin
  {$IFNDEF CLX}

  {$IFDEF MONITOR_REPAINTS}
  Inc(TeeMonitor);
  FBitmap.Canvas.TextOut(0,0,IntToStr(TeeMonitor));
  {$ENDIF}

//  Assert(FBitmap.PixelFormat=pfDevice,'Buffer Bitmap PixelFormat <> pfDevice');

  {$IFDEF LCL}
  ACanvas.Draw(ALeft, ATop, FBitmap);
  {$ELSE}

  {$IFDEF FMX}
  {$ELSE}

  if View3DOptions.Parent.Parent<>nil then
  {$IFOPT C+}
  tmpRes:=
  {$ENDIF}
  BitBlt( ACanvas.Handle,ALeft,ATop,
          FBitmap.Width,
          FBitmap.Height,
          FBitmap.Canvas.Handle,0,0,SRCCOPY);

  {$IFOPT C+}
  {$IFNDEF TEEOCX}
  Assert(tmpRes,'Error transferring internal Bitmap using BitBlt');
  {$ENDIF}
  {$ENDIF}
  {$ENDIF}
  {$ENDIF}

  {$ELSE}
  QPainter_drawPixmap(ACanvas.Handle, ALeft, ATop, FBitmap.Handle, 0, 0,
    FBitmap.Width, FBitmap.Height);
  {$ENDIF}
end;

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Delphi XE2 Update2: DCC Warning in TeCanvas.pas

Post by Yeray » Thu Nov 24, 2011 8:19 am

Hi Tom,

Yes, we are aware of this warning. As you've probably seen looking at the conditions, this variable won't be used without being defined. But anyway, we'll try to clean the warning messages in future releases.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Tom
Newbie
Newbie
Posts: 4
Joined: Wed Oct 05, 2011 12:00 am

Re: Delphi XE2 Update2: DCC Warning in TeCanvas.pas

Post by Tom » Fri Nov 25, 2011 7:05 am

Hi Yeray,
But anyway, we'll try to clean the warning messages in future releases.
thank you.

In the mean time I suppress the warning by adding the following code at the beginning of the method:

Code: Select all

...
begin
  {$IFNDEF CLX}
// changes start
  {$IFOPT C+}
  tmpRes:= False;
  {$ENDIF}
// changes end
  ...
Best regards
Tom

Post Reply