[lazarus] copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
Hi,

Due to the previous discussion of copyright infringement in FPC code,
I downloaded a Similarity Tester (SIM 2.21) and ran it against a few
random selected files, comparing LCL to Kylix 3 source.

Oh my!!!   I found quite a bit of code that are marked as copied.  No,
I'm not talking about the class interfaces which are duplicated or
purpose.

Note:
This tool is automated and fast.  I'm sure _not_ everything it detects
are actual copied code, but it might be worth our while going through
it and verifying the code marked.
Rather be safe than sorry. Plus we can then say we tried to remove
infringed code from our side.


BTW:
   The tool can be downloaded from the following website.  It's for
MSDOS and Unix. I just compiled SIM 2.21 under Ubuntu 7.10 without
problems.
  http://www.cs.vu.nl/~dick/sim.html
  ftp://ftp.cs.vu.nl/pub/dick/similarity_tester

A quick way to get everything:  wget -nd
ftp://ftp.cs.vu.nl/pub/dick/similarity_tester/*



Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 Oh my!!!   I found quite a bit of code that are marked as copied.  No,
 I'm not talking about the class interfaces which are duplicated or
 purpose.



To prove this point, I attached the output of 'sim_pasc' comparing the
LCL's controls.pas to the Kylix 3 QControls.pas
Even some of the comments are identical!

See attached file for output:
  Line 5-30  (code looks the same)
  Line 60-69  (even comments are the same)
  Line 351-355 (code identical)
  ...etc...



Disclaimer:
There are many false positives!  I'm NOT accusing anybody of any
infringements as I don't know the history of each file and if portions
of the code possibly came from public domain.  I'm just saying it
might be worth a review.



Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/


controls.compared.gz
Description: GNU Zip compressed data


Re: copyright infringement in LCL code

2007-11-13 Thread Dave Coventry
On Nov 13, 2007 12:55 PM, Graeme Geldenhuys [EMAIL PROTECTED] wrote:
 To prove this point, I attached the output of 'sim_pasc' comparing the
 LCL's controls.pas to the Kylix 3 QControls.pas
 Even some of the comments are identical!

 See attached file for output:
   Line 5-30  (code looks the same)
   Line 60-69  (even comments are the same)
   Line 351-355 (code identical)
   ...etc...

Eeep!

Gosh, looks like we opened a can of worms here...

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] copyright infringement in LCL code

2007-11-13 Thread Marc Weustink

Graeme Geldenhuys wrote:

Hi,

Due to the previous discussion of copyright infringement in FPC code,
I downloaded a Similarity Tester (SIM 2.21) and ran it against a few
random selected files, comparing LCL to Kylix 3 source.

Oh my!!!   I found quite a bit of code that are marked as copied.  No,
I'm not talking about the class interfaces which are duplicated or
purpose.


Did you also skip the trivial implementations ?

I know for some parts I wrote myself that they are pretty similar to the 
way delphi had implemented them. Most smaller implementations of a given 
method can only be done in one efficient way. So it make's sense that 
they look equal.



Note:
This tool is automated and fast.  I'm sure _not_ everything it detects
are actual copied code, but it might be worth our while going through
it and verifying the code marked.
Rather be safe than sorry. Plus we can then say we tried to remove
infringed code from our side.


True. The most used pieces of delphi code I recognize, but not the from 
the bit more exotic areas.
We have also had one or two cases where code appeared to be similar, but 
only had a (important) difference in details.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Yury Sidorov

From: Graeme Geldenhuys [EMAIL PROTECTED]

On 13/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:


Oh my!!!   I found quite a bit of code that are marked as copied. 
No,

I'm not talking about the class interfaces which are duplicated or
purpose.




To prove this point, I attached the output of 'sim_pasc' comparing 
the

LCL's controls.pas to the Kylix 3 QControls.pas
Even some of the comments are identical!


It seems you compared QControls.pas to itself :)

File /opt/lazarus/lcl/controls.pas:  cannot open  0 tokens
File /home/graemeg/kylix3/source/clx/QControls.pas: 28925 tokens
Total: 28925 tokens

Yury. 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Dave Coventry [EMAIL PROTECTED] wrote:

 Gosh, looks like we opened a can of worms here...


We might just have!!  :-)



Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 13/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:

Oh my!!!   I found quite a bit of code that are marked as copied.  No,
I'm not talking about the class interfaces which are duplicated or
purpose.




To prove this point, I attached the output of 'sim_pasc' comparing the
LCL's controls.pas to the Kylix 3 QControls.pas
Even some of the comments are identical!

See attached file for output:
  Line 5-30  (code looks the same)
  Line 60-69  (even comments are the same)
  Line 351-355 (code identical)
  ...etc...


How should I read it ? Does the tool change variable/procedure names ?
(I can't imagine we're using a QWidget)

