Metadata Repository : Change "ServiceCount" and "OperationCount" to Word instead of Byte. Note that all files generated by ws_helper should be regenerated.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1028 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2009-12-01 15:50:52 +00:00
parent 19bbf293d0
commit ae739b0486
3 changed files with 14 additions and 12 deletions

View File

@ -19,7 +19,6 @@ uses
Classes, SysUtils, TypInfo; Classes, SysUtils, TypInfo;
const const
sWST_SIGNATURE = 'WST_METADATA_0.2.2.0';
sWST_META = 'wst_meta'; sWST_META = 'wst_meta';
sFORMAT = 'FORMAT'; sFORMAT = 'FORMAT';
sTRANSPORT = 'TRANSPORT'; sTRANSPORT = 'TRANSPORT';
@ -56,7 +55,7 @@ type
PService = ^TService; PService = ^TService;
TService = record TService = record
Name : ShortString; Name : ShortString;
OperationsCount : Byte; OperationsCount : Word;
Operations : PServiceOperation; Operations : PServiceOperation;
Properties : PPropertyData; Properties : PPropertyData;
end; end;
@ -66,7 +65,7 @@ type
NameSpace : ShortString; NameSpace : ShortString;
Name : ShortString; Name : ShortString;
RootAddress : ShortString; RootAddress : ShortString;
ServicesCount : Byte; ServicesCount : Word;
Services : PService; Services : PService;
end; end;
@ -114,7 +113,8 @@ type
function GetServiceDefaultFormatProperties(AServiceTyp : PTypeInfo):string; function GetServiceDefaultFormatProperties(AServiceTyp : PTypeInfo):string;
implementation implementation
uses wst_resources_imp, binary_streamer, imp_utils, wst_types; uses
wst_resources_imp, binary_streamer, imp_utils, wst_types, wst_consts;
{$INCLUDE wst_rtl_imp.inc} {$INCLUDE wst_rtl_imp.inc}
@ -353,7 +353,7 @@ var
begin begin
AService^.Name := rdr.ReadAnsiStr(); AService^.Name := rdr.ReadAnsiStr();
AService^.Properties := nil; AService^.Properties := nil;
k := rdr.ReadInt8U(); k := rdr.ReadInt16U();
if ( k > 0 ) then begin if ( k > 0 ) then begin
AService^.Operations := wst_GetMem( k * SizeOf(TServiceOperation) ); AService^.Operations := wst_GetMem( k * SizeOf(TServiceOperation) );
AService^.OperationsCount := k; AService^.OperationsCount := k;
@ -382,7 +382,7 @@ begin
try try
FillChar(ARepository^,c,#0); FillChar(ARepository^,c,#0);
ARepository^.Name := rdr.ReadAnsiStr(); ARepository^.Name := rdr.ReadAnsiStr();
c := rdr.ReadInt8U(); c := rdr.ReadInt16U();
if ( c > 0 ) then begin if ( c > 0 ) then begin
ARepository^.Services := wst_GetMem( c * SizeOf(TService) ); ARepository^.Services := wst_GetMem( c * SizeOf(TService) );
ARepository^.ServicesCount := c; ARepository^.ServicesCount := c;

View File

@ -25,9 +25,6 @@ uses
Classes, SysUtils, Classes, SysUtils,
pastree, pascal_parser_intf, binary_streamer; pastree, pascal_parser_intf, binary_streamer;
const
sWST_META = 'WST_METADATA_0.2.2.0';
type type
{ TMetadataGenerator } { TMetadataGenerator }
@ -49,6 +46,8 @@ type
implementation implementation
uses
wst_consts;
{ TMetadataGenerator } { TMetadataGenerator }
@ -58,7 +57,7 @@ var
typeList : TList; typeList : TList;
elt : TPasElement; elt : TPasElement;
begin begin
FStream.WriteAnsiStr(sWST_META); FStream.WriteAnsiStr(sWST_SIGNATURE);
FStream.WriteAnsiStr(FSymbolTable.CurrentModule.Name); FStream.WriteAnsiStr(FSymbolTable.CurrentModule.Name);
k := 0; k := 0;
typeList := FSymbolTable.CurrentModule.InterfaceSection.Declarations; typeList := FSymbolTable.CurrentModule.InterfaceSection.Declarations;
@ -68,7 +67,7 @@ begin
if elt.InheritsFrom(TPasClassType) and ( TPasClassType(elt).ObjKind = okInterface ) then if elt.InheritsFrom(TPasClassType) and ( TPasClassType(elt).ObjKind = okInterface ) then
inc(k); inc(k);
end; end;
FStream.WriteInt8U(k); FStream.WriteInt16U(k);
end; end;
procedure TMetadataGenerator.GenerateIntfMetadata(AIntf: TPasClassType); procedure TMetadataGenerator.GenerateIntfMetadata(AIntf: TPasClassType);
@ -116,7 +115,7 @@ var
begin begin
FStream.WriteAnsiStr(AIntf.Name); FStream.WriteAnsiStr(AIntf.Name);
c := GetElementCount(AIntf.Members,TPasProcedure); c := GetElementCount(AIntf.Members,TPasProcedure);
FStream.WriteInt8U(c); FStream.WriteInt16U(c);
mbrs := AIntf.Members; mbrs := AIntf.Members;
for i := 0 to pred(mbrs.Count) do begin for i := 0 to pred(mbrs.Count) do begin
elt := TPasElement(mbrs[i]); elt := TPasElement(mbrs[i]);

View File

@ -16,6 +16,9 @@ unit wst_consts;
interface interface
const
sWST_SIGNATURE = 'WST_METADATA_0.6';
resourcestring resourcestring
SERR_CannotMakeInternalSymbolName ='Unable to make an internal symbol Name from "%s".'; SERR_CannotMakeInternalSymbolName ='Unable to make an internal symbol Name from "%s".';
SERR_CannotResolveNamespace = 'Unable to resolve this namespace : "%s".'; SERR_CannotResolveNamespace = 'Unable to resolve this namespace : "%s".';