Browse Source

* just realized that AnsiStrPas is entirely unnecessary, because typecasting a
pchar to ansistring performs exactly the same thing :)

git-svn-id: trunk@30056 -

nickysn 10 years ago
parent
commit
547e20f1a2
2 changed files with 4 additions and 26 deletions
  1. 2 13
      ide/gdbmicon.pas
  2. 2 13
      packages/gdbint/src/gdbcon.pp

+ 2 - 13
ide/gdbmicon.pas

@@ -109,17 +109,6 @@ begin
 {$endif windows}
 end;
 
-function AnsiStrPas(S: PChar): AnsiString;
-var
-  Res: AnsiString;
-  Len: LongInt;
-begin
-  Len := StrLen(S);
-  SetLength(Res, Len);
-  Move(S^, Res[1], Len);
-  AnsiStrPas := Res;
-end;
-
 constructor TGDBController.Init;
 begin
   inherited Init;
@@ -317,7 +306,7 @@ begin
   if GDB.ResultRecord.Success then
     PrintCommand:=GDB.ResultRecord.Parameters['value'].AsString
   else
-    PrintCommand:=AnsiStrPas(GetError);
+    PrintCommand:=AnsiString(GetError);
 end;
 
 const
@@ -330,7 +319,7 @@ begin
   if GDB.ResultRecord.Success then
     PrintFormattedCommand:=GDB.ResultRecord.Parameters['value'].AsString
   else
-    PrintFormattedCommand:=AnsiStrPas(GetError);
+    PrintFormattedCommand:=AnsiString(GetError);
 end;
 
 function TGDBController.BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;

+ 2 - 13
packages/gdbint/src/gdbcon.pp

@@ -177,17 +177,6 @@ begin
 {$endif win32}
 end;
 
-function AnsiStrPas(S: PChar): AnsiString;
-var
-  Res: AnsiString;
-  Len: LongInt;
-begin
-  Len := StrLen(S);
-  SetLength(Res, Len);
-  Move(S^, Res[1], Len);
-  AnsiStrPas := Res;
-end;
-
 constructor TGDBController.Init;
 begin
   inherited init;
@@ -484,9 +473,9 @@ begin
   while p^ in [' ',#9] do
     inc(p);
   if assigned(p) then
-    InternalGetValue:=AnsiStrPas(p)
+    InternalGetValue:=AnsiString(p)
   else
-    InternalGetValue:=AnsiStrPas(GetError);
+    InternalGetValue:=AnsiString(GetError);
   if assigned(p3) then
     p3^:=#10;
   got_error:=false;