View Issue Details

IDProjectCategoryView StatusLast Update
0035105FPCFCLpublic2020-04-01 12:49
ReporterSerge Anvarov Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version3.3.1 
Summary0035105: TRegistry. Patch 6. ReadDate and ReadTime
DescriptionReadDate and ReadTime have the same read implementation as ReadDateTime, only cut off the unnecessary part. Therefore, they have a ReadDateTime call inserted in them.
Additional InformationOf course, can be mark them as inline, but this will require placing ReadDateTime above others, which I did not do for simplicity.
TagsNo tags attached.
Fixed in Revision44480
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Serge Anvarov

2019-02-16 21:04

reporter  

registry6.diff (894 bytes)   
Index: packages/fcl-registry/src/registry.pp
===================================================================
--- packages/fcl-registry/src/registry.pp	(revision 41343)
+++ packages/fcl-registry/src/registry.pp	(working copy)
@@ -373,11 +377,8 @@
 end;
 
 function TRegistry.ReadDate(const Name: string): TDateTime;
 begin
-  Result:=Default(TDateTime);
-  ReadBinaryData(Name, Result, SizeOf(TDateTime));
-  Result:=Trunc(Result);
+  Result := Trunc(ReadDateTime(Name));
 end;
 
 function TRegistry.ReadDateTime(const Name: string): TDateTime;
@@ -461,11 +462,8 @@
 end;
 
 function TRegistry.ReadTime(const Name: string): TDateTime;
 begin
-  Result:=Default(TDateTime);
-  ReadBinaryData(Name, Result, SizeOf(TDateTime));
-  Result:=Frac(Result);
+  Result := Frac(ReadDateTime(Name));
 end;
 
 procedure TRegistry.WriteBinaryData(const Name: string; var Buffer; BufSize: Integer);
registry6.diff (894 bytes)   

Serge Anvarov

2019-04-10 07:14

reporter   ~0115372

Revision 60900. The patch is still actual.

Serge Anvarov

2019-04-10 07:21

reporter   ~0115374

Including Unicode version

Michael Van Canneyt

2020-04-01 09:39

administrator   ~0121816

Checked and applied, thank you very much!

Issue History

Date Modified Username Field Change
2019-02-16 21:04 Serge Anvarov New Issue
2019-02-16 21:04 Serge Anvarov File Added: registry6.diff
2019-04-10 07:14 Serge Anvarov Note Added: 0115372
2019-04-10 07:21 Serge Anvarov Note Added: 0115374
2020-04-01 09:39 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-04-01 09:39 Michael Van Canneyt Status new => resolved
2020-04-01 09:39 Michael Van Canneyt Resolution open => fixed
2020-04-01 09:39 Michael Van Canneyt Fixed in Version => 3.3.1
2020-04-01 09:39 Michael Van Canneyt Fixed in Revision => 44480
2020-04-01 09:39 Michael Van Canneyt FPCTarget => 3.2.0
2020-04-01 09:39 Michael Van Canneyt Note Added: 0121816