Re: [fpc-devel] I can NOT install the fpbuild trank make deb packages
Hi, please try this as root /usr/sbin/update-alternatives --remove pc /usr/bin/fpc and retry to install. thx kisda J. Peter Mugaas wrote: I was using the make deb from the fpcbuild trunk and I am able to generate the .deb files for installation. But now, I get another error when installing the FreePascal Debian packages. Selecting previously deselected package fp-compiler. (Reading database ... 434508 files and directories currently installed.) Unpacking fp-compiler (from fp-compiler_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-docs. Unpacking fp-docs (from fp-docs_2.1.1-20060724_all.deb) ... Selecting previously deselected package fp-ide. Unpacking fp-ide (from fp-ide_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-base. Unpacking fp-units-base (from fp-units-base_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-db. Unpacking fp-units-db (from fp-units-db_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-fcl. Unpacking fp-units-fcl (from fp-units-fcl_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-fv. Unpacking fp-units-fv (from fp-units-fv_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-gfx. Unpacking fp-units-gfx (from fp-units-gfx_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-gnome1. Unpacking fp-units-gnome1 (from fp-units-gnome1_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-gtk. Unpacking fp-units-gtk (from fp-units-gtk_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-gtk2. Unpacking fp-units-gtk2 (from fp-units-gtk2_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-misc. Unpacking fp-units-misc (from fp-units-misc_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-net. Unpacking fp-units-net (from fp-units-net_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-units-rtl. Unpacking fp-units-rtl (from fp-units-rtl_2.1.1-20060724_i386.deb) ... Selecting previously deselected package fp-utils. Unpacking fp-utils (from fp-utils_2.1.1-20060724_i386.deb) ... Setting up fp-docs (2.1.1-20060724) ... Setting up fp-units-rtl (2.1.1-20060724) ... Setting up fp-utils (2.1.1-20060724) ... Setting up fp-compiler (2.1.1-20060724) ... update-alternatives: slave link name /usr/share/man/man1/pc.1.gz duplicated dpkg: error processing fp-compiler (--install): subprocess post-installation script returned error exit status 2 Setting up fp-ide (2.1.1-20060724) ... Setting up fp-units-base (2.1.1-20060724) ... Setting up fp-units-db (2.1.1-20060724) ... Setting up fp-units-fcl (2.1.1-20060724) ... Setting up fp-units-fv (2.1.1-20060724) ... Setting up fp-units-gfx (2.1.1-20060724) ... Setting up fp-units-gtk (2.1.1-20060724) ... Setting up fp-units-gtk2 (2.1.1-20060724) ... Setting up fp-units-misc (2.1.1-20060724) ... Setting up fp-units-net (2.1.1-20060724) ... Setting up fp-units-gnome1 (2.1.1-20060724) ... Errors were encountered while processing: fp-compiler signature.asc Description: OpenPGP digital signature ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] debian patch for fpcbuild
Stefan Kisdaroczi wrote: not needed: control is created from control.in by script fixdeb like all *.in files outdated: amd64 arch is missing, but is in control.in Micha ? Am i wrong ? What about the others files ? Hmm, dpkg-buildpackage needs a control file before it will run the rules script, which only then runs fixdeb. A bit of a chicken-and-egg problem. OTOH, 'make deb' indeed doesn't need it. Micha ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] debian patch for fpcbuild
Stefan Kisdaroczi wrote: === --- install/debian/copyright.in (revision 144) +++ install/debian/copyright.in (working copy) @@ -5,8 +5,7 @@ Carlos Laviola [EMAIL PROTECTED] Strange, this file doesn't exist in my copy: I only have a copyright file. Micha ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] debian patch for fpcbuild
Micha Nelissen schrieb: Stefan Kisdaroczi wrote: not needed: control is created from control.in by script fixdeb like all *.in files outdated: amd64 arch is missing, but is in control.in Micha ? Am i wrong ? What about the others files ? Hmm, dpkg-buildpackage needs a control file before it will run the rules script, which only then runs fixdeb. A bit of a chicken-and-egg problem. OTOH, 'make deb' indeed doesn't need it. thx for the explanation. so removing the control file is wrong, sorry. Micha ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel signature.asc Description: OpenPGP digital signature ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] InflateRect() not cross-platform
On Tue, 25 Jul 2006, Graeme Geldenhuys wrote: Hi, Any reason why there isn't a cross-platfrom InflateRect() function in the RTL? It only appears in the Windows API translations and is a very handly funtion to have. For those that don't know InflateRect(): Usage: InflateRect(Rect, 1, 1); InflateRect(Rect, -2, -2); You can enlarge/shrink the X and Y co-ordinates of a TRect using this function. Well, feel free to implement it. We'll put it in types.pas, together with the other TRect functions. Michael. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] InflateRect() not cross-platform
Well, feel free to implement it. We'll put it in types.pas, together with the other TRect functions. Excellent. I just needed the location where it should go. Thanks Regards, Graeme. -- There's no place like 127.0.0.1 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] InflateRect() not cross-platform
You can enlarge/shrink the X and Y co-ordinates of a TRect using this function. Well, feel free to implement it. We'll put it in types.pas, together with the other TRect functions. I see there is already such a function, just with a different name: OffsetRect() I guess there is no need to add InflateRect() now... Graeme. -- There's no place like 127.0.0.1 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] InflateRect() not cross-platform
Graeme Geldenhuys wrote: I see there is already such a function, just with a different name: OffsetRect() I guess there is no need to add InflateRect() now... Offset is for position, Inflate is for size. AFAIK. Micha ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] InflateRect() not cross-platform
On Tue, 25 Jul 2006, Micha Nelissen wrote: Graeme Geldenhuys wrote: I see there is already such a function, just with a different name: OffsetRect() I guess there is no need to add InflateRect() now... Offset is for position, Inflate is for size. AFAIK. Correct. Michael. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] Size() function
Would there be a use for these funtions in the Types.pas unit? They do what Point() does for TPoint... function Size(AWidth, AHeight: Integer): TSize; function Size(ARect: TRect): TSize; Regards, Graeme. -- There's no place like 127.0.0.1 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Size() function
On Tue, 25 Jul 2006, Graeme Geldenhuys wrote: Would there be a use for these funtions in the Types.pas unit? They do what Point() does for TPoint... function Size(AWidth, AHeight: Integer): TSize; function Size(ARect: TRect): TSize; You mean it would compute the surface size ? Michael. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Size() function
Would there be a use for these funtions in the Types.pas unit? They do what Point() does for TPoint... function Size(AWidth, AHeight: Integer): TSize; function Size(ARect: TRect): TSize; You mean it would compute the surface size ? They return a TSize record, same as Point() returns a TPoint record. I don't know why Size() wasn't included in the first place and Point() Rect() was? - function Size(AWidth, AHeight: Integer): TSize; begin Result.cx := AWidth; Result.cy := AHeight; end; function Size(ARect: TRect): TSize; begin Result.cx := ARect.Right - ARect.Left; Result.cy := ARect.Bottom - ARect.Top; end; - I also have a few arithmetic operator functions that work against TPoint, TSize and TRect so you can compare for example two TSize records against each other, etc... operator = (const ASize1, ASize2: TSize) b: Boolean; operator + (const APoint1, APoint2: TPoint) p: TPoint; operator + (const APoint: TPoint; ASize: TSize) p: TPoint; operator + (const ASize: TSize; APoint: TPoint) s: TSize; operator + (const ASize1, ASize2: TSize) s: TSize; operator + (const APoint: TPoint; i: Integer) p: TPoint; operator + (const ASize: TSize; i: Integer) s: TSize; operator - (const APoint1, APoint2: TPoint) p: TPoint; operator - (const APoint: TPoint; i: Integer) p: TPoint; operator - (const ASize: TSize; const APoint: TPoint) s: TSize; operator - (const ASize: TSize; i: Integer) s: TSize; [...] Graeme. -- There's no place like 127.0.0.1 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] patch for whatsnew.txt
hi, repos fpcbuild: trunk and fixes_2_0, install/doc/whatsnew.txt Improved data base support and Improved database support means the same i think... kisda Index: whatsnew.txt === --- whatsnew.txt(Revision 153) +++ whatsnew.txt(Arbeitskopie) @@ -38,7 +38,6 @@ FCL: * Lot of small bugs and compatibility fixes - * Improved data base support * Improved database support * The sqlitedataset, interbase, fpodbc, ddg, mysqldb3 and mysqldb4 units are obsolete and replaced by the sqldb components signature.asc Description: OpenPGP digital signature ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] [patch] types.pp - InflateRect() Size()
Hi, Attached is a patch for the types.pp unit. I also include some Unit Tests for InflateRect() function in a separate file (uses fpcUnit) by wasn't sure how or where to incorporate them. The patch needs to be applied in the root FPC source directory. Changes: * Added a new InflateRect() function, which does the same as the Windows API call, but is cross-platform. * Added two Size() functions with different parameters that return a TSize record. It works the same as the Point() function that returns a TPoint record. Regards, Graeme. -- There's no place like 127.0.0.1 Index: rtl/objpas/types.pp === --- rtl/objpas/types.pp (revision 4294) +++ rtl/objpas/types.pp (working copy) @@ -263,7 +263,11 @@ function IsRectEmpty(const Rect : TRect) : Boolean; function OffsetRect(var Rect : TRect;DX : Integer;DY : Integer) : Boolean; function CenterPoint(const Rect: TRect): TPoint; +function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; +function Size(AWidth, AHeight: Integer): TSize; +function Size(ARect: TRect): TSize; + implementation @@ -391,5 +395,36 @@ end; +function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; +begin + if Assigned(@Rect) then + begin +with Rect do +begin + dec(Left, dx); + dec(Top, dy); + inc(Right, dx); + inc(Bottom, dy); +end; +Result := True; + end + else +Result := False; +end; + +function Size(AWidth, AHeight: Integer): TSize; +begin + Result.cx := AWidth; + Result.cy := AHeight; +end; + + +function Size(ARect: TRect): TSize; +begin + Result.cx := ARect.Right - ARect.Left; + Result.cy := ARect.Bottom - ARect.Top; +end; + + end. unit InfateRectTest; {$mode objfpc}{$H+} interface uses Classes, SysUtils, fpcunit, testregistry; type TTestInflateRect= class(TTestCase) private FRect: TRect; protected procedure SetUp; override; published procedure InflateOne; procedure InflateTwo; procedure InflateNegativeOne; procedure InflateNegativeTwo; procedure InflateMixed1; procedure InflateMixed2; procedure InflateLarge; procedure TestResult; end; implementation uses Types; procedure TTestInflateRect.SetUp; begin FRect.TopLeft := Point(10, 10); FRect.BottomRight := Point(50, 50); end; procedure TTestInflateRect.InflateOne; begin InflateRect(FRect, 1, 1); AssertEquals('Failed on 1', 9, FRect.Left); {x1} AssertEquals('Failed on 2', 9, FRect.Top); {y1} AssertEquals('Failed on 3', 51, FRect.Right); {x2} AssertEquals('Failed on 4', 51, FRect.Bottom);{y2} end; procedure TTestInflateRect.InflateTwo; begin InflateRect(FRect, 2, 2); AssertEquals('Failed on 1', 8, FRect.Left); {x1} AssertEquals('Failed on 2', 8, FRect.Top); {y1} AssertEquals('Failed on 3', 52, FRect.Right); {x2} AssertEquals('Failed on 4', 52, FRect.Bottom);{y2} Setup; { Reset Rectangle } InflateRect(FRect, 1, 2); AssertEquals('Failed on 1', 9, FRect.Left); {x1} AssertEquals('Failed on 2', 8, FRect.Top); {y1} AssertEquals('Failed on 3', 51, FRect.Right); {x2} AssertEquals('Failed on 4', 52, FRect.Bottom);{y2} end; procedure TTestInflateRect.InflateNegativeOne; begin InflateRect(FRect, -1, -1); AssertEquals('Failed on 1', 11, FRect.Left); {x1} AssertEquals('Failed on 2', 11, FRect.Top); {y1} AssertEquals('Failed on 3', 49, FRect.Right); {x2} AssertEquals('Failed on 4', 49, FRect.Bottom);{y2} end; procedure TTestInflateRect.InflateNegativeTwo; begin InflateRect(FRect, -2, -2); AssertEquals('Failed on 1', 12, FRect.Left); {x1} AssertEquals('Failed on 2', 12, FRect.Top); {y1} AssertEquals('Failed on 3', 48, FRect.Right); {x2} AssertEquals('Failed on 4', 48, FRect.Bottom);{y2} Setup; { Reset Rectangle } InflateRect(FRect, -1, -2); AssertEquals('Failed on 1', 11, FRect.Left); {x1} AssertEquals('Failed on 2', 12, FRect.Top); {y1} AssertEquals('Failed on 3', 49, FRect.Right); {x2} AssertEquals('Failed on 4', 48, FRect.Bottom);{y2} end; procedure TTestInflateRect.InflateMixed1; begin InflateRect(FRect, 0, -2); AssertEquals('Failed on 1', 10, FRect.Left); {x1} AssertEquals('Failed on 2', 12, FRect.Top); {y1} AssertEquals('Failed on 3', 50, FRect.Right); {x2} AssertEquals('Failed on 4', 48, FRect.Bottom);{y2} end; procedure TTestInflateRect.InflateMixed2; begin InflateRect(FRect, -2, 0); AssertEquals('Failed on 1', 12, FRect.Left); {x1} AssertEquals('Failed on 2', 10, FRect.Top); {y1} AssertEquals('Failed on 3', 48, FRect.Right); {x2} AssertEquals('Failed on 4', 50, FRect.Bottom);{y2} end; procedure TTestInflateRect.InflateLarge; begin InflateRect(FRect, 20, 0); AssertEquals('Failed on 1', -10, FRect.Left); {x1} AssertEquals('Failed on 2',
[fpc-devel] Inlining functions...
Hi, some questions: 1) Is there some good reason why the support for the inline keyword can be turned on and off explicitely by the {$INLINE} directive? 2) Can I check somehow if inlining is enabled during compilation? {$IFOPT INLINE} didn't work. ;) 2a) If the answer to 2) is no, can we make the compiler to ignore it like the far keyword? It's because, I'm quite used to the fact that inline is merely a suggestion to the compiler, not taken as a command to be obeyed all times. Vinzent. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] InflateRect() not cross-platform
If you are using Lazarus, Just include LCLIntf unit. Jesus Reyes A. I can't use the LCL. The project I am working on is a new cross-platform widget set written in FPC. Either way, no reason such a handy function shouldn't be in FPC for all platforms. Regards, Graeme. -- There's no place like 127.0.0.1 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Inlining functions...
At 16:56 25-7-2006, you wrote: Hi, some questions: 1) Is there some good reason why the support for the inline keyword can be turned on and off explicitely by the {$INLINE} directive? Historical 2) Can I check somehow if inlining is enabled during compilation? {$IFOPT INLINE} didn't work. ;) You can't test it. Also the inline is only a hint for the compiler. 2a) If the answer to 2) is no, can we make the compiler to ignore it like the far keyword? It's because, I'm quite used to the fact that inline is merely a suggestion to the compiler, not taken as a command to be obeyed all times. What to ignore? Peter ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel