Selaa lähdekoodia

* Fix compilation after rebase

Michael VAN CANNEYT 2 vuotta sitten
vanhempi
commit
9930f5ba04

+ 1 - 1
packages/fcl-base/src/fpexprpars.pp

@@ -60,7 +60,7 @@ Type
     FTokenType : TTokenType;
   private
     function GetCurrentChar: AnsiChar;
-    procedure ScanError(Msg: AnsiString);
+    procedure ScanError(const Msg: AnsiString);
   protected
     procedure SetSource(const AValue: AnsiString ); virtual;
     function DoIdentifier: TTokenType;

+ 1 - 1
packages/fcl-base/src/inicol.pp

@@ -48,7 +48,7 @@ Type
     Procedure SaveToIni(Ini: TCustomInifile; Section : String); virtual;
     Procedure SaveToFile(const AFileName : String; const Section : String);
     Procedure LoadFromIni(Ini: TCustomInifile; Section : String); virtual;
-    Procedure LoadFromFile(AFileName :String ; const Section : String);
+    Procedure LoadFromFile(const AFileName,  Section : String);
     Property Prefix : String  Read FPrefix;
     Property SectionPrefix : String  Read FSectionPrefix;
     Property FileName : String Read FFileName Write FFileName;

+ 1 - 1
packages/fcl-fpcunit/src/DUnitCompatibleInterface.inc

@@ -27,7 +27,7 @@
     class procedure CheckEquals(expected, actual: boolean; const msg: string = ''); overload;
     class procedure CheckEquals(expected, actual: TClass; const msg: string = ''); overload;
     class procedure CheckEquals(expected, actual: int64; const msg: string = ''); overload;
-    class procedure CheckEquals(expected, actual: QWord; cons msg: string = ''); overload;
+    class procedure CheckEquals(expected, actual: QWord; const msg: string = ''); overload;
     class procedure CheckNotEquals(expected, actual: Ansistring; const msg: string = ''); overload;
     class procedure CheckNotEquals(expected, actual: unicodestring; const msg: string = ''); overload;
     class procedure CheckNotEquals(expected, actual: integer; const msg: string = ''); overload; virtual;

+ 2 - 2
packages/fcl-hash/src/fpasn.pp

@@ -82,7 +82,7 @@ procedure ASNParse(const Buffer: TBytes; List: TStrings);
 procedure ASNParse_GetItem(List: TStrings; Index: integer; out ASNType, ASNSize: integer);
 function ASNParse_GetIntBytes(List: TStrings; ListIndex: integer; ID: int64): TBytes;
 function ASNFetch(var Buffer: PByte; BufferEnd: PByte; Out ASNType, ASNSize: Int32): Boolean; overload;
-function ASNFetchOID(var Buffer: PByte; BufferEnd: PByte; out OID: String): Boolean; overload;
+function ASNFetchOID(var Buffer: PByte; BufferEnd: PByte; out OID: UnicodeString): Boolean; overload;
 function ASNFetchOID(var Buffer: PByte; BufferEnd: PByte; out OID: AnsiString): Boolean; overload;
 
 implementation
@@ -814,7 +814,7 @@ begin
   OID:=OIDS;
 end;
 
-function ASNFetchOID(var Buffer: PByte; BufferEnd: PByte; out OID: String): Boolean;
+function ASNFetchOID(var Buffer: PByte; BufferEnd: PByte; out OID: UnicodeString): Boolean;
 var
   ASNType, ASNSize: Int32;
   OIDEnd: PByte;

+ 2 - 2
packages/fcl-hash/src/fphashutils.pp

@@ -32,7 +32,7 @@ Function BytesFromVar(aLocation : Pointer; aSize : Integer) : TBytes;
 Procedure BytesToVar(const aBytes : TBytes; out aLocation; aSize : Integer);
 Procedure BytesToVar(const aBytes : TBytes; Out aLocation : Pointer);
 
-Procedure HexStrToBytes(Const aHexStr : String; out aBytes : TBytes); overload;
+Procedure HexStrToBytes(Const aHexStr : UnicodeString; out aBytes : TBytes); overload;
 Procedure HexStrToBytes(Const aHexStr : AnsiString; out aBytes : TBytes); overload;
 Function HexStrToBytes(Const aHexStr : String) : TBytes; overload;
 Function HexStrToString(Const aHexStr :  String) : AnsiString; overload;
