浏览代码

* changed some message handling to ansistring, no slow down measurable with make cycle, resolves #8890

git-svn-id: trunk@7370 -
florian 18 年之前
父节点
当前提交
39dc562326
共有 2 个文件被更改,包括 21 次插入21 次删除
  1. 4 4
      compiler/cmsgs.pas
  2. 17 17
      compiler/comphook.pas

+ 4 - 4
compiler/cmsgs.pas

@@ -52,7 +52,7 @@ type
     procedure ClearIdx;
     procedure ClearIdx;
     procedure CreateIdx;
     procedure CreateIdx;
     function  GetPChar(nr:longint):pchar;
     function  GetPChar(nr:longint):pchar;
-    function  Get(nr:longint;const args:array of string):string;
+    function  Get(nr:longint;const args:array of string):ansistring;
   end;
   end;
 
 
 { this will read a line until #10 or #0 and also increase p }
 { this will read a line until #10 or #0 and also increase p }
@@ -66,11 +66,11 @@ uses
   cutils;
   cutils;
 
 
 
 
-function MsgReplace(const s:string;const args:array of string):string;
+function MsgReplace(const s:string;const args:array of string):ansistring;
 var
 var
   last,
   last,
   i  : longint;
   i  : longint;
-  hs : string;
+  hs : ansistring;
 
 
 begin
 begin
   if s='' then
   if s='' then
@@ -375,7 +375,7 @@ begin
 end;
 end;
 
 
 
 
-function TMessage.Get(nr:longint;const args:array of string):string;
+function TMessage.Get(nr:longint;const args:array of string):ansistring;
 var
 var
   hp : pchar;
   hp : pchar;
 begin
 begin

+ 17 - 17
compiler/comphook.pas

@@ -121,7 +121,7 @@ var
 
 
 { Default Functions }
 { Default Functions }
 Function  def_status:boolean;
 Function  def_status:boolean;
-Function  def_comment(Level:Longint;const s:string):boolean;
+Function  def_comment(Level:Longint;const s:ansistring):boolean;
 function  def_internalerror(i:longint):boolean;
 function  def_internalerror(i:longint):boolean;
 procedure def_initsymbolinfo;
 procedure def_initsymbolinfo;
 procedure def_donesymbolinfo;
 procedure def_donesymbolinfo;
@@ -132,7 +132,7 @@ Function  def_getnamedfiletime(Const F : String) : Longint;
 type
 type
   tstopprocedure         = procedure(err:longint);
   tstopprocedure         = procedure(err:longint);
   tstatusfunction        = function:boolean;
   tstatusfunction        = function:boolean;
-  tcommentfunction       = function(Level:Longint;const s:string):boolean;
+  tcommentfunction       = function(Level:Longint;const s:ansistring):boolean;
   tinternalerrorfunction = function(i:longint):boolean;
   tinternalerrorfunction = function(i:longint):boolean;
 
 
   tinitsymbolinfoproc = procedure;
   tinitsymbolinfoproc = procedure;
@@ -198,22 +198,22 @@ end;
                           Stopping the compiler
                           Stopping the compiler
 ****************************************************************************}
 ****************************************************************************}
 
 
-     constructor EControlCAbort.Create;
-       begin
-         inherited Create('Ctrl-C Signaled!');
-       end;
+constructor EControlCAbort.Create;
+  begin
+    inherited Create('Ctrl-C Signaled!');
+  end;
 
 
 
 
-     constructor ECompilerAbort.Create;
-       begin
-         inherited Create('Compilation Aborted');
-       end;
+constructor ECompilerAbort.Create;
+  begin
+    inherited Create('Compilation Aborted');
+  end;
 
 
 
 
-     constructor ECompilerAbortSilent.Create;
-       begin
-         inherited Create('Compilation Aborted');
-       end;
+constructor ECompilerAbortSilent.Create;
+  begin
+    inherited Create('Compilation Aborted');
+  end;
 
 
 
 
 {****************************************************************************
 {****************************************************************************
@@ -243,13 +243,13 @@ begin
 end;
 end;
 
 
 
 
-Function def_comment(Level:Longint;const s:string):boolean;
+Function def_comment(Level:Longint;const s:ansistring):boolean;
 const
 const
   rh_errorstr   = 'error:';
   rh_errorstr   = 'error:';
   rh_warningstr = 'warning:';
   rh_warningstr = 'warning:';
 var
 var
-  hs : string;
-  hs2 : string;
+  hs : ansistring;
+  hs2 : ansistring;
 begin
 begin
   def_comment:=false; { never stop }
   def_comment:=false; { never stop }
   hs:='';
   hs:='';