View Issue Details

IDProjectCategoryView StatusLast Update
0036993FPCPatchpublic2020-04-30 11:31
ReporterLacaK Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0.4 
Fixed in Version3.3.1 
Summary0036993: Tweaking of fcl-base/src/FileInfo unit
Description- removing unused variables
- changing some Var parameters to Out to suppress varnings: "Local variable "..." does not seem to be initialized"
- changed variable data type to suppress varning "mixed signed and unsigned expressions gives 64 bit results"
TagsNo tags attached.
Fixed in Revision45188
FPCOldBugId
FPCTarget4.0.0
Attached Files

Activities

LacaK

2020-04-30 08:31

developer   ~0122535

fileinfo.pp.diff (3,604 bytes)   
--- fileinfo.pp.old	Thu Apr 30 08:02:58 2020
+++ fileinfo.pp	Thu Apr 30 08:29:29 2020
@@ -101,17 +101,17 @@
                      );
 
 // Extract program version information in 1 call.
-Function GetProgramVersion (Var Version : TVersionQuad) : Boolean;
-Function GetProgramVersion (Var Version : TProgramVersion) : Boolean;
+Function GetProgramVersion (Out Version : TVersionQuad) : Boolean;
+Function GetProgramVersion (Out Version : TProgramVersion) : Boolean;
 // Compare 2 versions
 Function CompareVersionQuads(Quad1,Quad2 : TVersionQuad) : TVersionCompare;
 Function CompareProgramVersion(Version1,Version2 : TProgramVersion) : TVersionCompare;
 // Convert version quad to string
 Function VersionQuadToStr(Const Quad : TVersionQuad) : String;
-Function ProgramversionToStr(Const Version : TProgramVersion) : String;
+Function ProgramVersionToStr(Const Version : TProgramVersion) : String;
 // Try to convert string to version quad.
-Function TryStrToVersionQuad(S : String; Var Quad : TVersionQuad) : Boolean;
-Function TryStrToProgramVersion(S : String; Var Version : TProgramVersion) : Boolean;
+Function TryStrToVersionQuad(S : String; Out Quad : TVersionQuad) : Boolean;
+Function TryStrToProgramVersion(S : String; Out Version : TProgramVersion) : Boolean;
 // Convert string to version quad, raise exception if invalid string.
 Function StrToVersionQuad(Const S : String) : TVersionQuad;
 Function StrToProgramVersion(Const S : String ): TProgramVersion;
@@ -183,7 +183,7 @@
 procedure TVersionInfo.Load(Const AFileName : String);
 
 Var
-  I : Integer;
+  I : LongWord;
 
 begin
   FreeResources;
@@ -265,8 +265,7 @@
 Var
   VI : TVersionInfo;
   ST : TVersionStringTable;
-  TI,I,J : Integer;
-  S: String;
+  TI,I : Integer;
 
 begin
   FEnabled:=True;
@@ -304,9 +303,9 @@
         end;
       end;
     ST:=VI.StringFileInfo.Items[Ti];
-    for J:=0 to ST.Count-1 do
-      if (FFilter.Count=0) or (FFilter.IndexOf(ST.Keys[j])<>-1) then
-        FVersionStrings.Add(ST.Keys[j]+'='+ST.Values[j]);
+    for i:=0 to ST.Count-1 do
+      if (FFilter.Count=0) or (FFilter.IndexOf(ST.Keys[i])<>-1) then
+        FVersionStrings.Add(ST.Keys[i]+'='+ST.Values[i]);
   finally
     FreeAndNil(VI);
   end;
@@ -347,7 +346,7 @@
 
 { Convenience function }
 
-Function GetProgramVersion (Var Version : TVersionQuad) : Boolean;
+Function GetProgramVersion (Out Version : TVersionQuad) : Boolean;
 
 Var
   VI : TVersionInfo;
@@ -370,7 +369,7 @@
   end;
 end;
 
-Function GetProgramVersion (Var Version : TProgramVersion) : Boolean;
+Function GetProgramVersion (Out Version : TProgramVersion) : Boolean;
 Var
   VQ : TVersionQuad;
 begin
@@ -435,7 +434,7 @@
   Result:=Format('%d.%d.%d.%d',[Version.Major,Version.Minor,Version.Revision,Version.Build]);
 end;
 
-Function TryStrToProgramVersion(S : String; Var Version : TProgramVersion) : Boolean;
+Function TryStrToProgramVersion(S : String; Out Version : TProgramVersion) : Boolean;
 
 Var
   Q : TVersionQuad;
@@ -445,7 +444,7 @@
     Version:=Q;
 end;
 
-Function TryStrToVersionQuad(S : String; Var Quad : TVersionQuad) : Boolean;
+Function TryStrToVersionQuad(S : String; Out Quad : TVersionQuad) : Boolean;
 
 Var
   I,P,Dots,Q : Integer;
@@ -488,12 +487,12 @@
 Function NewerVersion(V1,V2 : TProgramVersion) : Boolean;
 
 Var
-  Q1,Q2 : TversionQuad;
+  Q1,Q2 : TVersionQuad;
 
 begin
   Q1:=V1;
   Q2:=V2;
-  Result:=Newerversion(Q1,Q2);
+  Result:=NewerVersion(Q1,Q2);
 end;
 
 Function NewerVersion(Q1,Q2 : TVersionQuad) : Boolean;
fileinfo.pp.diff (3,604 bytes)   

Michael Van Canneyt

2020-04-30 09:02

administrator   ~0122537

Checked and applied, thank you very much!

Issue History

Date Modified Username Field Change
2020-04-30 08:18 LacaK New Issue
2020-04-30 08:18 LacaK File Added: fileinfo.pp.diff
2020-04-30 08:20 LacaK Summary Tweaking of FileInfo unit => Tweaking of fcl-base/src/FileInfo unit
2020-04-30 08:20 LacaK FPCTarget => -
2020-04-30 08:30 LacaK File Deleted: fileinfo.pp.diff
2020-04-30 08:31 LacaK Note Added: 0122535
2020-04-30 08:31 LacaK File Added: fileinfo.pp.diff
2020-04-30 09:02 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-04-30 09:02 Michael Van Canneyt Status new => resolved
2020-04-30 09:02 Michael Van Canneyt Resolution open => fixed
2020-04-30 09:02 Michael Van Canneyt Fixed in Version => 3.3.1
2020-04-30 09:02 Michael Van Canneyt Fixed in Revision => 45188
2020-04-30 09:02 Michael Van Canneyt FPCTarget - => 4.0.0
2020-04-30 09:02 Michael Van Canneyt Note Added: 0122537
2020-04-30 11:31 LacaK Status resolved => closed