@@ -144,7 +144,7 @@ begin
 end;
 
 
-procedure HexStrToBytes(const aHexStr: String; out aBytes: TBytes);
+procedure HexStrToBytes(const aHexStr: UnicodeString; out aBytes: TBytes);
 
 const
   Convert: array['0'..'f'] of SmallInt =

+ 1 - 1
packages/fcl-pdf/src/fppdfparser.pp

@@ -1304,7 +1304,7 @@ begin
     SetLength(B2,(aSrc.Size div 2));
     aSrc.ReadBuffer(B[0],aSrc.Size);
     end;
-  HexToBin(PChar(B),PChar(B2),Length(B2));
+  HexToBin(PAnsiChar(B),PAnsiChar(B2),Length(B2));
   if not Direct then
     aDest.WriteBuffer(B2[0],Length(B2));
 end;

+ 1 - 0
packages/fcl-web/src/base/fphttpclient.pp

@@ -413,6 +413,7 @@ Type
 
 Function EncodeURLElement(const S : UnicodeString) : UnicodeString;
 Function DecodeURLElement(const S : AnsiString) : AnsiString;
+function DecodeURLElement(const S: UnicodeString): UnicodeString;
 
 implementation
 

+ 2 - 2
packages/fcl-web/src/base/httpdefs.pp

@@ -862,7 +862,7 @@ begin
     EndBound:=UTF8Encode('--'+Boundary);
   {$ELSE}
     Bound:=Boundary;
-    EndBound:='--'+Boundary
+    EndBound:='--'+Boundary;
   {$ENDIF}
   bl := Length(Bound)+6;
   LeadingLineEndMissing:=False;
@@ -2070,7 +2070,7 @@ begin
 {$IF SIZEOF(CHAR)=2}
   FRawData:=TEncoding.Default.GetBytes(AValue);
 {$ELSE}
-  Result:=TEncoding.Default.GetAnsiBytes(FRawData);
+  FRawData:=TEncoding.Default.GetAnsiBytes(AValue);
 {$ENDIF}
 end;
 

+ 0 - 6
packages/rtl-objpas/src/inc/dateutil.inc

@@ -2717,12 +2717,6 @@ begin
      result:=result+encodedate(yy,mm,dd);
 end;
 
-function ScanDateTime(const Pattern: Ansistring; const s: string;
-  startpos: integer): tdatetime;
-begin
-
-end;
-
 
 function scandatetime(const pattern:string;const s:string;startpos:integer=1) : tdatetime; overload;
 

+ 2 - 2
packages/webidl/src/webidlscanner.pp

@@ -26,7 +26,7 @@ type
 {$IF SIZEOF(CHAR)=2}
   TIDLString = String;
 {$ELSE}
-  TIDLString = UT8String;
+  TIDLString = UTF8String;
 {$ENDIF}
 
   EWebIDLError = class(Exception);
@@ -219,7 +219,7 @@ Type
     function IsFloat(const Value: TIDLString; out e: TMaxFloat): boolean;
     procedure NextToken;
     procedure Log(aMsgType: TMessageType; aMsgNumber: integer;
-      const aMsgFmt: String; const Args: array of const; MsgPos: PChar = nil);
+      const aMsgFmt: TIDLString; const Args: array of const; MsgPos: PChar = nil);
     procedure LogXExpectedButTokenFound(const X: TIDLString; ErrorPos: PChar = nil);
     procedure ReadOperand(Skip: boolean = false); // unary operators plus one operand
     procedure ReadExpression; // binary operators

+ 32 - 15
packages/webidl/src/webidltowasmjob.pp

@@ -68,22 +68,25 @@ type
     FPasInterfaceSuffix: TIDLString;
   Protected
     FWritingPasInterface: boolean;
-    function BaseUnits: TIDLString; override;
+    function BaseUnits: String; override;
     // Auxiliary routines
-    function GetPasClassName(const aName: TIDLString): TIDLString; overload; // convert to PasInterfacePrefix+X+FPasInterfaceSuffix
+    function GetPasClassName(const aName: String): String; overload; // convert to PasInterfacePrefix+X+FPasInterfaceSuffix
       override;
     function IntfToPasClassName(const aName: TIDLString): TIDLString; virtual;
     function ComputeGUID(const Prefix: TIDLString; aList: TIDLDefinitionList): TIDLString; virtual;
     procedure GetOptions(L: TStrings; Full: boolean); override;
