* More changes for operator bug

Order_overloaded method removed because it conflicted with
    new implementation where the defs are ordered
    according to the unit loading order !
This commit is contained in:
pierre 2000-04-26 08:54:18 +00:00
parent 25d48db77a
commit 3174b39bcc
5 changed files with 63 additions and 12 deletions

View File

@ -785,9 +785,6 @@ unit pmodules;
end; end;
hp:=pused_unit(hp^.next); hp:=pused_unit(hp^.next);
end; end;
{$ifndef DONOTCHAINOPERATORS}
symtablestack^.chainoperators;
{$endif DONOTCHAINOPERATORS}
aktprocsym:=oldprocsym; aktprocsym:=oldprocsym;
end; end;
@ -1164,6 +1161,10 @@ unit pmodules;
unitst^.next:=symtablestack; unitst^.next:=symtablestack;
symtablestack:=unitst; symtablestack:=unitst;
{$ifndef DONOTCHAINOPERATORS}
symtablestack^.chainoperators;
{$endif DONOTCHAINOPERATORS}
{$ifdef DEBUG} {$ifdef DEBUG}
test_symtablestack; test_symtablestack;
{$endif DEBUG} {$endif DEBUG}
@ -1490,6 +1491,10 @@ unit pmodules;
if token=_USES then if token=_USES then
loadunits; loadunits;
{$ifndef DONOTCHAINOPERATORS}
symtablestack^.chainoperators;
{$endif DONOTCHAINOPERATORS}
{ reset ranges/stabs in exported definitions } { reset ranges/stabs in exported definitions }
reset_global_defs; reset_global_defs;
@ -1668,7 +1673,13 @@ unit pmodules;
end. end.
{ {
$Log$ $Log$
Revision 1.189 2000-04-25 23:55:30 pierre Revision 1.190 2000-04-26 08:54:18 pierre
* More changes for operator bug
Order_overloaded method removed because it conflicted with
new implementation where the defs are ordered
according to the unit loading order !
Revision 1.189 2000/04/25 23:55:30 pierre
+ Hint about unused unit + Hint about unused unit
* Testop bug fixed !! * Testop bug fixed !!
Now the operators are only applied if the unit is explicitly loaded Now the operators are only applied if the unit is explicitly loaded

View File

@ -264,15 +264,17 @@ begin
aktprocsym:=new(pprocsym,init(sp)); aktprocsym:=new(pprocsym,init(sp));
{ for operator we have only one definition for each overloaded { for operator we have only one definition for each overloaded
operation } operation }
{$ifdef DONOTCHAINOPERATORS}
if (options=potype_operator) then if (options=potype_operator) then
begin begin
{ the only problem is that nextoverloaded might not be in a unit { the only problem is that nextoverloaded might not be in a unit
known for the unit itself } known for the unit itself }
{ not anymore PM }
if assigned(overloaded_operators[optoken]) then if assigned(overloaded_operators[optoken]) then
aktprocsym^.definition:=overloaded_operators[optoken]^.definition; aktprocsym^.definition:=overloaded_operators[optoken]^.definition;
end; {$ifndef DONOTCHAINOPERATORS}
overloaded_operators[optoken]:=aktprocsym;
{$endif DONOTCHAINOPERATORS} {$endif DONOTCHAINOPERATORS}
end;
symtablestack^.insert(aktprocsym); symtablestack^.insert(aktprocsym);
end; end;
@ -2014,7 +2016,13 @@ end.
{ {
$Log$ $Log$
Revision 1.58 2000-04-25 23:55:29 pierre Revision 1.59 2000-04-26 08:54:19 pierre
* More changes for operator bug
Order_overloaded method removed because it conflicted with
new implementation where the defs are ordered
according to the unit loading order !
Revision 1.58 2000/04/25 23:55:29 pierre
+ Hint about unused unit + Hint about unused unit
* Testop bug fixed !! * Testop bug fixed !!
Now the operators are only applied if the unit is explicitly loaded Now the operators are only applied if the unit is explicitly loaded

View File

@ -409,6 +409,9 @@
pd^.forwarddef:=false; pd^.forwarddef:=false;
end; end;
pd:=pd^.nextoverloaded; pd:=pd^.nextoverloaded;
{ do not check defs of operators in other units }
if pd^.procsym<>@self then
pd:=nil;
end; end;
end; end;
@ -419,6 +422,7 @@
last,pd : pprocdef; last,pd : pprocdef;
begin begin
resolvedef(pdef(definition)); resolvedef(pdef(definition));
{$ifdef DONOTCHAINOPERATORS}
if (definition^.proctypeoption=potype_operator) then if (definition^.proctypeoption=potype_operator) then
begin begin
last:=definition; last:=definition;
@ -444,8 +448,10 @@
break; break;
end; end;
end; end;
{$endif DONOTCHAINOPERATORS}
end; end;
{$ifdef DONOTCHAINOPERATORS}
procedure tprocsym.order_overloaded; procedure tprocsym.order_overloaded;
var firstdef,currdef,lastdef : pprocdef; var firstdef,currdef,lastdef : pprocdef;
begin begin
@ -485,6 +491,7 @@
currdef:=currdef^.nextoverloaded; currdef:=currdef^.nextoverloaded;
end; end;
end; end;
{$endif DONOTCHAINOPERATORS}
procedure tprocsym.write; procedure tprocsym.write;
begin begin
@ -2137,7 +2144,13 @@
{ {
$Log$ $Log$
Revision 1.142 2000-04-19 08:24:41 pierre Revision 1.143 2000-04-26 08:54:19 pierre
* More changes for operator bug
Order_overloaded method removed because it conflicted with
new implementation where the defs are ordered
according to the unit loading order !
Revision 1.142 2000/04/19 08:24:41 pierre
* remove a memory leak with resourcestrings * remove a memory leak with resourcestrings
Revision 1.141 2000/04/03 14:50:05 pierre Revision 1.141 2000/04/03 14:50:05 pierre

View File

@ -115,7 +115,9 @@
{ tests, if all procedures definitions are defined and not } { tests, if all procedures definitions are defined and not }
{ only forward } { only forward }
procedure check_forward; procedure check_forward;
{$ifdef DONOTCHAINOPERATORS}
procedure order_overloaded; procedure order_overloaded;
{$endif DONOTCHAINOPERATORS}
procedure write;virtual; procedure write;virtual;
procedure deref;virtual; procedure deref;virtual;
procedure load_references;virtual; procedure load_references;virtual;
@ -317,7 +319,13 @@
{ {
$Log$ $Log$
Revision 1.46 2000-02-09 13:23:05 peter Revision 1.47 2000-04-26 08:54:19 pierre
* More changes for operator bug
Order_overloaded method removed because it conflicted with
new implementation where the defs are ordered
according to the unit loading order !
Revision 1.46 2000/02/09 13:23:05 peter
* log truncated * log truncated
Revision 1.45 2000/01/07 01:14:41 peter Revision 1.45 2000/01/07 01:14:41 peter

View File

@ -1469,11 +1469,13 @@ implementation
end; end;
{$ifdef DONOTCHAINOPERATORS}
procedure order_overloads(p : Pnamedindexobject); procedure order_overloads(p : Pnamedindexobject);
begin begin
if psym(p)^.typ=procsym then if psym(p)^.typ=procsym then
pprocsym(p)^.order_overloaded; pprocsym(p)^.order_overloaded;
end; end;
{$endif DONOTCHAINOPERATORS}
procedure tsymtable.foreach(proc2call : tnamedindexcallback); procedure tsymtable.foreach(proc2call : tnamedindexcallback);
begin begin
@ -1751,8 +1753,11 @@ implementation
aktlocalsymtable:=@self; aktlocalsymtable:=@self;
end; end;
end; end;
{ order procsym overloads } {$ifdef DONOTCHAINOPERATORS}
{ obsolete code DO NOT USE it anymore PM }
{ order procsym overloads }
foreach({$ifndef TP}@{$endif}Order_overloads); foreach({$ifndef TP}@{$endif}Order_overloads);
{$endif DONOTCHAINOPERATORS}
{ write definitions } { write definitions }
writedefs; writedefs;
{ write symbols } { write symbols }
@ -2879,7 +2884,13 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.85 2000-04-25 23:55:30 pierre Revision 1.86 2000-04-26 08:54:19 pierre
* More changes for operator bug
Order_overloaded method removed because it conflicted with
new implementation where the defs are ordered
according to the unit loading order !
Revision 1.85 2000/04/25 23:55:30 pierre
+ Hint about unused unit + Hint about unused unit
* Testop bug fixed !! * Testop bug fixed !!
Now the operators are only applied if the unit is explicitly loaded Now the operators are only applied if the unit is explicitly loaded