Skip to content

Commit e8fbd94

Browse files
committed
cleanup
1 parent cf6788b commit e8fbd94

36 files changed

+174
-207
lines changed

Core/FileSystems/FSBlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ FSBlock::init(FSBlockType t)
4343

4444
case FSBlockType::BOOT:
4545

46-
if (nr == 0 && fs->traits.dos != FSVolumeType::NODOS) {
46+
if (nr == 0 && fs->traits.dos != FSFormat::NODOS) {
4747
bdata[0] = 'D';
4848
bdata[1] = 'O';
4949
bdata[2] = 'S';

Core/FileSystems/FSDescriptors.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313

1414
namespace vamiga {
1515

16-
FileSystemDescriptor::FileSystemDescriptor(isize numBlocks, FSVolumeType dos)
16+
FileSystemDescriptor::FileSystemDescriptor(isize numBlocks, FSFormat dos)
1717
{
1818
init(numBlocks, dos);
1919
}
2020

21-
FileSystemDescriptor::FileSystemDescriptor(Diameter dia, Density den, FSVolumeType dos)
21+
FileSystemDescriptor::FileSystemDescriptor(Diameter dia, Density den, FSFormat dos)
2222
{
2323
init(dia, den, dos);
2424
}
2525

26-
FileSystemDescriptor::FileSystemDescriptor(const GeometryDescriptor &geometry, FSVolumeType dos)
26+
FileSystemDescriptor::FileSystemDescriptor(const GeometryDescriptor &geometry, FSFormat dos)
2727
{
2828
init(geometry, dos);
2929
}
@@ -35,7 +35,7 @@ FileSystemDescriptor::FileSystemDescriptor(const PartitionDescriptor &des)
3535

3636

3737
void
38-
FileSystemDescriptor::init(isize numBlocks, FSVolumeType dos)
38+
FileSystemDescriptor::init(isize numBlocks, FSFormat dos)
3939
{
4040
// Copy parameters
4141
this->numBlocks = numBlocks;
@@ -66,7 +66,7 @@ FileSystemDescriptor::init(isize numBlocks, FSVolumeType dos)
6666
}
6767

6868
void
69-
FileSystemDescriptor::init(const GeometryDescriptor &geometry, FSVolumeType dos)
69+
FileSystemDescriptor::init(const GeometryDescriptor &geometry, FSFormat dos)
7070
{
7171
init(geometry.numBlocks(), dos);
7272
}
@@ -79,7 +79,7 @@ FileSystemDescriptor::init(const PartitionDescriptor &des)
7979
}
8080

8181
void
82-
FileSystemDescriptor::init(Diameter dia, Density den, FSVolumeType dos)
82+
FileSystemDescriptor::init(Diameter dia, Density den, FSFormat dos)
8383
{
8484
init(GeometryDescriptor(dia, den), dos);
8585
}
@@ -103,7 +103,7 @@ FileSystemDescriptor::dump(std::ostream &os) const
103103
os << tab("Reserved");
104104
os << dec(numReserved) << std::endl;
105105
os << tab("DOS version");
106-
os << FSVolumeTypeEnum::key(dos) << std::endl;
106+
os << FSFormatEnum::key(dos) << std::endl;
107107
os << tab("Root block");
108108
os << dec(rootBlock) << std::endl;
109109
os << tab("Bitmap blocks");
@@ -121,7 +121,7 @@ FileSystemDescriptor::checkCompatibility() const
121121
if (bsize != 512 || FORCE_FS_WRONG_BSIZE) {
122122
throw AppError(Fault::FS_WRONG_BSIZE);
123123
}
124-
if (!FSVolumeTypeEnum::isValid(dos) || FORCE_FS_WRONG_DOS_TYPE) {
124+
if (!FSFormatEnum::isValid(dos) || FORCE_FS_WRONG_DOS_TYPE) {
125125
throw AppError(Fault::FS_WRONG_DOS_TYPE);
126126
}
127127
}

Core/FileSystems/FSDescriptors.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct FileSystemDescriptor {
3939
isize numReserved = 0;
4040

4141
// File system type
42-
FSVolumeType dos = FSVolumeType::NODOS;
42+
FSFormat dos = FSFormat::NODOS;
4343

4444
// Location of the root block
4545
Block rootBlock = 0;
@@ -50,15 +50,15 @@ struct FileSystemDescriptor {
5050

5151
// Initializing
5252
FileSystemDescriptor() { };
53-
FileSystemDescriptor(isize numBlocks, FSVolumeType dos);
54-
FileSystemDescriptor(const GeometryDescriptor &geometry, FSVolumeType dos);
53+
FileSystemDescriptor(isize numBlocks, FSFormat dos);
54+
FileSystemDescriptor(const GeometryDescriptor &geometry, FSFormat dos);
5555
FileSystemDescriptor(const PartitionDescriptor &des);
56-
FileSystemDescriptor(Diameter dia, Density den, FSVolumeType dos);
56+
FileSystemDescriptor(Diameter dia, Density den, FSFormat dos);
5757

58-
void init(isize numBlocks, FSVolumeType dos);
59-
void init(const GeometryDescriptor &geometry, FSVolumeType dos);
58+
void init(isize numBlocks, FSFormat dos);
59+
void init(const GeometryDescriptor &geometry, FSFormat dos);
6060
void init(const PartitionDescriptor &des);
61-
void init(Diameter type, Density density, FSVolumeType dos);
61+
void init(Diameter type, Density density, FSFormat dos);
6262

6363
// Computed values
6464
isize numBytes() const { return numBlocks * bsize; }

Core/FileSystems/FSDoctor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if (value > (u32)exp) \
3636
{ *expected = (u8)(exp); return Fault::FS_EXPECTED_SMALLER_VALUE; } }
3737

3838
#define EXPECT_DOS_REVISION { \
39-
if (!FSVolumeTypeEnum::isValid((isize)value)) return Fault::FS_EXPECTED_DOS_REVISION; }
39+
if (!FSFormatEnum::isValid((isize)value)) return Fault::FS_EXPECTED_DOS_REVISION; }
4040

4141
#define EXPECT_REF { \
4242
if (!fs.block(value)) return Fault::FS_EXPECTED_REF; }

