Notes |
(0033519)
Sven Barth (reporter)
2010-01-08 20:51
|
A quick grep in RTL directory shows that there are some more locations where TTime is used, while a time_t was meant. I'll try to write a patch similiar to the attached one containing all TTime occurences... (it's my fault after all :P ) |
|
(0033520)
Sven Barth (reporter)
2010-01-08 21:29
|
Ok... I'll attach three patches:
* time_rtl.patch replaces all (Unix) TTime types in all RTLs with time_t (includes changes from time_impact.patch)
* time_users.patch replaces two TTime occurences in packages/users
* time_x11.patch: TTime is redefined in x.pp as culong (and used in all x11 units that use TTime). I only moved the PTime type defined there below the TTime declaration to be sure that the correct type is used. If you're sure that not the new System.TTime is used, you might ignore this patch |
|
(0033524)
Marco van de Voort (manager)
2010-01-09 16:39
edited on: 2010-01-09 16:43
|
This is no solution, since it possibly breaks heaps of headers.
When baseunix was conceived, there was a lot of pressure on me to define friendly pascal/Delphi styleguide T<x> identifiers for everything instead of c-like "time_t" likes.
I didn't know then that Delphi defined a similar type in system.
However if we are going to remove the baseunix stuff, I propose to come clean, and remove all T<X> friendly types, including TOFF etc.
|
|
(0033525)
Marco van de Voort (manager)
2010-01-09 17:12
|
I misunderstood apparantly, from Florian I understood it only goes for the "system unit" implementation scope.
Solved that by postponing aliasing ttime to time_t till unixtype, r14584
FreeBSD now cycles. |
|
(0033526)
Sven Barth (reporter)
2010-01-09 17:36
|
Also a way to solves this... :)
A little question regarding the PTime pointer in packages/X11/x.pp: Does it refer to the TTime defined directly below it or the TTime defined in system.pp? |
|
(0033527)
Marco van de Voort (manager)
2010-01-09 18:49
edited on: 2010-01-09 18:52
|
(Edited) I don't know what it does in such circumstances, since ttime is also defined within the same block. Something for the compiler guys.
But probably the whole principle is wrong. It should use the versions from baseunix as much as possible and not import its own.
Since this could break on (32-bit) systems where time_t is already 64-bit, UNLESS the x11 time_t type is independant from the system one.
|
|
(0033528)
Sven Barth (reporter)
2010-01-09 20:17
edited on: 2010-01-09 20:22
|
I don't think it should. The declaration of Time in X.h looks like this:
typedef CARD32 Time
So it's not the same as time_t. The use of the same type names is only in our sources.
Btw: Linux didn't cycle. There was a use of TTime inside system.pp (ossysc.inc)). I'll upload the patch once the cycle is complete.
Edit: patch uploaded. I also replaced the usage of PTime with the "more sane" ptime_t. Linux now cycles again.
|
|
(0033529)
Marco van de Voort (manager)
2010-01-09 23:03
|
Fixed that, and another one when compiling with -dFPC_USE_LIBC |
|
(0033542)
Marco van de Voort (manager)
2010-01-10 16:24
|
- Reversed x11 ttime/ptime.
- "users" is no problem since importing unix units with ttime in it overrides the system definition |
|