Recent

Author Topic: [BUG] after SVN versionS (svn fpc2.7.1 & svn lazarus)  (Read 3486 times)

freeman35

  • Jr. Member
  • **
  • Posts: 92
[BUG] after SVN versionS (svn fpc2.7.1 & svn lazarus)
« on: January 04, 2013, 12:11:11 pm »
/lazpaint-code$ svn update
Updating '.':
At revision 447.

~/lazpaint-code/bgrabitmap/bgracanvas.pas(437,13) Error: Incompatible types: got "TFPPenEndCap" expected "TPenEndCap"

error is:  in
constructor TBGRAPen.Create;
...
EndCap := pecRound;

When ctrl + Left click on EndCap goto "EndCap: TPenEndCap;"  This is difinition in BGRACanvas.
When ctrl + Left click on pecRound goto
/fpcsource/packages/fcl-images/src/FPcanvas.pp
line 117
TFPPenEndCap = (
    pecRound,
    pecSquare,
    pecFlat

  );             
---------
But in /lazarus/lcl/graphics.pp
line 576
// pen end caps. valid only for geometric pens
  TPenEndCap = (
    pecRound,
    pecSquare,
    pecFlat

  );

Yes type name is diferent, but set of element name is same and compiler give error.

~/lazpaint-code/bgrabitmap/bgracanvas.pas(438,16) Error: Incompatible types: got "TFPPenJoinStyle" expected "TPenJoinStyle"
same problem
TPenJoinStyle  &  TFPPenJoinStyle

TFPPenJoinStyle = (
    pjsRound,
    pjsBevel,
    pjsMiter
  );

My idea is,  this error compiler and/or IDE site :) 'cos Type name is diferent, it has to be, but name of element name haveto diferent too.

My suggestion one inc file and all types and variables difinitions (ofcource just globals) be in this inc file, so everyone know and easy find variable and names, and write small info each one


[HOW TO FIX this error]
in BGRACanvas  line 8 (uses area)
  Classes, SysUtils, Graphics, GraphType, Types, FPImage, FPCanvas, BGRABitmapTypes;//old
  Classes, SysUtils, FPCanvas, Graphics, GraphType, Types, FPImage, BGRABitmapTypes;// new

just change place "FPCanvas," haveto before "Graphics," :)
« Last Edit: January 04, 2013, 12:14:20 pm by freeman35 »

circular

  • Hero Member
  • *****
  • Posts: 4471
    • Personal webpage
Re: [BUG] after SVN versionS (svn fpc2.7.1 & svn lazarus)
« Reply #1 on: January 04, 2013, 05:32:20 pm »
Ok. It's changed on subversion.

Quote
My suggestion one inc file and all types and variables difinitions (ofcource just globals) be in this inc file, so everyone know and easy find variable and names, and write small info each one
What do you mean by that?
Conscience is the debugger of the mind

freeman35

  • Jr. Member
  • **
  • Posts: 92
Re: [BUG] after SVN versionS (svn fpc2.7.1 & svn lazarus)
« Reply #2 on: January 04, 2013, 10:09:40 pm »
I mean, if more files will use project or component set, some times use type const var etc. definition needed. My idea is, all this definition in one file and extention be .inc (examp. globalVars.inc ) you know .inc mean included. when you need to use global definition, just add globalVars.inc to uses.
And acually people (I'm too :) ) just write code and no any info, two days later forget why I wrote :D
I hope I translate my idea.

 

TinyPortal © 2005-2018