Browse Source

merge r14143 from cpstrnew branch by paul:
use RawByteString instead of AnsiString for Pos()

git-svn-id: trunk@19099 -

paul 14 years ago
parent
commit
55434fd1d8
2 changed files with 6 additions and 6 deletions
  1. 3 3
      rtl/inc/astrings.inc
  2. 3 3
      rtl/inc/systemh.inc

+ 3 - 3
rtl/inc/astrings.inc

@@ -796,7 +796,7 @@ begin
   Pointer(fpc_ansistr_Copy):=ResultAddress;
   Pointer(fpc_ansistr_Copy):=ResultAddress;
 end;
 end;
 
 
-Function Pos (Const Substr : ShortString; Const Source : AnsiString) : SizeInt;
+Function Pos (Const Substr : ShortString; Const Source : RawByteString) : SizeInt;
 
 
 var
 var
   i,MaxLen : SizeInt;
   i,MaxLen : SizeInt;
@@ -823,7 +823,7 @@ begin
 end;
 end;
 
 
 
 
-Function Pos (Const Substr : AnsiString; Const Source : AnsiString) : SizeInt;
+Function Pos (Const Substr : RawByteString; Const Source : RawByteString) : SizeInt;
 var
 var
   i,MaxLen : SizeInt;
   i,MaxLen : SizeInt;
   pc : pchar;
   pc : pchar;
@@ -853,7 +853,7 @@ end;
 { pos(c: char; const s: shortstring) also exists, so otherwise   }
 { pos(c: char; const s: shortstring) also exists, so otherwise   }
 { using pos(char,pchar) will always call the shortstring version }
 { using pos(char,pchar) will always call the shortstring version }
 { (exact match for first argument), also with $h+ (JM)           }
 { (exact match for first argument), also with $h+ (JM)           }
-Function Pos (c : Char; Const s : AnsiString) : SizeInt;
+Function Pos (c : Char; Const s : RawByteString) : SizeInt;
 var
 var
   i: SizeInt;
   i: SizeInt;
   pc : pchar;
   pc : pchar;

+ 3 - 3
rtl/inc/systemh.inc

@@ -840,7 +840,7 @@ Procedure Insert(source:Char;var s:shortstring;index:SizeInt);
 Function  Pos(const substr:shortstring;const s:shortstring):SizeInt;
 Function  Pos(const substr:shortstring;const s:shortstring):SizeInt;
 Function  Pos(C:Char;const s:shortstring):SizeInt;
 Function  Pos(C:Char;const s:shortstring):SizeInt;
 {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
 {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
-Function  Pos (const Substr : ShortString; const Source : AnsiString) : SizeInt;
+Function  Pos (const Substr : ShortString; const Source : RawByteString) : SizeInt;
 Procedure SetString (out S : AnsiString; Buf : PChar; Len : SizeInt);
 Procedure SetString (out S : AnsiString; Buf : PChar; Len : SizeInt);
 Procedure SetString (out S : AnsiString; Buf : PWideChar; Len : SizeInt);
 Procedure SetString (out S : AnsiString; Buf : PWideChar; Len : SizeInt);
 {$endif FPC_HAS_FEATURE_ANSISTRINGS}
 {$endif FPC_HAS_FEATURE_ANSISTRINGS}
@@ -873,8 +873,8 @@ function  pos(const substr : shortstring;c:char): SizeInt;
 
 
 {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
 {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
 Procedure UniqueString(var S : AnsiString);external name 'FPC_ANSISTR_UNIQUE';
 Procedure UniqueString(var S : AnsiString);external name 'FPC_ANSISTR_UNIQUE';
-Function  Pos (const Substr : AnsiString; const Source : AnsiString) : SizeInt;
-Function  Pos (c : Char; const s : AnsiString) : SizeInt;
+Function  Pos (const Substr : RawByteString; const Source : RawByteString) : SizeInt;
+Function  Pos (c : Char; const s : RawByteString) : SizeInt;
 Procedure Insert (const Source : AnsiString; var S : AnsiString; Index : SizeInt);
 Procedure Insert (const Source : AnsiString; var S : AnsiString; Index : SizeInt);
 Procedure Delete (var S : AnsiString; Index,Size: SizeInt);
 Procedure Delete (var S : AnsiString; Index,Size: SizeInt);
 Function  StringOfChar(c : char;l : SizeInt) : AnsiString;
 Function  StringOfChar(c : char;l : SizeInt) : AnsiString;