Browse Source

* Patch from Luiz Americo to put Const in front of string parameters

git-svn-id: trunk@15670 -
michael 15 years ago
parent
commit
fcfcfc43cf

+ 1 - 1
packages/fcl-base/src/dummy/eventlog.inc

@@ -32,7 +32,7 @@ begin
   DeActivateFileLog;
 end;
 
-procedure TEventLog.WriteSystemLog(EventType : TEventType; Msg : String);
+procedure TEventLog.WriteSystemLog(EventType : TEventType; const Msg : String);
 
 begin
   WriteFileLog(EventType,Msg);

+ 27 - 27
packages/fcl-base/src/eventlog.pp

@@ -52,8 +52,8 @@ Type
     procedure SetFileName(const Value: String);
     procedure ActivateSystemLog;
     function DefaultFileName: String;
-    procedure WriteFileLog(EventType : TEventType; Msg: String);
-    procedure WriteSystemLog(EventType: TEventType; Msg: String);
+    procedure WriteFileLog(EventType : TEventType; const Msg: String);
+    procedure WriteSystemLog(EventType: TEventType; const Msg: String);
     procedure DeActivateFileLog;
     procedure DeActivateSystemLog;
     procedure CheckIdentification;
@@ -71,18 +71,18 @@ Type
     Function EventTypeToString(E : TEventType) : String;
     Function RegisterMessageFile(AFileName : String) : Boolean; virtual;
     Function UnRegisterMessageFile : Boolean; virtual;
-    Procedure Log (EventType : TEventType; Msg : String); {$ifndef fpc }Overload;{$endif}
-    Procedure Log (EventType : TEventType; Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
-    Procedure Log (Msg : String); {$ifndef fpc }Overload;{$endif}
-    Procedure Log (Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
-    Procedure Warning (Msg : String); {$ifndef fpc }Overload;{$endif}
-    Procedure Warning (Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
-    Procedure Error (Msg : String); {$ifndef fpc }Overload;{$endif}
-    Procedure Error (Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
-    Procedure Debug (Msg : String); {$ifndef fpc }Overload;{$endif}
-    Procedure Debug (Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
-    Procedure Info (Msg : String); {$ifndef fpc }Overload;{$endif}
-    Procedure Info (Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
+    Procedure Log (EventType : TEventType; const Msg : String); {$ifndef fpc }Overload;{$endif}
+    Procedure Log (EventType : TEventType; const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
+    Procedure Log (const Msg : String); {$ifndef fpc }Overload;{$endif}
+    Procedure Log (const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
+    Procedure Warning (const Msg : String); {$ifndef fpc }Overload;{$endif}
+    Procedure Warning (const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
+    Procedure Error (const Msg : String); {$ifndef fpc }Overload;{$endif}
+    Procedure Error (const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
+    Procedure Debug (const Msg : String); {$ifndef fpc }Overload;{$endif}
+    Procedure Debug (const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
+    Procedure Info (const Msg : String); {$ifndef fpc }Overload;{$endif}
+    Procedure Info (const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
   Published
     Property Identification : String Read FIdentification Write SetIdentification;
     Property LogType : TLogType Read Flogtype Write SetlogType;
@@ -126,12 +126,12 @@ begin
     Raise ELogError.Create(SErrOperationNotAllowed);
 end;
 
-procedure TEventLog.Debug(Fmt: String; Args: array of const);
+procedure TEventLog.Debug(const Fmt: String; Args: array of const);
 begin
    Debug(Format(Fmt,Args));
 end;
 
-procedure TEventLog.Debug(Msg: String);
+procedure TEventLog.Debug(const Msg: String);
 begin
   Log(etDebug,Msg);
 end;
@@ -142,38 +142,38 @@ begin
     Active:=True;
 end;
 
-procedure TEventLog.Error(Fmt: String; Args: array of const);
+procedure TEventLog.Error(const Fmt: String; Args: array of const);
 begin
   Error(Format(Fmt,Args));
 end;
 
-procedure TEventLog.Error(Msg: String);
+procedure TEventLog.Error(const Msg: String);
 begin
   Log(etError,Msg);
 end;
 
-procedure TEventLog.Info(Fmt: String; Args: array of const);
+procedure TEventLog.Info(const Fmt: String; Args: array of const);
 begin
   Info(Format(Fmt,Args));
 end;
 
-procedure TEventLog.Info(Msg: String);
+procedure TEventLog.Info(const Msg: String);
 begin
   Log(etInfo,Msg);
 end;
 
-procedure TEventLog.Log(Msg: String);
+procedure TEventLog.Log(const Msg: String);
 begin
   Log(DefaultEventType,msg);
 end;
 
-procedure TEventLog.Log(EventType: TEventType; Fmt: String;
+procedure TEventLog.Log(EventType: TEventType; const Fmt: String;
   Args: array of const);
 begin
   Log(EventType,Format(Fmt,Args));
 end;
 
-procedure TEventLog.Log(EventType: TEventType; Msg: String);
+procedure TEventLog.Log(EventType: TEventType; const Msg: String);
 begin
   EnsureActive;
   Case FlogType of
@@ -182,7 +182,7 @@ begin
   end;
 end;
 
-procedure TEventLog.WriteFileLog(EventType : TEventType; Msg : String);
+procedure TEventLog.WriteFileLog(EventType : TEventType; const Msg : String);
 
 Var
   S,TS,T : String;
@@ -204,7 +204,7 @@ begin
     Raise ELogError.CreateFmt(SErrLogFailedMsg,[S]);
 end;
 
-procedure TEventLog.Log(Fmt: String; Args: array of const);
+procedure TEventLog.Log(const Fmt: String; Args: array of const);
 begin
   Log(Format(Fmt,Args));
 end;
@@ -267,12 +267,12 @@ begin
   Flogtype := Value;
 end;
 
-procedure TEventLog.Warning(Fmt: String; Args: array of const);
+procedure TEventLog.Warning(const Fmt: String; Args: array of const);
 begin
   Warning(Format(Fmt,Args));
 end;
 
-procedure TEventLog.Warning(Msg: String);
+procedure TEventLog.Warning(const Msg: String);
 begin
   Log(etWarning,Msg);
 end;

+ 1 - 1
packages/fcl-base/src/os2/eventlog.inc

@@ -164,7 +164,7 @@ begin
 end;
 
 
-procedure TEventLog.WriteSystemLog (EventType: TEventType; Msg: string);
+procedure TEventLog.WriteSystemLog (EventType: TEventType; const Msg: string);
 
 const
   WinET: array [TEventType] of Str3 = ('USR', 'INF', 'WRN', 'ERR', 'DBG');

+ 1 - 1
packages/fcl-base/src/unix/eventlog.inc

@@ -76,7 +76,7 @@ begin
   CloseLog;
 end;
 
-procedure TEventLog.WriteSystemLog(EventType : TEventType; Msg : String);
+procedure TEventLog.WriteSystemLog(EventType : TEventType; const Msg : String);
 
 Var
   P,PT : PChar;

+ 1 - 1
packages/fcl-base/src/win/eventlog.inc

@@ -49,7 +49,7 @@ function ReportEvent(hEventLog: THandle; wType, wCategory: Word;
   dwDataSize: DWORD; lpStrings, lpRawData: Pointer): BOOL; stdcall;
 }
 
-procedure TEventLog.WriteSystemLog(EventType : TEventType; Msg : String);
+procedure TEventLog.WriteSystemLog(EventType : TEventType; const Msg : String);
 
 Var
   P : PChar;