Hi,

Please find attached a minor patch that removes the following compiler
hints when TRegexEngine.Parse(...) is used.

================
iterator_impl.pas(306,46) Hint: Local variable "LErrorCode" does not
seem to be initialized
iterator_impl.pas(306,34) Hint: Local variable "LErrorPos" does not
seem to be initialized
================

The patch simply changes the 'var' parameters to 'out' parameters.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
Index: packages/regexpr/src/regex.pp
===================================================================
--- packages/regexpr/src/regex.pp	(revision 12964)
+++ packages/regexpr/src/regex.pp	(working copy)
@@ -169,8 +169,8 @@
       constructor Create(const aRegexStr : string);
       destructor Destroy; override;
 
-      function Parse(var aErrorPos : integer;
-                     var aErrorCode: TRegexError) : boolean; virtual;
+      function Parse(out aErrorPos : integer;
+                     out aErrorCode: TRegexError) : boolean; virtual;
       function MatchString(const S : string; out MatchPos : integer; var Offset : integer) : boolean; virtual;
       function ReplaceAllString(const src, newstr: ansistring; out DestStr : string): Integer;
 
@@ -374,8 +374,8 @@
 end;
 
 {--------}
-function TRegexEngine.Parse(var aErrorPos : integer;
-                              var aErrorCode: TRegexError)
+function TRegexEngine.Parse(out aErrorPos : integer;
+                              out aErrorCode: TRegexError)
                                                             : boolean;
 begin
   {clear the current transition table}
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to