init vars for coverity (formats)

This commit is contained in:
Robbbert 2022-03-26 01:26:34 +11:00
parent 36ebc5ef08
commit ff351d1603
7 changed files with 39 additions and 39 deletions

View File

@ -59,7 +59,7 @@ private:
bool m_prodos_order;
int m_tracks;
int m_tracks = 0;
};
extern const floppy_format_type FLOPPY_A216S_FORMAT;

View File

@ -290,7 +290,7 @@ static floperr_t basicdsk_get_indexed_sector_info(floppy_image_legacy *floppy, i
static void basicdsk_default_geometry(const struct FloppyFormat *format, struct basicdsk_geometry *geometry)
{
int sector_length;
int sector_length = 0;
memset(geometry, 0, sizeof(*geometry));
auto err = util::option_resolution::get_default(format->param_guidelines, PARAM_HEADS, &geometry->heads);

View File

@ -28,21 +28,21 @@ public:
private:
struct sysinfo_sector
{
uint8_t unused1[16];
uint8_t disk_name[8];
uint8_t disk_ext[3];
uint8_t disk_number[2];
uint8_t fc_start_trk;
uint8_t fc_start_sec;
uint8_t fc_end_trk;
uint8_t fc_end_sec;
uint8_t free[2];
uint8_t month;
uint8_t day;
uint8_t year;
uint8_t last_trk;
uint8_t last_sec;
uint8_t unused2[216];
uint8_t unused1[16]{};
uint8_t disk_name[8]{};
uint8_t disk_ext[3]{};
uint8_t disk_number[2]{};
uint8_t fc_start_trk = 0;
uint8_t fc_start_sec = 0;
uint8_t fc_end_trk = 0;
uint8_t fc_end_sec = 0;
uint8_t free[2]{};
uint8_t month = 0;
uint8_t day = 0;
uint8_t year = 0;
uint8_t last_trk = 0;
uint8_t last_sec = 0;
uint8_t unused2[216]{};
} info;
static const format formats[];
static const format formats_head1[];

View File

@ -2194,7 +2194,7 @@ std::vector<std::vector<uint8_t>> floppy_image_format_t::extract_sectors_from_bi
return sectors;
// Start by detecting all id and data blocks
uint32_t hblk[100], dblk[100];
uint32_t hblk[100]{}, dblk[100]{};
uint32_t hblk_count = 0, dblk_count = 0;
// Precharge the shift register to detect over-the-index stuff
@ -2276,7 +2276,7 @@ std::vector<std::vector<uint8_t>> floppy_image_format_t::extract_sectors_from_bi
return sectors;
// Start by detecting all id and data blocks
uint32_t hblk[100], dblk[100];
uint32_t hblk[100]{}, dblk[100]{};
uint32_t hblk_count = 0, dblk_count = 0;
// Precharge the shift register to detect over-the-index stuff

View File

@ -40,7 +40,7 @@ private:
std::vector<uint8_t> m_sector_count;
std::vector<uint8_t> m_ssize;
int m_trackmult;
int m_trackmult = 1;
};
extern const floppy_format_type FLOPPY_IMD_FORMAT;

View File

@ -55,30 +55,30 @@ public:
// could be changed, but we do not support this (yet). These are defined
// in the CHD and must match those of the device. They are stored by the GDDD tag.
// The encoding is not stored in the CHD but is also supposed to be immutable.
int cylinders;
int heads;
int sectors_per_track;
int sector_size;
int cylinders = 0;
int heads = 0;
int sectors_per_track = 0;
int sector_size = 0;
mfmhd_enc_t encoding;
// Parameters like interleave, precompensation, write current can be changed
// on every write operation. They are stored by the GDDI tag (first record).
int interleave;
int cylskew;
int headskew;
int write_precomp_cylinder; // if -1, no wpcom on the disks
int reduced_wcurr_cylinder; // if -1, no rwc on the disks
int interleave = 0;
int cylskew = 0;
int headskew = 0;
int write_precomp_cylinder = 0; // if -1, no wpcom on the disks
int reduced_wcurr_cylinder = 0; // if -1, no rwc on the disks
// Parameters for the track layout that are supposed to be the same for
// all tracks and that do not change (until the next reformat).
// Also, they do not have any influence on the CHD file.
// They are stored by the GDDI tag (second record).
int gap1;
int gap2;
int gap3;
int sync;
int headerlen;
int ecctype; // -1 is CRC
int gap1 = 0;
int gap2 = 0;
int gap3 = 0;
int sync = 0;
int headerlen = 0;
int ecctype = 0; // -1 is CRC
bool sane_rec() const
{

View File

@ -51,11 +51,11 @@ struct td0dsk_tag
};
struct tdlzhuf {
uint16_t r,
bufcnt,bufndx,bufpos, // string buffer
uint16_t r = 0,
bufcnt = 0, bufndx = 0, bufpos = 0, // string buffer
// the following to allow block reads from input in next_word()
ibufcnt,ibufndx; // input buffer counters
uint8_t inbuf[BUFSZ]; // input buffer
ibufcnt = 0, ibufndx = 0; // input buffer counters
uint8_t inbuf[BUFSZ]{}; // input buffer
};