Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-06 Thread Bram Kuijvenhoven
Michael Van Canneyt wrote: I don't consider storing a pointer in the tag is broken code, it was considered the accepted way to maintain a pointer to your custom data from a standard control and there is often no simple alternative. Accepted only because there was no other way. The only

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-06 Thread Aleš Katona
The problem here is that if you introduce a changing type to Tag, you're going to break streaming of the components between various platforms. However I think simplest would be to simply make the tag something huge for years to come, like Int64. The idea with hidden union is nice tho. But you'll

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-06 Thread Burkhard Carstens
Am Mittwoch, 6. September 2006 11:05 schrieb Michael Van Canneyt: On Wed, 6 Sep 2006, Ale Katona wrote: The problem here is that if you introduce a changing type to Tag, you're going to break streaming of the components between various platforms. However I think simplest would be to simply

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Mattias Gaertner
On Mon, 4 Sep 2006 07:13:53 +0200 Martin Schreiber [EMAIL PROTECTED] wrote: On Monday 04 September 2006 02.55, Luiz Americo wrote: I'd like to propose change TComponent.Tag type from longint to PtrInt. I know it's not a good programing practice, but sometimes this property can be used to

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Daniël Mantione
Op Mon, 4 Sep 2006, schreef Mattias Gaertner: Me2. Just one disadvantage: The Tag is published. If someone stores a 64bit value and the component is stored, the stream can not be read under 32bit anymore. ...which makes it impossible to use streams for anything derived from Tcomponent,

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Vincent Snijders
Daniël Mantione schreef: Op Mon, 4 Sep 2006, schreef Mattias Gaertner: Me2. Just one disadvantage: The Tag is published. If someone stores a 64bit value and the component is stored, the stream can not be read under 32bit anymore. ...which makes it impossible to use streams for anything

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Mattias Gaertner
On Mon, 04 Sep 2006 11:56:06 +0200 Vincent Snijders [EMAIL PROTECTED] wrote: Daniël Mantione schreef: Op Mon, 4 Sep 2006, schreef Mattias Gaertner: Me2. Just one disadvantage: The Tag is published. If someone stores a 64bit value and the component is stored, the stream can

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Vincent Snijders
Daniël Mantione schreef: Op Mon, 4 Sep 2006, schreef Vincent Snijders: Daniël Mantione schreef: Op Mon, 4 Sep 2006, schreef Mattias Gaertner: Me2. Just one disadvantage: The Tag is published. If someone stores a 64bit value and the component is stored, the stream can not be read under

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Marc Weustink
Marc Weustink wrote: Michael Van Canneyt wrote: On Mon, 4 Sep 2006, peter green wrote: Me2. Just one disadvantage: The Tag is published. If someone stores a 64bit value and the component is stored, the stream can not be read under 32bit anymore. ...which makes it impossible to use

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Mattias Gaertner
On Mon, 04 Sep 2006 13:16:11 +0200 Vincent Snijders [EMAIL PROTECTED] wrote: Daniël Mantione schreef: Op Mon, 4 Sep 2006, schreef Vincent Snijders: Daniël Mantione schreef: Op Mon, 4 Sep 2006, schreef Mattias Gaertner: Me2. Just one disadvantage: The Tag is published. If

RE: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread peter green
...which makes it impossible to use streams for anything derived from Tcomponent, which is really a lot. I don't think we should break this feature to allow broken code to work. BTW even borland themselves seemed to promote its use for storing pointers from delphi 3 help: Tag has no

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-04 Thread Luiz Americo Pereira Camara
Daniël Mantione wrote: In 16 bit days it was considered acceptable to typecast pointers into records and just increase their offset. However, it was not portable. Making your code portable requires some effort. This kind of code is just one example of things you should not do in portable code.

RE: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-03 Thread peter green
I'd like to propose change TComponent.Tag type from longint to PtrInt. I know it's not a good programing practice, but sometimes this property can be used to hold pointers. In 32bit there's not many problems since pointer and longint have the same size, but the thing changes in 64 bit. The

Re: [fpc-devel] Propose: change TComponent.Tag from longint to PtrInt

2006-09-03 Thread Martin Schreiber
On Monday 04 September 2006 02.55, Luiz Americo wrote: I'd like to propose change TComponent.Tag type from longint to PtrInt. I know it's not a good programing practice, but sometimes this property can be used to hold pointers. In 32bit there's not many problems since pointer and longint have