better not to use CLX sources, they are a bit different than VCL 
(besides the LCL predates CLX)



Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Marc Weustink [EMAIL PROTECTED] wrote:

 Did you also skip the trivial implementations ?


Yes, that's why I only listed 3 items in my previous email.  As I
mentioned, that tools isn't perfect and I don't think any automated
tool can be.  At least it highlights the good and bad. Hence the
reason a human needs to review the marked code to get rid of false
positives (which see to be the majority listed).

 method can only be done in one efficient way. So it make's sense that
 they look equal.

I'm not arguing that. I totally agree.. hence the reason I mentioned
'false positives'.



Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Marc Weustink [EMAIL PROTECTED] wrote:

 How should I read it ? Does the tool change variable/procedure names ?
 (I can't imagine we're using a QWidget)

The tool has a set of language rules which can be adjusted.  They
mentioned in the help that it searches for code patterns.

 better not to use CLX sources, they are a bit different than VCL
 (besides the LCL predates CLX)


I know, it was just a quick test to see how the program works and the
output it generates. The CLX code was all I had available, without
having to boot up my windows VMWare session and copy the Delphi 7
source over to Linux.  Though I'm sure CLX and VCL have a lot of
similar code anyway.

BTW:
  What does FreeCLX contain?  Is that public domain or still Borland copyright?



Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Dave Coventry
On Nov 13, 2007 1:19 PM, Marc Weustink [EMAIL PROTECTED] wrote:
 Did you really take look at the file ?

 Only in the case where there is a similarity in comments I've doubts
 (also note that this is from Kylix code, written after the LCl existed).
 All other are either mismatches or trivial implementations.

 Marc


I hope so!

I haven't looked at the file (except to glance over Graeme's comparison).

But I'm afraid that I was pretty high-handed with the blogger.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 Oops! Well spotted and my mistake.  I attached the new output.  Funny
 enough, most of those I mentioned are still marked. :)


At closer inspection, the program seems to switch between files (yeah,
sounds weird) and sometimes does a comparison against the same file.
This seems to be the case with the one where the comments are the
same.  My bad!  There are a bunch of parameters I can pass to the
program.  I'll read the man page to see if I can tell it not to
compare the same files.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Mattias Gaertner
On Tue, 13 Nov 2007 13:18:32 +0200
Crause, Christo (JC) [EMAIL PROTECTED] wrote:

  It seems you compared QControls.pas to itself :)
  
  File /opt/lazarus/lcl/controls.pas:  cannot open  0 tokens
  File /home/graemeg/kylix3/source/clx/QControls.pas: 28925 tokens
  Total: 28925 tokens
  
  Yury. 
 
 Indeed.  A quick look at the source of the left and right sections
 shows that the source code  is from the same file:
 
 /home/graemeg/kylix3/source/clx/QControls.pas: line
 2579-2605|/home/graemeg/kylix3/source/clx/QControls.pas: line
 2607-2633[132]

I did a quick test comparing VCL/Controls.pas with
lcl/include/control.inc.
It found only very short things. See attachment.


Mattias

File lazarus/lcl/include/control.inc: 18610 tokens
File Vcl/Controls.pas: 58794 tokens
Total: 77404 tokens

