From 331f4eaff3b3d0652333ac5d62a4b08d1dfaa8b8 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 9 May 2015 12:42:22 +0000 Subject: [PATCH] * Fix some warnings git-svn-id: trunk@30830 - --- .../googleapi/src/googlediscoverytopas.pp | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/googleapi/src/googlediscoverytopas.pp b/packages/googleapi/src/googlediscoverytopas.pp index ff0e4daf1b..03bedba63d 100644 --- a/packages/googleapi/src/googlediscoverytopas.pp +++ b/packages/googleapi/src/googlediscoverytopas.pp @@ -490,8 +490,16 @@ begin end; function TTypeDefs.Find(ATypename: String): TTypeDef; -begin +Var + I : Integer; + +begin + I:=IndexOf(ATypeName); + if (I=-1) then + Result:=Nil + else + Result:=GetD(I); end; function TTypeDefs.AddTypeDef(ADataType: TDataType; APascalName: String; @@ -639,7 +647,7 @@ end; procedure TDiscoveryJSONToPas.CollectType(S: TSchema; NamePrefix: String; IsTopLevel : Boolean); Var - CN,TCN,AE : String; + AE : String; Dt : TDataType; BaseArrayElement : Boolean; @@ -790,12 +798,12 @@ begin else if Result='number' then begin if (AFormat='double') then - Result:='double' - else - Result:='integer' + Result:='double' + else + Result:='integer' end else if Result='string' then - if Aformat='date-time' then + if Aformat='date-time' then Result:='TDatetime' else if Aformat='date' then Result:='TDate' @@ -1030,7 +1038,6 @@ procedure TDiscoveryJSONToPas.CreateInterface; end; Var - I : Integer; S : TTypeDef; R : TSchema; @@ -1057,7 +1064,6 @@ end; procedure TDiscoveryJSONToPas.CreateImplementation; Var - I : Integer; R : TSchema; S : TTypeDef; begin @@ -1538,11 +1544,9 @@ procedure TDiscoveryJSONToPas.CreateAPIClassImplementation; end; Var - CN,SCN : String; + CN : String; S : TSchema; I : Integer; - L : TStrings; - TD : TTypeDef; begin CN:=GetAPIClassName; @@ -1653,8 +1657,6 @@ end; procedure TDiscoveryJSONToPas.Execute; -Var - L : TStringList; begin Source.Clear; Addln('unit '+outputunitname+';');