Procházet zdrojové kódy

* reverted partially r11598 because it breaks delphi compatibility and e.g. tw3721.pp

git-svn-id: trunk@13398 -
florian před 16 roky
rodič
revize
87df99a53d
2 změnil soubory, kde provedl 13 přidání a 10 odebrání
  1. 10 8
      rtl/objpas/sysutils/sysstr.inc
  2. 3 2
      rtl/objpas/sysutils/sysstrh.inc

+ 10 - 8
rtl/objpas/sysutils/sysstr.inc

@@ -35,18 +35,20 @@ begin
    end;
 end;
 
+{ declaring this breaks delphi compatibility and e.g. tw3721.pp
 FUNCTION NewStr (Const S: ShortString): PShortString;
 VAR P: PShortString;
 BEGIN
-   If (S = '') Then 
-     P := Nil 
-    Else 
+   If (S = '') Then
+     P := Nil
+    Else
      Begin               { Return nil }
      GetMem(P, Length(S) + 1);                        { Allocate memory }
      If (P<>Nil) Then P^ := S;                        { Hold string }
      End;
    NewStr := P;                                       { Return result }
 END;
+}
 
 {   DisposeStr frees the memory occupied by S   }
 
@@ -251,7 +253,7 @@ end;
 
 type
   TCaseTranslationTable = array[0..255] of char;
-  
+
 var
   { Tables with upper and lowercase forms of character sets.
     MUST be initialized with the correct code-pages }
@@ -333,7 +335,7 @@ begin
     Result:=Ord(S1^)-Ord(S2^); //!! Must be replaced by ansi characters !!
     Inc(S1);
     Inc(S2);
-  end;  
+  end;
   if (Result=0) and (S1^<>S2^) then // loop ended because exactly one has #0
     if S1^=#0 then // shorter string is smaller
       result:=-1
@@ -1759,7 +1761,7 @@ begin
 end;
 
 // from textmode IDE util funcs.
-function BoolToStr(B: boolean; const TrueS, FalseS: string): string; 
+function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
 begin
   if B then Result:=TrueS else BoolToStr:=FalseS;
 end;
@@ -2048,7 +2050,7 @@ Var
         places, remove decimal point. }
       If (DecimalPoint < len) And (Digits[DecimalPoint + 1] = ' ') Then
           Digits[DecimalPoint] := ' ';
-      { Convert spaces left from obligatory decimal point to zeroes. 
+      { Convert spaces left from obligatory decimal point to zeroes.
         MVC : If - sign is encountered, replace it too, and put at position 1}
       I:=DecimalPoint-Placehold[2];
       J:=0;
@@ -2085,7 +2087,7 @@ Var
 
       { Find and cut out exponent. Always the
         last 6 characters in the string.
-        -> 0000E+0000                         
+        -> 0000E+0000
         *** No, not always the last 6 characters, this depends on
             the maximally supported precision (JM)}
       I:=Pos('E',Digits);

+ 3 - 2
rtl/objpas/sysutils/sysstrh.inc

@@ -67,7 +67,8 @@ Const
 Var TrueBoolStrs,
     FalseBoolStrs : Array of String;
 
-function NewStr(Const S: ShortString): PShortString; overload;
+// declaring this breaks delphi compatibility and e.g. tw3721.pp
+// function NewStr(Const S: ShortString): PShortString; overload;
 function NewStr(const S: string): PString; overload;
 procedure DisposeStr(S: PString); overload;
 procedure DisposeStr(S: PShortString); overload;
@@ -210,7 +211,7 @@ Function FormatCurr(const Format: string; Value: Currency; Const FormatSettings:
 {$endif}
 
 function StrToBool(const S: string): Boolean;
-function BoolToStr(B: Boolean;UseBoolStrs:Boolean=False): string;  
+function BoolToStr(B: Boolean;UseBoolStrs:Boolean=False): string;
 function BoolToStr(B: Boolean;const TrueS,FalseS:string): string; inline;
 function StrToBoolDef(const S: string; Default: Boolean): Boolean;
 function TryStrToBool(const S: string; out Value: Boolean): Boolean;