[haiku-commits] haiku: hrev56224 - src/add-ons/kernel/file_systems/fat

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 28 Jun 2022 15:40:44 +0000 (UTC)

hrev56224 adds 1 changeset to branch 'master'
old head: 4ac797a9cf9f9280ae158a0b83ce9868c3546f4c
new head: 7c09ef12550b2d3ba32086de3b612308e5c326cd
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=7c09ef12550b+%5E4ac797a9cf9f

----------------------------------------------------------------------------

7c09ef12550b: FAT: Fix 32 bit gcc2 compile.
  
  You can't initialize struct fields in the declaration in gcc2, but you
  can set them up in a constructor.  So made one for struct diri,
  and initialize nested sub-structures too.
  
  Change-Id: Ic8b824bc157cca4cdb8c4e41afdca596776c0d55
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/4995
  Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                                 [ Alexander G. M. Smith <agmsmith@xxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev56224
Commit:      7c09ef12550b2d3ba32086de3b612308e5c326cd
URL:         https://git.haiku-os.org/haiku/commit/?id=7c09ef12550b
Author:      Alexander G. M. Smith <agmsmith@xxxxxx>
Date:        Mon Feb 28 21:37:20 2022 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Tue Jun 28 15:40:41 2022 UTC

----------------------------------------------------------------------------

2 files changed, 13 insertions(+), 2 deletions(-)
src/add-ons/kernel/file_systems/fat/iter.cpp | 10 ++++++++++
src/add-ons/kernel/file_systems/fat/iter.h   |  5 +++--

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/file_systems/fat/iter.cpp 
b/src/add-ons/kernel/file_systems/fat/iter.cpp
index f59e6ab531..93dbecbe0d 100644
--- a/src/add-ons/kernel/file_systems/fat/iter.cpp
+++ b/src/add-ons/kernel/file_systems/fat/iter.cpp
@@ -306,6 +306,16 @@ diri_init(nspace *vol, uint32 cluster, uint32 index, 
struct diri *diri)
 }
 
 
+diri::diri()
+{
+       csi.vol = NULL;
+       csi.cluster = 0;
+       csi.sector = 0;
+
+       current_block = NULL;
+}
+
+
 diri::~diri()
 {
        if (current_block != NULL)
diff --git a/src/add-ons/kernel/file_systems/fat/iter.h 
b/src/add-ons/kernel/file_systems/fat/iter.h
index ea996b6a48..2d11402b81 100644
--- a/src/add-ons/kernel/file_systems/fat/iter.h
+++ b/src/add-ons/kernel/file_systems/fat/iter.h
@@ -34,11 +34,12 @@ status_t csi_write_block(struct csi *csi, uint8 *buffer);
 
 /* directory entry iterator */
 struct diri {
-       struct csi csi = {};
+       struct csi csi;
        uint32 starting_cluster;
        uint32 current_index;
-       uint8 *current_block = NULL;
+       uint8 *current_block;
 
+       diri();
        ~diri();
 };
 


Other related posts:

  • » [haiku-commits] haiku: hrev56224 - src/add-ons/kernel/file_systems/fat - waddlesplash