View Issue Details

IDProjectCategoryView StatusLast Update
0032131FPCRTLpublic2017-07-10 11:59
ReporterThaddy de KoningAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.1.1Product Build36717 
Target Version3.2.0Fixed in Version3.1.1 
Summary0032131: RandomFrom<T> correction: wrong FPC_FULLVERSION const.
DescriptionI seem to have provided a wrong patch. Code good, FPC_FULLVERSION wrong.
Code will never get activated 301010 vs 30101
New patch provided to activate code.
TagsNo tags attached.
Fixed in Revision36718
FPCOldBugId
FPCTarget
Attached Files
  • randomfrompatch2.patch (795 bytes)
    Index: rtl/objpas/math.pp
    ===================================================================
    --- rtl/objpas/math.pp	(revision 36717)
    +++ rtl/objpas/math.pp	(working copy)
    @@ -613,7 +613,7 @@
     function RandomFrom(const AValues: array of Double): Double; overload;
     function RandomFrom(const AValues: array of Integer): Integer; overload;
     function RandomFrom(const AValues: array of Int64): Int64; overload;
    -{$if FPC_FULLVERSION >=301010}
    +{$if FPC_FULLVERSION >=30101}
     generic function RandomFrom<T>(const AValues:array of T):T;
     {$endif}
     
    @@ -2604,7 +2604,7 @@
       result:=AValues[random(High(AValues)+1)];
     end;
     
    -{$if FPC_FULLVERSION >=301010}
    +{$if FPC_FULLVERSION >=30101}
     generic function RandomFrom<T>(const AValues:array of T):T;
     begin
       result:=AValues[random(High(AValues)+1)];
    

Activities

Thaddy de Koning

2017-07-10 09:25

reporter  

randomfrompatch2.patch (795 bytes)
Index: rtl/objpas/math.pp
===================================================================
--- rtl/objpas/math.pp	(revision 36717)
+++ rtl/objpas/math.pp	(working copy)
@@ -613,7 +613,7 @@
 function RandomFrom(const AValues: array of Double): Double; overload;
 function RandomFrom(const AValues: array of Integer): Integer; overload;
 function RandomFrom(const AValues: array of Int64): Int64; overload;
-{$if FPC_FULLVERSION >=301010}
+{$if FPC_FULLVERSION >=30101}
 generic function RandomFrom<T>(const AValues:array of T):T;
 {$endif}
 
@@ -2604,7 +2604,7 @@
   result:=AValues[random(High(AValues)+1)];
 end;
 
-{$if FPC_FULLVERSION >=301010}
+{$if FPC_FULLVERSION >=30101}
 generic function RandomFrom<T>(const AValues:array of T):T;
 begin
   result:=AValues[random(High(AValues)+1)];

Michael Van Canneyt

2017-07-10 11:59

administrator   ~0101648

This time I actually compiled and ran the test program.

Issue History

Date Modified Username Field Change
2017-07-10 09:25 Thaddy de Koning New Issue
2017-07-10 09:25 Thaddy de Koning File Added: randomfrompatch2.patch
2017-07-10 11:54 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-07-10 11:54 Michael Van Canneyt Status new => assigned
2017-07-10 11:59 Michael Van Canneyt Fixed in Revision => 36718
2017-07-10 11:59 Michael Van Canneyt Note Added: 0101648
2017-07-10 11:59 Michael Van Canneyt Status assigned => resolved
2017-07-10 11:59 Michael Van Canneyt Fixed in Version => 3.1.1
2017-07-10 11:59 Michael Van Canneyt Resolution open => fixed
2017-07-10 11:59 Michael Van Canneyt Target Version => 3.2.0