Skip to content

Commit 8a976ed

Browse files
committed
Warning fix.
1 parent c71d8d6 commit 8a976ed

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/data/layout.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ static unsigned getTrackStep()
2222

2323
case DRIVETYPE_APPLE2:
2424
return 4;
25+
26+
default:
27+
error("bad drive_type {}", (int)drive_type);
2528
}
2629

2730
case FORMATTYPE_80TRACK:
@@ -41,7 +44,13 @@ static unsigned getTrackStep()
4144
"you can't read/write an 80 track image from/to an "
4245
"Apple II "
4346
"drive");
47+
48+
default:
49+
error("bad drive_type {}", (int)drive_type);
4450
}
51+
52+
default:
53+
error("bad format_type {}", (int)drive_type);
4554
}
4655

4756
return 1;

lib/imagereader/imdimagereader.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class IMDImageReader : public ImageReader
200200
headerPtr++;
201201
sectorSize = getSectorSize(header.SectorSize);
202202

203-
unsigned optionalsector_map[header.numSectors];
203+
std::vector<unsigned> optionalsector_map(header.numSectors);
204204
// The Sector Cylinder Map has one entry for each sector, and
205205
// contains the logical Cylinder ID for the corresponding sector in
206206
// the Sector Numbering Map.
@@ -224,7 +224,7 @@ class IMDImageReader : public ImageReader
224224
// The Sector Head Map has one entry for each sector, and contains
225225
// the logical Head ID for the corresponding sector in the Sector
226226
// Numbering Map.
227-
unsigned optionalhead_map[header.numSectors];
227+
std::vector<unsigned> optionalhead_map(header.numSectors);
228228
if (header.Head & SEC_HEAD_MAP_FLAG)
229229
{
230230
// Read optional sector head map

0 commit comments

Comments
 (0)