diff options
| author | 2022-03-26 01:26:34 +1100 | |
|---|---|---|
| committer | 2022-03-26 01:26:34 +1100 | |
| commit | ff351d16035d263d0093246d5905d051879e1a37 (patch) | |
| tree | ce2b650d5685a58823a18738dcdcc43b1d418516 /src | |
| parent | 36ebc5ef089f132ee6d5572a35318b89299cb7db (diff) | |
init vars for coverity (formats)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/formats/ap2_dsk.h | 2 | ||||
| -rw-r--r-- | src/lib/formats/basicdsk.cpp | 2 | ||||
| -rw-r--r-- | src/lib/formats/flex_dsk.h | 30 | ||||
| -rw-r--r-- | src/lib/formats/flopimg.cpp | 4 | ||||
| -rw-r--r-- | src/lib/formats/imd_dsk.h | 2 | ||||
| -rw-r--r-- | src/lib/formats/mfm_hd.h | 30 | ||||
| -rw-r--r-- | src/lib/formats/td0_dsk.cpp | 8 |
7 files changed, 39 insertions, 39 deletions
diff --git a/src/lib/formats/ap2_dsk.h b/src/lib/formats/ap2_dsk.h index f70483bd072..373cdb361e3 100644 --- a/src/lib/formats/ap2_dsk.h +++ b/src/lib/formats/ap2_dsk.h @@ -59,7 +59,7 @@ private: bool m_prodos_order; - int m_tracks; + int m_tracks = 0; }; extern const floppy_format_type FLOPPY_A216S_FORMAT; diff --git a/src/lib/formats/basicdsk.cpp b/src/lib/formats/basicdsk.cpp index 2eea96f6e00..1984f0bd7ca 100644 --- a/src/lib/formats/basicdsk.cpp +++ b/src/lib/formats/basicdsk.cpp @@ -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); diff --git a/src/lib/formats/flex_dsk.h b/src/lib/formats/flex_dsk.h index dbe53d26aae..9a5b0a68872 100644 --- a/src/lib/formats/flex_dsk.h +++ b/src/lib/formats/flex_dsk.h @@ -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[]; diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp index 8e9dbaf47a2..c7461087447 100644 --- a/src/lib/formats/flopimg.cpp +++ b/src/lib/formats/flopimg.cpp @@ -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 diff --git a/src/lib/formats/imd_dsk.h b/src/lib/formats/imd_dsk.h index acf7da9b892..e067383c6a1 100644 --- a/src/lib/formats/imd_dsk.h +++ b/src/lib/formats/imd_dsk.h @@ -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; diff --git a/src/lib/formats/mfm_hd.h b/src/lib/formats/mfm_hd.h index d5b03c1e457..fd2b260ba24 100644 --- a/src/lib/formats/mfm_hd.h +++ b/src/lib/formats/mfm_hd.h @@ -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 { diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp index b6ab2753c14..ab8ea3d73c1 100644 --- a/src/lib/formats/td0_dsk.cpp +++ b/src/lib/formats/td0_dsk.cpp @@ -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 }; |
