Răsfoiți Sursa

* some warning about uninitialized vars fixed by using out instead of var

git-svn-id: trunk@141 -
florian 20 ani în urmă
părinte
comite
9c717f2a35
2 a modificat fișierele cu 8 adăugiri și 6 ștergeri
  1. 2 2
      compiler/cutils.pas
  2. 6 4
      compiler/widestr.pas

+ 2 - 2
compiler/cutils.pas

@@ -87,7 +87,7 @@ interface
     {# Returns true if value is a power of 2, the actual
        exponent value is returned in power.
     }
-    function ispowerof2(value : int64;var power : longint) : boolean;
+    function ispowerof2(value : int64;out power : longint) : boolean;
     function backspace_quote(const s:string;const qchars:Tcharset):string;
     function octal_quote(const s:string;const qchars:Tcharset):string;
     function maybequoted(const s:string):string;
@@ -629,7 +629,7 @@ uses
       end;
 
 
-    function ispowerof2(value : int64;var power : longint) : boolean;
+    function ispowerof2(value : int64;out power : longint) : boolean;
     {
       return if value is a power of 2. And if correct return the power
     }

+ 6 - 4
compiler/widestr.pas

@@ -23,6 +23,8 @@
 }
 unit widestr;
 
+{$i fpcdefs.inc}
+
   interface
 
     uses
@@ -41,8 +43,8 @@ unit widestr;
           maxlen,len : SizeInt;
        end;
 
-    procedure initwidestring(var r : pcompilerwidestring);
-    procedure donewidestring(var r : pcompilerwidestring);
+    procedure initwidestring(out r : pcompilerwidestring);
+    procedure donewidestring(out r : pcompilerwidestring);
     procedure setlengthwidestring(r : pcompilerwidestring;l : SizeInt);
     function getlengthwidestring(r : pcompilerwidestring) : SizeInt;
     procedure concatwidestringchar(r : pcompilerwidestring;c : tcompilerwidechar);
@@ -63,7 +65,7 @@ unit widestr;
        globals;
 
 
-    procedure initwidestring(var r : pcompilerwidestring);
+    procedure initwidestring(out r : pcompilerwidestring);
 
       begin
          new(r);
@@ -72,7 +74,7 @@ unit widestr;
          r^.maxlen:=0;
       end;
 
-    procedure donewidestring(var r : pcompilerwidestring);
+    procedure donewidestring(out r : pcompilerwidestring);
 
       begin
          if assigned(r^.data) then