* just realized that AnsiStrPas is entirely unnecessary, because typecasting a

pchar to ansistring performs exactly the same thing :)

git-svn-id: trunk@30056 -
This commit is contained in:
nickysn 2015-03-02 00:03:02 +00:00
parent 9d1c9a2a6a
commit 547e20f1a2
2 changed files with 4 additions and 26 deletions

View File

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

View File

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