Browse Source

* Fix compilation after rebase

Michaël Van Canneyt 2 years ago
parent
commit
885a265edb

+ 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-db/src/dbase/dbf_prscore.pas

@@ -100,7 +100,7 @@ type
     procedure ClearExpressions; virtual;
 //    procedure GetGeneratedVars(AList: TList);
     procedure GetFunctionNames(AList: TStrings);
-    function GetFunctionDescription(AFunction: AnsiString): AnsiString;
+    function GetFunctionDescription(const AFunction: AnsiString): AnsiString;
     property HexChar: AnsiChar read FHexChar write FHexChar;
     property ArgSeparator: AnsiChar read FArgSeparator write FArgSeparator;
     property Optimize: Boolean read FOptimize write FOptimize;

+ 2 - 2
packages/fcl-db/src/dbase/dbf_prsdef.pas

@@ -182,7 +182,7 @@ type
     FValue: Double;
   public
     // not overloaded to support older Delphi versions
-    constructor Create(const AName: AnsiString; AValue: AnsiString);
+    constructor Create(const AName: AnsiString; const AValue: AnsiString);
     constructor CreateAsDouble(const AName: AnsiString; AValue: Double);
 
     function AsPointer: PAnsiChar; override;
@@ -605,7 +605,7 @@ end;
 
 { TFloatConstant }
 
-constructor TFloatConstant.Create(const AName, AValue: AnsiString);
+constructor TFloatConstant.Create(const AName: AnsiString; const aValue : AnsiString);
 begin
   inherited Create(AName, etFloat, _FloatVariable);
 

+ 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-passrc/src/pscanner.pp

@@ -6363,7 +6363,7 @@ begin
   HandleMode(S);
 end;
 
-procedure TPascalScanner.SetModeSwitch(S: String);
+procedure TPascalScanner.SetModeSwitch(S: TPasScannerString);
 begin
   HandleModeSwitch(S);
 end;

+ 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;

+ 3 - 2
packages/fcl-web/src/base/fphttpclient.pp

@@ -411,8 +411,9 @@ Type
   // writing to socket
   EHTTPClientSocketWrite = Class(EHTTPClientSocket);
 
-Function EncodeURLElement(const S : String) : String;
-Function DecodeURLElement(Const S : String) : String;
+Function EncodeURLElement(const S : UnicodeString) : UnicodeString;
+Function DecodeURLElement(const S : AnsiString) : AnsiString;
+function DecodeURLElement(const S: UnicodeString): UnicodeString;
 
 implementation
 

+ 31 - 1
packages/fcl-web/src/base/httpdefs.pp

@@ -836,10 +836,19 @@ var
   p: SizeInt;
   BufEnd: SizeInt;
   LeadingLineEndMissing: Boolean;
+  Bound,EndBound : RawByteString;
+  
 begin
   // The length of the boundary, including the leading CR/LF, '--' and trailing '--' or
   // CR/LF.
-  bl := Length(FBoundary)+6;
+  {$IF SIZEOF(CHAR)=2}
+    Bound:=UTF8Encode(Boundary);
+    EndBound:=UTF8Encode('--'+Boundary);
+  {$ELSE}
+    Bound:=Boundary;
+    EndBound:='--'+Boundary;
+  {$ENDIF}
+  bl := Length(Bound)+6;
   LeadingLineEndMissing:=False;
   if State=cssStart then
     begin
@@ -1994,6 +2003,27 @@ begin
    end;
 end;
 
+<<<<<<< HEAD
+=======
+function TMimeItem.GetData: String;
+begin
+{$IF SIZEOF(CHAR)=2}
+  Result:=TEncoding.Default.GetString(FRawData);
+{$ELSE}
+  Result:=TEncoding.Default.GetAnsiString(FRawData);
+{$ENDIF}
+end;
+
+procedure TMimeItem.SetData(AValue: String);
+begin
+{$IF SIZEOF(CHAR)=2}
+  FRawData:=TEncoding.Default.GetBytes(AValue);
+{$ELSE}
+  FRawData:=TEncoding.Default.GetAnsiBytes(AValue);
+{$ENDIF}
+end;
+
+>>>>>>> 9930f5ba04 (* Fix compilation after rebase)
 function TMimeItem.CreateUploadedFileStreaming(Files: TUploadedFiles): TUploadedFile;
 begin
   if FLocalFilename='' then

+ 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 ;