Michael VAN CANNEYT пре 2 година
родитељ
комит
d23fa5a87f

+ 22 - 19
rtl/objpas/classes/classes.inc

@@ -1080,9 +1080,9 @@ end;
  *       Miscellaneous procedures and functions                       *
  **********************************************************************}
 
-function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings; AddEmptyStrings : Boolean = False): Integer;
+function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PAnsiChar; Strings: TStrings; AddEmptyStrings : Boolean = False): Integer;
 var
-  b, c : pchar;
+  b, c : PAnsiChar;
 
   procedure SkipWhitespace;
     begin
@@ -1102,7 +1102,7 @@ var
             begin
               setlength(s, l);
               if l>0 then
-                move (b^, s[1],l*SizeOf(char));
+                move (b^, s[1],l*SizeOf(AnsiChar));
               Strings.Add (s);
             end;
           inc (result);
@@ -1110,7 +1110,7 @@ var
     end;
 
 var
-  quoted : char;
+  quoted : AnsiChar;
 begin
   result := 0;
   c := Content;
@@ -1698,8 +1698,8 @@ type
 
 function CharToOrd(var P: Pointer): Cardinal;
 begin
-  result:= ord(pchar(P)^);
-  inc(pchar(P));
+  result:= ord(PAnsiChar(P)^);
+  inc(PAnsiChar(P));
 end;
 
 function WideCharToOrd(var P: Pointer): Cardinal;
@@ -1711,23 +1711,23 @@ end;
 function Utf8ToOrd(var P:Pointer): Cardinal;
 begin
   // Should also check for illegal utf8 combinations
-  Result := Ord(PChar(P)^);
+  Result := Ord(PAnsiChar(P)^);
   Inc(P);
   if (Result and $80) <> 0 then
     if (Ord(Result) and %11100000) = %11000000 then begin
       Result := ((Result and %00011111) shl 6)
-                or (ord(PChar(P)^) and %00111111);
+                or (ord(PAnsiChar(P)^) and %00111111);
       Inc(P);
     end else if (Ord(Result) and %11110000) = %11100000 then begin
       Result := ((Result and %00011111) shl 12)
-                or ((ord(PChar(P)^) and %00111111) shl 6)
-                or (ord((PChar(P)+1)^) and %00111111);
+                or ((ord(PAnsiChar(P)^) and %00111111) shl 6)
+                or (ord((PAnsiChar(P)+1)^) and %00111111);
       Inc(P,2);
     end else begin
       Result := ((ord(Result) and %00011111) shl 18)
-                or ((ord(PChar(P)^) and %00111111) shl 12)
-                or ((ord((PChar(P)+1)^) and %00111111) shl 6)
-                or (ord((PChar(P)+2)^) and %00111111);
+                or ((ord(PAnsiChar(P)^) and %00111111) shl 12)
+                or ((ord((PAnsiChar(P)+1)^) and %00111111) shl 6)
+                or (ord((PAnsiChar(P)+2)^) and %00111111);
       Inc(P,3);
     end;
 end;
