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@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Alexander G. M. Smith 2022-02-28 16:37:20 -05:00 committed by waddlesplash
parent 4ac797a9cf
commit 7c09ef1255
2 changed files with 13 additions and 2 deletions

View File

@ -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)

View File

@ -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();
};