* Renamed IIOffset to FieldOffset to avoid confusion with IOffset (TImplementedInterface)

git-svn-id: trunk@6219 -
This commit is contained in:
chrivers 2007-01-26 23:03:40 +00:00
parent cf759d9c5c
commit 0249f07fa9
3 changed files with 16 additions and 16 deletions

View File

@ -521,7 +521,7 @@ implementation
ImplIntf.AddImplProc(implprocdef)
end
else
if ImplIntf.itype = etStandard then
if ImplIntf.VtblImplIntf.IType = etStandard then
Message1(sym_e_no_matching_implementation_found,tprocdef(def).fullprocname(false));
end;
end;
@ -1221,10 +1221,10 @@ implementation
{ VTable }
current_asmdata.asmlists[al_globals].concat(Tai_const.Createname(intf_get_vtbl_name(AImplIntf.VtblImplIntf),0));
{ IOffset field }
if AImplIntf.VtblImplIntf.itype = etStandard then
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.ioffset))
if AImplIntf.VtblImplIntf.IType = etStandard then
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.IOffset))
else
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.iioffset));
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.FieldOffset));
{ IIDStr }
current_asmdata.getdatalabel(iidlabel);
rawdata.concat(cai_align.create(const_align(sizeof(aint))));
@ -1236,7 +1236,7 @@ implementation
rawdata.concat(Tai_string.Create(AImplIntf.IntfDef.iidstr^));
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(iidlabel));
{ IType }
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(aint(AImplIntf.itype)));
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(aint(AImplIntf.VtblImplIntf.IType)));
end;

View File

@ -643,6 +643,7 @@ implementation
for i:=0 to aclass.ImplementedInterfaces.Count-1 do
begin
ImplIntf:=TImplementedInterface(aclass.ImplementedInterfaces[i]);
{ FIXME: Is this check valid? }
if ImplIntf.IntfDef.Objname^=pattern then
begin
found:=true;
@ -651,8 +652,8 @@ implementation
end;
if found then
begin
ImplIntf.itype := etFieldValue;
ImplIntf.iioffset := tfieldvarsym(p.propaccesslist[palt_read].firstsym^.sym).fieldoffset;
ImplIntf.IType := etFieldValue;
ImplIntf.FieldOffset := tfieldvarsym(p.propaccesslist[palt_read].firstsym^.sym).fieldoffset;
end
else
Comment(V_Error, 'Implements-property used on unimplemented interface');

View File

@ -204,10 +204,10 @@ interface
VtblImplIntf : TImplementedInterface;
NameMappings : TFPHashList;
ProcDefs : TFPObjectList;
// IIOffset can be merged with IOffset. But then, fpc is not allowed to genrate a vmtentry.
// FieldOffset can be merged with IOffset. But then, fpc is not allowed to genrate a vmtentry.
// Right now, fpc generate an entry for all implemented interfaces (but it should just for etStandard ones)
// - Ivo Steinmann
iioffset : longint;
FieldOffset : longint;
constructor create(aintf: tobjectdef);
constructor create_deref(d:tderef);
destructor destroy; override;
@ -4028,12 +4028,11 @@ implementation
begin
inherited create;
intfdef:=aintf;
ioffset:=-1;
itype:=etStandard;
iioffset:=-1;
IOffset:=-1;
IType:=etStandard;
FieldOffset:=-1;
NameMappings:=nil;
procdefs:=nil;
iioffset := 0;
end;
@ -4042,9 +4041,9 @@ implementation
inherited create;
intfdef:=nil;
intfdefderef:=d;
ioffset:=-1;
itype:=etStandard;
iioffset:=-1;
IOffset:=-1;
IType:=etStandard;
FieldOffset:=-1;
NameMappings:=nil;
procdefs:=nil;
end;