@@ -1767,7 +1767,7 @@ var
       NewInString := InString;
       w := CharToOrdfunc(P);
       if w = ord('''') then
-        begin //quote char
+        begin //quote AnsiChar
         if not InString then
           NewInString := True;
         NewStr := '''''';
@@ -1776,7 +1776,7 @@ var
         begin //printable ascii or bytes
         if not InString then
           NewInString := True;
-        NewStr := char(w);
+        NewStr := AnsiChar(w);
         end
       else
         begin //ascii control chars, non ascii
@@ -1799,7 +1799,7 @@ var
 
   procedure OutString(s: String);
   begin
-    OutChars(Pointer(S),PChar(S)+Length(S),@CharToOrd,Encoding=oteLFM);
+    OutChars(Pointer(S),PAnsiChar(S)+Length(S),@CharToOrd,Encoding=oteLFM);
   end;
 
   procedure OutWString(W: WideString);
@@ -1815,9 +1815,9 @@ var
   procedure OutUtf8Str(s: String);
   begin
     if Encoding=oteLFM then
-      OutChars(Pointer(S),PChar(S)+Length(S),@CharToOrd)
+      OutChars(Pointer(S),PAnsiChar(S)+Length(S),@CharToOrd)
     else
-      OutChars(Pointer(S),PChar(S)+Length(S),@Utf8ToOrd);
+      OutChars(Pointer(S),PAnsiChar(S)+Length(S),@Utf8ToOrd);
   end;
 
   function ReadWord : word; {$ifdef CLASSESINLINE}inline;{$endif CLASSESINLINE}
@@ -2589,6 +2589,9 @@ var
     Output.WriteByte(0);        // Terminate property list
   end;
 
+const
+  signature: PAnsiChar = 'TPF0';
+
 begin
   Version:=TBinaryObjectReader.TBOVersion.boVersion0;
   parser := TParser.Create(Input);
@@ -2650,7 +2653,7 @@ begin
     result:=afalse;
 end;
 
-function LineStart(Buffer, BufPos: PChar): PChar;
+function LineStart(Buffer, BufPos: PAnsiChar): PAnsiChar;
 
 begin
   Result := BufPos;

+ 44 - 44
rtl/objpas/classes/classesh.inc

@@ -76,16 +76,16 @@ const
 
 { TParser special tokens }
 
-  toEOF     = Char(0);
-  toSymbol  = Char(1);
-  toString  = Char(2);
-  toInteger = Char(3);
-  toFloat   = Char(4);
-  toWString = Char(5);
+  toEOF     = AnsiChar(0);
+  toSymbol  = AnsiChar(1);
+  toString  = AnsiChar(2);
+  toInteger = AnsiChar(3);
+  toFloat   = AnsiChar(4);
+  toWString = AnsiChar(5);
 
 Const
-  FilerSignature : Array[1..4] of char = 'TPF0';
-  FilerSignature1 : Array[1..4] of char = 'TPF1';
+  FilerSignature : Array[1..4] of Ansichar = 'TPF0';
+  FilerSignature1 : Array[1..4] of Ansichar = 'TPF1';
 
 type
 { Text alignment types }
@@ -623,9 +623,9 @@ type
     FMissingNameValueSeparatorAction: TMissingNameValueSeparatorAction;
     FSpecialCharsInited : boolean;
     FAlwaysQuote: Boolean;
-    FQuoteChar : Char;
-    FDelimiter : Char;
-    FNameValueSeparator : Char;
+    FQuoteChar : AnsiChar;
+    FDelimiter : AnsiChar;
+    FNameValueSeparator : AnsiChar;
     FUpdateCount: Integer;
     FAdapter: IStringsAdapter;
     FLBS : TTextLineBreakStyle;
@@ -653,19 +653,19 @@ type
     procedure SetUseLocale(AValue: Boolean);
     procedure SetWriteBOM(AValue: Boolean);
     procedure SetValue(const Name, Value: string);
-    procedure SetDelimiter(c:Char);
-    procedure SetQuoteChar(c:Char);
-    procedure SetNameValueSeparator(c:Char);
+    procedure SetDelimiter(c:AnsiChar);
+    procedure SetQuoteChar(c:AnsiChar);
+    procedure SetNameValueSeparator(c:AnsiChar);
     procedure WriteData(Writer: TWriter);
     procedure DoSetTextStr(const Value: string; DoClear : Boolean);
-    Function GetDelimiter : Char;
-    Function GetNameValueSeparator : Char;
-    Function GetQuoteChar: Char;
+    Function GetDelimiter : AnsiChar;
+    Function GetNameValueSeparator : AnsiChar;
+    Function GetQuoteChar: AnsiChar;
     Function GetLineBreak : String;
     procedure SetLineBreak(const S : String);
     Function GetSkipLastLineBreak : Boolean;
     procedure SetSkipLastLineBreak(const AValue : Boolean);
-    Procedure DoSetDelimitedText(const AValue: string; DoClear,aStrictDelimiter : Boolean; aQuoteChar,aDelimiter : Char);
+    Procedure DoSetDelimitedText(const AValue: string; DoClear,aStrictDelimiter : Boolean; aQuoteChar,aDelimiter : AnsiChar);
   protected
     function CompareStrings(const s1,s2 : string) : Integer; virtual;
     procedure DefineProperties(Filer: TFiler); override;
@@ -715,7 +715,7 @@ type
     procedure SetStrings(TheStrings: array of string); overload; virtual;
     Procedure AddText(Const S : String); virtual;
     procedure AddCommaText(const S: String);
-    procedure AddDelimitedText(const S: String; ADelimiter: char; AStrictDelimiter: Boolean); overload;
+    procedure AddDelimitedText(const S: String; ADelimiter: AnsiChar; AStrictDelimiter: Boolean); overload;
     procedure AddDelimitedtext(const S: String); overload;
     procedure Append(const S: string);
     procedure Assign(Source: TPersistent); override;
@@ -735,7 +735,7 @@ type
     procedure ForEach(aCallback: TStringsForeachMethodExObj);
     function GetEnumerator: TStringsEnumerator;
     procedure GetNameValue(Index : Integer; Out AName,AValue : String);
-    function GetText: PChar; virtual;
+    function GetText: PAnsiChar; virtual;
     function IndexOf(const S: string): Integer; virtual;
     function IndexOf(const S: string; aStart : Integer): Integer; virtual;
     function IndexOfName(const Name: string): Integer; virtual;
@@ -766,22 +766,22 @@ type
     function Shift : String;
     Procedure Slice(fromIndex: integer; aList : TStrings);
     Function Slice(fromIndex: integer) : TStrings;
-    procedure SetText(TheText: PChar); virtual;
+    procedure SetText(TheText: PAnsiChar); virtual;
     property AlwaysQuote: Boolean read FAlwaysQuote write FAlwaysQuote;
     property Capacity: Integer read GetCapacity write SetCapacity;
     property CommaText: string read GetCommaText write SetCommaText;
     property Count: Integer read GetCount;
     property DefaultEncoding: TEncoding read FDefaultEncoding write SetDefaultEncoding;
     property DelimitedText: string read GetDelimitedText write SetDelimitedText;
-    property Delimiter: Char read GetDelimiter write SetDelimiter;
+    property Delimiter: AnsiChar read GetDelimiter write SetDelimiter;
     property Encoding: TEncoding read FEncoding;
     property LineBreak : string Read GetLineBreak write SetLineBreak;
     Property MissingNameValueSeparatorAction : TMissingNameValueSeparatorAction Read GetMissingNameValueSeparatorAction Write SetMissingNameValueSeparatorAction;
     property Names[Index: Integer]: string read GetName;
-    Property NameValueSeparator : Char Read GetNameValueSeparator Write SetNameValueSeparator;
+    Property NameValueSeparator : AnsiChar Read GetNameValueSeparator Write SetNameValueSeparator;
     property Objects[Index: Integer]: TObject read GetObject write PutObject;
     property Options: TStringsOptions read FOptions write FOptions;
-    property QuoteChar: Char read GetQuoteChar write SetQuoteChar;
+    property QuoteChar: AnsiChar read GetQuoteChar write SetQuoteChar;
     Property SkipLastLineBreak : Boolean Read GetSkipLastLineBreak Write SetSkipLastLineBreak;
     // Same as SkipLastLineBreak but for Delphi compatibility. Note it has opposite meaning.
     Property TrailingLineBreak : Boolean Read GetTrailingLineBreak Write SetTrailingLineBreak;
@@ -1311,10 +1311,10 @@ type
   private
     Res: TFPResourceHandle;
     Handle: TFPResourceHGLOBAL;
-    procedure Initialize(Instance: TFPResourceHMODULE; Name, ResType: PChar; NameIsID: Boolean);
+    procedure Initialize(Instance: TFPResourceHMODULE; Name, ResType: PAnsiChar; NameIsID: Boolean);
   public
-    constructor Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PChar);
-    constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PChar);
+    constructor Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PAnsiChar);
+    constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PAnsiChar);
     destructor Destroy; override;
   end;
 {$endif FPC_OS_UNICODE}
@@ -1583,7 +1583,7 @@ type
     procedure Read(var Buf; Count: LongInt); virtual;
 
     function ReadBoolean: Boolean;
-    function ReadChar: Char;
+    function ReadChar: AnsiChar;
     function ReadWideChar: WideChar;
     function ReadUnicodeChar: UnicodeChar;
     procedure ReadCollection(Collection: TCollection);
@@ -1651,7 +1651,7 @@ type
 
     procedure WriteBinary(const Buffer; Count: Longint); virtual; abstract;
     procedure WriteBoolean(Value: Boolean); virtual; abstract;
-    // procedure WriteChar(Value: Char);
+    // procedure WriteChar(Value: AnsiChar);
 {$ifndef FPUNONE}
     procedure WriteFloat(const Value: Extended); virtual; abstract;
     procedure WriteSingle(const Value: Single); virtual; abstract;
@@ -1774,7 +1774,7 @@ type
     procedure WriteBoolean(Value: Boolean);
     procedure WriteCollection(Value: TCollection);
     procedure WriteComponent(Component: TComponent);
-    procedure WriteChar(Value: Char);
+    procedure WriteChar(Value: AnsiChar);
     procedure WriteWideChar(Value: WideChar);
     procedure WriteDescendent(ARoot: TComponent; AAncestor: TComponent);
 {$ifndef FPUNONE}
@@ -1810,17 +1810,17 @@ type
   TParser = class(TObject)
   private
     fStream : TStream;
-    fBuf : pchar;
+    fBuf : PAnsiChar;
     fBufLen : integer;
     fPos : integer;
     fDeltaPos : integer;
-    fFloatType : char;
+    fFloatType : AnsiChar;
     fSourceLine : integer;
-    fToken : char;
+    fToken : AnsiChar;
     fEofReached : boolean;
     fLastTokenStr : string;
     fLastTokenWStr : widestring;
-    function GetTokenName(aTok : char) : string;
+    function GetTokenName(aTok : AnsiChar) : string;
     procedure LoadBuffer;
     procedure CheckLoadBuffer; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
     procedure ProcessChar; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
@@ -1828,7 +1828,7 @@ type
     function IsHexNum : boolean; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
     function IsAlpha : boolean; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
     function IsAlphaNum : boolean; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
-    function GetHexValue(c : char) : byte; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
+    function GetHexValue(c : AnsiChar) : byte; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
     function GetAlphaNum : string;
     procedure HandleNewLine;
     procedure SkipBOM;
@@ -1840,20 +1840,20 @@ type
     procedure HandleHexNumber;
     function HandleQuotedString : string;
     procedure HandleDecimalCharacter(var ascii : boolean;
-                                     out WideChr: widechar; out StringChr: char);
+                                     out WideChr: widechar; out StringChr: AnsiChar);
     procedure HandleString;
     procedure HandleMinus;
     procedure HandleUnknown;
   public
     constructor Create(Stream: TStream);
     destructor Destroy; override;
-    procedure CheckToken(T: Char);
+    procedure CheckToken(T: AnsiChar);
     procedure CheckTokenSymbol(const S: string);
     procedure Error(const Ident: string);
     procedure ErrorFmt(const Ident: string; const Args: array of const);
     procedure ErrorStr(const Message: string);
     procedure HexToBinary(Stream: TStream);
-    function NextToken: Char;
+    function NextToken: AnsiChar;
     function SourcePos: Longint;
     function TokenComponentIdent: string;
 {$ifndef FPUNONE}
@@ -1863,9 +1863,9 @@ type
     function TokenString: string;
     function TokenWideString: WideString;
     function TokenSymbolIs(const S: string): Boolean;
-    property FloatType: Char read fFloatType;
+    property FloatType: AnsiChar read fFloatType;
     property SourceLine: Integer read fSourceLine;
-    property Token: Char read fToken;
+    property Token: AnsiChar read fToken;
   end;
 
 { TThread }
@@ -2525,8 +2525,8 @@ procedure ObjectTextToResource(Input, Output: TStream);
 
 { Utility routines }
 
-function LineStart(Buffer, BufPos: PChar): PChar;
-procedure BinToHex(BinValue, HexValue: PChar; BinBufSize: Integer); deprecated 'use procedures from unit StrUtils';
-function HexToBin(HexValue, BinValue: PChar; BinBufSize: Integer): Integer;
-function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings; AddEmptyStrings : Boolean = False): Integer;
+function LineStart(Buffer, BufPos: PAnsiChar): PAnsiChar;
+procedure BinToHex(BinValue, HexValue: PAnsiChar; BinBufSize: Integer); deprecated 'use procedures from unit StrUtils';
+function HexToBin(HexValue, BinValue: PAnsiChar; BinBufSize: Integer): Integer;
+function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PAnsiChar; Strings: TStrings; AddEmptyStrings : Boolean = False): Integer;
 Function IfThen(AValue: Boolean; const ATrue: TStringList; const AFalse: TStringList = nil): TStringList; overload;

+ 6 - 6
rtl/objpas/classes/parser.inc

@@ -36,7 +36,7 @@ const
     'WideString'
   );
 
-function TParser.GetTokenName(aTok: char): string;
+function TParser.GetTokenName(aTok: AnsiChar): string;
 begin
   if ord(aTok) <= LastSpecialToken then
     Result:=TokNames[ord(aTok)]
@@ -87,7 +87,7 @@ begin
   Result:=IsAlpha or IsNumber;
 end;
 
-function TParser.GetHexValue(c: char): byte; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
+function TParser.GetHexValue(c: AnsiChar): byte; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
 begin
   case c of
     '0'..'9' : Result:=ord(c)-$30;
@@ -259,7 +259,7 @@ begin
 end;
 
 procedure TParser.HandleDecimalCharacter(var ascii: boolean; out
-  WideChr: widechar; out StringChr: char);
+  WideChr: widechar; out StringChr: AnsiChar);
 var i : integer;
 begin
   inc(fPos);
@@ -285,7 +285,7 @@ procedure TParser.HandleString;
 var ascii : boolean;
   s: string;
   w: WideChar;
-  c: char;
+  c: AnsiChar;
 begin
   fLastTokenWStr:='';
   fLastTokenStr:='';
@@ -374,7 +374,7 @@ begin
   FreeMem(fBuf);
 end;
 
-procedure TParser.CheckToken(T: Char);
+procedure TParser.CheckToken(T: AnsiChar);
 begin
   if fToken<>T then
     ErrorFmt(SParWrongTokenType,[GetTokenName(T),GetTokenName(fToken)]);
@@ -433,7 +433,7 @@ begin
   NextToken;
 end;
 
-function TParser.NextToken: Char;
+function TParser.NextToken: AnsiChar;
 
 begin
   SkipWhiteSpace;

+ 4 - 4
rtl/objpas/classes/reader.inc

@@ -549,7 +549,7 @@ begin
     CopyNow := FBufEnd - FBufPos;
     if CopyNow > Count then
       CopyNow := Count;
-    Move(PChar(FBuffer)[FBufPos], Dest^, CopyNow);
+    Move(PAnsiChar(FBuffer)[FBufPos], Dest^, CopyNow);
     Inc(FBufPos, CopyNow);
     Inc(Dest, CopyNow);
     Dec(Count, CopyNow);
@@ -867,7 +867,7 @@ begin
     raise EReadError.Create(SInvalidPropertyValue);
 end;
 
-function TReader.ReadChar: Char;
+function TReader.ReadChar: AnsiChar;
 var
   s: String;
 begin
@@ -1286,7 +1286,7 @@ procedure TReader.ReadProperty(AInstance: TPersistent);
 var
   Path: String;
   Instance: TPersistent;
-  DotPos, NextPos: PChar;
+  DotPos, NextPos: PAnsiChar;
   PropInfo: PPropInfo;
   Obj: TObject;
   Name: String;
@@ -1320,7 +1320,7 @@ begin
     try
       Instance := AInstance;
       FCanHandleExcepts := True;
-      DotPos := PChar(Path);
+      DotPos := PAnsiChar(Path);
       while True do
       begin
         NextPos := StrScan(DotPos, '.');

+ 5 - 5
rtl/objpas/classes/streams.inc

@@ -1820,7 +1820,7 @@ constructor TResourceStream.CreateFromID(Instance: TFPResourceHMODULE; ResID: In
   end;
 {$else FPC_OS_UNICODE}
 
-procedure TResourceStream.Initialize(Instance: TFPResourceHMODULE; Name, ResType: PChar; NameIsID: Boolean);
+procedure TResourceStream.Initialize(Instance: TFPResourceHMODULE; Name, ResType: PAnsiChar; NameIsID: Boolean);
   begin
     Res:=FindResource(Instance, Name, ResType);
     if Res=0 then
@@ -1837,15 +1837,15 @@ procedure TResourceStream.Initialize(Instance: TFPResourceHMODULE; Name, ResType
     SetPointer(LockResource(Handle),SizeOfResource(Instance,Res));
   end;
 
-constructor TResourceStream.Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PChar);
+constructor TResourceStream.Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PAnsiChar);
   begin
     inherited create;
-    Initialize(Instance,pchar(ResName),ResType,False);
+    Initialize(Instance,PAnsiChar(ResName),ResType,False);
   end;
-constructor TResourceStream.CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PChar);
+constructor TResourceStream.CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PAnsiChar);
   begin
     inherited create;
-    Initialize(Instance,pchar(PtrInt(ResID)),ResType,True);
+    Initialize(Instance,PAnsiChar(PtrInt(ResID)),ResType,True);
   end;
 {$endif FPC_OS_UNICODE}
 

+ 20 - 20
rtl/objpas/classes/stringl.inc

@@ -104,7 +104,7 @@ begin
   FLBS:=AValue;
 end;
 
-procedure TStrings.SetDelimiter(c:Char);
+procedure TStrings.SetDelimiter(c:AnsiChar);
 begin
   CheckSpecialChars;
   FDelimiter:=c;
@@ -123,7 +123,7 @@ begin
     FEncoding:=nil;
 end;
 
-Function TStrings.GetDelimiter : Char;
+Function TStrings.GetDelimiter : AnsiChar;
 begin
   CheckSpecialChars;
   Result:=FDelimiter;
@@ -142,19 +142,19 @@ begin
 end;
 
 
-procedure TStrings.SetQuoteChar(c:Char);
+procedure TStrings.SetQuoteChar(c:AnsiChar);
 begin
   CheckSpecialChars;
   FQuoteChar:=c;
 end;
 
-Function TStrings.GetQuoteChar :Char;
+Function TStrings.GetQuoteChar :AnsiChar;
 begin
   CheckSpecialChars;
   Result:=FQuoteChar;
 end;
 
-procedure TStrings.SetNameValueSeparator(c:Char);
+procedure TStrings.SetNameValueSeparator(c:AnsiChar);
 begin
   CheckSpecialChars;
   FNameValueSeparator:=c;
@@ -162,7 +162,7 @@ end;
 
 
 
-Function TStrings.GetNameValueSeparator :Char;
+Function TStrings.GetNameValueSeparator :AnsiChar;
 begin
   CheckSpecialChars;
   Result:=FNameValueSeparator;
@@ -172,7 +172,7 @@ end;
 function TStrings.GetCommaText: string;
 
 Var
-  C1,C2 : Char;
+  C1,C2 : AnsiChar;
   FSD : Boolean;
 
 begin
@@ -216,8 +216,8 @@ Function TStrings.GetDelimitedText: string;
 
 Var
   I : integer;
-  p : pchar;
-  BreakChars : set of char;
+  p : PAnsiChar;
+  BreakChars : set of AnsiChar;
   S : String;
   doQuote : Boolean;
     
@@ -235,11 +235,11 @@ begin
     doQuote:=FAlwaysQuote;
     If not DoQuote then
       begin
-      p:=pchar(S);
+      p:=PAnsiChar(S);
       //Quote strings that include BreakChars:
       while not(p^ in BreakChars) do
         inc(p);
-      DoQuote:=(p<>pchar(S)+length(S));  
+      DoQuote:=(p<>PAnsiChar(S)+length(S));  
       end;
     if DoQuote and (QuoteChar<>#0) then
       Result:=Result+QuoteString(S,QuoteChar)
@@ -534,7 +534,7 @@ begin
   DoSetDelimitedText(aValue,True,StrictDelimiter,FQuoteChar,FDelimiter);
 end;
 
-Procedure TStrings.DoSetDelimitedText(const AValue: string; DoClear,aStrictDelimiter : Boolean; aQuoteChar,aDelimiter : Char);
+Procedure TStrings.DoSetDelimitedText(const AValue: string; DoClear,aStrictDelimiter : Boolean; aQuoteChar,aDelimiter : AnsiChar);
 
 var
   len,i,j: SizeInt;
@@ -772,7 +772,7 @@ end;
 
 Function TStrings.GetTextStr: string;
 
-Var P : Pchar;
+Var P : PAnsiChar;
     I,L,NLS : SizeInt;
     S,NL : String;
 
@@ -966,7 +966,7 @@ begin
   DoSetDelimitedText(S,False,StrictDelimiter,'"',',');
 end;
 
-procedure TStrings.AddDelimitedText(const S: String; ADelimiter: Char; AStrictDelimiter: Boolean);
+procedure TStrings.AddDelimitedText(const S: String; ADelimiter: AnsiChar; AStrictDelimiter: Boolean);
 
 begin
   CheckSpecialChars;
@@ -1252,9 +1252,9 @@ begin
 end;
 
 
-Function TStrings.GetText: PChar;
+Function TStrings.GetText: PAnsiChar;
 begin
-  Result:=StrNew(Pchar(Self.Text));
+  Result:=StrNew(PAnsiChar(Self.Text));
 end;
 
 
@@ -1580,13 +1580,13 @@ begin
     Exit;
     end;
   NL:=GetLineBreakCharLBS;
-  NLS:=Length(NL)*SizeOf(Char);
+  NLS:=Length(NL)*SizeOf(AnsiChar);
   For i:=0 To count-1 do
     begin
     S:=Strings[I];
     L:=Length(S);
     if L<>0 then
-      Stream.WriteBuffer(S[1], L*SizeOf(Char));
+      Stream.WriteBuffer(S[1], L*SizeOf(AnsiChar));
     if (I<Count-1) or Not SkipLastLineBreak then
       Stream.WriteBuffer(NL[1], NLS);
     end;
@@ -1630,7 +1630,7 @@ end;
 
 
 
-Procedure TStrings.SetText(TheText: PChar);
+Procedure TStrings.SetText(TheText: PAnsiChar);
 
 Var S : String;
 
@@ -1848,7 +1848,7 @@ begin
       begin
       MSize:=FCapacity*Sizeof(TStringItem);
       System.Move (FList^,NewList^,MSize);
-      FillWord (Pchar(NewList)[MSize],(NewCapacity-FCapacity)*(SizeOf(TStringItem) div SizeOf(Word)), 0);
+      FillWord (PAnsiChar(NewList)[MSize],(NewCapacity-FCapacity)*(SizeOf(TStringItem) div SizeOf(Word)), 0);
       FreeMem (Flist,MSize);
       end;
     Flist:=NewList;

+ 1 - 1
rtl/objpas/classes/twriter.inc

@@ -129,7 +129,7 @@ Var
   Mode : TMode;
   S : String;
   I,L : Longint;
-  c : char;
+  c : AnsiChar;
 
    Procedure Add (A : String);
 

+ 2 - 2
rtl/objpas/classes/util.inc

@@ -11,7 +11,7 @@
 
  **********************************************************************}
 
-procedure BinToHex(BinValue, HexValue: PChar; BinBufSize: Integer);
+procedure BinToHex(BinValue, HexValue: PAnsiChar; BinBufSize: Integer);
 Const
   HexDigits='0123456789ABCDEF';
 var
@@ -27,7 +27,7 @@ begin
 end;
 
 
-function HexToBin(HexValue, BinValue: PChar; BinBufSize: Integer): Integer;
+function HexToBin(HexValue, BinValue: PAnsiChar; BinBufSize: Integer): Integer;
 // more complex, have to accept more than bintohex
 // A..F    1000001
 // a..f    1100001

+ 3 - 3
rtl/objpas/classes/writer.inc

@@ -438,7 +438,7 @@ end;
 procedure TBinaryObjectWriter.Write(const Buffer; Count: Longint);
 var
   CopyNow: LongInt;
-  SourceBuf: PChar;
+  SourceBuf: PAnsiChar;
 begin
   SourceBuf:=@Buffer;
   while Count > 0 do
@@ -446,7 +446,7 @@ begin
     CopyNow := Count;
     if CopyNow > FBufSize - FBufPos then
       CopyNow := FBufSize - FBufPos;
-    Move(SourceBuf^, PChar(FBuffer)[FBufPos], CopyNow);
+    Move(SourceBuf^, PAnsiChar(FBuffer)[FBufPos], CopyNow);
     Dec(Count, CopyNow);
     Inc(FBufPos, CopyNow);
     inc(SourceBuf, CopyNow);
@@ -604,7 +604,7 @@ begin
   Driver.WriteBoolean(Value);
 end;
 
-procedure TWriter.WriteChar(Value: Char);
+procedure TWriter.WriteChar(Value: AnsiChar);
 begin
   WriteString(Value);
 end;