Skip to content

Commit c96f388

Browse files
authored
Merge branch 'main' into ide_check_writable_file
2 parents 1d2936d + 1f16a59 commit c96f388

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/DiskFile.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ CDiskFile::CDiskFile(CConfigurator *cfg, CSystem *sys, CDiskController *c,
130130

131131
/* If the disk file size was not set and the disk file does not exist, do
132132
* not create it, but exit */
133-
int diskFileSize = myCfg->get_num_value("autocreate_size", false, 0);
133+
u64 diskFileSize = myCfg->get_num_value("autocreate_size", false, 0);
134134
if (!diskFileSize) {
135135
FAILURE_1(Runtime, "%s: file does not exist and no autocreate_size set.",
136136
devid_string);
@@ -204,13 +204,13 @@ void CDiskFile::checkFileWritable(const std::string& fileName) const {
204204
}
205205

206206
void CDiskFile::createDiskFile(const std::string &fileName, u64 diskFileSize) {
207-
208207
std::ofstream ofs(fileName, std::ios::binary);
209208
if (ofs.is_open() && ofs.good()) {
210209
ofs.seekp((diskFileSize)-1);
211210
ofs.write("", 1);
212211
} else {
213-
FAILURE_1(Runtime, "%s: File does not exist and could not be created", devid_string);
212+
FAILURE_1(Runtime, "%s: File does not exist and could not be created",
213+
devid_string);
214214
}
215215

216216
std::cout << devid_string << " " << (diskFileSize / 1024 / 1024) << "MB file "

src/DiskFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class CDiskFile : public CDisk {
7575
FILE *handle;
7676
char *filename;
7777

78-
void createDiskFile(const std::string &filename, int diskFileSize);
78+
void createDiskFile(const std::string &filename, u64 diskFileSize);
7979
std::string defaultFilename;
8080
void checkFileWritable(const std::string& filename) const;
8181
};

0 commit comments

Comments
 (0)