-    function GetTypeName(const aTypeName: TIDLString; ForTypeDef: Boolean=False
-      ): TIDLString; override;
+    function GetTypeName(const aTypeName: String; ForTypeDef: Boolean=False): String; override;
     function GetPasIntfName(Intf: TIDLDefinition): TIDLString;
     function GetResolvedType(aDef: TIDLTypeDefDefinition; out aTypeName,
-      aResolvedTypename: TIDLString): TIDLDefinition; overload; override;
-    function GetInterfaceDefHead(Intf: TIDLInterfaceDefinition): TIDLString;
+      aResolvedTypename: String): TIDLDefinition; overload; override;
+{$IF SIZEOF(CHAR)=1}      
+    function GetResolvedType(aDef: TIDLTypeDefDefinition; out aTypeName,
+      aResolvedTypename: TIDLString): TIDLDefinition; overload; 
+{$ENDIF}      
+    function GetInterfaceDefHead(Intf: TIDLInterfaceDefinition): String;
       override;
-    function GetDictionaryDefHead(const CurClassName: TIDLString;
-      Dict: TIDLDictionaryDefinition): TIDLString; override;
+    function GetDictionaryDefHead(const CurClassName: String;
+      Dict: TIDLDictionaryDefinition): String; override;
     function WriteOtherImplicitTypes(Intf: TIDLInterfaceDefinition; aMemberList: TIDLDefinitionList): Integer;
       override;
     // Code generation routines. Return the number of actually written defs.
@@ -136,12 +139,12 @@ implementation
 
 { TWebIDLToPasWasmJob }
 
-function TWebIDLToPasWasmJob.BaseUnits: TIDLString;
+function TWebIDLToPasWasmJob.BaseUnits: String;
 begin
   Result:='SysUtils, JOB_JS';
 end;
 
-function TWebIDLToPasWasmJob.GetPasClassName(const aName: TIDLString): TIDLString;
+function TWebIDLToPasWasmJob.GetPasClassName(const aName: String): String;
 begin
   Result:=aName;
   if (LeftStr(Result,length(ClassPrefix))=ClassPrefix)
@@ -239,8 +242,8 @@ begin
   inherited GetOptions(L, Full);
 end;
 
-function TWebIDLToPasWasmJob.GetTypeName(const aTypeName: TIDLString;
-  ForTypeDef: Boolean): TIDLString;
+function TWebIDLToPasWasmJob.GetTypeName(const aTypeName: String;
+  ForTypeDef: Boolean): String;
 begin
   Case aTypeName of
     'union',
@@ -269,8 +272,22 @@ begin
   Result:=GetPasClassName(Result);
 end;
 
+{$IF SIZEOF(CHAR)=1}
 function TWebIDLToPasWasmJob.GetResolvedType(aDef: TIDLTypeDefDefinition; out
   aTypeName, aResolvedTypename: TIDLString): TIDLDefinition;
+
+Var
+  TN,RTN : String;
+  
+begin
+  Result:=GetResolvedType(aDef,TN,RTN);
+  aTypeName:=TN;
+  aResolvedTypeName:=RTN;
+end;
+{$ENDIF}
+
+function TWebIDLToPasWasmJob.GetResolvedType(aDef: TIDLTypeDefDefinition; out
+  aTypeName, aResolvedTypename: String): TIDLDefinition;
 begin
   Result:=inherited GetResolvedType(aDef, aTypeName, aResolvedTypename);
   if Result is TIDLInterfaceDefinition then
@@ -280,7 +297,7 @@ begin
 end;
 
 function TWebIDLToPasWasmJob.GetInterfaceDefHead(Intf: TIDLInterfaceDefinition
-  ): TIDLString;
+  ): String;
 var
   aParentName, aPasIntfName: TIDLString;
 begin
@@ -297,8 +314,8 @@ begin
   Result:=Result+','+aPasIntfName+')';
 end;
 
-function TWebIDLToPasWasmJob.GetDictionaryDefHead(const CurClassName: TIDLString;
-  Dict: TIDLDictionaryDefinition): TIDLString;
+function TWebIDLToPasWasmJob.GetDictionaryDefHead(const CurClassName: String;
+  Dict: TIDLDictionaryDefinition): String;
 begin
   Result:=CurClassName+'Rec = record';
   if Dict=nil then ;