Core/FileSystems/FSObjects.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ FSString::FSString(const u8 *bcpl, isize limit) : limit(limit)
4343
}
4444

4545
char
46-
FSString::capital(char c, FSVolumeType dos)
46+
FSString::capital(char c, FSFormat dos)
4747
{
4848
if (isINTLVolumeType(dos)) {
4949
return (c >= 'a' && c <= 'z') || ((u8)c >= 224 && (u8)c <= 254 && (u8)c != 247) ? c - ('a' - 'A') : c ;
@@ -73,7 +73,7 @@ FSString::hashValue() const
7373
*/
7474

7575
u32
76-
FSString::hashValue(FSVolumeType dos) const
76+
FSString::hashValue(FSFormat dos) const
7777
{
7878
u32 result = (u32)length();
7979
for (auto c : str) {

Core/FileSystems/FSObjects.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct FSString {
2424
// Maximum number of permitted characters
2525
isize limit = 0;
2626

27-
static char capital(char c, FSVolumeType dos);
27+
static char capital(char c, FSFormat dos);
2828

2929
FSString(const string &cppS, isize limit = 1024);
3030
FSString(const char *c, isize limit = 1024);
@@ -36,7 +36,7 @@ struct FSString {
3636
bool operator== (const FSString &rhs) const;
3737
isize length() const { return (isize)str.length(); }
3838
bool empty() const { return str.empty(); }
39-
u32 hashValue(FSVolumeType dos) const;
39+
u32 hashValue(FSFormat dos) const;
4040

4141
void write(u8 *p);
4242

Core/FileSystems/FSTypes.h

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct FSOpt
3030
bool accept(const FSBlock *b) const { return b ? (filter ? filter(*b) : true) : false; }
3131
};
3232

33-
enum class FSVolumeType : long
33+
enum class FSFormat : long
3434
{
3535
OFS = 0, // Original File System
3636
FFS = 1, // Fast File System
@@ -43,85 +43,85 @@ enum class FSVolumeType : long
4343
NODOS
4444
};
4545

46-
struct FSVolumeTypeEnum : Reflection<FSVolumeTypeEnum, FSVolumeType>
46+
struct FSFormatEnum : Reflection<FSFormatEnum, FSFormat>
4747
{
4848
static constexpr long minVal = 0;
49-
static constexpr long maxVal = long(FSVolumeType::NODOS);
49+
static constexpr long maxVal = long(FSFormat::NODOS);
5050

51-
static const char *_key(FSVolumeType value)
51+
static const char *_key(FSFormat value)
5252
{
5353
switch (value) {
5454

55-
case FSVolumeType::OFS: return "OFS";
56-
case FSVolumeType::FFS: return "FFS";
57-
case FSVolumeType::OFS_INTL: return "OFS_INTL";
58-
case FSVolumeType::FFS_INTL: return "FFS_INTL";
59-
case FSVolumeType::OFS_DC: return "OFS_DC";
60-
case FSVolumeType::FFS_DC: return "FFS_DC";
61-
case FSVolumeType::OFS_LNFS: return "OFS_LNFS";
62-
case FSVolumeType::FFS_LNFS: return "FFS_LNFS";
63-
case FSVolumeType::NODOS: return "NODOS";
55+
case FSFormat::OFS: return "OFS";
56+
case FSFormat::FFS: return "FFS";
57+
case FSFormat::OFS_INTL: return "OFS_INTL";
58+
case FSFormat::FFS_INTL: return "FFS_INTL";
59+
case FSFormat::OFS_DC: return "OFS_DC";
60+
case FSFormat::FFS_DC: return "FFS_DC";
61+
case FSFormat::OFS_LNFS: return "OFS_LNFS";
62+
case FSFormat::FFS_LNFS: return "FFS_LNFS";
63+
case FSFormat::NODOS: return "NODOS";
6464
}
6565
return "???";
6666
}
6767

68-
static const char *help(FSVolumeType value)
68+
static const char *help(FSFormat value)
6969
{
7070
return "";
7171
}
7272

73-
static FSVolumeType fromDosType(u32 value)
73+
static FSFormat fromDosType(u32 value)
7474
{
7575
switch (value) {
7676

77-
case 0x444F5300: return FSVolumeType::OFS;
78-
case 0x444F5301: return FSVolumeType::FFS;
79-
case 0x444F5302: return FSVolumeType::OFS_INTL;
80-
case 0x444F5303: return FSVolumeType::FFS_INTL;
81-
case 0x444F5304: return FSVolumeType::OFS_DC;
82-
case 0x444F5305: return FSVolumeType::FFS_DC;
83-
case 0x444F5306: return FSVolumeType::OFS_LNFS;
84-
case 0x444F5307: return FSVolumeType::FFS_LNFS;
85-
default: return FSVolumeType::NODOS;
77+
case 0x444F5300: return FSFormat::OFS;
78+
case 0x444F5301: return FSFormat::FFS;
79+
case 0x444F5302: return FSFormat::OFS_INTL;
80+
case 0x444F5303: return FSFormat::FFS_INTL;
81+
case 0x444F5304: return FSFormat::OFS_DC;
82+
case 0x444F5305: return FSFormat::FFS_DC;
83+
case 0x444F5306: return FSFormat::OFS_LNFS;
84+
case 0x444F5307: return FSFormat::FFS_LNFS;
85+
default: return FSFormat::NODOS;
8686
}
8787
}
8888
};
8989

90-
inline bool isOFSVolumeType(FSVolumeType value)
90+
inline bool isOFSVolumeType(FSFormat value)
9191
{
9292
switch (value) {
9393

94-
case FSVolumeType::OFS:
95-
case FSVolumeType::OFS_INTL:
96-
case FSVolumeType::OFS_DC:
97-
case FSVolumeType::OFS_LNFS: return true;
98-
default: return false;
94+
case FSFormat::OFS:
95+
case FSFormat::OFS_INTL:
96+
case FSFormat::OFS_DC:
97+
case FSFormat::OFS_LNFS: return true;
98+
default: return false;
9999
}
100100
}
101101

102-
inline bool isFFSVolumeType(FSVolumeType value)
102+
inline bool isFFSVolumeType(FSFormat value)
103103
{
104104
switch (value) {
105105

106-
case FSVolumeType::FFS:
107-
case FSVolumeType::FFS_INTL:
108-
case FSVolumeType::FFS_DC:
109-
case FSVolumeType::FFS_LNFS: return true;
110-
default: return false;
106+
case FSFormat::FFS:
107+
case FSFormat::FFS_INTL:
108+
case FSFormat::FFS_DC:
109+
case FSFormat::FFS_LNFS: return true;
110+
default: return false;
111111
}
112112
}
113113

114-
inline bool isINTLVolumeType(FSVolumeType value)
114+
inline bool isINTLVolumeType(FSFormat value)
115115
{
116116
switch (value) {
117117

118-
case FSVolumeType::OFS_INTL:
119-
case FSVolumeType::FFS_INTL:
120-
case FSVolumeType::OFS_DC:
121-
case FSVolumeType::FFS_DC:
122-
case FSVolumeType::OFS_LNFS:
123-
case FSVolumeType::FFS_LNFS: return true;
124-
default: return false;
118+
case FSFormat::OFS_INTL:
119+
case FSFormat::FFS_INTL:
120+
case FSFormat::OFS_DC:
121+
case FSFormat::FFS_DC:
122+
case FSFormat::OFS_LNFS:
123+
case FSFormat::FFS_LNFS: return true;
124+
default: return false;
125125
}
126126
}
127127

@@ -273,7 +273,7 @@ struct FSItemTypeEnum : Reflection<FSItemTypeEnum, FSItemType>
273273

274274
struct FSTraits
275275
{
276-
FSVolumeType dos = FSVolumeType::NODOS;
276+
FSFormat dos = FSFormat::NODOS;
277277

278278
isize blocks = 0;
279279
isize bytes = 0;
@@ -307,13 +307,12 @@ typedef struct
307307
string modificationDate;
308308

309309
// Capacity information
310-
/*
310+
isize numBlocks;
311311
isize freeBlocks;
312312
isize usedBlocks;
313313
isize freeBytes;
314314
isize usedBytes;
315315
double fillLevel;
316-
*/
317316
}
318317
FSInfo;
319318

0 commit comments

Comments
 (0)