[fpc-devel] Patches

Adem listmember at letterboxes.org
Thu Sep 30 17:36:03 CEST 2010


  On 2010-09-30 18:07, Michael Van Canneyt wrote:
>> Actually, if I were DoDi, I'd probably bring all those units (that do 
>> nothing but declare various types and constants) in the uses secions 
>> of globals.pas into globals.pas. I don't see why bringing together 
>> all the globals together should make everything dependent on 
>> everything else; after all 'globals' are those variables/routines 
>> that are common to all.
>  I think there is a misunderstanding: 'global variables' <> 'globals'.
True. 'Globals' include 'global variables', structures and routines.
> He meant variables that are not part of an object, but declared as a unit
> variable. If you put all such 'global' variables in 1 unit, you do 
> drag in all the original units, if the variables are typed.
I checked the following units used in globals.pas.

   -- version.pas
   Uses no external units. Comprises of a few type/constant declarations.

   -- globtype.pas
   Uses no external units. Comprises of a few type/constant declarations.

   -- systems.pas
    Uses some external units, all except one is already used in globals.pas.
    The only extra unit is {$ifdef FreeBSD},SysCtl,{$endif} which could 
easily be added to the uses section (or the body) of globals.pas.

   -- cpuinfo.pas
    Uses no external units. Comprises of a few type/constant declarations.

IOW, all these units could be combined into globals.pas

[ Curious: Why does every unit here has .pas extension but SysCtl ( .pp 
extension)? ]

Cheers,
Adem




More information about the fpc-devel mailing list