lazarus/lcl/include/control.inc: line 2382-2398|Vcl/Controls.pas: line 
3687-3699[84]
procedure TControl.SetName(const Value |procedure TControl.SetName(const Value
var|var
ChangeText: Boolean;   |ChangeText: Boolean;
begin  |begin
ChangeText := (csSetCaption in Control |ChangeText := (csSetCaption in Control
not (csLoading in ComponentState) and  |not (csLoading in ComponentState) and 
((Owner = nil) or not (Owner is TContr |((Owner = nil) or not (Owner is TContr
not (csLoading in TControl(Owner).Comp |not (csLoading in TControl(Owner).Comp
   |inherited SetName(Value);
inherited SetName(Value);  |if ChangeText then Text := Value;
if ChangeText then Text := Value;  |end;
end;   |
   |procedure TControl.SetClientSize(Value
{- |
{  TControl Show   |
{- |
procedure TControl.Show;   |

lazarus/lcl/include/control.inc: line 1007-1022|Vcl/Controls.pas: line 
4540-4552[59]
Function TControl.Perform(Msg:Cardinal |function TControl.Perform(Msg: Cardina
var|var
Message : TLMessage;   |Message: TMessage;
begin  |begin
Message.Msg := Msg;|Message.Msg := Msg;
Message.WParam := WParam;  |Message.WParam := WParam;
Message.LParam := LParam;  |Message.LParam := LParam;
Message.Result := 0;   |Message.Result := 0;
if Self  nil then WindowProc(Message |if Self  nil then WindowProc(Message
Result := Message.Result;  |Result := Message.Result;
end;   |end;
   |
{- |procedure TControl.CalcDockSizes;
TControl.GetClientOrigin   |
-- |
function TControl.GetClientOrigin: TPo |

lazarus/lcl/include/control.inc: line 596-606|Vcl/Controls.pas: line 
5090-5100[55]
function TControl.IsHelpKeyWordStored: |function TControl.IsCaptionStored: Boo
begin  |begin
Result := (ActionLink = nil) or not Ac |Result := (ActionLink = nil) or not Ac
end;   |end;
   |
function TControl.IsOnClickStored: Boo |function TControl.IsEnabledStored: Boo
begin  |begin
Result := (ActionLink = nil) or not Ac |Result := (ActionLink = nil) or not Ac
end;   |end;
   |
function TControl.IsShowHintStored: Bo |function TControl.IsHintStored: Boolea

lazarus/lcl/include/control.inc: line 1044-1056|Vcl/Controls.pas: line 
3597-3606[55]
Function TControl.ScreenToClient(const |function TControl.ScreenToClient(const
var|var
P : TPoint;|Origin: TPoint;
begin  |begin
P := ClientOrigin; |Origin := ClientOrigin;
Result.X := APoint.X - P.X;|Result.X := Point.X - Origin.X;
Result.Y := APoint.Y - P.Y;|Result.Y := Point.Y - Origin.Y;
end;   |end;
   |
{- |procedure TControl.SendCancelMode(Send
Function TControl.ClientToScreen(const |
-- |
Function TControl.ClientToScreen(const |

lazarus/lcl/include/control.inc: line 1056-1068|Vcl/Controls.pas: line 
3588-3597[52]
Function TControl.ClientToScreen(const |function TControl.ClientToScreen(const
var|var
P : TPoint;|Origin: TPoint;
begin  |begin
P := ClientOrigin; |Origin := ClientOrigin;
Result.X := APoint.X + P.X;|Result.X := Point.X + Origin.X;
Result.Y := APoint.Y + P.Y;|Result.Y := Point.Y + Origin.Y;
end;   

Re: copyright infringement in LCL code

2007-11-13 Thread Mattias Gaertner
On Tue, 13 Nov 2007 13:33:10 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 On 13/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:
 
  Oops! Well spotted and my mistake.  I attached the new output.
  Funny enough, most of those I mentioned are still marked. :)
 
 
 At closer inspection, the program seems to switch between files (yeah,
 sounds weird) and sometimes does a comparison against the same file.
 This seems to be the case with the one where the comments are the
 same.  My bad!  There are a bunch of parameters I can pass to the
 program.  I'll read the man page to see if I can tell it not to
 compare the same files.

RTFM

./sim_pasc -s -f -F


Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Mattias Gaertner [EMAIL PROTECTED] wrote:

 RTFM

 ./sim_pasc -s -f -F


heheh... Justed noticed that bit of information myself.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 At closer inspection, the program seems to switch between files (yeah,
 sounds weird) and sometimes does a comparison against the same file.

OK, I get it now.  The program can test for code duplicates in the
same file as well. (this could be quite handy for my own work).  You
have to explicitly tell it not to compare a file against itself.

The new results seem much better!!

Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: copyright infringement in LCL code

2007-11-13 Thread Sergio Samayoa
File /opt/lazarus/lcl/controls.pas:  cannot open  0 tokens

File /home/graemeg/kylix3/source/clx/QControls.pas: 28925 tokens

Total: 28925 tokens

 



Re: copyright infringement in LCL code

2007-11-13 Thread Graeme Geldenhuys
On 13/11/2007, Sergio Samayoa [EMAIL PROTECTED] wrote:

 File /opt/lazarus/lcl/controls.pas:  cannot open  0 tokens
 File /home/graemeg/kylix3/source/clx/QControls.pas: 28925
 tokens


I know, read the rest of the thread.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Bogusław Brandys

Graeme Geldenhuys wrote:

On 13/11/2007, Mattias Gaertner [EMAIL PROTECTED] wrote:

RTFM

./sim_pasc -s -f -F



heheh... Justed noticed that bit of information myself.


Regards,
  - Graeme -





Please provide updated results with command line options mentioned 
above.I have no access to delphi or kylix sources like many others 
probably (well,I have them partially because I have delphi 5 std but 
I've never looked inside them)



Kind regards
Boguslaw Brandys

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: copyright infringement in LCL code

2007-11-13 Thread Mattias Gaertner
On Tue, 13 Nov 2007 14:29:10 +0100
Bogusław Brandys [EMAIL PROTECTED] wrote:

 Graeme Geldenhuys wrote:
  On 13/11/2007, Mattias Gaertner [EMAIL PROTECTED] wrote:
  RTFM
 
  ./sim_pasc -s -f -F
  
  
  heheh... Justed noticed that bit of information myself.
  
  
  Regards,
- Graeme -
  
  
 
 
 Please provide updated results with command line options mentioned 
 above.I have no access to delphi or kylix sources like many others 
 probably (well,I have them partially because I have delphi 5 std but 
 I've never looked inside them)

I sent an example. Search this thread.

Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives