View Issue Details

IDProjectCategoryView StatusLast Update
0035106FPCFCLpublic2020-04-01 12:49
ReporterSerge Anvarov Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version3.3.1 
Summary0035106: TRegistry. Patch 7. WriteBinaryData
DescriptionParameter Buffer marked as a const, not a var. Reason:
1. Both implementations (registry and xml) use it as const.
2. Compatible with Delphi
TagsNo tags attached.
Fixed in Revision44479
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Serge Anvarov

2019-02-16 21:49

reporter  

registry7.diff (1,105 bytes)   
Index: packages/fcl-registry/src/registry.pp
===================================================================
--- packages/fcl-registry/src/registry.pp	(revision 41343)
+++ packages/fcl-registry/src/registry.pp	(working copy)
@@ -113,7 +113,7 @@
     procedure MoveKey(const OldName, NewName: string; Delete: Boolean);
     procedure RenameValue(const OldName, NewName: string);
     procedure WriteCurrency(const Name: string; Value: Currency);
-    procedure WriteBinaryData(const Name: string; var Buffer; BufSize: Integer);
+    procedure WriteBinaryData(const Name: string; const Buffer; BufSize: Integer);
     procedure WriteBool(const Name: string; Value: Boolean);
     procedure WriteDate(const Name: string; Value: TDateTime);
     procedure WriteDateTime(const Name: string; Value: TDateTime);
@@ -468,7 +468,7 @@
   Result:=Frac(Result);
 end;
 
-procedure TRegistry.WriteBinaryData(const Name: string; var Buffer; BufSize: Integer);
+procedure TRegistry.WriteBinaryData(const Name: string; const Buffer; BufSize: Integer);
 begin
   PutData(Name, @Buffer, BufSize, rdBinary);
 end;
registry7.diff (1,105 bytes)   

Serge Anvarov

2019-04-10 07:16

reporter   ~0115373

Revision 60900. The patch is still actual.

Bart Broersma

2019-07-12 11:58

reporter   ~0117214

@Serge: you should probably also alter signature of the version with UnicodeString parameter.

Serge Anvarov

2019-07-12 20:40

reporter   ~0117229

Here you are
registry7.1.diff (1,559 bytes)   
Index: packages/fcl-registry/src/registry.pp
===================================================================
--- packages/fcl-registry/src/registry.pp	(revision 42351)
+++ packages/fcl-registry/src/registry.pp	(working copy)
@@ -159,8 +159,8 @@
     procedure RenameValue(const OldName, NewName: String);
     procedure WriteCurrency(const Name: UnicodeString; Value: Currency);
     procedure WriteCurrency(const Name: String; Value: Currency);
-    procedure WriteBinaryData(const Name: UnicodeString; var Buffer; BufSize: Integer);
-    procedure WriteBinaryData(const Name: String; var Buffer; BufSize: Integer);
+    procedure WriteBinaryData(const Name: UnicodeString; const Buffer; BufSize: Integer);
+    procedure WriteBinaryData(const Name: String; const Buffer; BufSize: Integer);
     procedure WriteBool(const Name: UnicodeString; Value: Boolean);
     procedure WriteBool(const Name: String; Value: Boolean);
     procedure WriteDate(const Name: UnicodeString; Value: TDateTime);
@@ -780,12 +780,12 @@
   Result:=ValueExists(UnicodeString(Name));
 end;
 
-procedure TRegistry.WriteBinaryData(const Name: UnicodeString; var Buffer; BufSize: Integer);
+procedure TRegistry.WriteBinaryData(const Name: UnicodeString; const Buffer; BufSize: Integer);
 begin
   PutData(Name, @Buffer, BufSize, rdBinary);
 end;
 
-procedure TRegistry.WriteBinaryData(const Name: String; var Buffer;
+procedure TRegistry.WriteBinaryData(const Name: String; const Buffer;
   BufSize: Integer);
 begin
   WriteBinaryData(UnicodeString(Name), Buffer, BufSize);
registry7.1.diff (1,559 bytes)   

Michael Van Canneyt

2020-04-01 09:34

administrator   ~0121815

Applied, thank you for the patch!

Issue History

Date Modified Username Field Change
2019-02-16 21:49 Serge Anvarov New Issue
2019-02-16 21:49 Serge Anvarov File Added: registry7.diff
2019-04-10 07:16 Serge Anvarov Note Added: 0115373
2019-07-12 11:58 Bart Broersma Note Added: 0117214
2019-07-12 20:40 Serge Anvarov File Added: registry7.1.diff
2019-07-12 20:40 Serge Anvarov Note Added: 0117229
2020-04-01 09:34 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-04-01 09:34 Michael Van Canneyt Status new => resolved
2020-04-01 09:34 Michael Van Canneyt Resolution open => fixed
2020-04-01 09:34 Michael Van Canneyt Fixed in Version => 3.3.1
2020-04-01 09:34 Michael Van Canneyt Fixed in Revision => 44479
2020-04-01 09:34 Michael Van Canneyt FPCTarget => 3.2.0
2020-04-01 09:34 Michael Van Canneyt Note Added: 0121815