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

View File

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

View File

@ -204,10 +204,10 @@ interface
VtblImplIntf : TImplementedInterface; VtblImplIntf : TImplementedInterface;
NameMappings : TFPHashList; NameMappings : TFPHashList;
ProcDefs : TFPObjectList; 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) // Right now, fpc generate an entry for all implemented interfaces (but it should just for etStandard ones)
// - Ivo Steinmann // - Ivo Steinmann
iioffset : longint; FieldOffset : longint;
constructor create(aintf: tobjectdef); constructor create(aintf: tobjectdef);
constructor create_deref(d:tderef); constructor create_deref(d:tderef);
destructor destroy; override; destructor destroy; override;
@ -4028,12 +4028,11 @@ implementation
begin begin
inherited create; inherited create;
intfdef:=aintf; intfdef:=aintf;
ioffset:=-1; IOffset:=-1;
itype:=etStandard; IType:=etStandard;
iioffset:=-1; FieldOffset:=-1;
NameMappings:=nil; NameMappings:=nil;
procdefs:=nil; procdefs:=nil;
iioffset := 0;
end; end;
@ -4042,9 +4041,9 @@ implementation
inherited create; inherited create;
intfdef:=nil; intfdef:=nil;
intfdefderef:=d; intfdefderef:=d;
ioffset:=-1; IOffset:=-1;
itype:=etStandard; IType:=etStandard;
iioffset:=-1; FieldOffset:=-1;
NameMappings:=nil; NameMappings:=nil;
procdefs:=nil; procdefs:=nil;
end; end;